HOG Getting an Assertion

asked Feb 17 '17

Aeroclassics gravatar image

updated Oct 8 '0

I am compiling in VS2015 using the prebuilt Windows 3.2 libraries. This program came from a very good blog. When I run it I get an assertion:

Unhandled exception at 0x000007FEFD70A06D in HOGSVM.exe: Microsoft C++ exception: cv::Exception at memory location 0x00000000002AE910.

Always at the same memory location And this is on my console:

OpenCV Error: Assertion failed ((n & (n - 1)) == 0) in cv::alignSize, file C:\build\master_winpack-build-win64-vc14\opencv\modules\core\include\opencv2/core/utility.hpp, line 438

The line being called is: hog.compute(deskewedtrainCells[y], descriptors);

vector<float> descriptors; vector<mat> &deskewedtrainCells

are the two parameters to this call.

The assertion seems to come after the line in types.hpp: template<typename _tp=""> inline Size_<_Tp>::Size_() : width(0), height(0) {} control comes back to program and the next step is the assertion.

Thanks, Doug

Preview: (hide)

Comments

1

This program came from a very good blog and Always at the same memory location. You clearly think we are psychics able to know about which code you are talking exactly. Provide us at least with the full code, there is no way of telling why it is going wrong now ...

StevenPuttemans gravatar imageStevenPuttemans (Feb 17 '17)edit

@steven, my apologies you are quite right. I had meant to put a link into the original post but simply forgot. Here is the link to the original blog post: http://www.learnopencv.com/handwritten-digits-classification-an-opencv-c-python-tutorial/ (http://www.learnopencv.com/handwritte...) and https://github.com/spmallick/learnopencv/tree/master/digits-classification (https://github.com/spmallick/learnope...)

Thanks.

Aeroclassics gravatar imageAeroclassics (Feb 17 '17)edit