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:
StevenPuttemans
2013-10-30 13:34:27 +01:00
parent 4bc105c40b
commit 2b106db02f
78 changed files with 217 additions and 229 deletions

View File

@@ -64,9 +64,9 @@ int main( void ){
/// 3. Display your stuff!
imshow( atom_window, atom_image );
cvMoveWindow( atom_window, 0, 200 );
moveWindow( atom_window, 0, 200 );
imshow( rook_window, rook_image );
cvMoveWindow( rook_window, w, 200 );
moveWindow( rook_window, w, 200 );
waitKey( 0 );
return(0);

View File

@@ -304,7 +304,7 @@ int Displaying_Random_Text( Mat image, char* window_name, RNG rng )
*/
int Displaying_Big_End( Mat image, char* window_name, RNG )
{
Size textsize = getTextSize("OpenCV forever!", CV_FONT_HERSHEY_COMPLEX, 3, 5, 0);
Size textsize = getTextSize("OpenCV forever!", FONT_HERSHEY_COMPLEX, 3, 5, 0);
Point org((window_width - textsize.width)/2, (window_height - textsize.height)/2);
int lineType = 8;
@@ -313,7 +313,7 @@ int Displaying_Big_End( Mat image, char* window_name, RNG )
for( int i = 0; i < 255; i += 2 )
{
image2 = image - Scalar::all(i);
putText( image2, "OpenCV forever!", org, CV_FONT_HERSHEY_COMPLEX, 3,
putText( image2, "OpenCV forever!", org, FONT_HERSHEY_COMPLEX, 3,
Scalar(i, i, 255), 5, lineType );
imshow( window_name, image2 );

View File

@@ -45,7 +45,7 @@ int main( int argc, char** argv )
// convert image to YUV color space. The output image will be created automatically.
Mat I_YUV;
cvtColor(I, I_YUV, CV_BGR2YCrCb);
cvtColor(I, I_YUV, COLOR_BGR2YCrCb);
vector<Mat> planes; // Use the STL's vector structure to store multiple Mat objects
split(I_YUV, planes); // split the image into separate color planes (Y U V)
@@ -117,7 +117,7 @@ int main( int argc, char** argv )
cvtColor(I_YUV, I, CV_YCrCb2BGR); // and produce the output RGB image
namedWindow("image with grain", CV_WINDOW_AUTOSIZE); // use this to create images
namedWindow("image with grain", WINDOW_AUTOSIZE); // use this to create images
#ifdef DEMO_MIXED_API_USE
// this is to demonstrate that I and IplI really share the data - the result of the above

View File

@@ -30,8 +30,8 @@ int main( int argc, char* argv[])
else
I = imread( filename, CV_LOAD_IMAGE_COLOR);
namedWindow("Input", CV_WINDOW_AUTOSIZE);
namedWindow("Output", CV_WINDOW_AUTOSIZE);
namedWindow("Input", WINDOW_AUTOSIZE);
namedWindow("Output", WINDOW_AUTOSIZE);
imshow("Input", I);
double t = (double)getTickCount();
@@ -42,7 +42,7 @@ int main( int argc, char* argv[])
cout << "Hand written function times passed in seconds: " << t << endl;
imshow("Output", J);
cvWaitKey(0);
waitKey(0);
Mat kern = (Mat_<char>(3,3) << 0, -1, 0,
-1, 5, -1,
@@ -54,7 +54,7 @@ int main( int argc, char* argv[])
imshow("Output", K);
cvWaitKey(0);
waitKey(0);
return 0;
}
void Sharpen(const Mat& myImage,Mat& Result)