1 #include "opencv2/highgui/highgui.hpp"
2 #include "opencv2/imgproc/imgproc.hpp"
16 src = imread(
"/home/did/projects/cloudFPGA/cFp_Zoo/HOST/vision/median_blur/languages/python/CARLA.jpg", 1 );
17 cvtColor( src, gray, CV_BGR2GRAY );
18 Mat dst, dst_norm, dst_norm_scaled;
19 dst = Mat::zeros( src.size(), CV_32FC1 );
22 cornerHarris( gray, dst, 7, 5, 0.05, BORDER_DEFAULT );
25 normalize( dst, dst_norm, 0, 255, NORM_MINMAX, CV_32FC1, Mat() );
26 convertScaleAbs( dst_norm, dst_norm_scaled );
29 for(
int j = 0; j < dst_norm.rows ; j++ )
30 {
for(
int i = 0; i < dst_norm.cols; i++ )
32 if( (
int) dst_norm.at<
float>(j,i) >
thresh )
34 circle( dst_norm_scaled, Point( i, j ), 5, Scalar(0), 2, 8, 0 );
41 namedWindow(
"corners_window", CV_WINDOW_AUTOSIZE );
42 imshow(
"corners_window", dst_norm_scaled );