An example using pyrDown and pyrUp functions
#include "iostream"
const char* window_name = "Pyramids Demo";
int main(
int argc,
char** argv )
{
cout << "\n Zoom In-Out demo \n "
"------------------ \n"
" * [i] -> Zoom in \n"
" * [o] -> Zoom out \n"
" * [ESC] -> Close program \n" << endl;
const char* filename = argc >=2 ? argv[1] : "chicky_512.png";
Mat src = imread( samples::findFile( filename ) );
printf(" Error opening image\n");
printf(" Program Arguments: [image_name -- default chicky_512.png] \n");
return EXIT_FAILURE;
}
for(;;)
{
imshow( window_name, src );
char c = (char)waitKey(0);
if( c == 27 )
{ break; }
else if( c == 'i' )
printf( "** Zoom In: Image x 2 \n" );
}
else if( c == 'o' )
printf( "** Zoom Out: Image / 2 \n" );
}
}
return EXIT_SUCCESS;
}
n-dimensional dense array class
Definition mat.hpp:828
int cols
Definition mat.hpp:2154
bool empty() const
Returns true if the array has no elements.
int rows
the number of rows and columns or (-1, -1) when the matrix has more than 2 dimensions
Definition mat.hpp:2154
Template class for specifying the size of an image or rectangle.
Definition types.hpp:335
int main(int argc, char *argv[])
Definition highgui_qt.cpp:3