Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

I want to calibrate image/pixel size so I can measure the separation of two moving objects.

I am measuring a moving diffraction pattern with a line-scan camera. I am interested in knowing the real-world separation of the 1st order bands as they move apart and together over time. Each line of the image has 3 bright spots, corresponding to the two moving diffraction spots on either side of a stationary central spot from the undiffracted light source. Currently I am calculating the width of the pattern using geometry and carefully measuring everything in my setup. This is a pain, as the distances between components change with every run.

What I would like to be able to do is place reference diffraction gratings in my system, and use the spacing of these reference diffra
ction patterns to calibrate my system so that I can output the separation of the spots in real-world measures (mm) rather than pixels.

I am trying to work with the calibration and caliper VI's, but I'm finding it tough going... any help would be appreciated.

I'm using Labview 6i, Vision 6.0

Thanks
0 Kudos
Message 1 of 10
(4,573 Views)
Could you post an image that demonstrates what you are trying to measure?

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 2 of 10
(4,573 Views)
I have attached two files. The first is an image of a 2 micron grating diffraction pattern (GRATING.JPG), the second is the diffraction pattern generated by a contracting muscle (what I'm trying to measure) (EXAMPLE.JPG). Each line of the image represents a sampling interval (eg 1 millisecond).
Download All
0 Kudos
Message 3 of 10
(4,573 Views)
I tried detecting the first and last edge in each row, with settings of contrast = 10, width = 4, steepness = 2. It worked well on your muscle image. I had to increase the contrast to 50 for the grating image.

Another possibility is using peak detection, and only keeping the first and last peak. That would give you the center of the bars instead of the outer edges.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 4 of 10
(4,573 Views)
I have been using the peak detect VI quite successfully, but I get my results in pixels... I'm trying to figure out how to set it up so that I can scan a couple of known gratings, say 2 microns and 4 microns, and then tell the system "OK, there's 2 microns, there's 4 microns, now read the muscle pattern and tell me what the lengths are in microns, not pixels".

The problem is that the width of the diffraction pattern is inversely proportional to the spacing of the grating (smaller grating, wider diffraction pattern).

If I can't do it with the known gratings, I thought I might be able to read a ruler (to convert pixel widths to real world dimensions) then use trigonometry to figure out what the "grating" spacing of the muscle is... I thou
ght it would be "simpler" to work from known grating sizes, and go from there :^}

Marc
0 Kudos
Message 5 of 10
(4,573 Views)
Marc,

Since the relationship is not linear, you won't be able to read your spacing in microns directly. You will have to read it in pixels and convert to microns.

You need to figure out an equation that relates the grating spacing (microns) to the spacing on the diffraction pattern (pixels). It sounds like a 1/x type function. Use your known values to generate values for your constants in your equation. Once you have the equation, you can plug in your number of pixels and get out microns.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 6 of 10
(4,573 Views)
Thanks, Bruce. That's essentially what I'm doing now... ah well, I had hoped for a shortcut...

But... If I can get a real-world measure of pixel size, by say scanning a ruler, then I could measure the width of the diffraction pattern of a known grating in millimeters, work out (using the grating equation) the distance from the grating to the screen, , and then, knowing that, I can take my muscle diffraction pattern, measure the spacing there, and knowing the distance to the muscle (same as the grating), I can work out the angle of diffraction, and figure out the grating spacing of the muscle.

So, this brings me back to part of my original problem... how do I use the calibration VIs to tell Labview that 1 pixel is x mm
on the screen?

Marc
0 Kudos
Message 7 of 10
(4,573 Views)
Marc,

I don't see any benefit of converting pixels to mm, since it cancels out in your final equation.

However, if you want to do it, use Set Simple Calibration and specify the X and Y scale.

Bruce
Bruce Ammons
Ammons Engineering
0 Kudos
Message 8 of 10
(4,574 Views)

hi

I am new to labview and vision.. and i am kinda confused about the scaling of X and Y for calibration... if i say i want x step =1 , y step =1 and units=mm, does that mean each increment in the pixel coordinate is 1mm, i.e (1,1) pixel == (1mm, 1mm) real world??? or is it trying to find the relation between 1mm and pixel ... thank you

rsa

0 Kudos
Message 9 of 10
(4,412 Views)
rsa,
 
Take a look at the Vision Concepts Manual at:
 
 
Chapter 3 describes System Setup and Calibration and should clear up any questions you have on real world calibration.
0 Kudos
Message 10 of 10
(4,403 Views)