Machine Vision

cancel
Showing results for 
Search instead for 
Did you mean: 

Image calibration without Grid

Solved!
Go to solution

I am doing an offline image processing so I do not have access to the the camera. I am provided 2 images, one image will be used as the reference and the other will be the actual image. I have attached both images. 

 

 

The first image is my calibrate image. The inner light rectangle is 534x211mm in actual. The coordinates of the rectangle is not known. But I know the coordinate of the black dot which is at (380,0). This image is just a a snap of the whole table. 

My issue is that the calibrated image is distorted in the right side. If I measure the rectangle using the Vision assistant, the right side is smaller than the left side of the rectangle. Since I do not have access to the camera, I cannot do a grid calibration. Is there any other way for me to be able to correct the image such that the lighter rectangle will have a dimension of 534x211 mm?

calibrate.jpg

 

 

This image is the second image. My task will be to get the coordinates of the other black circle given only the rectangle sides and the coordinate of the first picture black dot. Is it possible to get the coordinates of the black dots given the first picture as my calibration picture?

 

snap.jpg

0 Kudos
Message 1 of 5
(2,673 Views)

Hi,

 

As I understand the light rectangles are the same.

Why do you need to correct the rectangle if you have the coordinates of black dot.

I think there are functions that you can use to find the coordinates of other black dots in relation to known one.

 

Best regards  

0 Kudos
Message 2 of 5
(2,591 Views)
Solution
Accepted by topic author meanne23

Matlab has specific function to create affine transform for correction.

If you have access to the Image Processing toolbox in Matlab you can see what they do and copy the logic into LabVIEW. 

https://www.mathworks.com/help/images/registering-an-aerial-photo-to-an-orthophoto.html;jsessionid=2...

 

In matlab you will:

1. Create synthetic image has your square and the box undistorted (or feed in the points programmatically)

2. Mark the corner points and the circle point on the distorted image (cpselect)

3. Call function that create the affine transform between them.

Amit Shachaf
0 Kudos
Message 3 of 5
(2,583 Views)

thanks a lot! will try this out. Will update if i made any success. 

0 Kudos
Message 4 of 5
(2,576 Views)
Solution
Accepted by topic author meanne23

There is one more option

If you look at NI documentation in 

https://documentation.help/NI-Vision-LabView-Basics/Perspective_and_Nonlinear_Distortion_Calibration...

You will see that comment:

"You can define a calibration template by supplying an image of a grid or providing a list of pixel coordinates and their corresponding real-world coordinates. This section discusses the grid method of defining a calibration template in detail."

Instead of using the calibration template you can supply to the NI functions the list of the points on the image and the list of where the point should be. 

It will create the transform for you same like the Matlab function.

Amit Shachaf
0 Kudos
Message 5 of 5
(2,567 Views)