21 <<
"--------------------------------------------------------------------------" << endl
22 <<
"This program shows how to use makeTransformToGlobal() to compute required pose,"
23 <<
"how to use makeCameraPose and Viz3d::setViewerPose. You can observe the scene "
24 <<
"from camera point of view (C) or global point of view (G)" << endl
26 <<
"./transformations [ G | C ]" << endl
37 ifstream ifs(
"bunny.ply");
40 for(
size_t i = 0; i < 12; ++
i)
45 for(
size_t i = 0; i < 1889; ++
i)
46 ifs >> data[i].x >> data[i].y >> data[i].
z >> dummy1 >> dummy2;
55 int main(
int argn,
char **argv)
61 cout <<
"Missing arguments." << endl;
65 bool camera_pov = (argv[1][0] ==
'C');
74 Point3f cam_pos(3.0f,3.0f,3.0f), cam_focal_point(3.0f,3.0f,2.0f), cam_y_dir(-1.0f,0.0f,0.0f);
84 Mat bunny_cloud = cvcloud_load();
90 Affine3f cloud_pose_global = transform * cloud_pose;
97 myWindow.showWidget(
"CPW", cpw, cam_pose);
98 myWindow.showWidget(
"CPW_FRUSTUM", cpw_frustum, cam_pose);
102 myWindow.showWidget(
"bunny", cloud_widget, cloud_pose_global);
106 myWindow.setViewerPose(cam_pose);
This 3D Widget represents camera position in a scene by its axes or viewing frustum. :
Definition: widgets.hpp:534
Template class for 3D points specified by its coordinates x, y and z.
Definition: types.hpp:218
Clouds.
Definition: widgets.hpp:671
Vec< float, 3 > Vec3f
Definition: matx.hpp:376
Affine3d makeTransformToGlobal(const Vec3d &axis_x, const Vec3d &axis_y, const Vec3d &axis_z, const Vec3d &origin=Vec3d::all(0))
Takes coordinate frame data and builds transform to global coordinate frame.
Affine3d makeCameraPose(const Vec3d &position, const Vec3d &focal_point, const Vec3d &y_dir)
Constructs camera pose from position, focal_point and up_vector (see gluLookAt() for more infromation...
Compond widgets.
Definition: widgets.hpp:504
The Viz3d class represents a 3D visualizer window. This class is implicitly shared. :
Definition: viz3d.hpp:67
Affine3< float > Affine3f
Definition: affine.hpp:142
#define CV_32FC3
Definition: cvdef.h:148
for i
Definition: modelConvert.m:63
Vec< float, 2 > Vec2f
Definition: matx.hpp:375
Definition: gr_skig.hpp:67
void transform(InputArray src, OutputArray dst, InputArray m)
Performs the matrix transformation of every array element.
int main(int argc, const char *argv[])
Definition: facerec_demo.cpp:67
Affine transform.
Definition: affine.hpp:61