Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

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

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!";
                 exit(0);

             }
             else {
                 timer1->Start();
                 information->Text = " Signal!";



                 Mat frame, gray, gray_old, dif;

                capture>>frame;
                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::Bitmap(frame->width,frame->height,frame->widthStep,
             System::Drawing::Imaging::PixelFormat::Format24bppRgb,(System::IntPtr) frame->imageData);
             pictureBox1->Refresh();

the problem is After GaussianBlur all word's like frame and capture give error...

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

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!";
                 exit(0);

             }
             else {
                 timer1->Start();
                 information->Text = " Signal!";



                 Mat frame, gray, gray_old, dif;

                capture>>frame;
                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::Bitmap(frame->width,frame->height,frame->widthStep,
             System::Drawing::Imaging::PixelFormat::Format24bppRgb,(System::IntPtr) frame->imageData);
             pictureBox1->Refresh();

How can I show the problem cameraCapture? All syntax "frame" is After GaussianBlur all word's like frame and capture give error...underlined in red after Gaussian function...

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

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!";
                 exit(0);

             }
             else {
                 timer1->Start();
                 information->Text = " Signal!";



                 Mat frame, gray, gray_old, dif;

                capture>>frame;
                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::Bitmap(frame->width,frame->height,frame->widthStep,
             System::Drawing::Imaging::PixelFormat::Format24bppRgb,(System::IntPtr) frame->imageData);
             pictureBox1->Refresh();

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

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

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!";
                 exit(0);

             }
             else {
                 timer1->Start();
                 information->Text = " Signal!";



                 Mat frame, gray, gray_old, dif;

                capture>>frame;
                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::Bitmap(frame->width,frame->height,frame->widthStep,
             System::Drawing::Imaging::PixelFormat::Format24bppRgb,(System::IntPtr) frame->imageData);
             pictureBox1->Refresh();

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