Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

IMAQ Calibrated image, Measurement problem

Hi All,
 
I have a problem with the measurement (edge to edge distance), using a Calibrated picture.
 
I learned a calibration grid for our setup.
After each image acquire, I use IMAQ Set Calibration Info, followed by IMAQ Correct Calibrated Image. The result looks ok, and no error is returned.
For each product found in the image I perform various distance measuring. Which I convert to mm using the IMAQ Pixel To Real Word.
Problem is, if I do this for long products (see prods_long.png), the result is about 7% less than the expected value.
If I do this for shorter products (8th of the size of shown products, width is the same), the result is about 1-5% more than the expected value, depending on the position. (Center: 5%, corner: 1%.)
 
The pixel coordinates I convert are the right ones, If I overlay a line, the line is at the expected location.
 
See code.png for block diagram snippets.
 
I guess I'm doing something wrong with the calibration steps I use but can't find out where/what.
 
I use IMAQdx 3.1, Labview 8.5, Vision 8.5
Download All
0 Kudos
Message 1 of 3
(3,587 Views)
 

Dear Sir,

 

Thank you verry much for your post on our webforum.

I found the following suggestions in a internal database, I hope that this will help you further;

1) Try double-checking the sheet that you printed out with a set of calipers to be sure that the dots that you use are, in fact, equally spaced. Laser printers have very good resolution, but they are not really designed for printing out precise test patterns.

2) Is the test sheet flat in the image? It appears that there is some curling at the edges. Is that a result of lighting, or is the sheet actually bending? Be sure that the center points of the test sheet correspond to the center points of the rubber sheet.

3) You may be able to improve the results by using manual point calibration instead of automatic grid calibration. This would involve generating a 2-D array of real-world X-Y coordinates and an array of pixel coordinates. This will involve more work on the front-end, but will be more precise.

4) Try plotting the amount of error as a function of position. This will give you additional information about how the error changes with relation to coordinates on the image. This error map can help us find out if the error is a linear function or not. If so, you can apply a manual adjustment to the calibration based on position with relation to the center.

To answer your question about the calibration algorithm, it is using the center points of the dots, not the size of the dots. The barrel distortion that you are seeing in the image should not affect the default calibration unless the actual center points are shifting as well.

For additional information on calibration and distortion, I would suggest looking at the following resources:

IMAQ Vision Concepts Manual (See Chapter 3)
http://digital.ni.com/manuals.nsf/websearch/34548BDDD48DF68B86256F81005B94F8

Spatial Calibration - Tutorial
http://zone.ni.com/devzone/conceptd.nsf/webmain/ef66eeb671b0019b862569d10078c45e 

Please let me know if this helps you further,

 

Best regards,

 

Martijn S

Martijn S
Applications Engineer
NI Netherlands
0 Kudos
Message 2 of 3
(3,496 Views)
Thanks for the response,
 
Problem was solved already. Sorry for not posting it.
 
The distance from the camera to the calibrationgrid was slightly different (about 5%) than the distance to the products. this explains the 5%. Stupid me. Also, product height varies, so now I use a correction based on the height of the product, this adds another 1-2% to the accurancy.
 
Also the original grid we used was not very neat, we printed another calibrationgrid, and had it pasted it on foamboard so it can't bend. Now measurement is quite accurate (+/- 2mm)
 
Regards,
 
Jos.
0 Kudos
Message 3 of 3
(3,481 Views)