Qt Opencv webcam viewer
Video Software
Description:

A widget to display opencv IplImage structures.

Opens a webcam, and displays the image in the widget.

Changelog:

8 years ago

Added first support for 8 bits BGR images.

More later on.

purplehuman

2 years ago

I'm using your QOpenCVWidget in one of my GPL projects. I'd like to thank you and include your copyright notice in the source files. Could you give me your copyright information please?

Report

fafa70

3 years ago

i ran your code but it gave me this error:
QtOpenCV: ../QtOpenCV/main.cpp:13: int main(int, char**): Assertion `camera' failed.
The program has unexpectedly finished.
i am using logitech c310 in ubuntu 11.04

Report

droetker

4 years ago

have you got a repository where you have the code?
If I want to use it in my software, it would be great to have a git repo, where I can suggest you patches as well?
gitorious? github? google code?

Report

Frienddy

5 years ago

hi, we usually make a proglam using opencv or webcam. when we run the program, it will show the webcam.(put the webcam code in the main.cpp)
now, i want the webcam will be shown after another widget/page.
example, first i have a login page, after i login successfully, i want the webcam is shown.(put the webcam code to another .cpp, like webcam.cpp or capture.cpp)
what should i do?

Report

ddonofrio

5 years ago

It works perfectly. Thank you for posting this sample program. I just modified a few lines for creating a fisiogram viewer.

Obviously my modification will be under GPL and I will mention you.

Thanks again. Good Job!

Report

corest

5 years ago

Compile program without problems. But whe i'm trying to run program i get:

QtOpenCV: ../QtOpenCV/main.cpp:13: int main(int, char**): Assertion `camera' failed.
The program has unexpectedly finished.

Report

bajoelkid12

5 years ago

hello.. .i've tried to debug this code in my PC, but this following error occur,

C:\Qt\2010.05\QtOpenCV-build-desktop\debug\QtOpenCV.exe exited with code -1073741515

is there any idea ? thanks before

Report

Tectu

6 years ago

Hi,

Every time I want compile your Code, I get these Errors:

cannot find -lcv
cannot find -lhighgui
collect2: ld returned 1 exit status


I have all headerfiles in the right Directory. Does anyone have an Idea?



Greez Tectz

Report

yakirari

6 years ago

Your problem is with the opencv libraries, not the include files, but I guess you already figured it out.

Report

paju

6 years ago

I'm trying to staticaly linking the OpenCV library with this application in Windows but it doesn't work...
Whit shared librarys all is fine...

Report

Antigol

6 years ago

I replace your algorithm with this two lines....


IplImage *cvimage = cvQueryFrame(camera);

image = QImage((const uchar *)cvimage->imageData, cvimage->width, cvimage->height, QImage::Format_RGB888).rgbSwapped();

Report

xairoy

6 years ago

Hallo,
I have downloaded the code and tried to extend it in which I added two buttons "START RECORDING" and "STOP RECORDING" recording. When I pressed the "START RECORDING" button, i start another timer in which I capture the frame and save it in a QQueue<QQueue<IplImage*> imageQueue.

It has worked, it seems.
Now when I press the "STOP RECODING" Button, i tried to write the capture to a video file.
following is the code:

void MyCameraWindow::StopRec()
{
InitializeWrite();
IplImage* img = 0;
for (int i=0 ;i<imageQueue.length();i++)
{
img=imageQueue.dequeue();

cvWriteFrame(writer,img);
cvWaitKey(20);
}
tmrStart->stop();
btnStartRecording->setVisible(true);
btnStopRecording->setEnabled(false);

}

void MyCameraWindow::InitializeWrite()
{
writer = 0;
int isColor = 1;
int fps = 25;
int frameW = 640;
int frameH = 480;
writer=cvCreateVideoWriter("out.avi",CV_FOURCC('P','I','M','1'),
fps,cvSize(frameW,frameH),isColor);

}
when I debug step by step the code works until cvWriteFrame(writer,img);
I have checked the writer is not null and the img as well. when I execute cvWriteFrame(writer,img ), I get the error in qglobal.h file on line 2188.
please help.
Roy

Report

carllooper

7 years ago

Got it to build and work on my system.

What I did is documented here:

http://www.qtcentre.org/forum/f-newbie-4/t-qt-connect-logitech-webcam-21945-post113678.html#post113678

cheers
Carl

