cloudFPGA (cF) API  1.0
The documentation of the source code of cloudFPGA (cF)
harris_standalone.cpp File Reference
#include "opencv2/highgui/highgui.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for harris_standalone.cpp:

Go to the source code of this file.

Functions

int main ()
 

Variables

int thresh = 200
 

Function Documentation

◆ main()

int main ( )

Definition at line 12 of file harris_standalone.cpp.

13 {
14  Mat src, gray;
15  // Load source image and convert it to gray
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 );
20 
21  // Detecting corners
22  cornerHarris( gray, dst, 7, 5, 0.05, BORDER_DEFAULT );
23 
24  // Normalizing
25  normalize( dst, dst_norm, 0, 255, NORM_MINMAX, CV_32FC1, Mat() );
26  convertScaleAbs( dst_norm, dst_norm_scaled );
27 
28  // Drawing a circle around corners
29  for( int j = 0; j < dst_norm.rows ; j++ )
30  { for( int i = 0; i < dst_norm.cols; i++ )
31  {
32  if( (int) dst_norm.at<float>(j,i) > thresh )
33  {
34  circle( dst_norm_scaled, Point( i, j ), 5, Scalar(0), 2, 8, 0 );
35  }
36  }
37  }
38 
39 
40  // Showing the result
41  namedWindow( "corners_window", CV_WINDOW_AUTOSIZE );
42  imshow( "corners_window", dst_norm_scaled );
43 
44  waitKey(0);
45  return(0);
46 }
int thresh

Variable Documentation

◆ thresh

int thresh = 200

Definition at line 10 of file harris_standalone.cpp.