-
Notifications
You must be signed in to change notification settings - Fork 4
/
detector.cpp
46 lines (36 loc) · 1.09 KB
/
detector.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
40
41
42
43
44
45
46
#include "PoseDetection.h"
int main()
{
PoseDetection poseDetect;
poseDetect.setupBenchmark("lagergehaeuse.ply"); //Uncomment if Benchmark is not wanted
int counter = 0;
///////IMAGE SOURCES:
cv::VideoCapture sequence("benchmark/img%0d.png");
//cv::VideoCapture sequence("benchmarkLINEMOD/color%0d.jpg");
//Kinect2 kin2;
/////////////////////
while (true)
{
std::vector<cv::Mat> imgs;
cv::Mat colorImg;
cv::Mat depthImg;
///////IMAGE SOURCES:
sequence >> colorImg;
depthImg = cv::imread("benchmark/depth" + std::to_string(counter) + ".png",
cv::IMREAD_ANYDEPTH);
//Video Capture does not work with 16bit png on linux
//depthImg = loadDepthLineModDataset("benchmarkLINEMOD/depth" + std::to_string(counter) + ".dpt");
//kin2.getKinectFrames(colorImg, depthImg);
////////////////////
if (colorImg.empty())
{
std::cout << "End of Sequence" << std::endl;
cv::waitKey(0);
}
imgs.push_back(colorImg);
imgs.push_back(depthImg);
std::vector<ObjectPose> objPose;
poseDetect.detect(imgs, "lagergehaeuse.ply", 1, objPose, true);
counter++;
}
}