Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Thank You for Every One, I used Only this simple Code and All this is good, This one worked perfect

in main(){ cv::VideoCapture cap("K:/OpenCv/DataSetCar/WP.mp4"); if(!cap.isOpened()) // check if we succeeded return -1;

         Mat edges;
         namedWindow("myFrame",1);
         for(;;)
         {
             Mat frame;
             cap >> frame; // get a new frame from camera
               imshow("edges", frame);
             if(waitKey(30) >= 0) break;
         }
         // the camera will be deinitialized automatically in VideoCapture destructor
         return 0;

}

Thank You for Every One, I used Only this simple Code and All this is good, This one worked perfect

in main(){ int main() { cv::VideoCapture cap("K:/OpenCv/DataSetCar/WP.mp4"); if(!cap.isOpened()) // check if we succeeded return -1;

         Mat edges;
         namedWindow("myFrame",1);
         for(;;)
         {
             Mat frame;
             cap >> frame; // get a new frame from camera
               imshow("edges", frame);
             if(waitKey(30) >= 0) break;
         }
         // the camera will be deinitialized automatically in VideoCapture destructor
}           
         return 0;

}

Thank You for Every One, I used Only this simple Code and All this is good, This one worked perfect

int main() { cv::VideoCapture {

  VideoCapture cap("K:/OpenCv/DataSetCar/WP.mp4");
          if(!cap.isOpened())  // check if we succeeded
              return -1;

-1;

         Mat edges;
         namedWindow("myFrame",1);
         for(;;)
         {
             Mat frame;
             cap >> frame; // get a new frame from camera
               imshow("edges", frame);
             if(waitKey(30) >= 0) break;
         }           
         return 0;

}

Thank You for Every One, I used Only this simple Code and All this is good, This one worked perfect

int main() {

  VideoCapture cap("K:/OpenCv/DataSetCar/WP.mp4");
         if(!cap.isOpened())  // check if we succeeded
             return -1;

         Mat edges;
         namedWindow("myFrame",1);
         for(;;)
         {
             Mat frame;
             cap >> frame; // get a new frame from camera
               imshow("edges", frame);
             if(waitKey(30) >= 0) break;
         }           
         return 0;

}

Thank You for Every One, I used Only this simple Code and All this is good, This one worked perfect

*The problem was that I was using a video of * 1280 X 768 *then I reduced the Size to * 640X480 and this solved my problem int main() {

  VideoCapture cap("K:/OpenCv/DataSetCar/WP.mp4");
         if(!cap.isOpened())  // check if we succeeded
             return -1;

         Mat edges;
         namedWindow("myFrame",1);
         for(;;)
         {
             Mat frame;
             cap >> frame; // get a new frame from camera
               imshow("edges", frame);
             if(waitKey(30) >= 0) break;
         }           
         return 0;

}