Applied all fixes related to translating C to C++ code
Also fixed some typos and code alignment Also adapted tutorial CPP samples Fixed some identation problems
This commit is contained in:
@@ -58,10 +58,10 @@ int main( int, char** argv )
|
||||
dst.create( src.size(), src.type() );
|
||||
|
||||
/// Convert the image to grayscale
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create a window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Create a Trackbar for user to enter threshold
|
||||
createTrackbar( "Min Threshold:", window_name, &lowThreshold, max_lowThreshold, CannyThreshold );
|
||||
|
@@ -65,13 +65,13 @@ int main( int, char** argv )
|
||||
|
||||
|
||||
/// Show what you got
|
||||
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( source_window, WINDOW_AUTOSIZE );
|
||||
imshow( source_window, src );
|
||||
|
||||
namedWindow( warp_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( warp_window, WINDOW_AUTOSIZE );
|
||||
imshow( warp_window, warp_dst );
|
||||
|
||||
namedWindow( warp_rotate_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( warp_rotate_window, WINDOW_AUTOSIZE );
|
||||
imshow( warp_rotate_window, warp_rotate_dst );
|
||||
|
||||
/// Wait until user exits the program
|
||||
|
@@ -25,7 +25,7 @@ int main(int, char** argv)
|
||||
{ return -1; }
|
||||
|
||||
/// Convert it to gray
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Reduce the noise so we avoid false circle detection
|
||||
GaussianBlur( src_gray, src_gray, Size(9, 9), 2, 2 );
|
||||
@@ -47,7 +47,7 @@ int main(int, char** argv)
|
||||
}
|
||||
|
||||
/// Show your results
|
||||
namedWindow( "Hough Circle Transform Demo", CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( "Hough Circle Transform Demo", WINDOW_AUTOSIZE );
|
||||
imshow( "Hough Circle Transform Demo", src );
|
||||
|
||||
waitKey(0);
|
||||
|
@@ -46,7 +46,7 @@ int main( int, char** argv )
|
||||
}
|
||||
|
||||
/// Pass the image to gray
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_RGB2GRAY );
|
||||
|
||||
/// Apply Canny edge detector
|
||||
Canny( src_gray, edges, 50, 200, 3 );
|
||||
@@ -55,10 +55,10 @@ int main( int, char** argv )
|
||||
char thresh_label[50];
|
||||
sprintf( thresh_label, "Thres: %d + input", min_threshold );
|
||||
|
||||
namedWindow( standard_name, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( standard_name, WINDOW_AUTOSIZE );
|
||||
createTrackbar( thresh_label, standard_name, &s_trackbar, max_trackbar, Standard_Hough);
|
||||
|
||||
namedWindow( probabilistic_name, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( probabilistic_name, WINDOW_AUTOSIZE );
|
||||
createTrackbar( thresh_label, probabilistic_name, &p_trackbar, max_trackbar, Probabilistic_Hough);
|
||||
|
||||
/// Initialize
|
||||
|
@@ -34,10 +34,10 @@ int main( int, char** argv )
|
||||
GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT );
|
||||
|
||||
/// Convert the image to grayscale
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_RGB2GRAY );
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Apply Laplace function
|
||||
Mat abs_dst;
|
||||
|
@@ -34,7 +34,7 @@ int main( int, char** argv )
|
||||
map_y.create( src.size(), CV_32FC1 );
|
||||
|
||||
/// Create window
|
||||
namedWindow( remap_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( remap_window, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Loop
|
||||
for(;;)
|
||||
|
@@ -33,10 +33,10 @@ int main( int, char** argv )
|
||||
GaussianBlur( src, src, Size(3,3), 0, 0, BORDER_DEFAULT );
|
||||
|
||||
/// Convert it to gray
|
||||
cvtColor( src, src_gray, CV_RGB2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_RGB2GRAY );
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Generate grad_x and grad_y
|
||||
Mat grad_x, grad_y;
|
||||
|
@@ -43,7 +43,7 @@ int main( int, char** argv )
|
||||
printf( " ** Press 'ESC' to exit the program \n");
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Initialize arguments for the filter
|
||||
top = (int) (0.05*src.rows); bottom = (int) (0.05*src.rows);
|
||||
|
@@ -35,7 +35,7 @@ int main ( int, char** argv )
|
||||
{ return -1; }
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Initialize arguments for the filter
|
||||
anchor = Point( -1, -1 );
|
||||
|
Reference in New Issue
Block a user