Android Question Bitmap Image Threshold Operation

canalrun

Well-Known Member
Licensed User
Longtime User
Hello,
I'm doing some image processing on bitmap images. I'm using the RSImageProcessing library with great success.

Basically I'm doing a Difference Blend between 2 images. When the 2 images are exactly the same, I get a difference blend of all black (colors.RGB(0,0,0)), as expected.

But, when I do a difference blend of nearly identical images (phone mounted on a tripod, images taken 5 seconds apart) I get a difference blend of almost black (maybe colors.RGB(2,1,3))). If I compare the 1st difference blend with this 2nd blend, I get a false not-the-same.

I really don't care about small changes. I think I would like to do a threshold where any grayscale pixel value less than a threshold is set to 0,0,0

I can do this on a pixel by pixel or row of pixels basis, but it is somewhat slow. Is there a function that does a threshold like this that I am not finding?

Thanks,
Barry.
 

daniel69

Member
Licensed User
Longtime User
Hi canalrun! I'm having the same problem. I think that the difference between the 2 images may be due to camera auto settings (balance, focus, exposure or other) ...
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
this is an OLD(!!) Thread. You should have created a new thread for this!
 
Upvote 0

canalrun

Well-Known Member
Licensed User
Longtime User
Yes. Very small changes between two images that are not visually apparent can produce "difference blend" images with "almost black" values. I ended up thresholding each RGB value – setting to 0 if less than some threshold.

Doing this thresholding pixel by pixel is very slow but if you do it pixel row by row it is much faster. There was an example posted by LucaMs, I believe, for pixel operations on a bitmap row. This was posted approximately one year ago.

Barry.
 
Upvote 0
Top