本次先對halcon的自標定作個總體介紹,瞭解屌炸天的自標定在實際應用中的應用與實現方法,具體的編程細節將在後續的文章中介紹。編程
halcon提供了一種自標定的算子,它能夠在不用標定板的狀況下,標定出相機內參(無焦距),相對於多幅標定沒法獲取相機的外參。微信
求出了相機內參就能夠進行畸變校訂,於是自標定相對於多幅標定,在畸變校訂方面更快捷,這樣設備在現場更容易操做、維護。dom
在畸變校訂之後咱們一樣能夠放置一個參考物求取像素當量,構建XY世界座標系,以用於測量、定位等應用。ide
edges_sub_pix (GrayImage,Edges,'canny',1.0,20,40) segment_contours_xld (Edges,ContoursSplit,'lines_circles',5,8,4) radial_distortion_self_calibration (ContoursSplit,SelectedContours, \ 640,480,0.08,42,'division', \ 'variable',0,CameraParam) get_domain (GrayImage,Domain) change_radial_distortion_cam_par ('fullsize',CameraParam,0,CamParamOut) change_radial_distortion_image (GrayImage,Domain,ImageRectified, \ CameraParam,CamParamOut)
上述代碼是一個常規的自標定流程:函數
1.求出拍攝物體的邊緣XLDspa
2.使用radial_distortion_self_calibration函數,根據邊緣求出相機內參orm
3.change_radial_distortion_cam_par 求出理想無畸變內參blog
4.change_radial_distortion_image 根據相機內參,對圖像進行畸變校訂內存
更多例程參考halcon exampleci
Calibrate the radial distortion coefficient and the center of distortion |
||
Compare results of camera calibration and radial distortion self-calibration |
T. Thormälen, H. Broszio: 「Automatic line-based estimation of radial lens distortion」; in: Integrated Computer-Aided Engineering; vol. 12; pp. 177-190; 2005.