11-30-2020 06:08 AM
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?
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?
Solved! Go to Solution.
12-14-2020 09:56 AM
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
12-14-2020 12:16 PM
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.
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.
12-14-2020 05:12 PM
thanks a lot! will try this out. Will update if i made any success.
12-14-2020 06:17 PM - edited 12-14-2020 06:17 PM
There is one more option
If you look at NI documentation in
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.