HOGDescripter does not compute 64 by 64 training images

asked 2014-08-15 02:45:31 -0500

TheMLearner gravatar image

updated 2014-08-17 18:04:29 -0500


I am new to OpenCV, currently I am building a C++ testing program using 2.4.9 on Windows 7, 32bit. I am trying to make HOGDescripter computing training images of 64 by 64 pixels. It works OK with 64 wide 128 high image, but not 64 by 64. Is this a bug? Bellow is the code snippet:

        HOGDescriptor hog(
            Size(64, 64),
            Size(16, 16),
            Size(8, 8),
            Size(8, 8), // cell size
            9, // n bins
            1, // deriv aperture
            0.0, // win sigma
            0.2, //_L2HysThreshold
            false, // gamma correction
            HOGDescriptor::DEFAULT_NLEVELS // n levels


            vector<Point> locations(1);
                Size(8, 8),

After the compute function, The vector "features" contains all invalid data, I think they are negative infinite.

Thanks in advance,


edit retag flag offensive close merge delete


Hi All,

I have figured that one out, that the Gaussian parameter for normalization can not be zero. By using DEFAULT_WIN_SIGMA, all works well now.

Cheers, Dakai

TheMLearner gravatar imageTheMLearner ( 2014-08-17 23:53:52 -0500 )edit