How to capture Video with OpenCV
Hi everyone,
I'm newbie in Qt as well as OpenCV,
I have download the source code from
http://qt-apps.org/content/show.php/...?content=89995,
and execute this program,
it shows an " Assertion failed! "
and say:
Program:....
File: ..\QtOpenCV\main.cpp
Line:13
Expression: camera
For information on how your program can cause an assertion failure,
see the Visual C++ documentation on asserts
(Press Retry to debug the application - JIT must be enabled)
http://www.freewebtown.com/ccdamon/Fail.jpg
I don't know how to solve the problem, could you help me?
Re: How to capture Video with OpenCV
Did you look into the source code - line 13 in file ..\QtOpenCV\main.cpp ?
Re: How to capture Video with OpenCV
I've looking into the source code ,
In the line 13, it seems a function which called " assert " ,and has an argument ( camera ).
In addition, I found that the header file which called " assert.h " was added in include file.
The path of the header file is C:\Qt\2010.05\mingw\include.
Please help me to solve the problem.
Re: How to capture Video with OpenCV
This function "assert" causes the program to terminate if assert's argument is 0, so it looks like "camera == 0". Show the code.
Btw. do you have a working camera on your machine ?
Re: How to capture Video with OpenCV
Why are you want to use OpenCV (for capturing image or video)?
If you want to capture image
Code:
CvCapture *capture = 0;
IplImage *frame = 0;
capture = cvCaptureFromCAM( 0 );
frame = cvQueryFrame( capture );
In frame you get all the data of image.
Re: How to capture Video with OpenCV
Hi,
Make sure your webcam is connected and working.
I made it work using
Code:
CvCapture * camera = cvCreateCameraCapture(0);
If argument 0 does not work, try with 1, and so on.