halcon直线标定板对相机标定的效果评估(对比矫正前后、对比标定板矫正效果)
生活随笔
收集整理的這篇文章主要介紹了
halcon直线标定板对相机标定的效果评估(对比矫正前后、对比标定板矫正效果)
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
原圖
程序源碼
* gen_caltab (7, 7, 0.0025, 1/2.5, 'GB025標定板.descr', 'GB025標定板.ps') * Calibration 01: Code generated by Calibration 01 * CameraParameters := [0.048105,-44.0585,8.31518e-006,8.3e-006,641.37,588.269,1280,1024] * CameraPose := [-0.000849522,-0.00119001,0.155349,357.367,2.64825,174.694,0] * stop () * Calibration 01: Code generated by Calibration 01 CameraParameters := [0.0481151,56.7536,-739213,1.05534e+010,0.00643696,0.00896216,8.31503e-006,8.3e-006,636.538,582.388,1280,1024] CameraPose := [-0.000719502,-0.00103218,0.155376,357.307,2.70546,174.696,0] stop ()read_image (Image, '直線標定板圖片/Left201113141949916.bmp') get_image_size (Image, Width, Height) dev_close_window () dev_open_window_fit_image (Image, 0, 0, -1, -1, WindowHandle) dev_display (Image) * Image Acquisition 01: Code generated by Image Acquisition 01 list_files ('直線標定板圖片', ['files','follow_links'], ImageFiles) tuple_regexp_select (ImageFiles, ['\\.(tif|tiff|gif|bmp|jpg|jpeg|jp2|png|pcx|pgm|ppm|pbm|xwd|ima|hobj)$','ignore_case'], ImageFiles) gen_empty_obj (Edges) for Index := 0 to 20 - 1 by 1read_image (Image, ImageFiles[Index])edges_sub_pix (Image, ImageEdges, 'canny', 1, 10, 40)segment_contours_xld (ImageEdges, SplitEdges, 'lines_circles', 5, 4, 2)select_shape_xld (SplitEdges, SelectedEdges, 'contlength', 'and', 30, 100000)concat_obj (Edges, SelectedEdges, Edges)dev_display (Image)dev_set_colored (12)dev_display (SelectedEdges)wait_seconds (0.1) * stop () endforradial_distortion_self_calibration (Edges, CalibrationEdges, Width, Height, 0.08, 42, 'polynomial', 'variable', 0, CamParMultiImage) dev_clear_window () dev_set_colored (12) dev_display (CalibrationEdges)**********對比矯正后的圖片與矯正前的圖片 change_radial_distortion_cam_par ('fixed', CamParMultiImage, 0, CamParMultiImageRect) for Index := 0 to |ImageFiles| - 1 by 1read_image (Image, ImageFiles[Index])get_domain (Image, Domain)* Rectify the image, i.e., remove the radial distortions.change_radial_distortion_image (Image, Domain, ImageRectified, CamParMultiImage, CamParMultiImageRect)* Display the distorted and undistorted image to visualize the* differences between the images.dev_display (Image)sub_image (Image, ImageRectified, ImageSub3, 1, 0)stop ()disp_message (WindowHandle, 'Image with radial distortions', 'window', 0, 0, 'black', 'true')wait_seconds (0.5)dev_display (ImageRectified)disp_message (WindowHandle, 'Image without radial distortions', 'window', 0, 0, 'black', 'true')wait_seconds (0.5) endfor*標定板畸變矯正準備 change_radial_distortion_cam_par ('fixed', CameraParameters, [0,0,0,0,0], CamParVirtualFixed) * CamParVirtualFixed:=CameraParameters gen_radial_distortion_map(MapFixed,CameraParameters,CamParVirtualFixed,'bilinear') *直線畸變矯正準備 change_radial_distortion_cam_par ('fixed', CamParMultiImage, [0,0,0,0,0], CamParMultiImageRect) get_domain (Image, Domain)for Index := 0 to |ImageFiles| - 1 by 1read_image (Image, ImageFiles[Index])* 直線標定change_radial_distortion_image (Image, Domain, ImageRectified, CamParMultiImage, CamParMultiImageRect)* 標定板標定map_image(Image,MapFixed,ImageRectifiedFixed)*標定板與直線標定sub_image (ImageRectified, ImageRectifiedFixed, ImageSub, 1, 128)intensity (Domain, ImageSub, Mean, Deviation)sub_image (Image, ImageRectifiedFixed, ImageSub1, 1, 128)intensity (Domain, ImageSub1, Mean1, Deviation1)sub_image (Image, ImageRectified, ImageSub2, 1, 128)intensity (Domain, ImageSub2, Mean2, Deviation2)dev_display (Image)disp_message (WindowHandle, 'Image with radial distortions', 'window', 0, 0, 'black', 'true')wait_seconds (0.5)dev_display (ImageRectified)disp_message (WindowHandle, 'Image without radial distortions', 'window', 0, 0, 'black', 'true')wait_seconds (0.5) endfor直線標定板標定前后對比:
直線標定板矯正與標定板差異
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的halcon直线标定板对相机标定的效果评估(对比矫正前后、对比标定板矫正效果)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: matlab中如何调用lm算法,lm算法
- 下一篇: Laravel框架一:原理机制篇