I am trying to find regions which have features strikingly different from the baseline.
To do that I subtract current image from the base, f
and b
are grayscale 2d image matrices.
diff = f - b
Some of the oeprations result in overflow and this leads to regions of high pixel value where really they should be set to zero.
How do I specify that the operation diff = f - b
should yield 0 for individual pixel value if f[x][y]
< b[x][y]
?