forked from Humhu/ibird-tracking
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcamera.h
66 lines (53 loc) · 1.32 KB
/
camera.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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
* camera.h
*
* Created on: Sep 11, 2011
* Author: ankush
*/
#ifndef CAMERA_H_
#define CAMERA_H_
#include <opencv2/core/core.hpp>
const double PI = 3.141592654;
struct camera_intrinsic_values //stores camera intrinsics
{ // TODO: Add undisortion parameters
double fx, fy, cx, cy;
camera_intrinsic_values()
{
/**
fx = 522.1019521747;
cx = 299.0472018951;
fy = 524.4051288723;
cy = 242.6572277189;
**/
fx = 261;
cx = 150;
fy = 262;
cy = 121;
}
};
struct camera
{
/*
*x,y,z are in centimeters
*theta, pan, tilt are in radians
*/
cv::Point3d position;
double theta, pan, tilt;
camera_intrinsic_values intrinsics;
camera() // Initialized for capture1...backcorner.avi
{
position.x = 0;
position.y = 0;
position.z = 4.25; // Camera is 33cm above the ground
theta = 0;
pan = 0;
tilt = -18.8*PI/180.0; //<<<<< UPDATE CAMERA TILT angle here
}
};
//--------------------------function Prototypes---------------------------
cv::Point2d cam_world_position_to_imageXY(cv::Point3d cam_world_position, camera &bb_cam);
cv::Point3d get_camera_world_coordinates(cv::Point3d real_world_position,
cv::Point3d camera_position, double heading,
double pan, double tilt);
//------------------------------------------------------------------------
#endif /* CAMERA_H_ */