Hello Guest it is September 19, 2020, 06:16:05 PM

Author Topic: Improving Signal to Noise Ratio  (Read 9533 times)

0 Members and 1 Guest are viewing this topic.

Improving Signal to Noise Ratio
« on: December 27, 2007, 01:21:47 PM »
Hello,

This forum has been way too quiet over the holidays so I thought it time to wake everybody up.

My Background.

I am a self-under-employed optical engineer and electrical engineer. These days I design laser delivery optics for laser micro-machining. These are basically 3 axis CNC mills with a tightly-focused high-energy laser spot doing the milling or drilling. Designing optics for a UV 193nm excimer laser focused to a 1um diameter spot to engrave diamond jewelry was my introduction to laser micro-machining.

Between 1986 and 1992 I designed optics and electronics for several commercial laser triangulation gauges. We usually used a Sharp 780nm near infrared laser diode and a Fairchild CCD 133 line array with 1000 pixels clocked at 1MHz, as I recall. I wrote diagnostic and testing software in c under DOS. I left the writing for Windows user software to those who like programming for a living.

The largest range I did was for a space docking gauge. The near point was 6 inches and the far point was 30 inches. Ultrasound is usually preferred for that range but ultrasound does not work in the vacuum of space. I do not know if it ever made it into space.

The smallest I did was nicknamed "pencil gauge" because the 3 inch long glass probe was about the diameter of a pencil. The range on that one was about 0.1 inch with the near point about 0.1 inch from the glass tip. This probe looked sideways and was used to inspect between the blades of a torpedo propeller. 

