diff options
author | Wind Yuan <feng.yuan@intel.com> | 2017-12-01 15:43:21 +0800 |
---|---|---|
committer | windyuan <feng.yuan@intel.com> | 2017-12-01 16:28:10 +0800 |
commit | 4e686ef8ab600c3b2bdd110cbded49d853375ef6 (patch) | |
tree | 4f61d7f8d00f9f93fc4e7e60eb18d77302f969e5 | |
parent | 36d06f77d5280d6c9665e911da183f5dd98bb036 (diff) | |
download | libxcam-4e686ef8ab600c3b2bdd110cbded49d853375ef6.tar.gz |
stitcher: revert viewpoint patch
* viewpoint doesn't help quality improvement
Signed-off-by: Wind Yuan <feng.yuan@intel.com>
-rw-r--r-- | tests/test-soft-image.cpp | 1 | ||||
-rw-r--r-- | xcore/interface/data_types.h | 7 | ||||
-rw-r--r-- | xcore/surview_fisheye_dewarp.cpp | 17 | ||||
-rw-r--r-- | xcore/surview_fisheye_dewarp.h | 2 |
4 files changed, 12 insertions, 15 deletions
diff --git a/tests/test-soft-image.cpp b/tests/test-soft-image.cpp index 1187f79..8508099 100644 --- a/tests/test-soft-image.cpp +++ b/tests/test-soft-image.cpp @@ -368,7 +368,6 @@ int main (int argc, char *argv[]) BowlDataConfig bowl; bowl.wall_height = 3000.0f; bowl.ground_length = 2000.0f; - bowl.viewpoint_z = 1300.0f; //bowl.a = 5000.0f; //bowl.b = 3600.0f; //bowl.c = 3000.0f; diff --git a/xcore/interface/data_types.h b/xcore/interface/data_types.h index d2047e0..a4d6f4e 100644 --- a/xcore/interface/data_types.h +++ b/xcore/interface/data_types.h @@ -127,7 +127,6 @@ typedef Point3DT<float> PointFloat3; * x_axis : front direction * y_axis : left direction * z_axis : up direction - * viewpoint_z : viewpoint in z_axis * wall_height : bowl height inside of view * ground_length: left direction distance from ellipsoid bottom edge to nearest side of the car in the view */ @@ -137,15 +136,15 @@ struct BowlDataConfig { // unit mm float center_z; - float viewpoint_z; float wall_height; float ground_length; BowlDataConfig () : a (6060.0f), b (4388.0f), c (3003.4f) , angle_start (90.0f), angle_end (270.0f) - , center_z (1500.0f), viewpoint_z (1200.0f) - , wall_height (3000.0f), ground_length (2801.0f) + , center_z (1500.0f) + , wall_height (3000.0f) + , ground_length (2801.0f) { XCAM_ASSERT (fabs(center_z) <= c); XCAM_ASSERT (a > 0.0f && b > 0.0f && c > 0.0f); diff --git a/xcore/surview_fisheye_dewarp.cpp b/xcore/surview_fisheye_dewarp.cpp index 3913846..6c0830c 100644 --- a/xcore/surview_fisheye_dewarp.cpp +++ b/xcore/surview_fisheye_dewarp.cpp @@ -65,7 +65,6 @@ SurViewFisheyeDewarp::fisheye_dewarp(MapTable &map_table, uint32_t table_w, uint PointFloat3 world_coord; PointFloat3 cam_coord; PointFloat3 cam_world_coord; - PointFloat3 view_point (0.0f, 0.0f, bowl_config.viewpoint_z); PointFloat2 image_coord; XCAM_LOG_DEBUG ("fisheye-dewarp:\n table(%dx%d), out_size(%dx%d)" @@ -82,7 +81,7 @@ SurViewFisheyeDewarp::fisheye_dewarp(MapTable &map_table, uint32_t table_w, uint for(uint32_t col = 0; col < table_w; col++) { PointFloat2 out_pos (col * scale_factor_w, row * scale_factor_h); world_coord = bowl_view_image_to_world (bowl_config, image_w, image_h, out_pos); - cal_cam_world_coord(view_point, world_coord, cam_world_coord); + cal_cam_world_coord(world_coord, cam_world_coord); world_coord2cam(cam_world_coord, cam_coord); cal_image_coord(cam_coord, image_coord); @@ -92,19 +91,19 @@ SurViewFisheyeDewarp::fisheye_dewarp(MapTable &map_table, uint32_t table_w, uint } void -SurViewFisheyeDewarp::cal_cam_world_coord(const PointFloat3 &view_point, const PointFloat3 &world_coord, PointFloat3 &cam_world_coord) +SurViewFisheyeDewarp::cal_cam_world_coord(const PointFloat3 &world_coord, PointFloat3 &cam_world_coord) { 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 - view_point.x; - rotation_tran_mat(1, 3) = _extrinsic_param.trans_y - view_point.y; - rotation_tran_mat(2, 3) = _extrinsic_param.trans_z - view_point.z; + rotation_tran_mat(0, 3) = _extrinsic_param.trans_x; + rotation_tran_mat(1, 3) = _extrinsic_param.trans_y; + rotation_tran_mat(2, 3) = _extrinsic_param.trans_z; - Mat4f world_coord_mat(Vec4f(1.0f, 0.0f, 0.0f, world_coord.x - view_point.x), - Vec4f(0.0f, 1.0f, 0.0f, world_coord.y - view_point.y), - Vec4f(0.0f, 0.0f, 1.0f, world_coord.z - view_point.z), + Mat4f world_coord_mat(Vec4f(1.0f, 0.0f, 0.0f, world_coord.x), + Vec4f(0.0f, 1.0f, 0.0f, world_coord.y), + Vec4f(0.0f, 0.0f, 1.0f, world_coord.z), Vec4f(0.0f, 0.0f, 0.0f, 1.0f)); Mat4f cam_world_coord_mat = rotation_tran_mat.inverse() * world_coord_mat; diff --git a/xcore/surview_fisheye_dewarp.h b/xcore/surview_fisheye_dewarp.h index abd7c1b..571b02a 100644 --- a/xcore/surview_fisheye_dewarp.h +++ b/xcore/surview_fisheye_dewarp.h @@ -49,7 +49,7 @@ private: virtual void cal_image_coord (const PointFloat3 &cam_coord, PointFloat2 &image_coord); - void cal_cam_world_coord (const PointFloat3 &view_point, const PointFloat3 &world_coord, PointFloat3 &cam_world_coord); + void cal_cam_world_coord (const PointFloat3 &world_coord, PointFloat3 &cam_world_coord); void world_coord2cam (const PointFloat3 &cam_world_coord, PointFloat3 &cam_coord); Mat4f generate_rotation_matrix(float roll, float pitch, float yaw); |