how to find the intensity of an image

1 次查看(过去 30 天)
hai
i have to divide a image by the intensity of the original image
is there any command available in matlab for finding the intensity of an image

回答(3 个)

Grzegorz Knor
Grzegorz Knor 2011-9-8

David Young
David Young 2011-9-8
Please see my reply to your previous question. That also pointed you to rgb2gray. If rgb2gray is not the answer, you need to explain what you mean by image intensity.

Image Analyst
Image Analyst 2011-9-8
It looks like you might be wanting to do flat field correction. I do this all the time, both on color and monochrome images. You need to convert both your "test" image and your "background" (what you call "original") image to single or double so that you don't get any clipping (due to them being integers). Then you need to convert your background image to an image where each pixel is the fraction of the max value. For example if your image is only 70% as bright at the corner, you're going to need to have 0.7 there and then divide your image by 0.7 there to being it up to what it should be. Something like this (untested):
fractionalImage = backgroundImage / max(max(backgroundImage));
flatImage = testImage / fractionalImage;
or something like that. The above is simplified. In reality you'll introduce noise by doing this so you'd want to get rid of that in your background image first. You can either blur the image or you can model it (like do a regression to fit it with a polynomial or some perfectly smooth function). This is a common correction for vignetting. For color you need to do each color channel independently (find the max for each channel) otherwise you're going to do some color rebalancing at the same time, which you don't want to do, since all you want to do is to correct for the non-uniformities in the illumination of your scene.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by