update samples: waitKey() usage

Original commit is a5f19f7dd6ae5bc93f73e0417a9e0bfd34c01672
This commit is contained in:
StevenPuttemans
2016-08-12 15:11:30 +02:00
committed by Alexander Alekhin
parent 4e7b521438
commit 6d34d6b47e
76 changed files with 142 additions and 154 deletions
@@ -90,7 +90,7 @@ int main(int argc, char** argv)
// infinite loop to display
// and refresh the content of the output image
// until the user presses q or Q
int key = 0;
char key = 0;
while(key != 'q' && key != 'Q')
{
// those paramaters cannot be =0
@@ -102,7 +102,7 @@ int main(int argc, char** argv)
HoughDetection(src_gray, src, cannyThreshold, accumulatorThreshold);
// get user key
key = waitKey(10);
key = (char)waitKey(10);
}
return 0;
@@ -40,9 +40,9 @@ int main( int, char** argv )
for(;;)
{
/// Each 1 sec. Press ESC to exit the program
int c = waitKey( 1000 );
char c = (char)waitKey( 1000 );
if( (char)c == 27 )
if( c == 27 )
{ break; }
/// Update map_x & map_y. Then apply remap
@@ -23,9 +23,6 @@ RNG rng(12345);
*/
int main( int, char** argv )
{
int c;
//![load]
src = imread( argv[1], IMREAD_COLOR ); // Load an image
@@ -59,13 +56,12 @@ int main( int, char** argv )
for(;;)
{
//![check_keypress]
c = waitKey(500);
if( (char)c == 27 )
char c = (char)waitKey(500);
if( c == 27 )
{ break; }
else if( (char)c == 'c' )
else if( c == 'c' )
{ borderType = BORDER_CONSTANT; }
else if( (char)c == 'r' )
else if( c == 'r' )
{ borderType = BORDER_REPLICATE; }
//![check_keypress]
@@ -25,8 +25,6 @@ int main ( int, char** argv )
int kernel_size;
const char* window_name = "filter2D Demo";
int c;
//![load]
src = imread( argv[1], IMREAD_COLOR ); // Load an image
@@ -45,9 +43,9 @@ int main ( int, char** argv )
int ind = 0;
for(;;)
{
c = waitKey(500);
char c = (char)waitKey(500);
/// Press 'ESC' to exit the program
if( (char)c == 27 )
if( c == 27 )
{ break; }
//![update_kernel]