HOG Getting an Assertion

asked 2017-02-16 18:24:04 -0600

Aeroclassics gravatar image

updated 2020-10-07 19:21:46 -0600

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

edit retag flag offensive close merge delete



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 ( 2017-02-17 03:41:20 -0600 )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...)


Aeroclassics gravatar imageAeroclassics ( 2017-02-17 08:48:32 -0600 )edit