Harris、Shi-Tomasi和亚像素角点都是角点,隶属于特征点这个大类(特征点可以分为边缘、角点、斑点).
void cv::cornerHarris | ( | InputArray | src, //需要为8位单通道 |
OutputArray | dst, //结果 | ||
int | blockSize, //领域大小 | ||
int | ksize, //Sobel孔径大小 | ||
double | k, //Harris参数 | ||
int |
borderType = BORDER_DEFAULT |
||
) |
Harris corner detector.
The function runs the Harris corner detector on the image. Similarly to cornerMinEigenVal and cornerEigenValsAndVecs , for each pixel (x, y) it calculates a 2\times2 gradient covariance matrix M^{(x,y)} over a \texttt{blockSize} \times \texttt{blockSize} neighborhood. Then, it computes the following characteristic:
(特征点计算方法)
Corners in the image can be found as the local maxima of this response map.
- Parameters
-
src Input single-channel 8-bit or floating-point image. dst Image to store the Harris detector responses. It has the type CV_32FC1 and the same size as src . blockSize Neighborhood size (see the details on cornerEigenValsAndVecs ). ksize Aperture parameter for the Sobel operator. k Harris detector free parameter. See the formula below. borderType Pixel extrapolation method. See cv::BorderTypes.
.,,THRESH_BINARY);
imshow();

void cv::goodFeaturesToTrack | ( | InputArray | image,//输入图像 |
OutputArray | corners,//输出向量 | ||
int | maxCorners,//角点最大数量 | ||
double | qualityLevel,//角点检测可接受的最小特征值 | ||
double | minDistance,//角点之间的最小距离 | ||
InputArray |
mask = noArray() ,//感兴趣区域 |
||
int |
blockSize = 3 ,//领域范围 |
||
bool |
useHarrisDetector = false ,//true为harris;false为Shi-Tomasi |
||
double |
k = 0.04 //权重系数 |
||
) |
Determines strong corners on an image.
The function finds the most prominent corners in the image or in the specified image region, as described in [154]
- Function calculates the corner quality measure at every source image pixel using the cornerMinEigenVal or cornerHarris .
- Function performs a non-maximum suppression (the local maximums in 3 x 3 neighborhood are retained).
- The corners with the minimal eigenvalue less than qualityLevel⋅maxx,yqualityMeasureMap(x,y) are rejected.
- The remaining corners are sorted by the quality measure in the descending order.
- Function throws away each corner for which there is a stronger corner at a distance less than maxDistance.
The function can be used to initialize a point-based tracker of an object.
- Note
- If the function is called with different values A and B of the parameter qualityLevel , and A > B, the vector of returned corners with qualityLevel=A will be the prefix of the output vector with qualityLevel=B .
- Parameters
-
image Input 8-bit or floating-point 32-bit, single-channel image. corners Output vector of detected corners. maxCorners Maximum number of corners to return. If there are more corners than are found, the strongest of them is returned. maxCorners <= 0
implies that no limit on the maximum is set and all detected corners are returned.qualityLevel Parameter characterizing the minimal accepted quality of image corners. The parameter value is multiplied by the best corner quality measure, which is the minimal eigenvalue (see cornerMinEigenVal ) or the Harris function response (see cornerHarris ). The corners with the quality measure less than the product are rejected. For example, if the best corner has the quality measure = 1500, and the qualityLevel=0.01 , then all the corners with the quality measure less than 15 are rejected. minDistance Minimum possible Euclidean distance between the returned corners. mask Optional region of interest. If the image is not empty (it needs to have the type CV_8UC1 and the same size as image ), it specifies the region in which the corners are detected. blockSize Size of an average block for computing a derivative covariation matrix over each pixel neighborhood. See cornerEigenValsAndVecs . useHarrisDetector Parameter indicating whether to use a Harris detector (see cornerHarris) or cornerMinEigenVal. k Free parameter of the Harris detector.
;i,Scalar());
}
imshow();

void cv::cornerSubPix | ( | InputArray | image, |
InputOutputArray | corners, | ||
Size | winSize, | ||
Size | zeroZone, | ||
TermCriteria | criteria | ||
) |
cout);
