Make highgui.hpp independent from C API
This commit is contained in:
@@ -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);
|
||||
|
@@ -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 );
|
||||
|
@@ -22,7 +22,7 @@ int main(int argc, char ** argv)
|
||||
|
||||
const char* filename = argc >=2 ? argv[1] : "lena.jpg";
|
||||
|
||||
Mat I = imread(filename, CV_LOAD_IMAGE_GRAYSCALE);
|
||||
Mat I = imread(filename, IMREAD_GRAYSCALE);
|
||||
if( I.empty())
|
||||
return -1;
|
||||
|
||||
@@ -67,7 +67,7 @@ int main(int argc, char ** argv)
|
||||
q2.copyTo(q1);
|
||||
tmp.copyTo(q2);
|
||||
|
||||
normalize(magI, magI, 0, 1, CV_MINMAX); // Transform the matrix with float values into a
|
||||
normalize(magI, magI, 0, 1, NORM_MINMAX); // Transform the matrix with float values into a
|
||||
// viewable image form (float between values 0 and 1).
|
||||
|
||||
imshow("Input Image" , I ); // Show the result
|
||||
|
@@ -36,9 +36,9 @@ int main( int argc, char* argv[])
|
||||
|
||||
Mat I, J;
|
||||
if( argc == 4 && !strcmp(argv[3],"G") )
|
||||
I = imread(argv[1], CV_LOAD_IMAGE_GRAYSCALE);
|
||||
I = imread(argv[1], IMREAD_GRAYSCALE);
|
||||
else
|
||||
I = imread(argv[1], CV_LOAD_IMAGE_COLOR);
|
||||
I = imread(argv[1], IMREAD_COLOR);
|
||||
|
||||
if (!I.data)
|
||||
{
|
||||
|
@@ -22,6 +22,10 @@ static void help( char* progName)
|
||||
// comment out the define to use only the latest C++ API
|
||||
#define DEMO_MIXED_API_USE
|
||||
|
||||
#ifdef DEMO_MIXED_API_USE
|
||||
# include <opencv2/highgui/highgui_c.h>
|
||||
#endif
|
||||
|
||||
int main( int argc, char** argv )
|
||||
{
|
||||
help(argv[0]);
|
||||
@@ -118,7 +122,7 @@ int main( int argc, char** argv )
|
||||
cvtColor(I_YUV, I, COLOR_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
|
||||
|
@@ -27,12 +27,12 @@ int main( int argc, char* argv[])
|
||||
Mat I, J, K;
|
||||
|
||||
if (argc >= 3 && !strcmp("G", argv[2]))
|
||||
I = imread( filename, CV_LOAD_IMAGE_GRAYSCALE);
|
||||
I = imread( filename, IMREAD_GRAYSCALE);
|
||||
else
|
||||
I = imread( filename, CV_LOAD_IMAGE_COLOR);
|
||||
I = imread( filename, IMREAD_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();
|
||||
@@ -43,7 +43,7 @@ int main( int argc, char* argv[])
|
||||
cout << "Hand written function times passed in seconds: " << t << endl;
|
||||
|
||||
imshow("Output", J);
|
||||
cvWaitKey(0);
|
||||
waitKey();
|
||||
|
||||
Mat kern = (Mat_<char>(3,3) << 0, -1, 0,
|
||||
-1, 5, -1,
|
||||
@@ -55,7 +55,7 @@ int main( int argc, char* argv[])
|
||||
|
||||
imshow("Output", K);
|
||||
|
||||
cvWaitKey(0);
|
||||
waitKey();
|
||||
return 0;
|
||||
}
|
||||
void Sharpen(const Mat& myImage,Mat& Result)
|
||||
|
Reference in New Issue
Block a user