halcon self-calibration

concept

This algorithm can calculate the internal parameters of the camera without using a calibration plate, so as to correct the distortion, which is suitable for the situation of large distortion. The algorithm is very simple:
1. Find the edge of the image to be segmented.
2. Self-calibration radial_distortion_self_calibration based on the screening line.
3. Get the calibration area.
4. Determine the new camera parameter change_radial_distortion_cam_par according to the specified radial distortion.
5. Change the radial distortion of the image to get a new image.
Note:
1. Ensure that there are enough straight line segments around the edges of the image.
2. Ensure that the operating environment memory>=2G.

example

read_image (Image, 'D:/TestBMP/Test_2D_S4.png')
edges_sub_pix(Image, Edges, 'canny', 1, 20, 40)
segment_contours_xld(Edges, ContoursSplit, 'lines_circles', 5, 4, 2)
select_shape_xld(ContoursSplit, SelectedXLD, 'width', 'and', 200, 99999)
radial_distortion_self_calibration(SelectedXLD, SelectedContours, 3024, 4032, 0.02, 50, 'division', 'variable', 0, CameraParam)
get_domain(Image, Domain)
change_radial_distortion_cam_par('fixed', CameraParam, 0, CamParamOut)
change_radial_distortion_image(Image, Domain, ImageRectified, CameraParam, CamParamOut)

Guess you like

Origin blog.csdn.net/baidu_35536188/article/details/115110815