Ask Your Question

tfjgeorge's profile - activity

2014-04-29 11:00:38 -0600 commented answer DaimlerPeopleDetector with smaller images

all right the problem came from some other implementation mistake, blurring the image did the trick, thanks!

2014-04-29 10:59:47 -0600 received badge  Scholar (source)
2014-04-29 06:36:24 -0600 commented answer DaimlerPeopleDetector with smaller images

I used a Gaussian Blur with kernel of size 3, 5, 7, but still no hit... Are you using another smoothing method ?

2014-04-29 04:48:10 -0600 commented answer DaimlerPeopleDetector with smaller images

I can't make it work... I edited the question to add sample images

2014-04-29 04:47:19 -0600 received badge  Student (source)
2014-04-29 04:45:25 -0600 received badge  Editor (source)
2014-04-29 02:49:52 -0600 asked a question DaimlerPeopleDetector with smaller images

Hi,

Is it possible to get the HOG DaimlerPeopleDetector work with smaller images? I am just upscaling the image before passing it to detectMultiScale. The idea behind that is that the gradients look roughly the same even with some upscaling?

Edit: I can't make it work with sample images like the ones below, even with a hit threshold as low as 0.1...

example 1 example 2

Some code:

vector<float> detector;
detector = HOGDescriptor::getDaimlerPeopleDetector();
Size win_size(48, 96);

HOGDescriptor cpu_hog(win_size, Size(16, 16), Size(8, 8), Size(8, 8), 9, 1, -1,
        HOGDescriptor::L2Hys, 0.2, false, HOGDescriptor::DEFAULT_NLEVELS);

cpu_hog.setSVMDetector(detector);


Mat image_resized;
vector<Rect> found;
double hit_threshold = 0.1;
double scale = 1.01;
int gr_threshold = 8;
double factor = 120./image.size[0];
Size new_size(round(image.size[1]*factor), 120);

Size win_stride(8, 8);
resize(image, image_resized, new_size, 0.0, 0.0, INTER_LINEAR);
cpu_hog.detectMultiScale(image_resized, found, hit_threshold, win_stride,
                                          Size(0, 0), scale, gr_threshold);

if (found.size() > 0)
    cout << "found new person" << endl;

Thanks for any help