#include <opencv2/opencv.hpp>
#include <opencv2/imgproc/imgproc.hpp>
using namespace cv;
using namespace std;
int main()
{
Mat image0= imread("lines.jpg");
Mat image;
cvtColor(image0, image, CV_RGB2GRAY);
Mat cornerStrength;
cornerHarris(image, cornerStrength, 3,3,0.01);
Mat harrisCorners;
double threshold1= 0.0001;
threshold(cornerStrength, harrisCorners, threshold1,255,THRESH_BINARY);
namedWindow("original image",WINDOW_NORMAL);
imshow("original image", image);
namedWindow("harris",WINDOW_NORMAL);
imshow("harris",harrisCorners);
waitKey(0);
}
Harris corners
最新推荐文章于 2023-09-07 09:44:58 发布