PDA

View Full Version : Error while executing the GUI Program for image processing



jakr13
10th January 2013, 01:02
Hi,

I am creating a GUI application for image processing with opencv library and i almost wrote a program but i am getting an error while debugging.

i have a screenshot of my GUI below in which i can able to open an image when the open pushbutton is pushed, but when i press the erode button i am getting the error as:

"Starting D:\qtproject\Final\debug\Final.exe...
Qt: Untested Windows version 6.2 detected!
OpenCV Error: Assertion failed (src.size() == dst.size() && src.type() == dst.type()) in unknown function, file C:\slave\WinInstallerMegaPack\src\opencv\modules\i mgproc\src\morph.cpp, line 1221
Qt has caught an exception thrown from an event handler. Throwing
exceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

D:\qtproject\Final\debug\Final.exe exited with code 3"

since i am newbie i dont know where i am going wrong. I have attached my code below for your consideration. Plz someone help me with this, because i have very less time to implement this.

85738574
thanx.

ChrisW67
10th January 2013, 01:39
As the assert in OpenCV (not Qt) is telling you, the src size and type are different to the dst size and type in a function found in C:\slave\WinInstallerMegaPack\src\opencv\modules\i mgproc\src\morph.cpp, line 1221. Look at that source, work out which function it is, and how you are calling it with incorrect values. By my reckoning that will be cvErode(): the first argument is expected to be type "const CvArr*" and you are passing "IplImage *" http://docs.opencv.org/modules/imgproc/doc/filtering.html#erode

jakr13
10th January 2013, 12:38
thanks for the reply ...but i passed "IplImage" in the position of "const CvArr*", It worked with vs2010 without Qt.

ChrisW67
10th January 2013, 21:05
OpenCV is not Qt, your code is not Qt, your compiler is not Qt, and the problem is a combination of these; ergo the problem is nothing to do with Qt.

The OpenCV sanity checks have told you exactly what the problem is. The size and type of the data represented by the first CvArr* and second CvArr* passed to cvErode() are not the same. Is the IplImage* op of type IPL_DEPTH_8U with only 1 channel?

jakr13
11th January 2013, 02:06
Hi Chris,

got you and it worked. Thanx for your help. Gonna implement some more things and will ask you if there is any problem,if i could not solve it.

jakr13