aboutsummaryrefslogtreecommitdiff
path: root/xcore/surview_fisheye_dewarp.cpp
diff options
context:
space:
mode:
authorWind Yuan <feng.yuan@intel.com>2017-11-09 13:15:54 +0800
committerwindyuan <feng.yuan@intel.com>2017-11-09 20:28:20 +0800
commitd6703decad390380e8f8706c35a04d829e93a571 (patch)
treed9ef9ff662f3d2d89a873050717fe898709367ec /xcore/surview_fisheye_dewarp.cpp
parent72e7164bfc1e8a159f5fc3a05b29815c1cae3c26 (diff)
downloadlibxcam-d6703decad390380e8f8706c35a04d829e93a571.tar.gz
bowl-data : change radian to angle degree
Signed-off-by: Wind Yuan <feng.yuan@intel.com>
Diffstat (limited to 'xcore/surview_fisheye_dewarp.cpp')
-rw-r--r--xcore/surview_fisheye_dewarp.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/xcore/surview_fisheye_dewarp.cpp b/xcore/surview_fisheye_dewarp.cpp
index 77f5a72..da096cc 100644
--- a/xcore/surview_fisheye_dewarp.cpp
+++ b/xcore/surview_fisheye_dewarp.cpp
@@ -97,13 +97,13 @@ SurViewFisheyeDewarp::cal_world_coord(uint32_t x, uint32_t y, MapTable &world_co
if(y < bowl_config.wall_image_height) {
world_z = 1500.0f - y * z_step;
- angle = bowl_config.angle_start - x * angle_step;
+ angle = degree2radian (bowl_config.angle_start - x * angle_step);
float r2 = 1 - world_z * world_z / (c * c);
- if(angle == PI / 2) {
+ if(XCAM_DOUBLE_EQUAL_AROUND (angle, PI / 2)) {
world_x = 0.0f;
world_y = sqrt(r2 * b * b);
- } else if (angle == PI * 3 / 2) {
+ } else if (XCAM_DOUBLE_EQUAL_AROUND (angle, PI * 3 / 2)) {
world_x = 0.0f;
world_y = -sqrt(r2 * b * b);
} else if((angle < PI / 2) || (angle > PI * 3 / 2)) {
@@ -125,12 +125,12 @@ SurViewFisheyeDewarp::cal_world_coord(uint32_t x, uint32_t y, MapTable &world_co
a = a - (y - bowl_config.wall_image_height) * step_a;
b = a * ratio_ab;
- angle = bowl_config.angle_start - x * angle_step;
+ angle = degree2radian (bowl_config.angle_start - x * angle_step);
- if(angle == PI / 2) {
+ if(XCAM_DOUBLE_EQUAL_AROUND (angle, PI / 2)) {
world_x = 0.0f;
world_y = b;
- } else if (angle == PI * 3 / 2) {
+ } else if (XCAM_DOUBLE_EQUAL_AROUND (angle, PI * 3 / 2)) {
world_x = 0.0f;
world_y = -b;
} else if((angle < PI / 2) || (angle > PI * 3 / 2)) {
@@ -150,9 +150,9 @@ SurViewFisheyeDewarp::cal_world_coord(uint32_t x, uint32_t y, MapTable &world_co
void
SurViewFisheyeDewarp::cal_cam_world_coord(MapTable world_coord, MapTable &cam_world_coord)
{
- Mat4f rotation_mat = generate_rotation_matrix(_extrinsic_param.roll * PI / 180,
- _extrinsic_param.pitch * PI / 180,
- _extrinsic_param.yaw * PI / 180);
+ Mat4f rotation_mat = generate_rotation_matrix( degree2radian (_extrinsic_param.roll),
+ degree2radian (_extrinsic_param.pitch),
+ degree2radian (_extrinsic_param.yaw));
Mat4f rotation_tran_mat = rotation_mat;
rotation_tran_mat(0, 3) = _extrinsic_param.trans_x;
rotation_tran_mat(1, 3) = _extrinsic_param.trans_y;