jwm
jwm

Reputation: 5040

cannot convert argument 8 from 'int' to 'cv::HOGDescriptor::HistogramNormType'

I am using opencv 4.1. for computing hog descriptors. Here is the constructor of hog:

HOGDescriptor hog(Size(20,20),
                  Size(8,8),
                  Size(4,4),
                  Size(4,4),
                  9,
                  1,
                  -1,
                  0, //this argument causes the compiling error
                  0.2,
                  0,
                  64,
                  1);

It gives the error:

C2664: 'cv::HOGDescriptor::HOGDescriptor(const cv::HOGDescriptor &)': cannot convert argument 8 from 'int' to 'cv::HOGDescriptor::HistogramNormType'

What is the problem with the argument 8?

Upvotes: 3

Views: 214

Answers (1)

Shawn Mathew
Shawn Mathew

Reputation: 2337

From HOGDescriptor() you'll see that the 8th argument needs to be of type HOGDescriptor::HistogramNormType. The error message also indicates this.

The default value for this parameter is HOGDescriptor::L2Hys. Using this should remove the error.

Note that using the same parameters in python would not give this error, but C++ will flag this as a compiler error.

Upvotes: 4

Related Questions