来源于HALCON案例:
radial_distortion_self_calibration.hdev
提取图像直线信息,进行校正。
01
算法分享
read_image (Image, '畸变图像.bmp')edges_sub_pix(Image, Edges, 'canny', 1, 10, 40) segment_contours_xld(Edges, ContoursSplit, 'lines_circles', 5, 4, 2) select_shape_xld(ContoursSplit, SelectedXLD, 'contlength', 'and', 60, 99999) get_image_size (Image, Width, Height)radial_distortion_self_calibration(SelectedXLD, SelectedContours,Width, Height, 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)
处理效果 |