Strange error with my thesis project
Hi people.
I m working for a image processing proyect at my thesis work. I' m finishing my work time because I won a scholarship to do it in foreign country and if I don t finish it I have to give the money back. My teacher in this country doesn' understand what is the error and his assistent neither. I need to accomplish it. I can pay something if someone is able to finish the work. The error is :
OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or
unsupported array type) in cvGetMat, file
/build/buildd/opencv-2.3.1/modules/core/src/array.cpp, line 2482 terminate
called after throwing an instance of 'cv::Exception' what():
/build/buildd/opencv-2.3.1/modules/core/src/array.cpp:2482: error: (-206)
Unrecognized or unsupported array type in function cvGetMat
I tried to text every function of my work and in everyone I have a similar error but with differents functions. I know I cant post the code. For this I didn t it. The proyect is around 400 lines, parenthesis and spaces included.
Sorry for my english
whoa, dramatic intro ..
"(Unrecognized or unsupported array type)"
no idea if it helps, but in almost all cases, i've seen this error, it was due to an empty matrix. so check, where you load images(wrong path), get pics from the cam(no capture), where Mats are returned ,etc.
starting a debugger, and see, where it cries out, whould be the most obvious approach, btw..
ok I downloaded gdb as debugger in ubuntu, do you know any good manual explaining how to use it. P.S. thanks to correct my english
first of all, 400 lines is not such much, so, if gdb is on another star for you, first try to sprinkle your code liberally with print statements like : cerr << m.rows << " " m.cols << " " << m.type() << " " m.channels() before applying that.
actually, it's some 7 years, since i last touched gdb, but wht i remember is:
compile with -g flag (enable debugging)
run:
gdb -q my_prog [args for my prog] --directory=folders_where_src_is:more_src_folders
man gdb // should give some more info
Ok i put my initial code (without inserting include, struct, namespace, etc...
I run and i have: r =0 , c= 0,t=0, ch=1 OpenCV Error: Bad flag (parameter or structure field) (Unrecognized or unsupported array type) in cvGetMat, file /build/buildd/opencv-2.3.1/modules/core/src/array.cpp, line 2482 terminate called after throwing an instance of 'cv::Exception' what(): /build/buildd/opencv-2.3.1/modules/core/src/array.cpp:2482: error: (-206)
Unrecognized or unsupported array type in function cvGetMat
ah, so it could not read/find your image, and returned an empty one.
Hi you had the reason. It doesn t read the image. Now it works. I printed all elements. I have just a doubt: r=486, c=648, type=16,channels=3,type=16,depth=0 Rows,cols and channels is ok. I m doubt about depth (doesn t have to return something different?) and type
Hey there,I guess the depth must be in the enumerated form from OpenCV. As you say it returns zero, it means its a CV_8U image (i.e Each channel in image is 8 bit. Thus it must be 8bit 3channel image in your case) Somebody please correct me if i am wrong.
Prasanna, no you're right . thanks for jumping in ;)
where can I see all the enumerated form of openCV? tthanks to help me guys!
opencv\modules\core\include\opencv2\core\core_c.h or
opencv\modules\core\include\opencv2\core\core.hpp