1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

update samples: waitKey() usage

Original commit is a5f19f7dd6
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
+6 -6
View File
@@ -78,9 +78,9 @@ int main( int argc, const char** argv )
if( inputName.empty() || (isdigit(inputName[0]) && inputName.size() == 1) )
{
int c = inputName.empty() ? 0 : inputName[0] - '0';
if(!capture.open(c))
cout << "Capture from camera #" << c << " didn't work" << endl;
int camera = inputName.empty() ? 0 : inputName[0] - '0';
if(!capture.open(camera))
cout << "Capture from camera #" << camera << " didn't work" << endl;
}
else
{
@@ -105,7 +105,7 @@ int main( int argc, const char** argv )
detectAndDraw( frame, canvas, cascade, nestedCascade, scale, tryflip );
int c = waitKey(10);
char c = (char)waitKey(10);
if( c == 27 || c == 'q' || c == 'Q' )
break;
}
@@ -128,7 +128,7 @@ int main( int argc, const char** argv )
char buf[1000+1];
while( fgets( buf, 1000, f ) )
{
int len = (int)strlen(buf), c;
int len = (int)strlen(buf);
while( len > 0 && isspace(buf[len-1]) )
len--;
buf[len] = '\0';
@@ -137,7 +137,7 @@ int main( int argc, const char** argv )
if( !image.empty() )
{
detectAndDraw( image, canvas, cascade, nestedCascade, scale, tryflip );
c = waitKey(0);
char c = (char)waitKey(0);
if( c == 27 || c == 'q' || c == 'Q' )
break;
}