11-08-2016 03:39 AM - edited 11-08-2016 03:47 AM
Hello ,
I am using Ni Vision for Object detection and want to do coordinate alignement. Currenly I am considering XY coorinate only.
My camera is Mounted on fixed position, But I am facing problem regaring to coordinate alignment.
Object which are near to center point of camera are aligned good with world coordinate but object, which are bit far from center of camera has some difference in (cm). I guess this is because of camera lens distortion so called barrel distortion.
Is there any way to correct or remove this distortion from the image??
I had seen some vi called perspective calibrartion vi, but I am bit confuse that how to use it, or may be there is some other solution to overcome this problem.
Thank you very much in advance.
Regards,
Ankit Ramani.
Solved! Go to Solution.
11-09-2016 12:59 AM
Hi Ankit,
what you are looking for is a calibration grid and the corresponding functions.
What are the Requirements for an NI Vision Calibration Grid? - National Instruments
http://digital.ni.com/public.nsf/allkb/815CFD0DACE4AFB08625770F004EE84E
IMAQ Learn Perspective Calibration VI - NI Vision 2016 for LabVIEW Help - National Instruments
http://zone.ni.com/reference/en-XX/help/370281AC-01/imaqvision/imaq_learn_perspective_calibration/
IMAQ Learn Calibration Template VI - NI Vision 2010 for LabVIEW Help - National Instruments
http://zone.ni.com/reference/en-XX/help/370281M-01/imaqvision/imaq_learn_calibration_template/
At the end of the help page there are examples listed on how to use the functions. Have you tried them?
Regards,
Christoph
11-10-2016 05:52 AM
Thank you very much for suggestions.
I tried the example given in link, and here in attachement I have attached one VI that suppos to work.
This Vi should give corrected image from camera distortion.
If it is possible for you then please have a look and give me some suggestions, that whether I am doing currect or not to avoid camera lens distortion .
Thank you very much once again.
Regards,
Ankit.
11-10-2016 06:07 AM
Hi Ankit,
please have a look at the 'Perspective Calibration.vi' example (also attached as VI snippet):
LabVIEW\examples\Vision\Calibration\Perspective Calibration.vi
You need a calibration image so the algorithm can calculate how the image is distorted. Please modify the example mentioned above and please provide images so I can really test you VI. Without an image a VISION VI is hard to test.
Regards,
Christoph
11-10-2016 08:01 AM
Thank you very much for suggestions.
What I did is captured One image from camera and then using Vision assistant, I change color plan and then use image calibration with Distortion model (Grid). As distance between two points are 13mm, so I provide that value and stored that calibrated image, which I have attached here. now I run my vi and provide calibrated image to calibration image file path and in image path I provide current image captured by camera in VI attached in previous post.
I will have a look at 'Perspective Calibration.vi'.
Thank you very much once again for your time and suggestions. 🙂