preCornerDetect函数
1、preCornerDetect函數(shù)
函數(shù)作用:
計算用于角點檢測的特征圖,利用圖像的二階導(dǎo)數(shù)進行求解角點,,二階導(dǎo)數(shù)為零說明是角點
2、preCornerDetect函數(shù)調(diào)用形式
C++:?void?preCornerDetect(InputArray?src, OutputArray?dst, int?ksize, int?borderType=BORDER_DEFAULT?)
InputArray?src:輸入圖像單通道8-bit圖像
OutputArray?dst:輸出圖像與輸入圖像通道一樣
int?ksize:鄰域處理的半徑3,5,7,9.。。。。。。。。。。。。。。。。。。
?int?borderType=BORDER_DEFAULT:圖像邊界處理的方式
The function calculates the complex spatial derivative-based function of the source image
where?,:math:D_y?are the first image derivatives,?,:math:D_{yy}?are the second image derivatives, and??is the mixed derivative.
3、opencv代碼:
#include<opencv2/imgproc/imgproc.hpp> #include<opencv2/core/core.hpp> #include<opencv2/highgui/highgui.hpp> #include<iostream> using namespace cv; using namespace std;int main() {Mat src,src_gray;src= imread("D:6.jpg");cvtColor(src, src_gray, CV_RGB2GRAY);Mat cornerStrength;/*cornerHarris(src_gray, cornerStrength, 3, 3, 0.01);threshold(cornerStrength, cornerStrength, 0.0001, 255, THRESH_BINARY);*/preCornerDetect(src_gray, cornerStrength, 3, BORDER_DEFAULT);imshow("shiyan", cornerStrength);waitKey(0);return 0; }
總結(jié)
以上是生活随笔為你收集整理的preCornerDetect函数的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: goodFeaturesToTrack函
- 下一篇: CalcBackProject函数