cvFindCornerSubPix亚像素角点寻找函数

在摄像机标定时也需要用到亚像素角点寻找函数。

函数 cvFindCornerSubPix 通过迭代来发现具有子象素精度的角点位置,或放射鞍点(radial saddle points)。

原型如下:

void cvFindCornerSubPix( const CvArr* image, CvPoint2D32f* corners,
                         int count, CvSize win, CvSize zero_zone,
                         CvTermCriteria criteria );
参数: image   IntPtr Input image
           corners array< Single ,
            2>[,](,)[,] Initial coordinates of the input corners and refined coordinates on output
           count    Int32  Number of corners
          win   Size
    Half sizes of the search window. For example, if win=(5,5) then 5*2+1 x 5*2+1 = 11 x 11 search window is used
         zeroZone  Size 
      Half size of the dead region in the middle of the search zone overwhich the summation in formulae below is not done. It is used sometimesto avoid possible singularities of the autocorrelation matrix. Thevalue of (-1,-1) indicates that there is no such size
       criteria MCvTermCriteria
        Criteria for termination of the iterative process of corner refinement.That is, the process of corner position refinement stops either aftercertain number of iteration or when a required accuracy is achieved.The criteria may specify either of or both the maximum number ofiteration and the required accuracy
例:
cvFindCornerSubPix(srcImage,corners,cornerCount,cvSize(11,11),cvSize(-1,-1), 
  cvTermCriteria(CV_TERMCRIT_ITER|CV_TERMCRIT_EPS,40,0.01));  
其中srcImage必须为单通道,深度为IPL_DEPTH_8U。否则报错。

你可能感兴趣的:(opencv)