Commit 27542529 authored by Alexey Spizhevoy's avatar Alexey Spizhevoy

refactored hog GPU

parent 6c326eb4
...@@ -148,7 +148,6 @@ Settings Settings::Read(int argc, char** argv) ...@@ -148,7 +148,6 @@ Settings Settings::Read(int argc, char** argv)
} }
App::App(const Settings &s) App::App(const Settings &s)
{ {
settings = s; settings = s;
...@@ -180,25 +179,26 @@ App::App(const Settings &s) ...@@ -180,25 +179,26 @@ App::App(const Settings &s)
cout << endl; cout << endl;
} }
void App::RunOpencvGui() void App::RunOpencvGui()
{ {
running = true; running = true;
Size win_width(settings.win_width, settings.win_width * 2); //(64, 128) or (48, 96) Size win_size(settings.win_width, settings.win_width * 2); //(64, 128) or (48, 96)
vector<float> detector; vector<float> detector;
if (win_width == Size(64,128)) if (win_size == Size(64,128))
detector = cv::gpu::HOGDescriptor::getPeopleDetector_64x128(); detector = cv::gpu::HOGDescriptor::getPeopleDetector_64x128();
else else
detector = cv::gpu::HOGDescriptor::getPeopleDetector_48x96(); detector = cv::gpu::HOGDescriptor::getPeopleDetector_48x96();
// GPU's HOG classifier // GPU's HOG classifier
cv::gpu::HOGDescriptor gpu_hog(win_width); cv::gpu::HOGDescriptor gpu_hog(win_size);
gpu_hog.setSVMDetector(detector); gpu_hog.setSVMDetector(detector);
// CPU's HOG classifier // CPU's HOG classifier
cv::HOGDescriptor cpu_hog(win_width, Size(16,16), Size(8,8), Size(8,8), 9, 1, -1, HOGDescriptor::L2Hys, 0.2, true, HOGDescriptor::DEFAULT_NLEVELS); cv::HOGDescriptor cpu_hog(win_size, Size(16,16), Size(8,8), Size(8,8), 9, 1, -1, HOGDescriptor::L2Hys, 0.2, true, HOGDescriptor::DEFAULT_NLEVELS);
cpu_hog.setSVMDetector(detector); cpu_hog.setSVMDetector(detector);
// Make endless cycle from video (if src is video) // Make endless cycle from video (if src is video)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment