mirror of
https://github.com/opencv/opencv.git
synced 2026-07-31 00:03:03 +04:00
some tweaks to samples
This commit is contained in:
+9
-1
@@ -57,6 +57,7 @@ private:
|
||||
string vdo_source;
|
||||
string output;
|
||||
int camera_id;
|
||||
bool write_once;
|
||||
};
|
||||
|
||||
int main(int argc, char** argv)
|
||||
@@ -97,6 +98,7 @@ App::App(CommandLineParser& cmd)
|
||||
<< "\tESC - exit\n"
|
||||
<< "\tm - change mode GPU <-> CPU\n"
|
||||
<< "\tg - convert image to gray or not\n"
|
||||
<< "\to - save output image once, or switch on/off video save\n"
|
||||
<< "\t1/q - increase/decrease HOG scale\n"
|
||||
<< "\t2/w - increase/decrease levels count\n"
|
||||
<< "\t3/e - increase/decrease HOG group threshold\n"
|
||||
@@ -120,6 +122,7 @@ App::App(CommandLineParser& cmd)
|
||||
hit_threshold = win_width == 48 ? 1.4 : 0.;
|
||||
scale = 1.05;
|
||||
gamma_corr = true;
|
||||
write_once = false;
|
||||
|
||||
cout << "Group threshold: " << gr_threshold << endl;
|
||||
cout << "Levels number: " << nlevels << endl;
|
||||
@@ -254,10 +257,11 @@ void App::run()
|
||||
|
||||
workEnd();
|
||||
|
||||
if (output!="")
|
||||
if (output!="" && write_once)
|
||||
{
|
||||
if (img_source!="") // wirte image
|
||||
{
|
||||
write_once = false;
|
||||
imwrite(output, img_to_show);
|
||||
}
|
||||
else //write video
|
||||
@@ -340,6 +344,10 @@ void App::handleKey(char key)
|
||||
gamma_corr = !gamma_corr;
|
||||
cout << "Gamma correction: " << gamma_corr << endl;
|
||||
break;
|
||||
case 'o':
|
||||
case 'O':
|
||||
write_once = !write_once;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user