-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.cpp
39 lines (36 loc) · 893 Bytes
/
main.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "BGRAVideoFrame.h"
#include "CameraReader.h"
#include "Marker.hpp"
#include "MarkerDetector.hpp"
#include "djicam.h"
#include <opencv2/opencv.hpp>
#include <time.h>
#include <unistd.h>
using namespace cv;
using namespace std;
int main() {
CameraReader reader(smallUSB);
reader.SetMarkerSize(40, 9, 6);
bool ret = reader.Start();
if (!ret) {
cout<<"failed"<<endl;
};
Mat large;
Size dsize;
dsize.width=1280;
dsize.height=1024;
while (true) {
if (reader.isImageGot) {
resize(reader.input,large,Size(1280,1024));
imshow("1", large);
//resizeWindow("1",1280,1024);
// cout<<reader.height<<"\t"<<reader.width<<endl;
}
if (reader.isImageGot && reader.isMarkerCatched) {
cout << reader.yPoint << "\t" << reader.foundMarker.z << "\t"
<< reader.foundMarker.id << endl;
}
waitKey(30);
}
return 0;
}