|
|
|
@ -89,7 +89,9 @@ TEST(Viz_viz3d, accuracy) |
|
|
|
|
viz::Color color = viz::Color::black(); |
|
|
|
|
|
|
|
|
|
viz::LineWidget lw(Point3f(0, 0, 0), Point3f(4.f, 4.f,4.f), viz::Color::green()); |
|
|
|
|
viz::PlaneWidget pw(Vec4f(0.0,1.0,2.0,3.0), 5.0); |
|
|
|
|
viz::PlaneWidget pw(Vec4f(0.0,1.0,2.0,3.0)); |
|
|
|
|
viz::PlaneWidget pw2(Vec4f(0.0,1.0,2.0,3.0), 2.0, viz::Color::red()); |
|
|
|
|
viz::PlaneWidget pw3(Vec4f(0.0,1.0,2.0,3.0), 3.0, viz::Color::blue()); |
|
|
|
|
viz::SphereWidget sw(Point3f(0, 0, 0), 0.2); |
|
|
|
|
viz::ArrowWidget aw(Point3f(0, 0, 0), Point3f(1, 1, 1), 0.01, viz::Color::red()); |
|
|
|
|
viz::CircleWidget cw(Point3f(0, 0, 0), 0.5, 0.01, viz::Color::green()); |
|
|
|
@ -101,8 +103,10 @@ TEST(Viz_viz3d, accuracy) |
|
|
|
|
viz::CloudWidget pcw2(cloud, viz::Color::magenta()); |
|
|
|
|
|
|
|
|
|
// viz.showWidget("line", lw);
|
|
|
|
|
// viz.showWidget("plane", pw);
|
|
|
|
|
viz.showWidget("sphere", sw); |
|
|
|
|
viz.showWidget("plane", pw); |
|
|
|
|
viz.showWidget("plane2", pw2); |
|
|
|
|
viz.showWidget("plane3", pw3); |
|
|
|
|
// viz.showWidget("sphere", sw);
|
|
|
|
|
// viz.showWidget("arrow", aw);
|
|
|
|
|
// viz.showWidget("circle", cw);
|
|
|
|
|
// viz.showWidget("cylinder", cyw);
|
|
|
|
@ -145,16 +149,33 @@ TEST(Viz_viz3d, accuracy) |
|
|
|
|
viz::CameraPositionWidget cpw(Vec3f(0.5, 0.5, 3.0), Vec3f(0.0,0.0,0.0), Vec3f(0.0,-1.0,0.0), 0.5); |
|
|
|
|
viz::CameraPositionWidget cpw2(0.5); |
|
|
|
|
viz::CameraPositionWidget frustum(K, 2.0, viz::Color::green()); |
|
|
|
|
// viz::CameraPositionWidget frustum2(K, 4.0, viz::Color::red());
|
|
|
|
|
viz::CameraPositionWidget frustum2(K, 4.0, viz::Color::red()); |
|
|
|
|
viz::CameraPositionWidget frustum3(Vec2f(CV_PI, CV_PI/2), 4.0); |
|
|
|
|
viz::Text3DWidget t3w1("Camera1", Point3f(0.4, 0.6, 3.0), 0.1); |
|
|
|
|
viz::Text3DWidget t3w2("Camera2", Point3f(0,0,0), 0.1); |
|
|
|
|
|
|
|
|
|
viz.showWidget("CameraPositionWidget", cpw); |
|
|
|
|
viz.showWidget("CameraPositionWidget2", cpw2, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5))); |
|
|
|
|
viz.showWidget("camera_label", t3w1); |
|
|
|
|
viz.showWidget("camera_label2", t3w2, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5))); |
|
|
|
|
viz.showWidget("frustrum", frustum, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5))); |
|
|
|
|
viz.showWidget("frustrum2", frustum2, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5))); |
|
|
|
|
// viz.showWidget("CameraPositionWidget", cpw);
|
|
|
|
|
// viz.showWidget("CameraPositionWidget2", cpw2, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5)));
|
|
|
|
|
// viz.showWidget("camera_label", t3w1);
|
|
|
|
|
// viz.showWidget("camera_label2", t3w2, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5)));
|
|
|
|
|
// viz.showWidget("frustrum", frustum, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5)));
|
|
|
|
|
// viz.showWidget("frustrum2", frustum2, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5)));
|
|
|
|
|
// viz.showWidget("frustum3", frustum3, Affine3f(0.524, 0, 0, Vec3f(-1.0, 0.5, 0.5)));
|
|
|
|
|
|
|
|
|
|
std::vector<Affine3f> trajectory; |
|
|
|
|
|
|
|
|
|
trajectory.push_back(Affine3f().translate(Vec3f(0.5,0.5,0.5))); |
|
|
|
|
trajectory.push_back(Affine3f().translate(Vec3f(1.0,0.0,0.0))); |
|
|
|
|
trajectory.push_back(Affine3f().translate(Vec3f(2.0,0.5,0.0))); |
|
|
|
|
trajectory.push_back(Affine3f(0.5, 0.0, 0.0, Vec3f(1.0,0.0,1.0))); |
|
|
|
|
//
|
|
|
|
|
viz.showWidget("trajectory1", viz::TrajectoryWidget(trajectory, viz::Color(0,255,255), true, 0.5)); |
|
|
|
|
viz.showWidget("trajectory2", viz::TrajectoryWidget(trajectory, K, 1.0, viz::Color(255,0,255))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// viz.showWidget("trajectory1", viz::TrajectoryWidget(trajectory/*, viz::Color::yellow()*/));
|
|
|
|
|
|
|
|
|
|
// viz.showWidget("CameraPositionWidget2", cpw2);
|
|
|
|
|
// viz.showWidget("CameraPositionWidget3", cpw3);
|
|
|
|
|