We always located and oriented detectors to take advantage of the Scheimpflug condition (http://www.multires.caltech.edu/pubs/DGPCourse/CurlessChapter.pdf pages 4 and 5). This results in a detector surface which is not perpendicular to the lens optical axis. Because of packaging, this is not convenient for consumer grade webcams...but it is possible.

Improving Signal to Noise Ratio.

The subjects of improving signal and/or reducing noise have come up in several postings. So I thought it appropriate to tackle the subject.

Signal is the result of laser light hitting a surface which scatters light over a large solid angle (think hemisphere), some of which is collected by the camera lens and focused (or at least concentrated) onto the camera detector. The detector for WebCams is usually a CCD area array.

Noise is just about anything else that will produce a signal from the camera. Noise can be electrical or optical, random or fixed.

An example of fixed optical noise is the image of other things in the area (aka background). One way to reduce that is to turn off AGC and grab one frame with the laser off and grab another frame with the laser on. Subtract one frame from the other, pixel by pixel. This will subtract the fixed optical noise from the picture and leave only the laser.

Another method is to use a color filter on the camera. The filter should pass the laser wavelength but as little else as possible. For a red laser, a red cellophane candy wrapper over the camera lens will help reduce background while having very little effect on the laser. This filter eliminates most of the blues and yellows but not much of the broad spectrum reds.

You can also work in the dark but this is often inconvenient or unsafe. Try using a red filter over the camera lens and a yellow light bulb (aka bug light) to see your workspace. Very little of the yellow light will get past the red filter into the camera.

A better solution is to use a laser line filter like those listed below. If you hold one of these up to your eye and look at the laser spot on the surface you will see the laser spot but not much else. Try looking at a light bulb through one of these filters to see how little white light passes.

Where to get color filters.

Camera stores have color filters. I have not found enough data yet to make any recommendations.

Theatrical supply shops have gelatin filters, often just called gels, for a many combinations of colors. Graphs exist for transmission spectra but I have not been able to find that data on the internet.

Edmund Optics has a few filters for 650nm but not much for 635nm, although the first one below should be usable for either. For the same money I would choose the 10nm bandwidth. I would choose the 80nm bandwidth if I happened to get a much better price or if I wanted to experiment with 635nm and 650nm.

Edmund Optics #46153, $46.30, center wavelength=650nm, bandwidth=80nm

http://www.edmundoptics.com/onlinecatalog/displayproduct.cfm?productID=1936

Edmund Optics #62112, $45.00, center wavelength=650nm, bandwidth=10nm

http://www.edmundoptics.com/onlinecatalog/displayproduct.cfm?productID=1903

Mounting Filters.

I like Thorlabs tubes for mounting optics. They also sell taps for their tube threads.

Thorlabs SM05 series of stackable tubes are suitable for mounting half inch diameter optics like lenses and filters.

http://www.thorlabs.com/newgrouppage9.cfm?objectGroup_ID=1521

This should be enough to get a discussion started for improving signal to noise ratio.
 
Tom Hubin
thubin@earthlink.net
Re: Improving Signal to Noise Ratio
« Reply #1 on: December 28, 2007, 12:28:34 PM »
Just a couple more thoughts on color filtering to improve SNR.

Assuming a color camera is used, can the blue and green data be ignored and only the red component used? This might be comparable to using a broadband red filter, like a red cellophane candy wrapper, on the camera.

Better yet, is it possible to digitally filter the picture for a narrow band of red around the laser color?

Yellow or blue or green workspace lighting might make it easier to isolate the red laser in the picture.

I have no experience with these methods. Just wondering out loud.

Tom Hubin
thubin@earthlink.net

Offline Chaoticone

*
  • *
  •  5,628 5,628
  • Precision Chaos
    • View Profile
Re: Improving Signal to Noise Ratio
« Reply #2 on: December 28, 2007, 08:46:01 PM »
Thanks a lot for the wealth of information and knowledge you bring and share. Glad you found or little spec. of the www.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline ART

*
  • *
  •  1,700 1,700
  • Tough as soggy paper.
    • View Profile
Re: Improving Signal to Noise Ratio
« Reply #3 on: December 28, 2007, 10:09:43 PM »
Hi Tom:

  Interesting thread. I have tried only useing the red channel for the webcam, but its not a great way to go. The red channel of the camera actually picks up quite a wide bandwidth of light, so infra red in lights and such makes it though, very little difference is seen from greyscale to colour or single red channel. In fact using only red channel probably lowers th eoverall resolution of the image. I dont think this section is important above the main problem Im still working on, properly centroiding the beam regsitered to get a thinner line consistantly from frame to frame. I just tried a canny edge filter, but it doesnt look very promising, Im thinking I need to simply implement a wider field gaussian filter to take into accoutn a wider line than I originally thought.  I have been planning on making the laser utrn on and off and subtracting the two to get rid of noise, and I think I may need an attenuation filter as well as the laser typically overwhelms the cameras sensors. I think a attenuation will produce a better line. The meshing is all working quite well,
and now its time to get the aquisition better. I can see form the autocalibration that I really need to start ovber with a better way of filtering the image to get a line segmentation of the laser line into data.. still dwelling on that one..

Art
Re: Improving Signal to Noise Ratio
« Reply #4 on: December 29, 2007, 12:11:31 PM »
Very intersting thread.  I do not claim to be an expert but I use expert imaging equipment at work.  One thing I may add is there are optics that can be placed between a camera and lense to correct for the nature of the lense distortion.  It looks like a long tube.  It is focused by observing a laser line through the lense.  You adjust the focus of the normal lense.  Then you adjust this tube until the line is perfectly straight from side to side on your monitor. 

Of course this is much higher quality imaging devices as compared to a web cam but hopefully someone who knows a lot more about htis than me may think of a way to add a "hobby" solutiion to the distrotion problem.

I am sorry I can't provide more information,  I operate the machine and lense but do not know exactly hw it works.

Robert
Re: Improving Signal to Noise Ratio
« Reply #5 on: December 29, 2007, 12:28:28 PM »
Hello Art,

> I think I may need an attenuation filter as well as the laser typically overwhelms the cameras sensors.

From this comment and those made by others about seeing the background I suspect that your exposure time is way too long. I just did a quick experiment with a 3Com Watchport/V webcam and an old red laser pointer of unknown power but probably 1mw or 2mw. The laser pointer  produced a 2mm x 6mm spot about 10 feet away.

I can set the camera AGC to off/average/center/peak for various results. Newer versions of this camera go for about $150 to $200 but older versions on ebay go for about $35 including shipping.

AGC set to "average" results in exposure time of 1/40 sec. The background is very visible. The laser spot is too bright, too large, and speckle around it is obvious.

AGC set to "center" reduces the exposure time a little.

AGC set to "peak", which should key on the laser spot, reduces the exposure time to 1/80 sec. This makes the background a little darker but does very little to improve the laser spot characteristics.

With AGC set to "off", I set the exposure time to 1/1000 sec. Background blacked out and the laser spot was clearly visible but not nearly as large and the speckle was gone. Even with 1/10000 sec exposure  I could see the laser on a wall 10 feet away. Not real bright but clearly detectable.

So I am guessing that your exposure time is too long. You can use a neutral density filter to reduce the light but you may find that the AGC just increases the exposure time to compensate. Also, CCD dark current will produce a low signal that is proportionate to exposure time so short exposure time is better than adding a neutral density filter.

Tom Hubin
thubin@earthlink.net
Re: Improving Signal to Noise Ratio
« Reply #6 on: April 17, 2008, 07:26:23 PM »
Hi guys

Just thumbing thru a Edmund Scientific catalog looking at filters to improve S/N.  You can get very narrow band interference filters (10nM FWHM) around a whole slew of central frequencies. Now the question is are your low cost laser diode line gens outputting at 632nM for the HeNe red ones and 532nM for the NdYag green ones?  My guess would be yes but just curious.
http://www.edmundoptics.com/onlinecatalog/displayproduct.cfm?productID=1903
At $40 odd dollars for the small ones you would not  want to get a bunch of them either side just to be sure.

Cheers
Mark


PS I just had a look at the specs on the laser pointers on Edmund and the red ones vary from 640nM to 670nm between 3 models... the green ones are both 532nM. A quick look at all their solid state lasers seems to indicate that the green 532nM ones are more consistant.. not sure why.
« Last Edit: April 17, 2008, 07:40:03 PM by mhasting2004 »
Re: Improving Signal to Noise Ratio
« Reply #7 on: April 18, 2008, 01:03:13 AM »

PS I just had a look at the specs on the laser pointers on Edmund and the red ones vary from 640nM to 670nm between 3 models... the green ones are both 532nM. A quick look at all their solid state lasers seems to indicate that the green 532nM ones are more consistant.. not sure why.


Hello Mark,

The Green ones are Frequency doubled NdYag lasers.  NdYag lases at 1064nm. The laser beam is then passed through a frequency doubling crystal. That results in much of the 1064nm being converted to 532nm.

Some of the original 1064nm is probably also there but the human eye won't see it. An InfraRed test card might show that some IR is there. They could also filter out the residual 1064nm but I doubt that they would bother.

The red ones are made from a variety of materials. Each material has a preferred radiation wavelength with a small bandwidth of a few nanometers.

Tom Hubin
thubin@earthlink.net
Re: Improving Signal to Noise Ratio
« Reply #8 on: April 18, 2008, 01:25:27 AM »
Hello Mark,

> Just thumbing thru a Edmund Scientific catalog looking at filters to improve S/N.

You really should not need a filter. If the laser is focused to about 100 microns where it hits the target surface it will be a couple of orders of magnitude brighter than any other light source in the room hitting that same point.

You will find that an averaging AGC, which is what most cameras use, will increase the exposure time until the background does show. The handful of pixels that make up the iamge of the laser will be saturated. Background noise and signal saturation will both hurt accuarcy.

If AGC is used it should be the peak detecting type. This will shorten exposure time until the laser signal is not saturating the pixels. The relatively low light level of the background will show up as black background.

If AGC is not used then the software should set the exposure time that produces peaksa little bellow saturation. IMO peaks at about 70% of saturation is good.

A normalized intensity would be the sum of the pixels divided by the exposure time. That would allow comparison of targets of various colors and textures. Even a flat photograph can be scanned and produce a greyscale output.

> You can get very narrow band interference filters (10nM FWHM) around a whole slew of central frequencies.

Even cheap laser diodes have a well defined wavelength within a bandwidth of a few nanometers. The ones sold by AixiZ on eBay are 635nm and 650nm. The ones that I am thinking of measure 12mm diameter and 30mm long and have adjustable focus and an optional line generator lens with available angles from 22 degrees to 120 degrees.

The 5mw, 635nm modules need a 3.2vdc, 20ma power supply. I have tried one of these it it seems to work ok.

The 10mw, 650nm modules can use 3-5vdc for power. I hope to use one of these so that I can use 5vdc from the USB line. I don't have one yet so I don't know the current but I would be surprised if it is more than 40ma.

Tom Hubin
thubin@earthlink.net

Re: Improving Signal to Noise Ratio
« Reply #9 on: May 06, 2008, 01:31:09 AM »
Hello,

I did some experiments with lighting and exposure control.

For each example the top left is a photo of my laser triangulation gauge looking down on a shiny plastic medical device. The laser shows as a single thin line of light generally from front to rear.

Only about 0.5 inch of the laser line is within the cameras field of view. Laser light outside of the cameras field of view is wasted.

The camera is on the left end of the bar and the laser module is on the right end. I have posted drawings of this setup on another thread.

Top right is what the gauge camera sees with the thin laser line hitting the shiny plastic surface. This is the image that I get in the Mach3 Video plugin.

Lower left is a contour map of the image (produced with MathCad 2000). I did everything in 8 bit black and white so light values range between 0 and 255. I also limited the camera resolution to 320 x 240, rather than 640 x 480, so as get it all to fit on my screen for these examples.

Lower right is a vertical slice through the image showing a graph of just a single column. Software would have to find the center of the laser on this line.

Exampl01 is the image with a lamp on the left side and a ceiling light. With AGC set to average, the exposure time of 1/60 sec is too long IMO. The laser signal is saturated at 255 and the noise floor is about 160. The second peak, with a value of about 245, is an edge of the device reflecting the left side lamp.

Exampl02 has the left side lamp turned off. This eliminates the reflection but the AGC increases the exposure time to 1/20 sec to try to get the average back up. This results in the laser signal even more saturated with lots of odd artifacts near it.

Exampl03 is nearly ideal, IMO. The left side light is off and the AGC is set to PEAK. The exposure time ends up at 1/244 sec and the peak of the laser signal is at, or slightly less than, 255. Noise floor is about 30 and the graphs look great.

Exampl04 has the left side light turned on and is using Peak AGC. Exposure time of 1/244 sec is the same as with the left side light off. This surprises me a little. In any case, the laser signal looks good with a narrow spike peaking at, or near, 255. Noise floor has increased to 50 or so. The reflection shows up again with a short peak of about 70. You can just barely see it in the image on the right side about 3/4 of the way up from the bottom.

Tom Hubin
thubin@earthlink.net