Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Help with using the LearnCalibration.vi

Solved!
Go to solution

I have a set of points which are the coordinates of points as they were projected on a screen.

I have another set of points, which is the coordinates of the points as they were  seen by a camera.

 

I would like to use the LearnCalibration.vi to figure out the scale, rotation and translation between the two sets of points.

 

 When I put the reference points (315 row,col coordinate pairs ranging from x=-700 to x=+700 and corresponding y values) and the real world points (315 row, col coordinate pairs ranging form x=-900 to x=+900 with corresponding y values) into the LearnCalibration.vi I get an image too small error.  The image input reference is a floating point image grayscale. 

 

Any thoughts.

0 Kudos
Message 1 of 12
(5,296 Views)
Here is the code.
0 Kudos
Message 2 of 12
(5,294 Views)

If you right click on the IMAQ Learn Calibration Template VI and select Help at the bottom of the document there are two paths to examples of how to use this VI. They are provided by National Instruments and may be sufficient for understanding how to use this VI. I recommend studying these block diagrams and comparing them to what you are doing so you can get your template to work properly.

Vince M
Applications Engineer
0 Kudos
Message 3 of 12
(5,277 Views)

Thanks for the help.

 

1.  I can't seem to find the files you are referring to ... where would they be in my computer.

2.  If you are an applications engineer, and have these things at your fingertips, why don't you put a link in so that I can get to it without spending 20 minutes fighting the filing system.

3.  I just finished the vision course and the instructor did a good job, but all the examples involved used images as reference points.

 

How about a little help rather than simply telling me to RTFI...That kind of help I don't need.

 

Thanks anyway.

 

NOT a solution.

0 Kudos
Message 4 of 12
(5,269 Views)

Vince,

 

Sorry about that...you were trying to help...and lord knows I need it.

 

Thanks...It's been a long week.

 

Please accept my appologies for being "short".

 

 

0 Kudos
Message 5 of 12
(5,240 Views)
  • <LabVIEW>\examples\Vision\2. Functions\Calibration\Perspective Calibration Example.llb
  • <LabVIEW>\examples\Vision\2. Functions\Calibration\Simple Calibration Example.llb


This will start at your root directory. For me this is C, so for me this is at the following path: C:\Program Files\National Instruments\LabVIEW 8.6\examples\Vision...

 

Appology accepted. I wasn't offended. I hope this week is going better for you.
Message Edited by seVEMes on 12-22-2008 10:36 AM
Vince M
Applications Engineer
0 Kudos
Message 6 of 12
(5,231 Views)

thanks again for your patience.

 

I recall seeing these before...Each of them inputs either a grid reference or an image.  What I have is a set of coordinated from a reference image and a set of coordinates from an image acquired by a camera.  I would like for the Learn calibration vi to do the Learn Calibration on these two equal length sets of data...but here seems to be some hickup with the size of the input image (even though it is not used)....that' why I'm puzzled.

 

The is equivalent to the MatLab cp2tform command...and the us of it to correct future images.

 

Thanks.

0 Kudos
Message 7 of 12
(5,228 Views)
Solution
Accepted by topic author Hummer1

Hey Hummer1,

 

2 things: First, your input image has to be either a U8 or an I16, but that is not what is causing your problem. 

 

We don't have great documentation on this particular VI, so I needed to look into it some more. While the information says that an image is no longer necessary for calibration of your program, it IS necessary to  have an image to add the calibration info to. As you have probably noticed, this particular VI does not have an output that adjusts the image, it just adds the calibration info TO the image so that you can calibrate it in later VIs. 

 

You will want to wire your image form the camera to the input of the learn calibration VI, so that you can  later use the correct calibrated image VI.

 

It took me some time to get everything to work as I had hoped, but this should fix your problem. 

 

Thanks for your patience!
Chris Van Horn
Applications Engineer
Message 8 of 12
(5,158 Views)

Thanks Chris.

 

That's just what I needed.

 

I will take a "dummy" image of the right kind and shape and put it in as the input to the LearnCalibration and see what happens.  By "dummy", I mean that I will create an image of the right horizontal and vertical pixel size int he proper format (I16 I guess), making each pixel zero and see how it goes.

 

Thanks for the help.

 

Humming Along Again.

0 Kudos
Message 9 of 12
(5,106 Views)

Thanks, Chris.

 

I have looked at the help file for the LearnCalibration and it seems to show that the vi supports more file types than just U8 or I16...I am actually trying to manage information in an image that is single percision floating point...Is that going to be possible...?

 

Can I create a "calibration image" in the I16 format and then use that calibration to correct a sngl(grayscale) image?

 

Thanks.

0 Kudos
Message 10 of 12
(5,069 Views)