From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image calibration

Hello,
I'm trying to use the function LearnCalibrationPoints with VB.NET and NI Vision 8.5 passing at the function these 4 points:
 
Point1   pixel 50,50      real 0,0
Point2   pixel 300,50     real 200,0
Point3   pixel 50,300     real 0,200
Point4   pixel 300,300    real 200,200
 
The function work properly (the return value of the function is 0). My problem is the position coordinate reference of the image that stay in the point 0,0: If i use the ConvertPixelToRealWorldCoordinates passing the point 50,50 (pixel) I have the result point 40,40 when I aspect a 0,0 result (in real coordinate).
 
Can anybody explain me how resolve the problem?
 
Thank You.
0 Kudos
Message 1 of 11
(4,588 Views)
Gualty -

In order for LearnCalibrationPoints to work properly, you need to set the origin of the coordinate system correctly.  In your case, since (50, 50) corresponds to (0, 0), that means that (50, 50) will be the origin.  To do this, assuming that LearnCalibrationOptions is the CWIMAQLearnCalibrationOptions object that you're passing in to LearnCalibrationPoints:

        LearnCalibrationOptions.CalibrationAxisInfo.Origin.Initialize(50, 50)

Let me know if you have any other issues with LearnCalibrationPoints.

Greg Stoll
Vision R&D
National Instruments
Greg Stoll
LabVIEW R&D
0 Kudos
Message 2 of 11
(4,580 Views)
ThankYou very much. I have set the position of the origin how You tell me and now my calibration is correct.  
0 Kudos
Message 3 of 11
(4,570 Views)

Hi, i am having similar problem....

 

So what happend if the origin of the coordinate system is outside the camera?

 

for example if I have something like

 

Point1   pixel 50,50      real 400,400

Point2   pixel 300,50     real 750,400

Point3   pixel 50,300     real 400,750

Point4   pixel 300,300    real 750,750

 

So lets say the origin in realworld coordinates is in a pixel that i actually don't see from the camera?

 

I don't really undestand why you have to include a origin, if you are giving points to it the origin should be easily calculated from thise points, but if i have to give the origin in pixel coordinate system then in some applications this origin can be outside the camera view.

 

Any ideas?

0 Kudos
Message 4 of 11
(4,130 Views)

Hi,

you can use negative numbers to set the origin position if it is outside the image.

 

Best regards,

Serena

0 Kudos
Message 5 of 11
(4,090 Views)

 

Hi

 

Yeah off course is posible to put negative numbers in the pixel origin, but i don't know those and i can not check them with the camera since the vision area is outside the robot origin. For example, if you would have a denso robot is easier because with the same matrix calibration you can actually teach a new coordinate system for the robot, same coordinate system than the matrix used for the camera calibration. As our in our own robot constructed system we can not have more than one coordinate system (it could be implemented but is just extra work), i would like that the camera software makes the coordinates trasformation. I quite don't understan why under NI calibration (point selection) you have to give a reference system if you are anyway giving the positions for the world system. Origin should be always in the origin of those position since they are calculated related from some origin.

 

BR

0 Kudos
Message 6 of 11
(4,085 Views)

hi gregstoll,

     

 i need to do point coordinates calibration in labview vi file  

 

Point1   pixel 50,50      real 400,400

Point2   pixel 300,50     real 750,400

Point3   pixel 50,300     real 400,750

Point4   pixel 300,300    real 750,750

             

 if i have 4 pixels point and real world location means how to apply this value to create calibrate image in labview .. (without vision assistant ) 

0 Kudos
Message 7 of 11
(3,555 Views)

Hello,

 

this should work (check out the help for IMAQ Learn Perspective Calibration for more information) :

 

Example_VI_BD.png

 

Best regards,

K


https://decibel.ni.com/content/blogs/kl3m3n



"Kudos: Users may give one another Kudos on the forums for posts that they found particularly helpful or insightful."
0 Kudos
Message 8 of 11
(3,547 Views)

Hi Sir .. i need VI file please if dont mind 

0 Kudos
Message 9 of 11
(3,542 Views)

(No need vi file ) sir thanks a lot .... 

 

 

0 Kudos
Message 10 of 11
(3,541 Views)