473,461 Members | 1,395 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Image processing

19
Hi,

I have a requirement to calculate the blue colored area in an JPG image. Can anyone suggest me a way to do this please?

References for any libraries or APIs are highly appreciated.

Thanks in advance.

Regards,
Prasath.
Aug 22 '10 #1

✓ answered by chaarmann

Have you looked up the API I mentioned?
I have no time to do that right now, but there should be a single command to load an image of type jpg from disk into memory. And another command to directly access the image buffer. I think you need to convert the image to bmp before accessing the image buffer, so that you have rgb-values inside the buffer or you don't need to convert and can get the pixel direcly with "int rgb = bufferedImage.getRGB(x, y)", but I can't remember exactly. You can find a lot of code examples if you google for "java Image-IO" or some of its classes.

4 2369
chaarmann
785 Expert 512MB
Just convert the image into a RGB-bitmap where a pixel is 3 bytes (red, green, blue). Then loop through the bytes of the bitmap and count the ones with a blue color. For example "0x0000FF" is a 100% blue dot. But maybe you also want slightly lighter or darker blue dots to be recognized, because the source was jpg, so you should define a derivation value accordingly. For example if you define value=3, then "0x0300FC" would also count as blue dot.

The java Image-IO is included since JDK1.4. Just read the normal API for it. (for example javax.imageio.ImageIO.BufferedImage)
Aug 24 '10 #2
popprem
19
Hi Chaarmann,

Thanks a lot for the reply. Yeah, i too got the point about
iterating pixels. I get jpg images as input for this
program. So can i do the image conversion from jpg to bytes
in the code level?

Please provide me a sample.

Thanks.
Aug 24 '10 #3
chaarmann
785 Expert 512MB
Have you looked up the API I mentioned?
I have no time to do that right now, but there should be a single command to load an image of type jpg from disk into memory. And another command to directly access the image buffer. I think you need to convert the image to bmp before accessing the image buffer, so that you have rgb-values inside the buffer or you don't need to convert and can get the pixel direcly with "int rgb = bufferedImage.getRGB(x, y)", but I can't remember exactly. You can find a lot of code examples if you google for "java Image-IO" or some of its classes.
Aug 24 '10 #4
popprem
19
Thanks for your reply Chaarmann. I got the hight and width
of the image, iterating through them and checking for blue
color pixels using "int rgb = bufferedImage.getRGB(x, y)"
and checking rgb for 0x0000FF.

Thanks a lot.
Aug 25 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Alexandre Fayolle | last post by:
Hello, I'm about to start a project which will involve some greyscale image processing using morphological operators (erosion, dilation, distance transforms...), and I was wondering if these...
0
by: Andreas Håkansson | last post by:
Hiya! I'm currently looking for a good image processig component (classes) to use in a project. I do not want to controls (winform or webform) since I will be doing this with code. I actually...
2
by: Maxwell2006 | last post by:
Hi, I am developing a simple image upload asp.net page and I am looking for a simple image processing component to be able to change the image resolution of jpg images and also reduce the...
10
by: stonny | last post by:
Hi, I am converting my matlab program into C/C++. I need to change some image processing toolbox functions into C/C++, such as edge detection, mathematical morphology. Is there any place that I...
1
by: stonny | last post by:
Hi, I am converting my matlab program into C. I need to change some image processing toolbox functions into C, such as edge detection, mathematical morphology. Since I am not very comfortable with...
5
by: edurand | last post by:
Hi, We are are pleased to announce the version 3.0 of the image processing library 'Filters'. You can use it in Python, and we have provided tutorials and samples in Python, with for exemple...
3
by: birensubudhi | last post by:
hey guys,can anyone tell me what is image processing, how to do it using C. IN KSHITIJ 2007 held at IIT kgp a que by INFOSYS is asked, they hav given an image then cut in different orientation...
26
by: mohangupta13 | last post by:
can anyone help me where to find the best image processing library for c++ mohan gupta
5
by: whisk3rs | last post by:
Hello, I have a conceptual question. I need to write a program that will take as input a list of images and then process each image individually (extract useful features from the image) ...
0
by: tavares | last post by:
(Our apologies for cross-posting. We appreciate if you kindly distribute this information by your co- workers and colleagues.) ...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.