You are not logged in.

1

Tuesday, August 17th 2010, 2:34pm

QT and OpenCV

Hello Guys,
I am getting some problem with QT and openCV integeration ,
I am trying to get the Image from web Cam using opencv ,

its like


CvCapture capture=cvCaptureFromCam(0);
IplImage *ipl;



loop
.
.
ipl= cvQueryFrame(capture);
..................... processing..........................................
.
.
end loop


cvReleaseImage(&ipl);
cvReleaseCapture(&capture);


The program runs fine but its gives me error when it comes to cvReleaseCapture().......
If any one has any idea why its happening please advice...Thanks

2

Tuesday, August 17th 2010, 2:51pm

You don't need to release the image (cvReleaseImage(&ipl);) because cvQueryFrame owns it.
Somewhere

Quoted


cvQueryFrame

Grabs and returns a frame from camera or AVI
IplImage* cvQueryFrame( CvCapture* capture );
capture
CvCapture representing camera or AVI file.

The function cvQueryFrame grabs a frame from camera or AVI and returns the pointer to grabbed image. Actually this function just successively calls cvGrabFrame and cvRetrieveFrame. The returned image should not be released by the user.
Fighting fire with fire.
Three can keep a secret if two of them are dead.

3

Tuesday, August 17th 2010, 3:08pm

Problem Solved

Thank you Messanger . you did a job for me .. I was struggling to find the answer for last two days.. Thanks again

4

Friday, January 7th 2011, 10:17am

Problem While invoking CV CAPTURE in Qt

#include<QtCore/QCoreApplication>#include<cv.h>
#include<highgui.h>
#include<stdio.h>
#include<string.h>
intmain(intargc,char*argv[])
{
QCoreApplicationa(argc,argv);
CvCapture*AVIfile=NULL;
cvCaptureFromFile("C:\\OpenCV2.2\\samples\\cpp\\Qt_sample\\cube4.avi");
if(!AVIfile){
return1;
}
cvReleaseCapture(&AVIfile);
returna.exec();
}
This code just builds fine, but when I tried to run it, the application is crashed. When tried to debug by setting break points, I could notice that immediately after the cvCaptureFromFile method is invoked, some assembly code shows up, and a message box comes in telling that "Inferior stopped because it received a signal from the operating system. Signal Name : SIGSEGV. Signal meaning: Segmentation fault. My .pro file is

QT += core


QT -= gui

TARGET = Dec28C1
CONFIG += console
CONFIG -= app_bundle
TEMPLATE = app
SOURCES += main.cpp
INCLUDEPATH += C:\OpenCV2.2\include\opencv C:\OpenCV2.2\include
LIBS += C:\OpenCV2.2\lib\*.lib

I am struggling with this since 1st January. I could compile and run some other programs well. But don't know. What to do with this error. Please help me.