源码来自:
http://www.ihalcon.com/read-9322.html
read_image(Image,'C:/Users/firecat/Downloads/9_281_67b0b01ce3c865f.jpg') edges_sub_pix(Image, Edges, 'canny', 1, 20, 40) segment_contours_xld(Edges, ContoursSplit, 'lines_circles', 5, 4, 2) select_shape_xld(ContoursSplit, SelectedXLD, 'contlength', 'and', 60, 99999) radial_distortion_self_calibration(SelectedXLD, SelectedContours, 533, 400, 0.05, 42, '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)
校正前:
校正后: