1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
-
- #include <opencv2/opencv.hpp>
-
- #include "System.h"
- #include <string>
- #include <chrono> // for time stamp
- #include <iostream>
-
- using namespace std;
-
- string parameterFile = "../ost.yaml";
- string vocFile = "../../Vocabulary/ORBvoc.txt";
-
- int main(int argc, char **argv) {
-
-
- ORB_SLAM3::System SLAM(vocFile, parameterFile, ORB_SLAM3::System::MONOCULAR, true);
-
-
- cv::VideoCapture cap(0);
-
-
- cap.set(cv::CAP_PROP_FRAME_WIDTH, 640);;
- cap.set(cv::CAP_PROP_FRAME_HEIGHT, 480);
-
-
- auto start = chrono::system_clock::now();
-
- while (1) {
- cv::Mat frame;
- cap >> frame;
- auto now = chrono::system_clock::now();
- auto timestamp = chrono::duration_cast<chrono::milliseconds>(now - start);
- SLAM.TrackMonocular(frame, double(timestamp.count())/1000.0);
- }
-
- return 0;
- }
|