Wednesday, August 17, 2011

Dealing with uneven illumination


We all know the importance of getting the lighting righting, don’t we? Much easier than fixing a bad image in software. But let’s be honest, sometimes it’s necessary to throw idealism out the window and adopt a more pragmatic approach.

Just such a scenario is described in “Software compensates for lighting nonuniformity in solar cell inspection” (Vision Systems Design, August 4th, 2011.) This describes a vision application where, for various reasons, it wasn’t possible to make the lighting perfect. Instead, developer Owens Design, out of Fremont, California, implemented a very simple trick to smooth out uneven lighting. When you read the article, you’ll probably agree that while it’s not rocket science, it is a very simple, and very neat, idea.

Okay, I’ll cut to the chase. The trick involves image arithmetic: the process of performing a mathematical operation on two images to produce a third. Now it’s not completely clear from the article which mathematical operator was used – addition, subtraction, absolute difference – but you could figure that out for yourself. The point is, image arithmetic is an oft-overlooked tool for improving contrast.

Before I go, a quick side note: one issue I have encountered with arithmetic operations is what happens when the sum exceeds 255 (or a difference is less than zero.) Different packages seem to handle this in different ways, so you’ll want to experiment to see what works best for you.

No comments: