From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Looking for guidance on smoothing uneven background illumination

Due to the constraints of the where my camera and lights must be mounted I have slightly uneven lighting. Moving from left to right across the image the gray levels drop by 10 - 20. As this is predictable and repeatable I'd like to apply some kind of filter to bring the whole image back to a more uniform level. Any suggestions?

 

0 Kudos
Message 1 of 8
(5,632 Views)

try placing a very white backdrop in the field of view of the camera.  Snap a picture.  Find the lowest, or highest value in the image.  Subtract the high value from every pixel in the image.  The resulting image is now a Non-Uniformity correction map.  Store this image, and add it to every image you capture.  The intensity values will be corrected then.

 

Any time you move the lights, or make any other adjustments to the camera, you will need to take another NUC image.  If the camera runs hot, you may want to wait until it reaches normal operating temperature.

 

You can do the image math either by converting to arrays, or with the IMAQ math functions.  If you have Vision Assistant, you can do the same thing there.

Machine Vision, Robotics, Embedded Systems, Surveillance

www.movimed.com - Custom Imaging Solutions
0 Kudos
Message 2 of 8
(5,618 Views)

Hi,

What movijohn explained to you is termed as "flat field correction". This is a very simple yet accurate and fast approach to take care of change in intensity over the same image

but are constant from one image to another. more details can be seen at  http://en.wikipedia.org/wiki/Flat-field_correction

regards

aveo 

0 Kudos
Message 3 of 8
(5,582 Views)

Thank you for the advice, this seems exactly what I was looking for. I'll give it a go and let you know how it works out.

 

0 Kudos
Message 4 of 8
(5,352 Views)

I would consider using a multiplicative correction factor instead of an additive factor.  You can pick the largest value in your reference image and divide the number by each pixel value.  To correct another image, multiply each pixel by the matching factor.  This works better in images with large variations in brightness.  If you images are fairly uniform brightness, the additive method works fine.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 5 of 8
(5,339 Views)

I am actually trying to balance the lighting on my images.  My camera vendor recommended running a flat field calibration.  Says it is the process of taking a black image (lens cap on) and am image of a white target.  I am hot spotting in the center and rolling off on the edges.  Finding it is not "built-in" to the NI Vision software.  Is this correct?

 

Not excited about writing this utility (will post result) but need to make sure I understand your algorithm.  This is my understanding of how this can be accomplished.

 

 - Take image of white target

 - Find minimum pixel value

 - Create image of same size using minimum pixel value

 - Do image subtract to create reference correction image

 

To Apply Correction

 - Do image subtract of captured image and reference correction image

 

Does this sound correct?

 

Matt

 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 6 of 8
(4,620 Views)

I found an easy method since I posted last.  Use IMAQ Mult Div with your reference image as the input and the image that needs to be corrected as the other input.  The constant should be whatever value you would want the reference image to be.  If you test it by using the reference image as both inputs, the output will have all the pixels equal to the constant value.

 

I used this on one of my projects and it worked amazingly well.

 

Bruce

Bruce Ammons
Ammons Engineering
0 Kudos
Message 7 of 8
(4,590 Views)

Yes, I think there's a large cross-over with this thread.

0 Kudos
Message 8 of 8
(4,583 Views)