Article Categories
- All Categories
-
Data Structure
-
Networking
-
RDBMS
-
Operating System
-
Java
-
MS Excel
-
iOS
-
HTML
-
CSS
-
Android
-
Python
-
C Programming
-
C++
-
C#
-
MongoDB
-
MySQL
-
Javascript
-
PHP
Selected Reading
How to calculate Elapsed time in OpenCV using C++?
Here, we will understand how to calculate the elapsed time using OpenCV.
The following program calculates the elapsed time in OpenCV using C++.
Example
#include//OpenCV header to use VideoCapture class// #include using namespace std; using namespace cv; int main() { Mat myImage;//Declaring a matrix to load the frames// namedWindow("Video Player");//Declaring the video to show the video// VideoCapture cap("video.mp4");//Declaring an object to load video from device// if (!cap.isOpened()){ //This section prompt an error message if no video stream is found// cout > myImage; int elapsed_time;//Declaring an integer variable to store the elapsed time// elapsed_time=cap.get(CAP_PROP_POS_MSEC);//Reading the elapsed time// cout This program will play the video and will show elapsed time in the console window.
Output
Advertisements


