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:
@@ -40,7 +40,7 @@ int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Set some parameters
|
||||
int blockSize = 3; int apertureSize = 3;
|
||||
@@ -64,7 +64,7 @@ int main( int, char** argv )
|
||||
minMaxLoc( Mc, &myHarris_minVal, &myHarris_maxVal, 0, 0, Mat() );
|
||||
|
||||
/* Create Window and Trackbar */
|
||||
namedWindow( myHarris_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( myHarris_window, WINDOW_AUTOSIZE );
|
||||
createTrackbar( " Quality Level:", myHarris_window, &myHarris_qualityLevel, max_qualityLevel, myHarris_function );
|
||||
myHarris_function( 0, 0 );
|
||||
|
||||
@@ -75,7 +75,7 @@ int main( int, char** argv )
|
||||
minMaxLoc( myShiTomasi_dst, &myShiTomasi_minVal, &myShiTomasi_maxVal, 0, 0, Mat() );
|
||||
|
||||
/* Create Window and Trackbar */
|
||||
namedWindow( myShiTomasi_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( myShiTomasi_window, WINDOW_AUTOSIZE );
|
||||
createTrackbar( " Quality Level:", myShiTomasi_window, &myShiTomasi_qualityLevel, max_qualityLevel, myShiTomasi_function );
|
||||
myShiTomasi_function( 0, 0 );
|
||||
|
||||
|
@@ -31,10 +31,10 @@ int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create a window and a trackbar
|
||||
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( source_window, WINDOW_AUTOSIZE );
|
||||
createTrackbar( "Threshold: ", source_window, &thresh, max_thresh, cornerHarris_demo );
|
||||
imshow( source_window, src );
|
||||
|
||||
@@ -77,6 +77,6 @@ void cornerHarris_demo( int, void* )
|
||||
}
|
||||
}
|
||||
/// Showing the result
|
||||
namedWindow( corners_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( corners_window, WINDOW_AUTOSIZE );
|
||||
imshow( corners_window, dst_norm_scaled );
|
||||
}
|
||||
|
@@ -32,10 +32,10 @@ int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create Window
|
||||
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( source_window, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Create Trackbar to set the number of corners
|
||||
createTrackbar( "Max corners:", source_window, &maxCorners, maxTrackbar, goodFeaturesToTrack_Demo );
|
||||
@@ -87,7 +87,7 @@ void goodFeaturesToTrack_Demo( int, void* )
|
||||
{ circle( copy, corners[i], r, Scalar(rng.uniform(0,255), rng.uniform(0,255), rng.uniform(0,255)), -1, 8, 0 ); }
|
||||
|
||||
/// Show what you got
|
||||
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( source_window, WINDOW_AUTOSIZE );
|
||||
imshow( source_window, copy );
|
||||
|
||||
/// Set the neeed parameters to find the refined corners
|
||||
|
@@ -32,10 +32,10 @@ int main( int, char** argv )
|
||||
{
|
||||
/// Load source image and convert it to gray
|
||||
src = imread( argv[1], 1 );
|
||||
cvtColor( src, src_gray, CV_BGR2GRAY );
|
||||
cvtColor( src, src_gray, COLOR_BGR2GRAY );
|
||||
|
||||
/// Create Window
|
||||
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( source_window, WINDOW_AUTOSIZE );
|
||||
|
||||
/// Create Trackbar to set the number of corners
|
||||
createTrackbar( "Max corners:", source_window, &maxCorners, maxTrackbar, goodFeaturesToTrack_Demo );
|
||||
@@ -87,6 +87,6 @@ void goodFeaturesToTrack_Demo( int, void* )
|
||||
{ circle( copy, corners[i], r, Scalar(rng.uniform(0,255), rng.uniform(0,255), rng.uniform(0,255)), -1, 8, 0 ); }
|
||||
|
||||
/// Show what you got
|
||||
namedWindow( source_window, CV_WINDOW_AUTOSIZE );
|
||||
namedWindow( source_window, WINDOW_AUTOSIZE );
|
||||
imshow( source_window, copy );
|
||||
}
|
||||
|
Reference in New Issue
Block a user