Viz initialize camera position

asked 2016-08-04 13:53:12 -0500

Nbb gravatar image

updated 2016-08-05 01:38:54 -0500

How do I initialize the camera such that the scene in 3D is viewed like the image in 2D ?

When I run my program, the camera starts off far off from the scene. I have to do a lot of dragging and scrolling before I get it to a decent position and viewing angle. I would like the camera to be initialized and view the 3D scene just like in the 2D image in the first figure.

EDIT: I am able to get something decent by initializing the camera at the origin with the focal length extracted from stereorectify. I still had to drag the camera back a little just to be able to visualize things.

Vec3d cam_pos(0, 0, 0), cam_focal_point(3155.774902, -1965.979706, 24912.193125), cam_y_dir(0.0f, 1.0f, 0.0f);
Affine3f cam_pose = viz::makeCameraPose(cam_pos, cam_focal_point, cam_y_dir);
myWindow.setViewerPose(cam_pose);

I'm still hoping someone can suggest how I can initialize the camera such that the scene is viewed just like the image

image description image description

edit retag flag offensive close merge delete