-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathPointsObjectCoord.h
37 lines (33 loc) · 3.17 KB
/
PointsObjectCoord.h
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
//
// Created by seedship on 7/9/20.
//
#ifndef HELLOAR_POINTSOBJECTCOORD_H
#define HELLOAR_POINTSOBJECTCOORD_H
#include <unordered_map>
#include <opencv2/opencv.hpp>
// Please note that this data is specifically for the image: images/1100_700_100_100.png
// It is generated by executing ./marker_generation 1100 700 100 100 out.png and then adding 100 pixels of padding on all 4 sides
// NOTE: each entry in the map corresponds to the 4 corners of the arUco marker. We define the top left corner of voxel 0 to be (0,0,0) in object space
// The first coordinate is the top left corner. The remaining 3 corners have been defined to be 100 away in the +x and +y directions. They are added in clockwise order.
// Perhaps we could not specify the last 3 coordinates and simply add +100 to the x and y coordinates of the 1st coordinate, but I wrote them in for convienence.
// All Z coordinates are set to 0, as we consider the surface that has the arUco markers to be our XY plane.
// I have arbitrarily defined the distances between voxels to be 100, because in the original image they are 100 pixels apart. We may need to find new offsets.
// It seems that moving the camera 1 cm in the X-Y direction produces a different distance change than moving it in the Z direction.
static std::unordered_map<int, std::vector<cv::Point3d>> objectCoordMap {{0, {cv::Point3d(0, 70, 50), cv::Point3d(0, 70, 40), cv::Point3d(0, 60, 40), cv::Point3d(0, 60, 50)}},
{1, {cv::Point3d(0, 70, 30), cv::Point3d(0, 70, 20), cv::Point3d(0, 60, 20), cv::Point3d(0, 60, 30)}},
{2, {cv::Point3d(0, 70, 10), cv::Point3d(0, 70, 0), cv::Point3d(0, 60, 0), cv::Point3d(0, 60, 10)}},
{3, {cv::Point3d(10, 70, 0), cv::Point3d(20, 70, 0), cv::Point3d(20, 60, 0), cv::Point3d(10, 60, 0)}},
{4, {cv::Point3d(30, 70, 0), cv::Point3d(40, 70, 0), cv::Point3d(40, 60, 0), cv::Point3d(30, 60, 0)}},
{5, {cv::Point3d(50, 70, 0), cv::Point3d(60, 70, 0), cv::Point3d(60, 60, 0), cv::Point3d(50, 60, 0)}},
{6, {cv::Point3d(0, 50, 50), cv::Point3d(0, 50, 40), cv::Point3d(0, 40, 40), cv::Point3d(0, 40, 50)}},
{7, {cv::Point3d(50, 50, 0), cv::Point3d(60, 50, 0), cv::Point3d(60, 40, 0), cv::Point3d(50, 40, 0)}},
{8, {cv::Point3d(0, 30, 50), cv::Point3d(0, 30, 40), cv::Point3d(0, 20, 40), cv::Point3d(0, 20, 50)}},
{9, {cv::Point3d(50, 30, 0), cv::Point3d(60, 30, 0), cv::Point3d(60, 20, 0), cv::Point3d(50, 20, 0)}},
{10, {cv::Point3d(0, 10, 50), cv::Point3d(0, 10, 40), cv::Point3d(0, 0, 40), cv::Point3d(0, 0, 50)}},
{11, {cv::Point3d(0, 10, 30), cv::Point3d(0, 10, 20), cv::Point3d(0, 0, 20), cv::Point3d(0, 0, 30)}},
{12, {cv::Point3d(0, 10, 10), cv::Point3d(0, 10, 0), cv::Point3d(0, 0, 0), cv::Point3d(0, 0, 10)}},
{13, {cv::Point3d(10, 10, 0), cv::Point3d(20, 10, 0), cv::Point3d(20, 0, 0), cv::Point3d(10, 0, 0)}},
{14, {cv::Point3d(30, 10, 0), cv::Point3d(40, 10, 0), cv::Point3d(40, 0, 0), cv::Point3d(30, 0, 0)}},
{15, {cv::Point3d(50, 10, 0), cv::Point3d(60, 10, 0), cv::Point3d(60, 0, 0), cv::Point3d(50, 0, 0)}}
};
#endif //HELLOAR_POINTSOBJECTCOORD_H