Pedestrain_Detection icon indicating copy to clipboard operation
Pedestrain_Detection copied to clipboard

OpenCV Error: Assertion failed

Open lyfighting opened this issue 5 years ago • 4 comments

您好,感谢您分享的代码,风格很清晰。 我在跑detection.cpp时,在226行 Result = -1 * alphamat * svecsmat; 报opencv的错:

“OpenCV Error: Assertion failed (a_size.width == len) in cv::gemm, file C:\build\master_winpack-build-win64-vc14\opencv\modules\core\src\matmul.cpp, line 1565...”

网上答案像是矩阵维度不符,你有什么建议吗?还有我用的opencv版本是3.4.0,请问你用的是哪个版本?

lyfighting avatar Nov 29 '19 12:11 lyfighting

您好,我看下了,确实是alphamat(11)与svecsmat(33780)维度不符合,但是为什么会这样呢?

lyfighting avatar Nov 29 '19 12:11 lyfighting

Starting training... Finishing training... loaded SVM_HOG.xml file after initialize the value of alphamat is [3780 x 3] after initialize the value of svindex is [3 x 1] the value of rho is 1 the value of alphamat is [1] the size of alphamat is [1 x 1] the size of svecsmat is [3780 x 3] libc++abi.dylib: terminating with uncaught exception of type cv::Exception: OpenCV(4.1.1) /tmp/opencv-20190908-41416-17rm3ol/opencv-4.1.1/modules/core/src/matmul.dispatch.cpp:344: error: (-215:Assertion failed) a_size.width == len in function 'gemm'

Process finished with exit code 6

northeast250 avatar Dec 12 '19 02:12 northeast250

我也遇到了这个问题@lyfighting 其中alpha初始化的维度还是对的,变换以后就不对了。

northeast250 avatar Dec 12 '19 02:12 northeast250

也是同样问题 double rho = svm ->getDecisionFunction(0, alphamat, svindex); 这句后出现问题

horo2016 avatar Apr 15 '21 03:04 horo2016