①criteria:迭代停止的模式选择,这是一个含有三个元素的元组型数。格式为(type,max_iter,epsilon)
其中,type又有两种选择:
—–cv2.TERM_CRITERIA_EPS :精确度(误差)满足epsilon停止。
—- cv2.TERM_CRITERIA_MAX_ITER:迭代次数超过max_iter停止。
—-cv2.TERM_CRITERIA_EPS+cv2.TERM_CRITERIA_MAX_ITER,两者合体,任意一个满足结束
②
如果对角点的精度有更高的要求,可以用cornerSubPix()函数将角点定位到子像素,从而取得亚像素级别的角点检测效果
cv2.cornerSubPix(image, corners, winSize, zeroZone, criteria)
函数参数说明如下:
image:输入图像
corners:输入角点的初始坐标以及精准化后的坐标用于输出。
winSize:搜索窗口边长的一半,例如如果winSize=Size(5,5),则一个大小为的搜索窗口将被使用。
zeroZone:搜索区域中间的dead region边长的一半,有时用于避免自相关矩阵的奇异性。如果值设为(-1,-1)则表示没有这个区域。
criteria:角点精准化迭代过程的终止条件。也就是当迭代次数超过criteria.maxCount,或者角点位置变化小于criteria.epsilon时,停止迭代过程。
③
Python:
retval, corners = cv.findChessboardCorners(image, patternSize, corners, flags)
Parameters
image | Source chessboard view. It must be an 8-bit grayscale or color image. |
patternSize | Number of inner corners per a chessboard row and column ( patternSize = cvSize(points_per_row,points_per_colum) = cvSize(columns,rows)). |
corners | Output array of detected corners. |
flags | Various operation flags that can be zero or a combination of the following values:
|
④
numpy.
zeros
(shape, dtype=float, order='C')
Return a new array of given shape and type, filled with zeros.
Parameters: | shape : int or sequence of ints
dtype : data-type, optional
order : {‘C’, ‘F’}, optional
|
---|---|
Returns: | out : ndarray
|
See also
Return an array of zeros with shape and type of input.
Return an array of ones with shape and type of input.
Return an empty array with shape and type of input.
Return a new array setting values to one.
Return a new uninitialized array.
⑤mgrid[ ]
⑥append()
⑦destroyAllwindows()
⑧wait()