Why tutorials compile and exit without any explains [closed]

asked 2016-08-09 10:39:59 -0600

Rubot gravatar image

updated 2018-10-17 15:53:05 -0600

Hello comrades. Please help me.
Win10, VS 2012 Express.
I try to learn OCV. I use just one C++ file in the project, copy tutorial examples from tutorial dir, to this file and try to compile.
Environment of VS turned good, all includes of the OCV, paths, libraries, etc a connected and many tutorials from different sources are works. Project directory permissions checked - All permissions
But when I try to test OpenCV tutorials and examples from tutorial dir, I have a trouble. Link - OK, Compile - OK no problem, but debugging is finished. At the Output window
Stream 0x3300 finished with code -1 (0xffffffff).
Stream 0x27f8 finished with code -1 (0xffffffff).
Stream 0x2af8 finished with code -1 (0xffffffff).
Program "[9316] OCVTest.exe" finished with code -1 (0xffffffff).
What's going on?

edit retag flag offensive reopen merge delete

Closed for the following reason the question is answered, right answer was accepted by berak
close date 2016-08-10 02:47:54.413385

Comments

hard to tell, without seing your code, but obviously your prog hit something like if (something_bad) return -1;.

so, probably nothing's wrong, you maybe forgot to supply a cmdline arg, an image failed to load, etc.

berak gravatar imageberak ( 2016-08-09 10:49:03 -0600 )edit

sorry for forgetting the obvious:

please tell us, which sample you're trying to use, then we can point you at where / why / how it failed for you.

berak gravatar imageberak ( 2016-08-09 12:57:34 -0600 )edit

First of all big thanks of quick answer. For example I try to start "opencv-2,4,13\opencv\sources\samples\cpp\tutorial_code\objectDetection...".
Second. Could you explain, what you mean, when you told - "you maybe forgot to supply a cmdline arg, an image failed to load, etc." ?

Rubot gravatar imageRubot ( 2016-08-09 14:15:12 -0600 )edit

it's probably one of those , and you did not see the error msg, starting your prog straight from your ide.

berak gravatar imageberak ( 2016-08-09 14:20:58 -0600 )edit

Yes. You are right. Rely i didn't read comments careful. I had make those XML files. And project was started. But unfortunately I have exception during a function call "detectAndDisplay( frame )". In the debug mode step by step, I see that webcam On, but just try to call detectAndDisplay( frame ) - exception.

Rubot gravatar imageRubot ( 2016-08-09 14:58:28 -0600 )edit

Exception exactly at string
*face_cascade.detectMultiScale( frame_gray, faces, 1.1, 2, 0|CV_HAAR_SCALE_IMAGE, Size(30, 30) ); OpenCV Error: Bad argument (Invalid classifier cascade) in cvHaarDetectObjectsForROC

Rubot gravatar imageRubot ( 2016-08-09 15:14:34 -0600 )edit

I had make those XML files.

what do you mean ? it seems, that did not work. try to copy them over from opencv/data/haarcascades, or use an absolute path to there.

berak gravatar imageberak ( 2016-08-10 00:28:08 -0600 )edit
1

Big big thanks Friend. All right, all work.

Rubot gravatar imageRubot ( 2016-08-10 02:38:05 -0600 )edit