halcon days of self-calibration fried cock (1)

The first self-calibration of halcon to be a general introduction to understand Cock fried-day self-calibration application and implementation in practical applications, specific programming details will be covered in a future article.

 

halcon is provided a self-calibration of the operator, which can without the use of calibration plate calibration of the internal reference camera (no focus), with respect to the plurality of calibration parameters can not be obtained outside the camera.

 

The internal reference can be obtained camera distortion correction, and thus self-calibration with respect to the pieces of calibration, more efficient in terms of distortion correction, easier to operate such equipment in the field, and maintenance.

 

After the distortion correction We can also place a reference object obtaining pixel equivalents, constructed world XY coordinate system for measurement, positioning applications.

 

  1. 1
    2
    3
    4
    5
    6
    7
    8
    9
    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)

 

The code is a self-calibration routine process:

1. The imaging object edge determined XLD

2. Use radial_distortion_self_calibration function, determined in accordance with internal reference edge camera

3. change_radial_distortion_cam_par find the ideal undistorted internal reference

4. change_radial_distortion_image The internal reference camera, the image distortion correction

 

More routine reference halcon example

radial_distortion_self_calibration.hdev

 

Calibrate the radial distortion coefficient and the center of distortion

radial_distortion_comparison.hdev

 

Compare results of camera calibration and radial distortion self-calibration

 

The principle of self-calibration from paper, paper money can not get really regret not understanding, Which can be downloaded to remember email me a copy.

T. Thormälen, H. Broszio: “Automatic line-based estimation of radial lens distortion”; in: Integrated Computer-Aided Engineering; vol. 12; pp. 177-190; 2005.

 
However, according to the documentation you can understand: halcon self-calibration according to the extracted object is the edge of a straight line, calculated camera distortion coefficients.
 
Because generally more severe distortion at the edges of the image, so it is necessary to ensure there is enough straight line around the edges of the image.
 
Of course, the object shot in real projects can not all have the same routine as the straight edge over alternative methods are: Films made with a printed black grid (10 * 10, can be adjusted according to their actual conditions) fills the vision,
 
Camera time to strike internal control, calibration based on this result, but also can be calculated based on a grid of pixels equivalent, to build the world XY coordinate system.
 
NOTICE: Use self-calibration halcon need to ensure that the operating environment Memory> = 2G, when you need to use a polynomial calibration mode> = 4G, otherwise there will be error 6001: memory not enough.
 

Guess you like

Origin www.cnblogs.com/wwwbdabc/p/11653237.html