MATLAB: How to calculate the background intensity of grayscale image

background correctionbackground intensityImage Processing Toolbox

How do i calculate the background intensity at each pixel of an grayscale image

Best Answer

It depends. If you can, just snap an image without your foreground in there. Like if it's a hand in front of a white sheet, snap a photo of just the white sheet alone, without the hand in there. If you can't do that and need to estimate the background from the actual image, then try to identify the foreground and use some algorithm to fill in those pixels with background, like use regionfill(), or fit the whole background mask to a 2-D polynomical, or use some morphological methods, etc. You forgot to attach your image(s) so I can't really offer better advice.
Related Question