Unable to detect any person using the CUDA HOG example app.

asked 2014-12-01 01:17:39 -0600

k_sze gravatar image

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.

edit retag flag offensive close merge delete

Comments

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-12-01 06:42:55 -0600 )edit

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 to cpp-example-train_HOG), or at least find an existing, usable model file?

k_sze gravatar imagek_sze ( 2014-12-02 01:54:16 -0600 )edit

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.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-12-02 06:27:36 -0600 )edit

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?

k_sze gravatar imagek_sze ( 2014-12-09 00:54:08 -0600 )edit

Well you should use this function and check if the return value is actually filled.

StevenPuttemans gravatar imageStevenPuttemans ( 2014-12-09 02:25:38 -0600 )edit