#include <iostream>
int DELAY_CAPTION = 1500;
int DELAY_BLUR = 100;
int MAX_KERNEL_LENGTH = 31;
char window_name[] = "Smoothing Demo";
int display_caption( const char* caption );
int display_dst( int delay );
int main( int argc, char ** argv )
{
const char* filename = argc >=2 ? argv[1] : "../data/lena.jpg";
printf(" Error opening image\n");
printf(" Usage: ./Smoothing [image_name -- default ../data/lena.jpg] \n");
return -1;
}
if( display_caption( "Original Image" ) != 0 ) { return 0; }
if( display_dst( DELAY_CAPTION ) != 0 ) { return 0; }
if( display_caption( "Homogeneous Blur" ) != 0 ) { return 0; }
for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 )
if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } }
if( display_caption( "Gaussian Blur" ) != 0 ) { return 0; }
for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 )
if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } }
if( display_caption( "Median Blur" ) != 0 ) { return 0; }
for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 )
if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } }
if( display_caption( "Bilateral Blur" ) != 0 ) { return 0; }
for ( int i = 1; i < MAX_KERNEL_LENGTH; i = i + 2 )
if( display_dst( DELAY_BLUR ) != 0 ) { return 0; } }
display_caption( "Done!" );
return 0;
}
int display_caption( const char* caption )
{
dst = Mat::zeros( src.
size(), src.
type() );
return display_dst(DELAY_CAPTION);
}
int display_dst( int delay )
{
if( c >= 0 ) { return -1; }
return 0;
}