enum {FRAMES = 1, PATH = 2, BOTH = FRAMES + PATH};
//! Displays trajectory of the given path either by coordinate frames or polyline
- WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::PATH, const Color &color = Color::white(), float scale = 1.0);
- //! Displays trajectory of the given path by frustums
- WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.0, const Color &color = Color::white());
- //! Displays trajectory of the given path by frustums
- WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.0, const Color &color = Color::white());
-
- private:
- /* hidden */
+ WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::PATH, float scale = 1.f, const Color &color = Color::white(),;
};
viz::WTrajectory::WTrajectory
-----------------------------
Constructs a WTrajectory.
-.. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::PATH, const Color &color = Color::white(), float scale = 1.0)
+.. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::PATH, float scale = 1.f, const Color &color = Color::white())
:param path: List of poses on a trajectory.
:param display_mode: Display mode. This can be PATH, FRAMES, and BOTH.
- :param color: :ocv:class:`Color` of the polyline that represents path. Frames are not affected.
:param scale: Scale of the frames. Polyline is not affected.
+ :param color: :ocv:class:`Color` of the polyline that represents path. Frames are not affected.
Displays trajectory of the given path as follows:
* FRAMES : Displays coordinate frames at each pose.
* PATH & FRAMES : Displays both poly line and coordinate frames.
-.. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.0, const Color &color = Color::white())
+viz::WTrajectoryFrustums
+----------------
+.. ocv:class:: WTrajectoryFrustums
+
+This 3D Widget represents a trajectory. ::
+
+ class CV_EXPORTS WTrajectoryFrustums : public Widget3D
+ {
+ public:
+ //! Displays trajectory of the given path by frustums
+ WTrajectoryFrustums(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.0, const Color &color = Color::white());
+ //! Displays trajectory of the given path by frustums
+ WTrajectoryFrustums(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.0, const Color &color = Color::white());
+ };
+
+viz::WTrajectoryFrustums::WTrajectoryFrustums
+-----------------------------
+Constructs a WTrajectoryFrustums.
+
+.. ocv:function:: WTrajectoryFrustums(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.0, const Color &color = Color::white())
:param path: List of poses on a trajectory.
:param K: Intrinsic matrix of the camera.
Displays frustums at each pose of the trajectory.
-.. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.0, const Color &color = Color::white())
+.. ocv:function:: WTrajectoryFrustums(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.0, const Color &color = Color::white())
:param path: List of poses on a trajectory.
:param fov: Field of view of the camera (horizontal, vertical).
//! Creates camera coordinate frame (axes) at the origin
WCameraPosition(float scale = 1.f);
//! Creates frustum based on the intrinsic marix K at the origin
- WCameraPosition(const Matx33f &K, float scale = 1.f, const Color &color = Color::white());
+ explicit WCameraPosition(const Matx33f &K, float scale = 1.f, const Color &color = Color::white());
//! Creates frustum based on the field of view at the origin
- WCameraPosition(const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
+ explicit WCameraPosition(const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
//! Creates frustum and display given image at the far plane
- WCameraPosition(const Matx33f &K, const Mat &img, float scale = 1.f, const Color &color = Color::white());
+ explicit WCameraPosition(const Matx33f &K, const Mat &img, float scale = 1.f, const Color &color = Color::white());
//! Creates frustum and display given image at the far plane
- WCameraPosition(const Vec2f &fov, const Mat &img, float scale = 1.f, const Color &color = Color::white());
+ explicit WCameraPosition(const Vec2f &fov, const Mat &img, float scale = 1.f, const Color &color = Color::white());
};
class CV_EXPORTS WTrajectory : public Widget3D
enum {FRAMES = 1, PATH = 2, BOTH = FRAMES + PATH };
//! Displays trajectory of the given path either by coordinate frames or polyline
- WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::PATH, const Color &color = Color::white(), float scale = 1.f);
+ WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::PATH, float scale = 1.f, const Color &color = Color::white());
+ };
+
+ class CV_EXPORTS WTrajectoryFrustums : public Widget3D
+ {
+ public:
//! Displays trajectory of the given path by frustums
- WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.f, const Color &color = Color::white());
+ explicit WTrajectoryFrustums(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.f, const Color &color = Color::white());
//! Displays trajectory of the given path by frustums
- WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
+ explicit WTrajectoryFrustums(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
};
class CV_EXPORTS WTrajectorySpheres: public Widget3D
template<> CV_EXPORTS WImage3D Widget::cast<WImage3D>();
template<> CV_EXPORTS WCameraPosition Widget::cast<WCameraPosition>();
template<> CV_EXPORTS WTrajectory Widget::cast<WTrajectory>();
+ template<> CV_EXPORTS WTrajectoryFrustums Widget::cast<WTrajectoryFrustums>();
template<> CV_EXPORTS WTrajectorySpheres Widget::cast<WTrajectorySpheres>();
template<> CV_EXPORTS WCloud Widget::cast<WCloud>();
template<> CV_EXPORTS WCloudCollection Widget::cast<WCloudCollection>();
};
}}}
-cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, int display_mode, const Color &color, float scale)
+cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, int display_mode, float scale, const Color &color)
{
vtkSmartPointer<vtkAppendPolyData> appendFilter = vtkSmartPointer<vtkAppendPolyData>::New();
WidgetAccessor::setProp(*this, actor);
}
-cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, float scale, const Color &color)
+template<> cv::viz::WTrajectory cv::viz::Widget::cast<cv::viz::WTrajectory>()
+{
+ Widget3D widget = this->cast<Widget3D>();
+ return static_cast<WTrajectory&>(widget);
+}
+
+///////////////////////////////////////////////////////////////////////////////////////////////
+/// WTrajectoryFrustums widget implementation
+
+cv::viz::WTrajectoryFrustums::WTrajectoryFrustums(const std::vector<Affine3f> &path, const Matx33f &K, float scale, const Color &color)
{
vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New();
float f_x = K(0,0);
setColor(color);
}
-cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale, const Color &color)
+cv::viz::WTrajectoryFrustums::WTrajectoryFrustums(const std::vector<Affine3f> &path, const Vec2f &fov, float scale, const Color &color)
{
vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New();
setColor(color);
}
-template<> cv::viz::WTrajectory cv::viz::Widget::cast<cv::viz::WTrajectory>()
+template<> cv::viz::WTrajectoryFrustums cv::viz::Widget::cast<cv::viz::WTrajectoryFrustums>()
{
Widget3D widget = this->cast<Widget3D>();
- return static_cast<WTrajectory&>(widget);
+ return static_cast<WTrajectoryFrustums&>(widget);
}
///////////////////////////////////////////////////////////////////////////////////////////////
-/// spheres trajectory widget implementation
+/// WTrajectorySpheres widget implementation
cv::viz::WTrajectorySpheres::WTrajectorySpheres(const std::vector<Affine3f> &path, float line_length, float init_sphere_radius, float sphere_radius,
const Color &line_color, const Color &sphere_color)