Merge remote-tracking branch 'origin/2.4' into merge-2.4
Conflicts: doc/tutorials/definitions/noContent.rst doc/tutorials/gpu/gpu-basics-similarity/gpu-basics-similarity.rst doc/tutorials/introduction/android_binary_package/dev_with_OCV_on_Android.rst doc/tutorials/introduction/how_to_write_a_tutorial/how_to_write_a_tutorial.rst modules/core/include/opencv2/core/core.hpp modules/core/include/opencv2/core/internal.hpp modules/core/include/opencv2/core/version.hpp modules/gpu/CMakeLists.txt modules/highgui/perf/perf_output.cpp modules/highgui/test/test_video_io.cpp modules/ocl/include/opencv2/ocl/ocl.hpp modules/ocl/perf/main.cpp modules/ocl/src/hog.cpp modules/ocl/src/initialization.cpp modules/ocl/src/moments.cpp modules/ocl/src/opencl/moments.cl modules/ocl/test/main.cpp modules/ocl/test/test_moments.cpp modules/python/test/test.py modules/ts/include/opencv2/ts/ts_perf.hpp modules/ts/src/precomp.hpp modules/ts/src/ts_perf.cpp
This commit is contained in:
@@ -58,6 +58,7 @@ private:
|
||||
string vdo_source;
|
||||
string output;
|
||||
int camera_id;
|
||||
bool write_once;
|
||||
};
|
||||
|
||||
int main(int argc, char** argv)
|
||||
@@ -98,6 +99,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"
|
||||
@@ -121,6 +123,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;
|
||||
@@ -255,10 +258,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
|
||||
@@ -341,6 +345,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