Ask Your Question

how can I load videoCapture inside windows for in a picture box

asked 2014-07-14 13:21:54 -0500

biza gravatar image

updated 2014-07-14 17:37:42 -0500

I have build a form that will serve as an interface, but now I am experiencing some problems getting cameraCapture load inside a pictureBox, I have done this code:

VideoCapture capture(0);

             if (!capture.isOpened()) {
                 information->Text = "no signal!";

             else {
                 information->Text = " Signal!";

                 Mat frame, gray, gray_old, dif;

                cvtColor(frame, gray_old, CV_BGR2GRAY);
                GaussianBlur(gray_old, gray_old, cv::Size(11, 11), 1.5, 1.5);
             frame = cvQueryFrame(capture);
              cvCopy(frame,frame); //it's important if u make the image in 3 channel or filtering
             pictureBox1->Image  = gcnew    //replacement of cvShowImage
             System::Drawing::Imaging::PixelFormat::Format24bppRgb,(System::IntPtr) frame->imageData);

How can I show the cameraCapture? All syntax "frame" is underlined in red after Gaussian function... The error: error C2819: type 'cv::Mat' does not have an overloaded member 'operator ->'

Can you help me please

edit retag flag offensive close merge delete



frame = cvQueryFrame(capture); // you already done the same some lines above. also, avoid all old c-api functions .. !

"problem is After GaussianBlur all word's like frame and capture give error" - meaning what, exactly ?

berak gravatar imageberak ( 2014-07-14 13:36:10 -0500 )edit

since your Mat is neither a pointer, not an IplImage (again, skip those old c-idioms), try frame.cols, frame.rows, etc

berak gravatar imageberak ( 2014-07-14 14:47:07 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2014-07-14 14:12:44 -0500

ben.seep gravatar image
edit flag offensive delete link more
Login/Signup to Answer

Question Tools


Asked: 2014-07-14 13:21:54 -0500

Seen: 1,180 times

Last updated: Jul 14 '14