Hi,
I am a new user, I hope I have posted in the right section.
I have an MVC application java that captures an image from file, saving it to an object of type BufferedImage. I would like to do the AND logical operation between two images but do not know how to do, I can not find the sample code, where can I find it?
I would use JAI but I have a 64 bit system and searching in internet I saw that JAI can be used only on 32-bit systems and jdk 1.3 or so. Or should I use OpenCV? What can I use?
Thanks

May 13th, 2014, 05:53 AM

Norm

Re: Image manipulations

Quote:

do the AND logical operation between two images

Can you explain what "AND operation" means with images? It does not make sense to me.

May 13th, 2014, 08:06 AM

Cornix

Re: Image manipulations

If you dont mind about hardware acceleration you could simply iterate over all pixels, do the calculations yourself, and write them back to a target image.

The question is how do I make the logical operations between images? if there is some sample code in the internet and if I have to use a library or not.
Thanks

May 14th, 2014, 08:25 AM

Norm

Re: Image manipulations

Quote:

logical operations between images?

What does a "logical operation" between images mean? Can you explain what you are talking about?

May 14th, 2014, 10:25 AM

argb

Re: Image manipulations

I need to load and load image1 image2 applicazioen in MVC, I have to get a immagine3 that contains only the parts common to both image1 and image2. I need to see some sample code. Can you help me? I do not know if I was clear.

May 14th, 2014, 10:34 AM

Norm

Re: Image manipulations

Quote:

I have to get a immagine3 that contains only the parts common to both image1 and image2

By common parts do you mean a pixel by pixel comparison of the two images from 0,0 (upper left) to width,length (lower right)and when the pixels match, that pixel is copied to image3? What value is the pixel set to if the pixels don't match?

May 15th, 2014, 03:15 AM

argb

Re: Image manipulations

You should compare pixel by pixel, but do not know
Thanks

May 15th, 2014, 05:41 AM

Norm

Re: Image manipulations

The BufferedImage class has methods that allow you to access the pixels in the image.

May 15th, 2014, 09:02 AM

argb

Re: Image manipulations

I tried to make the difference between two images in this way, but as a result I get a black image, why?