Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Overcoming Low Frequency Fluorescent Lighting problems

The low frequency of the standard fluorescent ballast produces inconsistency in captured images on my Unibrain Fire-i IEEE 1394 camera.  I have tried to compensate for this by taking several images and averaging them.  This method appears to work best with the camera set to it's lowest capture rate. (3.75fps)  At this rate I notice the greatest difference between one capture and the next.  But it is not always consistent.  Occasionally the camera appears to "sync" with the lighting and all images appear very similar.

I am attaching some image files as well as a couple of VIs that illustrate the problem.

At this point I am uncertain if I can "trick" my system into providing consistent images with this low frequency lighting or not.  Perhaps averaging a series of images is not the ideal approach?  

I would like to hear how others have tackled this problem and what has worked for them.  

Thank you.     

   
--

Patrick Allen
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 1 of 15
(5,625 Views)

Hi Pallen:

I did not look at your code, but have you tried longer shutter/exposure times to 'integrate' the varying light?

The images all looked fairly similar to me.

Is it possible to shield the cameras field of view from the fluorescents and use an alternative light source (LED's, incandescent).

Can you trigger the camera externally? Wonder if a circuit could be rigged up to provide a synchronous trigger signal at the peaks of the AC power that is going to the lights.

Message Edited by AnalogKid2DigitalMan on 06-19-2006 09:13 AM

~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 2 of 15
(5,625 Views)
Hi Pallen,
 
It might be worth averaging the images over more than just 2 images?
I have attached a jpg of a peice of code I wrote a few months ago.  It averages the images over as many as you want to set.
I would agree with AnalogKid2DigitalMan though.  Your best bet is to get away from the lights and move to a constant light source. (LED's)
 
Try this peice of code. Speed up your frame rate and average over say 5 frames.  The fluorescent lights are most likely flickering at a rate of about 100Hz (50Hz power supply) - 120Hz (60Hz Power supply) and so try and avoid frame rates that are multiples of these values.
 
Thanx
 
AdamB
Applications Engineering Team Leader | National Instruments | UK & Ireland
Message 3 of 15
(5,616 Views)
Thanks for the reply.  🙂

The images all looked fairly similar to me.

They are "similar".  But you can really notice the difference in light levels when you look at the white areas of the image. 

Is it possible to shield the cameras field of view from the fluorescents and use an alternative light source (LED's, incandescent).

Yes.  These things are very possible.  But for this particular experiment I am trying to produce a usable, reliable image using standard fluorescent lighting.  Although if I cannot do this in a reasonable amount of time we will likely use LED lighting.   

Can you trigger the camera externally? Wonder if a circuit could be rigged up to provide a synchronous trigger signal at the peaks of the AC power that is going to the lights.


This was the thought of one of the engineers I work with.  I felt I could put together a Schmitt Trigger circuit easily enough.  Although with the non deterministic nature of Windows, I'm not sure that I could reliably predict exactly when to trigger the camera.  For the short term the additional hardware and labor would negate the savings on lighting.  Although for the longer term it may be useful.  

   
   
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 4 of 15
(5,614 Views)
Hello Adam B,

Thanks for your reply.  

It might be worth averaging the images over more than just 2 images?

In this case I was averaging over 4 images.  But the code I have allows any number of images to be captured and averaged.  The "trick" was getting captured images to cover the entire range of (or as close as possible) light and dark images.   

I would agree with AnalogKid2DigitalMan though.  Your best bet is to get away from the lights and move to a constant light source. (LED's)

I agree 100%.  This was just a case of appeasing someone that was insistent that, "There should be an easy (cheap) way of solving this"  I'm now looking at http://www.luxeonstar.com/ as a source for LED lighting.  

The fluorescent lights are most likely flickering at a rate of about 100Hz (50Hz power supply) - 120Hz (60Hz Power supply) and so try and avoid frame rates that are multiples of these values.

This was my initial thinking too.  Unfortunately all of the frame rates available for this camera are multiples of 120.  I even tried introducing a random Wait Timer unsuccessfully to see if I could throw things out of sync.
 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 5 of 15
(5,617 Views)
Hi Pallen You could look at replacing the ballast on the flourescent lighting. A typical high frequency ballast ( like the ones used in Cat 2 office lighting ) will give you either 33kHz or 44kHz. This allows you several cycles of light within your aperture time and gets away from the flicker. It will also extend the life span of your lights and lessen the yellowing that you get over time. You can get the high frequency ballasts from either RS or an electrical factor. Be aware that the rating on the bulb will make a difference, i.e. a T8 bulb is easy to get a ballast for, other types of bulb will be harder. Good Luck Mike
Message 6 of 15
(5,611 Views)
Myk may have the solution with the high frequency ballast. I did not know such things were availble for general area lighting. Most fluorescent lights used in machine vision do use high frequencies just for this reason.
 
Of course you could alway turn every other bulb around in your lighting fixtures so one is always on 100% when the other is off, one is on 75% while the other 25%, both at 50%, etc... so you get uniform lightingwink smiley (NOT)
~~~~~~~~~~~~~~~~~~~~~~~~~~
"It’s the questions that drive us.”
~~~~~~~~~~~~~~~~~~~~~~~~~~
Message 7 of 15
(5,609 Views)
Thanks for the suggestion Mike.

We've previously looked into high frequency fluorescents.  But are looking for alternatives because cost and availability.  

I'm guessing both companies you mentioned were UK based?

These are lights we've used in the past:

http://www.stockeryale.com/i/fluo/products/linears/l_model_13.htm

So far I have not been able to locate very many Canadian or American suppliers of high frequency ballasts. 
---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 8 of 15
(5,598 Views)
Of course you could alway turn every other bulb around in your lighting fixtures so one is always on 100% when the other is off, one is on 75% while the other 25%, both at 50%, etc... so you get uniform lightingwink smiley (NOT)

I also had the suggestion to use two different phases for the electrical lighting as a means of minimizing if not eliminating the effect.

---------------------
Patrick Allen: FunctionalityUnlimited.ca
0 Kudos
Message 9 of 15
(5,598 Views)
If you set your shutter time so it covers an integer number of cycles on the light, you will get very consistant lighting.  For example, if your power is 60 Hz, the light is pulsing 120 times per second.  If your shutter time is 1/120 second, 2/120 second, 3/120 second, etc. it will integrate the same amount of light, regardless of where it starts in the cycle.
 
The challenge would be figuring out how the actual shutter time corresponds to the numbers in the camera settings.
 
Bruce
Bruce Ammons
Ammons Engineering
Message 10 of 15
(5,579 Views)