mirror of
https://github.com/opencv/opencv.git
synced 2026-07-28 23:03:03 +04:00
Update documentation ( tutorials )
This commit is contained in:
@@ -28,39 +28,50 @@ int main( void )
|
||||
printf( " * [d] -> Zoom out \n" );
|
||||
printf( " * [ESC] -> Close program \n \n" );
|
||||
|
||||
/// Test image - Make sure it s divisible by 2^{n}
|
||||
src = imread( "../data/chicky_512.png" );
|
||||
//![load]
|
||||
src = imread( "../data/chicky_512.png" ); // Loads the test image
|
||||
if( src.empty() )
|
||||
{ printf(" No data! -- Exiting the program \n");
|
||||
return -1; }
|
||||
//![load]
|
||||
|
||||
tmp = src;
|
||||
dst = tmp;
|
||||
|
||||
/// Create window
|
||||
namedWindow( window_name, WINDOW_AUTOSIZE );
|
||||
//![create_window]
|
||||
imshow( window_name, dst );
|
||||
//![create_window]
|
||||
|
||||
/// Loop
|
||||
//![infinite_loop]
|
||||
for(;;)
|
||||
{
|
||||
int c;
|
||||
c = waitKey(10);
|
||||
c = waitKey(0);
|
||||
|
||||
if( (char)c == 27 )
|
||||
{ break; }
|
||||
if( (char)c == 'u' )
|
||||
{ pyrUp( tmp, dst, Size( tmp.cols*2, tmp.rows*2 ) );
|
||||
{
|
||||
//![pyrup]
|
||||
pyrUp( tmp, dst, Size( tmp.cols*2, tmp.rows*2 ) );
|
||||
//![pyrup]
|
||||
printf( "** Zoom In: Image x 2 \n" );
|
||||
}
|
||||
else if( (char)c == 'd' )
|
||||
{ pyrDown( tmp, dst, Size( tmp.cols/2, tmp.rows/2 ) );
|
||||
{
|
||||
//![pyrdown]
|
||||
pyrDown( tmp, dst, Size( tmp.cols/2, tmp.rows/2 ) );
|
||||
//![pyrdown]
|
||||
printf( "** Zoom Out: Image / 2 \n" );
|
||||
}
|
||||
|
||||
imshow( window_name, dst );
|
||||
|
||||
//![update_tmp]
|
||||
tmp = dst;
|
||||
//![update_tmp]
|
||||
}
|
||||
//![infinite_loop]
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user