在使用cvExtractSurf提取特征出现
OpenCV Error : Incorrect size of input array ( Non - positive width or height ) in cvCreateMatHeader , file / build / buildd / opencv - 2.1 . 0 / src / cxcore / cxarray . cpp , line 113terminate called after throwing an instance of 'cv::Exception'what (): / build / buildd / opencv - 2.1 . 0 / src / cxcore / cxarray . cpp : 113 : error : (- 201 ) Non - positive width or height in function cvCreateMatHeader
上网搜了很多,是opencv的BUG吗?
Looks like someone has already created a bug report and found some fixes for this:源出处:http://opencv-users.1802565.n2.nabble.com/cvExtractSurf-fails-with-Non-positive-width-or-height-exception-opencv-2-1-0-td4963615.html
引用源内容:
Hello,
I use opencv 2.1.0-1 on archlinux (i386). I'm not sure if I don't
correctly use the API, if it is an archlinux package problem of if it
is a opencv bug. Thank you for your help
This is the output of my program:
./a.out
Filesize: 13x29
OpenCV Error: Incorrect size of input array (Non-positive width or
height) in cvCreateMatHeader, file
/build/src/OpenCV-2.1.0/src/cxcore/cxarray.cpp, line 113
terminate called after throwing an instance of 'cv::Exception'
what(): /build/src/OpenCV-2.1.0/src/cxcore/cxarray.cpp:113: error:
(-201) Non-positive width or height in function cvCreateMatHeader
Aborted
And here is the source code:
#include <cv.h>
#include <highgui.h>
#include <stdio.h>
int main(int argc, char** argv)
{
IplImage* image = cvLoadImage( "image.png",