Ask Your Question

Irene's profile - activity

2014-03-17 10:06:45 -0600 asked a question cvcapturefromavi not loading anything

Hello, I'm trying to get frames from video (avi-file). I'm under Windows,32bit, QT 5.2.0(Mingw-compiler), OpenCV 2.4.8. It's really a simple thing, i must be really dumb, but I can't get it. Here's the code:

CvCapture *capture = NULL;
capture = cvCaptureFromAVI("road4n.avi");//this file in the build folder
if(!capture){
    return -1;
}//more code here, but it doesn't work...

The program finishes with the code -1. When I remove the if condition, no errors occur, but the rest dosen't perform anyway. I've tried different paths, like "C:/road4n.avi", writing the full path to the build directory, using like all sorts of slashes etc with no result at all. I've also tried cvCaptureFromFile but it dosen't work either, but cvCaptureFromCAM(0) works fine. At some places they say that the recompilation of the opencv might solve the problem, but maybe it's easier than that? Thank you in advance!


UPD: I've edited the code so that no old-fashioned functions are used, so now it's:

VideoCapture cap("road4n.avi");
if(!cap.isOpened()) // check if we succeeded
return -1;

Result's still the same:(

2014-02-12 00:28:31 -0600 answered a question Can openCV be used to extract character strings from images?

hello, i suggest you look at this topic character recognition. There seem to be a few links with tutorials and code samples.

2014-02-12 00:24:27 -0600 answered a question Where would I find the library for OpenCV?

Hello, do you mean that you need an environment to use OpenCV? It's just OpenCV is a library, which can be integrated into compiler (like QT, or Visual Studio etc). Was that your question?

2014-01-30 23:17:47 -0600 answered a question Eclipse ignores build path? "make: *** No rule to make target"

Hello, hope it's not too late, i've had similar kind of problem in Windows, it seems that the path is wrong, try to copy the path from the explorer, maybe you've missed something. You could also try to look for an answer here: no rule to make target problem

2014-01-30 22:55:53 -0600 commented question "CvOpenGLCallback has not been declared" error, how do I deal with that?

Thank you, berak! I added the code (but for now I dealt with the problem by commenting the whole procedure))

2014-01-30 22:49:53 -0600 received badge  Editor (source)
2014-01-30 07:00:21 -0600 asked a question "CvOpenGLCallback has not been declared" error, how do I deal with that?

Hello, I am new to OpenCV and QT, so perhaps the question is in the wrong section. I use OpenCV 2.4.8 and QT 5.2.2, I was trying to build the project i found on the web, it was made in QT 4.7 and OpenCV 2.3 and I get this nasty error.
Google says CvOpenGLCallback derives from opencv_highgui, so I added highgui.h in the header file and it didn't work. Is there a way to deal with it or i should better find older versions of programs and try using them? Thank you.

UPD: Here's the code.

CV_IMPL void cvCreateOpenGLCallback( const char* window_name, CvOpenGLCallback callbackOpenGL, void* userdata, double angle, double zmin, double zmax)
{
    if (!guiMainThread)
        CV_Error( CV_StsNullPtr, "NULL guiReceiver (please create a window)" );
    QMetaObject::invokeMethod(guiMainThread,
        "setOpenGLCallback",
        Qt::AutoConnection,
        Q_ARG(QString, QString(window_name)),
        Q_ARG(void, (void)callbackOpenGL),
        Q_ARG(void*, userdata),
        Q_ARG(double, angle),
        Q_ARG(double, zmin),
        Q_ARG(double, zmax)
        );
}
This bit is in "window_QT.cpp", so it must be used only when window opens.