Hi,
I need to create a program, which one capture data from web camera using Qt 4.3.0 with Visual Studio 2005 ( VC ++ ) ( MFC program ). Can you help me for that? Please give a link to some examples for that.
Please help me
Hi,
I need to create a program, which one capture data from web camera using Qt 4.3.0 with Visual Studio 2005 ( VC ++ ) ( MFC program ). Can you help me for that? Please give a link to some examples for that.
Please help me
Amm... I think you are mixing things...
Do you mean you want to write an MFC program with visual studio, or do you mean you want to program a Qt application with the visual studio IDE ?
I guess its the later.
If so, please state the exact problem you need help with.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
Hi,
My probs is that, I need to create a program in Qt 4.3.0 and compile it using Visual Studio 2005 ( VC++ only). Through that program, I need to create a screen for capture images from a web camera. So I think about MFC. If any other way to create it, Please give me the tutorial for that.
Please help me.
If you say you need to create a Qt application, why are you thinking of MFC?Hi,
My probs is that, I need to create a program in Qt 4.3.0 and compile it using Visual Studio 2005 ( VC++ only). Through that program, I need to create a screen for capture images from a web camera. So I think about MFC. If any other way to create it, Please give me the tutorial for that.
Please help me.
Do you understand what MFC and Qt are?
If it is a requirement for you to use Qt, you don't need MFC.
On our wiki you can learn how to integrate Qt4 and MSVC, unless you are a commercial user of Qt, in that case you get a nice integration in to MSVC it self.
Last edited by high_flyer; 14th December 2007 at 09:49.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
I think it is because he is using Visual Studio 2005 and that obviously comes with the MFC libraries. I use visual studio 2005 with a commercial version of QT which integrates into this environment.
Yes, but that doesn't mean he should use them.I think it is because he is using Visual Studio 2005 and that obviously comes with the MFC libraries.
I think he does not understand what Qt and MFC are - look at the subject of the thread...
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
All depends on what he is comfortable with. I came from a background of having used MFC for 8 years and then recently moved to QT. The team I use to work with were all MFC developers and hence we stuck with it. Of course now, I am finding the switch to QT proving to be so much nicer and it helps me a lot more than MFC and also, this great site where people like yourself offer advice and help![]()
I think requirements come before the comfort, and he did state:All depends on what he is comfortable with.
MFC or Qt both are fine.My probs is that, I need to create a program in Qt 4.3.0 and compile it using Visual Studio 2005 ( VC++ only)
I find mixing is not good, unless there is no way with out it, which doesn't look to be the case here, since he is starting a new application.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
In my experience of working for various companies, most of them won't give you the time to learn a new library unless their budget covers it - but hey, I may have worked for some 'bad' companies?!
Requirements do play a BIG part of course and if certain requirements cannot be met using a certain library then obviously you look at alternatives.
Mixing MFC with Qt in certain circumstances you have to, although as you point out, this is a new application so I agree, don't mix them, using one or the other is enough.
Compiling a project in Visual Studio 2005 that uses Qt is simple with Qt VS-Integration, although you do need a commercial version of Qt.
Why does it need to be compiled using VS2005?
Do you have any examples with OpenCV in Qt.
Please give the link.
OpenCV is an external lib.
There is nothing special about using it with Qt, use it just as you would in any other application.
==========================signature=============== ==================
S.O.L.I.D principles (use them!):
https://en.wikipedia.org/wiki/SOLID_...iented_design)
Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.
You should look at this: http://opencvlibrary.sourceforge.net/CameraCapture
Instead of using cvShowImage, you would copy the data from the IPLImage and create a QImage to show in your Qt application.
Hi,
Thankyou for your reply,
I use that program. For convert the Image from IplImageToQImage to QImage, I use the function http://www.bernardotti.it/portal/showthread.php?t=597 . But It return *QImage. How can I display it?
Sorry, Because I am not an expert in Qt. Please help me...
Hi,
I have a form in Qt 4.3 and through my program I create a QImage. I create a function from create this QImage and that function return *QImage and it store in another *QImage. How Can I display it in my from. I want to display this *QImage as a widget in my form. How can I do this?
Please help me
The easiest way is to convert that QImage to QPixmap and use QLabel.
Please, don't ask the same question twice.
Hi,
I do that like this,
QImage *ImageVid;
IplImage* frame = cvQueryFrame( capture );
ImageVId = IplImageToQImage(frame);
and the function is this, It return QImage *. How Can I display this QImage * in a Label, through QLabel->setPixmap().
Because the property is " setPixmap ( const QPixmap & )"
Qt Code:
uchar *qImageBuffer = NULL; int width = iplImage->width; int widthStep = iplImage->widthStep; int height = iplImage->height; switch (iplImage->depth) { case IPL_DEPTH_8U: if (iplImage->nChannels == 1) { // OpenCV image is stored with one byte grey pixel. We convert it // to an 8 bit depth QImage. qImageBuffer = (uchar *) malloc(width*height*sizeof(uchar)); uchar *QImagePtr = qImageBuffer; const uchar *iplImagePtr = (const uchar *) iplImage->imageData; for (int y = 0; y < height; y++) { // Copy line by line memcpy(QImagePtr, iplImagePtr, width); QImagePtr += width; iplImagePtr += widthStep; } } else if (iplImage->nChannels == 3) { // OpenCV image is stored with 3 byte color pixels (3 channels). // We convert it to a 32 bit depth QImage. qImageBuffer = (uchar *) malloc(width*height*4*sizeof(uchar)); uchar *QImagePtr = qImageBuffer; const uchar *iplImagePtr = (const uchar *) iplImage->imageData; for (int y = 0; y < height; y++) { for (int x = 0; x < width; x++) { // We cannot help but copy manually. QImagePtr[0] = iplImagePtr[0]; QImagePtr[1] = iplImagePtr[1]; QImagePtr[2] = iplImagePtr[2]; QImagePtr[3] = 0; QImagePtr += 4; iplImagePtr += 3; } iplImagePtr += widthStep-3*width; } } else { qDebug("IplImageToQImage: image format is not supported : depth=8U and %d channels\n", iplImage->nChannels); } break; default: qDebug("IplImageToQImage: image format is not supported : depth=%d and %d channels\n", iplImage->depth, iplImage->nChannels); } QImage *qImage; QImage qImag; if (iplImage->nChannels == 1) { QRgb *colorTable = new QRgb[256]; for (int i = 0; i < 256; i++) colorTable[i] = qRgb(i, i, i); } else { } return qImage; }To copy to clipboard, switch view to plain text mode
Please help me to solve this probs...
Last edited by jacek; 17th December 2007 at 12:42. Reason: missing [code] tags
You have to convert QImage to QPixmap first. Check static methods of QPixmap in the docs.
What do you need qImag and colorTable for?Qt Code:To copy to clipboard, switch view to plain text mode
Hi,
I use that link ( http://opencvlibrary.sourceforge.net/CameraCapture ) for Qt. I face two probs in my program.
1. How can avoid cvNamedWindow( "mywindow", CV_WINDOW_AUTOSIZE );
Because in Qt, I have a window and I need to display the image in that window. When I comment this line then the Image is not display in my Qt Widget.
2. When I use this function ( http://groups.google.com/group/OpenC...encv+qt&rnum=2 ) for copy IplImage To QImage, i can copy and display the image. But the image is display as 90 degree rotated. How can I solve these two probs.
Please Help me...
Hi,
No reply?????????????
![]()
Bookmarks