Unable to detect any person using the CUDA HOG example app.
I have compiled OpenCV 3.0.0 master (commit 50c9367d7ae8824654776ffd1fd6707448ccb384) with the examples. Among the examples is opencv_source_code/samples/gpu/hog.cpp
, which compiles to a gpu-example-hog
binary.
It runs and I see the video window with the fps. However, I am unable to get it to detect any person in the video file input (I don't see any rectangle being drawn). The original video file is 1920x1080p. I have also tried resizing it to 960x540, 640x360, 480x270, 384x216 and 320x180. None of these resolutions yielded any detection result.
Could somebody help me with tweaking the command-line arguments? I can post the original video somewhere if that helps.
Are you sure that the model is found correctly? It seems to be the largest problems with my students. Try using absolute paths instead of relative paths.
What model? There is no mention of any model in the source code or in the command line help message of the
gpu-example-hog
executable.EDIT I did a little bit more digging. Do you mean I need to first train a model file using
samples/cpp/train_HOG.cpp
(which compiles tocpp-example-train_HOG
), or at least find an existing, usable model file?Well HOG uses internally a descriptor stored HOG feature model, called the defaultHOGdetector. However you are able to train a HOG model first and use that to train another model indeed. That was what I was aiming for.
Thanks for the clarification. Assuming I don't train my own model just yet, how do I know if OpenCV finds the internal/built-in model correctly?
Well you should use this function and check if the return value is actually filled.