Report

giridharakn

7 years ago

HI,

I want to Stream multiple IP Cameras. My camera's are connected to a Switch
(4 cameras) and my hardware (a i.MX27 based ) is also connected to switch. the hardware codec is integrated with gstreamer plugins. we can successfully stream single camera. But we need to stream all 4 cameras and create a quad view on 7 inch tft display. Our hardware video codes supports 4 channels where we can all 4 channels simultaneously.

Please throw some light on this.

Report

kosirm

7 years ago

hi, I'm running example and capture frame size isn't changing, it seems to me that cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 640); does nothing. Or have I missed something?
Thanks for any reply.

Report

kosirm

7 years ago

if(size == Size640) {
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH, 640);
cvSetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT, 480);
qDebug() << "Setting 640x480:CV_CAP_PROP_FRAME_WIDTH:" << cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_WIDTH);
qDebug() << "Setting 640x480CV_CAP_PROP_FRAME_HEIGHT:" << cvGetCaptureProperty(capture, CV_CAP_PROP_FRAME_HEIGHT);

}

returns:
Setting 640x480:CV_CAP_PROP_FRAME_WIDTH: 320
Setting 640x480CV_CAP_PROP_FRAME_HEIGHT: 240

Report

windel

7 years ago

Looks like your camera does not support these resolutions? I think it is an opencv issue.

Report

thuct

7 years ago

Hi all.
I am starting working with camera. I went to here and downloaded source code
http://www.qt-apps.org/content/show.php/Qt+Opencv+webcam+viewer?content=89995

Continued :
I installed Qt and OpenCV on my computer

I changed my.pro file
Quote:

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += "C:\OpenCV\cxcore\include" \
"C:\OpenCV\cv\include" \
"C:\OpenCV\cvaux\include"
win32 {
LIBS += -L"C:\OpenCV\lib"
}
LIBS += -lcv -lhighgui
SOURCES += main.cpp QOpenCVWidget.cpp MyCameraWindow.cpp
HEADERS += QOpenCVWidget.cpp MyCameraWindow.h


I builded my project. Done
I runs. It appears a very strange bugs
Quote:

Starting C:/Documents and Settings/Mr. Diego/My Documents/QtOpenCV/debug/QtOpenCV.exe...
C:/Documents and Settings/Mr. Diego/My Documents/QtOpenCV/debug/QtOpenCV.exe exited with code -1072365566


What happens with me ? Please help me.

Thanks in advance.
Diego

Report

thuct

7 years ago

Hi all.
I am starting working with camera. I went to here and downloaded source code
http://www.qt-apps.org/content/show.php/Qt+Opencv+webcam+viewer?content=89995

Continued :
I installed Qt and OpenCV on my computer

I changed my.pro file
Quote:

TEMPLATE = app
TARGET =
DEPENDPATH += .
INCLUDEPATH += "C:\OpenCV\cxcore\include" \
"C:\OpenCV\cv\include" \
"C:\OpenCV\cvaux\include"
win32 {
LIBS += -L"C:\OpenCV\lib"
}
LIBS += -lcv -lhighgui
SOURCES += main.cpp QOpenCVWidget.cpp MyCameraWindow.cpp
HEADERS += QOpenCVWidget.cpp MyCameraWindow.h


I builded my project. Done
I runs. It appears a very strange bugs
Quote:

Starting C:/Documents and Settings/Mr. Diego/My Documents/QtOpenCV/debug/QtOpenCV.exe...
C:/Documents and Settings/Mr. Diego/My Documents/QtOpenCV/debug/QtOpenCV.exe exited with code -1072365566


What happens with me ? Please help me.

Thanks in advance.
Diego

Report

bnilsson

7 years ago

Thanks for the simple tutorial, exactly what I need as a starter.
What will be your next step?

Report

windel

7 years ago

What would you like to see next?

Report

Supporters

Recent Donations

Be the first to donate
Filename Version Description Filetype Packagetype License Downloads Date Filesize Install
Score 66%
66.00 Likes
34 Dislikes

0 Supporters for Qt Opencv webcam viewer:

Recent Donations:

Be the first to donate
show all
Details
version
0.1
updated Sep 24 2008
added Sep 22 2008
downloads
page views 2170
support windel
For The Product
Qt Opencv webcam viewer
5 - 10 - 25 - 50 - 100 - 200 - 500