intensity correction in images

Hi,
I intend to correct the intensity in the images which arises due to the non uniformity in the illumination source.
As illustrated in the attched image, due to presence of inhomogeneity associated with the illumination source, the intensity is maximum at left and right side, however it is low on top and bottom. Now I intend to have uniform intensity through out. Is there any way out to achieve this ??
I tried with the normalize option e.g., But I am not succesful ..
normalize ( image data, 'range')

 Accepted Answer

If that is your illumination source, you need to convert that to a percentage image and then divide your test images by the percentage image.
maxValue = max(illuminationImage(:))
percentageImage = double(illuminationImage) / maxValue;
correctedImage = double(testImage) ./ percentageImage;
Rationale: If the image only has 90% as many photons hitting the scene there, you'd need to divide by 0.9 there to bring it up to the intensity it should have (the intensity it would have if it were illuminated by the full max intensity).

16 Comments

Hi,
Thanks for your response...
Actually, the attached one is my test image..
The code will still work. You just need to use your illumination image - the one that has no objects in it, or one of a totally blank scene, like of a uniform white sheet of paper.
I'm not sure I understand.
% Demo by Image Analyst.
clc; % Clear the command window.
fprintf('Beginning to run %s.m ...\n', mfilename);
close all; % Close all figures (except those of imtool.)
clearvars;
workspace; % Make sure the workspace panel is showing.
format long g;
format compact;
fontSize = 16;
load('illuminationImage.mat')
load('testImage.mat')
nexttile;
imshow(illuminationImage, []);
title('Illumination Image', 'FontSize', fontSize);
nexttile;
imshow(testImage, []);
title('Test Image', 'FontSize', fontSize);
maxValue = max(illuminationImage(:))
percentageImage = double(illuminationImage) / maxValue;
nexttile;
imshow(percentageImage, []);
title('Percentage Image', 'FontSize', fontSize);
correctedImage = double(testImage) ./ percentageImage;
nexttile;
imshow(correctedImage, []);
title('Corrected Image', 'FontSize', fontSize);
fprintf('Done running %s.m\n', mfilename);
Is the illumination image an image of the laser scanning the flat, uniform white or gray sheet? Well that looks pretty uniform. And is the image with the circle the image with a circular object in there? Is the circular object flat or 3-D? If it's 3-D then if it's closer to the laser it could reflect more brightly of course. If it's flat, then the reflectance should be the reflectance of the object, modified by the spatial variation of the laser and lens (but that looks pretty uniform to me)>
Yes, the illumination image is just recorded only with the laser sheet ON but without the presence of subject.. The laser sheet is flat
And I understod your point on the reflectance, but here the laser sheet profile itself not uniform. The intensity of the laser sheet is something similar to the one shown here (please see sheet profile.bmp). For instance, the portion of the subject illuminated by sheet region of A, C shows higher intensity , However, the decrease in intensity of laser sheet at region B results in lesser intesnity on the subject.
For e.g. In the test image you have shown, top and bottom portion is illuminated by region A, C of laser that's why it is brighter than middle portion that is illuminated by part B of the laser sheet. Hence, my idea is to correct this non uniformity in the intensity on the testImage. I tried as normalize option in matlab, I have attached the image obtained before and after normalization..
normalize ( testImage , 'range');
I hope this clarifies.. Please do let me know for adiitional info's...
OK, sorry for being dumb but maybe you could give me a line diagram of the imaging setup with and without the "subject" in place?
So if the laser is essentially a sheet/curtain with that two-gaussian-like profile, then why does it not have that profile all the way down the image, so that it's like stripes rather than a circle? Is it being focused beyond the plane somehow so that when it pivots away from the center it converges more and narrows down essentially making a circle?
Also did you post an image with the "subject" in place? All I saw was a unifrom mostly black image, and another one with a ring. Which one had the subject? What is the subject? Is it like a rectangular block or some kind of mechanical/metal part you are scanning?
Here the subject is actually a flame. Just imagine a candle flame, I am passing a laser sheet horizontally into the flame, say 5 mm above the candle. The insident laser beam will generate the fluorescence signal when the flame is present, and I am captuirng this fluoresecnce signal in the camera. Camera is placed on the top of laser laser sheet. Please have a look at the attached sketch..
The fluorescence signal is present only when the subject i.e. flame is present. Here, the attached image with ring shape is the one captured with the presence of subject. The another one is just black, because that is recorded in absence of subject i.e. flame , hence no fluorescence signal.
Here, the intensity of the generated fluoresecnce signal is directly proportional to the energy of the insident beam energy. This the reason why in the ring shaped image, some portion got higher intensity while other being lesser. This arises due to gausian profile of laser sheet. I attaching the .mat file of the ring image for your beter reference.
I guess it may be better to correct the intensity if we somehow have the sheet profile, however, the same is limited in the present configuration. Please let me know for additional info...
Hi IA,,
Hope you got the phsical description of the problem.
Please do let me know for any additional info's..
How do you know that the cross section of the flame really is not a ring? Maybe that's the way it is. If your laser is brighter at the edges due to it oscillating or whatever, then I'd think that the ring would just be brighter on two sides than all around.
Yes, cross section of the flame is mostly ring in shape. I just said candle as a example, but in our case flame is actually from round pipe,so flame is relatively ring in shape..
Yes, as you said, the ring is brighter only in the region wherever the laser is brighter...
I'm not sure of the problem now. What is being measured? Amount of light scattered by burning gasses? And you expect that to be ring shaped and you got a ring shape, so what's the problem? What shape or image do you expect to have?
The measured quantity is concentration of certain species in the flame. These specis generates fluorescence when the laser hits the flame. The generated fluoresecnce is captured in the camera.
The problem is not with ring shape, but it is about difference in the intensity distribution across the ring.
If you just open the image from the attached .mat file , you can observe, in some portions intensity is maximum in the ring, while in some other portions it is not.
The objective is to make intensity uniform across this ring... For this reason only, I tried normalize (my image) but not succesful...
OK, we can find the ring and find the max value in the ring. Do you then just want to set the whole ring to be this same gray level?
Yes pretty much similar to that...
Hi,
In that case will normalize option work??
No. It would be something like
mask = grayImage > someThresholdValue;
maxValue = max(grayImage(:))
grayImage(mask) = maxValue; % Set everything in the ring equal to the max value.
Appologies for being late in responding.. Yes, I am getting the desired results....

Sign in to comment.

More Answers (1)

Many thanks..
I have tried, but didn't get the desired results.. I have attached the corrected image, which I have got
I have attached test image, illumination image mat files for your reference.

5 Comments

Hi,
Just a note, here illumination image is recorded with the light source ON but without the object..
Do I need the background image without light source ON??
Are you using relfected light or transmitted light? Basically you will have non-uniformities due to the non-uniform illumination as well as the shading from the camera lens, and a few other things. You need to "undo" those effects by dividing them out.
Actually, I am illuminating my object with the laser sheet. This laser sheet profile got higher energy at the edges and dip in energy at the centre. This is the reason why the image shown in testImage.bmp has higher intensity at left and right side (shown with red circles) lower in the middle (shown with white circle)
Essentially, I intend to make unifrom intensity throughout.
You need to normalize intensity of all images and then you segmentation of region of intest will be become uniform.
Adjusting contrast of images so as to cover complete dynamic range of intensity of all pixels.
Please send all of your database images as zip file to amit.kenjale@gmail.com, I will try our some code that will work for all of your images.
Amit,
Thanks for the suggestion. I have attched the .mat file of the sample image here... Please let me know if you get any issues while accessing...

Sign in to comment.

Community Treasure Hunt

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

Start Hunting!