Commit 08956165 authored by Anatoly Baksheev's avatar Anatoly Baksheev

switched from unnecessarily 'dobule' to 'float' in some places (commonly for widget scale)

parent b560cc35
...@@ -262,8 +262,8 @@ This 3D Widget defines a finite plane. :: ...@@ -262,8 +262,8 @@ This 3D Widget defines a finite plane. ::
class CV_EXPORTS WPlane : public Widget3D class CV_EXPORTS WPlane : public Widget3D
{ {
public: public:
WPlane(const Vec4f& coefs, double size = 1.0, const Color &color = Color::white()); WPlane(const Vec4f& coefs, float size = 1.0, const Color &color = Color::white());
WPlane(const Vec4f& coefs, const Point3f& pt, double size = 1.0, const Color &color = Color::white()); WPlane(const Vec4f& coefs, const Point3f& pt, float size = 1.0, const Color &color = Color::white());
private: private:
/* hidden */ /* hidden */
}; };
...@@ -272,13 +272,13 @@ viz::WPlane::WPlane ...@@ -272,13 +272,13 @@ viz::WPlane::WPlane
------------------- -------------------
Constructs a WPlane. Constructs a WPlane.
.. ocv:function:: WPlane(const Vec4f& coefs, double size = 1.0, const Color &color = Color::white()) .. ocv:function:: WPlane(const Vec4f& coefs, float size = 1.0, const Color &color = Color::white())
:param coefs: Plane coefficients as in (A,B,C,D) where Ax + By + Cz + D = 0. :param coefs: Plane coefficients as in (A,B,C,D) where Ax + By + Cz + D = 0.
:param size: Size of the plane. :param size: Size of the plane.
:param color: :ocv:class:`Color` of the plane. :param color: :ocv:class:`Color` of the plane.
.. ocv:function:: WPlane(const Vec4f& coefs, const Point3f& pt, double size = 1.0, const Color &color = Color::white()) .. ocv:function:: WPlane(const Vec4f& coefs, const Point3f& pt, float size = 1.0, const Color &color = Color::white())
:param coefs: Plane coefficients as in (A,B,C,D) where Ax + By + Cz + D = 0. :param coefs: Plane coefficients as in (A,B,C,D) where Ax + By + Cz + D = 0.
:param pt: Position of the plane. :param pt: Position of the plane.
...@@ -317,14 +317,14 @@ This 3D Widget defines an arrow. :: ...@@ -317,14 +317,14 @@ This 3D Widget defines an arrow. ::
class CV_EXPORTS WArrow : public Widget3D class CV_EXPORTS WArrow : public Widget3D
{ {
public: public:
WArrow(const Point3f& pt1, const Point3f& pt2, double thickness = 0.03, const Color &color = Color::white()); WArrow(const Point3f& pt1, const Point3f& pt2, float thickness = 0.03, const Color &color = Color::white());
}; };
viz::WArrow::WArrow viz::WArrow::WArrow
----------------------------- -----------------------------
Constructs an WArrow. Constructs an WArrow.
.. ocv:function:: WArrow(const Point3f& pt1, const Point3f& pt2, double thickness = 0.03, const Color &color = Color::white()) .. ocv:function:: WArrow(const Point3f& pt1, const Point3f& pt2, float thickness = 0.03, const Color &color = Color::white())
:param pt1: Start point of the arrow. :param pt1: Start point of the arrow.
:param pt2: End point of the arrow. :param pt2: End point of the arrow.
...@@ -342,14 +342,14 @@ This 3D Widget defines a circle. :: ...@@ -342,14 +342,14 @@ This 3D Widget defines a circle. ::
class CV_EXPORTS WCircle : public Widget3D class CV_EXPORTS WCircle : public Widget3D
{ {
public: public:
WCircle(const Point3f& pt, double radius, double thickness = 0.01, const Color &color = Color::white()); WCircle(const Point3f& pt, float radius, float thickness = 0.01, const Color &color = Color::white());
}; };
viz::WCircle::WCircle viz::WCircle::WCircle
------------------------------- -------------------------------
Constructs a WCircle. Constructs a WCircle.
.. ocv:function:: WCircle(const Point3f& pt, double radius, double thickness = 0.01, const Color &color = Color::white()) .. ocv:function:: WCircle(const Point3f& pt, float radius, float thickness = 0.01, const Color &color = Color::white())
:param pt: Center of the circle. :param pt: Center of the circle.
:param radius: Radius of the circle. :param radius: Radius of the circle.
...@@ -365,14 +365,14 @@ This 3D Widget defines a cylinder. :: ...@@ -365,14 +365,14 @@ This 3D Widget defines a cylinder. ::
class CV_EXPORTS WCylinder : public Widget3D class CV_EXPORTS WCylinder : public Widget3D
{ {
public: public:
WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, double radius, int numsides = 30, const Color &color = Color::white()); WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, float radius, int numsides = 30, const Color &color = Color::white());
}; };
viz::WCylinder::WCylinder viz::WCylinder::WCylinder
----------------------------------- -----------------------------------
Constructs a WCylinder. Constructs a WCylinder.
.. ocv:function:: WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, double radius, int numsides = 30, const Color &color = Color::white()) .. ocv:function:: WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, float radius, int numsides = 30, const Color &color = Color::white())
:param pt_on_axis: A point on the axis of the cylinder. :param pt_on_axis: A point on the axis of the cylinder.
:param axis_direction: Direction of the axis of the cylinder. :param axis_direction: Direction of the axis of the cylinder.
...@@ -416,14 +416,14 @@ This 3D Widget represents a coordinate system. :: ...@@ -416,14 +416,14 @@ This 3D Widget represents a coordinate system. ::
class CV_EXPORTS WCoordinateSystem : public Widget3D class CV_EXPORTS WCoordinateSystem : public Widget3D
{ {
public: public:
WCoordinateSystem(double scale = 1.0); WCoordinateSystem(float scale = 1.0);
}; };
viz::WCoordinateSystem::WCoordinateSystem viz::WCoordinateSystem::WCoordinateSystem
--------------------------------------------------- ---------------------------------------------------
Constructs a WCoordinateSystem. Constructs a WCoordinateSystem.
.. ocv:function:: WCoordinateSystem(double scale = 1.0) .. ocv:function:: WCoordinateSystem(float scale = 1.0)
:param scale: Determines the size of the axes. :param scale: Determines the size of the axes.
...@@ -494,7 +494,7 @@ This 3D Widget represents 3D text. The text always faces the camera. :: ...@@ -494,7 +494,7 @@ This 3D Widget represents 3D text. The text always faces the camera. ::
class CV_EXPORTS WText3D : public Widget3D class CV_EXPORTS WText3D : public Widget3D
{ {
public: public:
WText3D(const String &text, const Point3f &position, double text_scale = 1.0, double face_camera = true, const Color &color = Color::white()); WText3D(const String &text, const Point3f &position, float text_scale = 1.0, bool face_camera = true, const Color &color = Color::white());
void setText(const String &text); void setText(const String &text);
String getText() const; String getText() const;
...@@ -504,7 +504,7 @@ viz::WText3D::WText3D ...@@ -504,7 +504,7 @@ viz::WText3D::WText3D
------------------------------- -------------------------------
Constructs a WText3D. Constructs a WText3D.
.. ocv:function:: WText3D(const String &text, const Point3f &position, double text_scale = 1.0, double face_camera = true, const Color &color = Color::white()) .. ocv:function:: WText3D(const String &text, const Point3f &position, float text_scale = 1.0, bool face_camera = true, const Color &color = Color::white())
:param text: Text content of the widget. :param text: Text content of the widget.
:param position: Position of the text. :param position: Position of the text.
...@@ -649,15 +649,15 @@ This 3D Widget represents camera position in a scene by its axes or viewing frus ...@@ -649,15 +649,15 @@ This 3D Widget represents camera position in a scene by its axes or viewing frus
{ {
public: public:
//! Creates camera coordinate frame (axes) at the origin //! Creates camera coordinate frame (axes) at the origin
WCameraPosition(double scale = 1.0); WCameraPosition(float scale = 1.0);
//! Creates frustum based on the intrinsic marix K at the origin //! Creates frustum based on the intrinsic marix K at the origin
WCameraPosition(const Matx33f &K, double scale = 1.0, const Color &color = Color::white()); WCameraPosition(const Matx33f &K, float scale = 1.0, const Color &color = Color::white());
//! Creates frustum based on the field of view at the origin //! Creates frustum based on the field of view at the origin
WCameraPosition(const Vec2f &fov, double scale = 1.0, const Color &color = Color::white()); WCameraPosition(const Vec2f &fov, float scale = 1.0, const Color &color = Color::white());
//! Creates frustum and display given image at the far plane //! Creates frustum and display given image at the far plane
WCameraPosition(const Matx33f &K, const Mat &img, double scale = 1.0, const Color &color = Color::white()); WCameraPosition(const Matx33f &K, const Mat &img, float scale = 1.0, const Color &color = Color::white());
//! Creates frustum and display given image at the far plane //! Creates frustum and display given image at the far plane
WCameraPosition(const Vec2f &fov, const Mat &img, double scale = 1.0, const Color &color = Color::white()); WCameraPosition(const Vec2f &fov, const Mat &img, float scale = 1.0, const Color &color = Color::white());
}; };
viz::WCameraPosition::WCameraPosition viz::WCameraPosition::WCameraPosition
...@@ -666,7 +666,7 @@ Constructs a WCameraPosition. ...@@ -666,7 +666,7 @@ Constructs a WCameraPosition.
- **Display camera coordinate frame.** - **Display camera coordinate frame.**
.. ocv:function:: WCameraPosition(double scale = 1.0) .. ocv:function:: WCameraPosition(float scale = 1.0)
Creates camera coordinate frame at the origin. Creates camera coordinate frame at the origin.
...@@ -676,7 +676,7 @@ Constructs a WCameraPosition. ...@@ -676,7 +676,7 @@ Constructs a WCameraPosition.
- **Display the viewing frustum.** - **Display the viewing frustum.**
.. ocv:function:: WCameraPosition(const Matx33f &K, double scale = 1.0, const Color &color = Color::white()) .. ocv:function:: WCameraPosition(const Matx33f &K, float scale = 1.0, const Color &color = Color::white())
:param K: Intrinsic matrix of the camera. :param K: Intrinsic matrix of the camera.
:param scale: Scale of the frustum. :param scale: Scale of the frustum.
...@@ -684,7 +684,7 @@ Constructs a WCameraPosition. ...@@ -684,7 +684,7 @@ Constructs a WCameraPosition.
Creates viewing frustum of the camera based on its intrinsic matrix K. Creates viewing frustum of the camera based on its intrinsic matrix K.
.. ocv:function:: WCameraPosition(const Vec2f &fov, double scale = 1.0, const Color &color = Color::white()) .. ocv:function:: WCameraPosition(const Vec2f &fov, float scale = 1.0, const Color &color = Color::white())
:param fov: Field of view of the camera (horizontal, vertical). :param fov: Field of view of the camera (horizontal, vertical).
:param scale: Scale of the frustum. :param scale: Scale of the frustum.
...@@ -698,7 +698,7 @@ Constructs a WCameraPosition. ...@@ -698,7 +698,7 @@ Constructs a WCameraPosition.
- **Display image on the far plane of the viewing frustum.** - **Display image on the far plane of the viewing frustum.**
.. ocv:function:: WCameraPosition(const Matx33f &K, const Mat &img, double scale = 1.0, const Color &color = Color::white()) .. ocv:function:: WCameraPosition(const Matx33f &K, const Mat &img, float scale = 1.0, const Color &color = Color::white())
:param K: Intrinsic matrix of the camera. :param K: Intrinsic matrix of the camera.
:param img: BGR or Gray-Scale image that is going to be displayed on the far plane of the frustum. :param img: BGR or Gray-Scale image that is going to be displayed on the far plane of the frustum.
...@@ -707,7 +707,7 @@ Constructs a WCameraPosition. ...@@ -707,7 +707,7 @@ Constructs a WCameraPosition.
Creates viewing frustum of the camera based on its intrinsic matrix K, and displays image on the far end plane. Creates viewing frustum of the camera based on its intrinsic matrix K, and displays image on the far end plane.
.. ocv:function:: WCameraPosition(const Vec2f &fov, const Mat &img, double scale = 1.0, const Color &color = Color::white()) .. ocv:function:: WCameraPosition(const Vec2f &fov, const Mat &img, float scale = 1.0, const Color &color = Color::white())
:param fov: Field of view of the camera (horizontal, vertical). :param fov: Field of view of the camera (horizontal, vertical).
:param img: BGR or Gray-Scale image that is going to be displayed on the far plane of the frustum. :param img: BGR or Gray-Scale image that is going to be displayed on the far plane of the frustum.
...@@ -732,11 +732,11 @@ This 3D Widget represents a trajectory. :: ...@@ -732,11 +732,11 @@ This 3D Widget represents a trajectory. ::
enum {DISPLAY_FRAMES = 1, DISPLAY_PATH = 2}; enum {DISPLAY_FRAMES = 1, DISPLAY_PATH = 2};
//! Displays trajectory of the given path either by coordinate frames or polyline //! Displays trajectory of the given path either by coordinate frames or polyline
WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), double scale = 1.0); WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.0);
//! Displays trajectory of the given path by frustums //! Displays trajectory of the given path by frustums
WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, double scale = 1.0, const Color &color = Color::white()); 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 //! Displays trajectory of the given path by frustums
WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, double scale = 1.0, const Color &color = Color::white()); WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.0, const Color &color = Color::white());
private: private:
/* hidden */ /* hidden */
...@@ -746,7 +746,7 @@ viz::WTrajectory::WTrajectory ...@@ -746,7 +746,7 @@ viz::WTrajectory::WTrajectory
----------------------------- -----------------------------
Constructs a WTrajectory. Constructs a WTrajectory.
.. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), double scale = 1.0) .. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.0)
:param path: List of poses on a trajectory. :param path: List of poses on a trajectory.
:param display_mode: Display mode. This can be DISPLAY_PATH, DISPLAY_FRAMES, DISPLAY_PATH & DISPLAY_FRAMES. :param display_mode: Display mode. This can be DISPLAY_PATH, DISPLAY_FRAMES, DISPLAY_PATH & DISPLAY_FRAMES.
...@@ -759,7 +759,7 @@ Constructs a WTrajectory. ...@@ -759,7 +759,7 @@ Constructs a WTrajectory.
* DISPLAY_FRAMES : Displays coordinate frames at each pose. * DISPLAY_FRAMES : Displays coordinate frames at each pose.
* DISPLAY_PATH & DISPLAY_FRAMES : Displays both poly line and coordinate frames. * DISPLAY_PATH & DISPLAY_FRAMES : Displays both poly line and coordinate frames.
.. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, double scale = 1.0, const Color &color = Color::white()) .. ocv:function:: WTrajectory(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 path: List of poses on a trajectory.
:param K: Intrinsic matrix of the camera. :param K: Intrinsic matrix of the camera.
...@@ -768,7 +768,7 @@ Constructs a WTrajectory. ...@@ -768,7 +768,7 @@ Constructs a WTrajectory.
Displays frustums at each pose of the trajectory. Displays frustums at each pose of the trajectory.
.. ocv:function:: WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, double scale = 1.0, const Color &color = Color::white()) .. ocv:function:: WTrajectory(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 path: List of poses on a trajectory.
:param fov: Field of view of the camera (horizontal, vertical). :param fov: Field of view of the camera (horizontal, vertical).
...@@ -788,7 +788,7 @@ represent the direction from previous position to the current. :: ...@@ -788,7 +788,7 @@ represent the direction from previous position to the current. ::
{ {
public: public:
WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length = 0.05f, WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length = 0.05f,
double init_sphere_radius = 0.021, sphere_radius = 0.007, float init_sphere_radius = 0.021, sphere_radius = 0.007,
Color &line_color = Color::white(), const Color &sphere_color = Color::white()); Color &line_color = Color::white(), const Color &sphere_color = Color::white());
}; };
...@@ -796,7 +796,7 @@ viz::WSpheresTrajectory::WSpheresTrajectory ...@@ -796,7 +796,7 @@ viz::WSpheresTrajectory::WSpheresTrajectory
------------------------------------------- -------------------------------------------
Constructs a WSpheresTrajectory. Constructs a WSpheresTrajectory.
.. ocv:function:: WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length = 0.05f, double init_sphere_radius = 0.021, double sphere_radius = 0.007, const Color &line_color = Color::white(), const Color &sphere_color = Color::white()) .. ocv:function:: WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length = 0.05f, float init_sphere_radius = 0.021, float sphere_radius = 0.007, const Color &line_color = Color::white(), const Color &sphere_color = Color::white())
:param path: List of poses on a trajectory. :param path: List of poses on a trajectory.
:param line_length: Length of the lines. :param line_length: Length of the lines.
......
...@@ -143,8 +143,8 @@ namespace cv ...@@ -143,8 +143,8 @@ namespace cv
class CV_EXPORTS WPlane : public Widget3D class CV_EXPORTS WPlane : public Widget3D
{ {
public: public:
WPlane(const Vec4f& coefs, double size = 1.0, const Color &color = Color::white()); WPlane(const Vec4f& coefs, float size = 1.f, const Color &color = Color::white());
WPlane(const Vec4f& coefs, const Point3f& pt, double size = 1.0, const Color &color = Color::white()); WPlane(const Vec4f& coefs, const Point3f& pt, float size = 1.f, const Color &color = Color::white());
private: private:
struct SetSizeImpl; struct SetSizeImpl;
}; };
...@@ -158,19 +158,19 @@ namespace cv ...@@ -158,19 +158,19 @@ namespace cv
class CV_EXPORTS WArrow : public Widget3D class CV_EXPORTS WArrow : public Widget3D
{ {
public: public:
WArrow(const Point3f& pt1, const Point3f& pt2, double thickness = 0.03, const Color &color = Color::white()); WArrow(const Point3f& pt1, const Point3f& pt2, float thickness = 0.03f, const Color &color = Color::white());
}; };
class CV_EXPORTS WCircle : public Widget3D class CV_EXPORTS WCircle : public Widget3D
{ {
public: public:
WCircle(const Point3f& pt, double radius, double thickness = 0.01, const Color &color = Color::white()); WCircle(const Point3f& pt, float radius, float thickness = 0.01f, const Color &color = Color::white());
}; };
class CV_EXPORTS WCylinder : public Widget3D class CV_EXPORTS WCylinder : public Widget3D
{ {
public: public:
WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, double radius, int numsides = 30, const Color &color = Color::white()); WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, float radius, int numsides = 30, const Color &color = Color::white());
}; };
class CV_EXPORTS WCube : public Widget3D class CV_EXPORTS WCube : public Widget3D
...@@ -182,7 +182,7 @@ namespace cv ...@@ -182,7 +182,7 @@ namespace cv
class CV_EXPORTS WCoordinateSystem : public Widget3D class CV_EXPORTS WCoordinateSystem : public Widget3D
{ {
public: public:
WCoordinateSystem(double scale = 1.0); WCoordinateSystem(float scale = 1.f);
}; };
class CV_EXPORTS WPolyLine : public Widget3D class CV_EXPORTS WPolyLine : public Widget3D
...@@ -210,7 +210,7 @@ namespace cv ...@@ -210,7 +210,7 @@ namespace cv
class CV_EXPORTS WText3D : public Widget3D class CV_EXPORTS WText3D : public Widget3D
{ {
public: public:
WText3D(const String &text, const Point3f &position, double text_scale = 1.0, bool face_camera = true, const Color &color = Color::white()); WText3D(const String &text, const Point3f &position, float text_scale = 1.f, bool face_camera = true, const Color &color = Color::white());
void setText(const String &text); void setText(const String &text);
String getText() const; String getText() const;
...@@ -248,15 +248,15 @@ namespace cv ...@@ -248,15 +248,15 @@ namespace cv
{ {
public: public:
//! Creates camera coordinate frame (axes) at the origin //! Creates camera coordinate frame (axes) at the origin
WCameraPosition(double scale = 1.0); WCameraPosition(float scale = 1.f);
//! Creates frustum based on the intrinsic marix K at the origin //! Creates frustum based on the intrinsic marix K at the origin
WCameraPosition(const Matx33f &K, double scale = 1.0, const Color &color = Color::white()); WCameraPosition(const Matx33f &K, float scale = 1.f, const Color &color = Color::white());
//! Creates frustum based on the field of view at the origin //! Creates frustum based on the field of view at the origin
WCameraPosition(const Vec2f &fov, double scale = 1.0, const Color &color = Color::white()); WCameraPosition(const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
//! Creates frustum and display given image at the far plane //! Creates frustum and display given image at the far plane
WCameraPosition(const Matx33f &K, const Mat &img, double scale = 1.0, const Color &color = Color::white()); 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 //! Creates frustum and display given image at the far plane
WCameraPosition(const Vec2f &fov, const Mat &img, double scale = 1.0, const Color &color = Color::white()); WCameraPosition(const Vec2f &fov, const Mat &img, float scale = 1.f, const Color &color = Color::white());
private: private:
struct ProjectImage; struct ProjectImage;
...@@ -268,11 +268,11 @@ namespace cv ...@@ -268,11 +268,11 @@ namespace cv
enum {DISPLAY_FRAMES = 1, DISPLAY_PATH = 2}; enum {DISPLAY_FRAMES = 1, DISPLAY_PATH = 2};
//! Displays trajectory of the given path either by coordinate frames or polyline //! Displays trajectory of the given path either by coordinate frames or polyline
WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), double scale = 1.0); WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::DISPLAY_PATH, const Color &color = Color::white(), float scale = 1.f);
//! Displays trajectory of the given path by frustums //! Displays trajectory of the given path by frustums
WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, double scale = 1.0, const Color &color = Color::white()); WTrajectory(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 //! Displays trajectory of the given path by frustums
WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, double scale = 1.0, const Color &color = Color::white()); WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
private: private:
struct ApplyPath; struct ApplyPath;
...@@ -281,8 +281,8 @@ namespace cv ...@@ -281,8 +281,8 @@ namespace cv
class CV_EXPORTS WSpheresTrajectory: public Widget3D class CV_EXPORTS WSpheresTrajectory: public Widget3D
{ {
public: public:
WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length = 0.05f, double init_sphere_radius = 0.021, WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length = 0.05f, float init_sphere_radius = 0.021f,
double sphere_radius = 0.007, const Color &line_color = Color::white(), const Color &sphere_color = Color::white()); float sphere_radius = 0.007f, const Color &line_color = Color::white(), const Color &sphere_color = Color::white());
}; };
class CV_EXPORTS WCloud: public Widget3D class CV_EXPORTS WCloud: public Widget3D
......
...@@ -104,7 +104,7 @@ struct cv::viz::WPlane::SetSizeImpl ...@@ -104,7 +104,7 @@ struct cv::viz::WPlane::SetSizeImpl
} }
}; };
cv::viz::WPlane::WPlane(const Vec4f& coefs, double size, const Color &color) cv::viz::WPlane::WPlane(const Vec4f& coefs, float size, const Color &color)
{ {
vtkSmartPointer<vtkPlaneSource> plane = vtkSmartPointer<vtkPlaneSource>::New(); vtkSmartPointer<vtkPlaneSource> plane = vtkSmartPointer<vtkPlaneSource>::New();
plane->SetNormal(coefs[0], coefs[1], coefs[2]); plane->SetNormal(coefs[0], coefs[1], coefs[2]);
...@@ -124,7 +124,7 @@ cv::viz::WPlane::WPlane(const Vec4f& coefs, double size, const Color &color) ...@@ -124,7 +124,7 @@ cv::viz::WPlane::WPlane(const Vec4f& coefs, double size, const Color &color)
setColor(color); setColor(color);
} }
cv::viz::WPlane::WPlane(const Vec4f& coefs, const Point3f& pt, double size, const Color &color) cv::viz::WPlane::WPlane(const Vec4f& coefs, const Point3f& pt, float size, const Color &color)
{ {
vtkSmartPointer<vtkPlaneSource> plane = vtkSmartPointer<vtkPlaneSource>::New(); vtkSmartPointer<vtkPlaneSource> plane = vtkSmartPointer<vtkPlaneSource>::New();
Point3f coefs3(coefs[0], coefs[1], coefs[2]); Point3f coefs3(coefs[0], coefs[1], coefs[2]);
...@@ -183,7 +183,7 @@ template<> cv::viz::WSphere cv::viz::Widget::cast<cv::viz::WSphere>() ...@@ -183,7 +183,7 @@ template<> cv::viz::WSphere cv::viz::Widget::cast<cv::viz::WSphere>()
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// arrow widget implementation /// arrow widget implementation
cv::viz::WArrow::WArrow(const Point3f& pt1, const Point3f& pt2, double thickness, const Color &color) cv::viz::WArrow::WArrow(const Point3f& pt1, const Point3f& pt2, float thickness, const Color &color)
{ {
vtkSmartPointer<vtkArrowSource> arrowSource = vtkSmartPointer<vtkArrowSource>::New(); vtkSmartPointer<vtkArrowSource> arrowSource = vtkSmartPointer<vtkArrowSource>::New();
arrowSource->SetShaftRadius(thickness); arrowSource->SetShaftRadius(thickness);
...@@ -256,7 +256,7 @@ template<> cv::viz::WArrow cv::viz::Widget::cast<cv::viz::WArrow>() ...@@ -256,7 +256,7 @@ template<> cv::viz::WArrow cv::viz::Widget::cast<cv::viz::WArrow>()
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// circle widget implementation /// circle widget implementation
cv::viz::WCircle::WCircle(const Point3f& pt, double radius, double thickness, const Color& color) cv::viz::WCircle::WCircle(const Point3f& pt, float radius, float thickness, const Color& color)
{ {
vtkSmartPointer<vtkDiskSource> disk = vtkSmartPointer<vtkDiskSource>::New(); vtkSmartPointer<vtkDiskSource> disk = vtkSmartPointer<vtkDiskSource>::New();
// Maybe the resolution should be lower e.g. 50 or 25 // Maybe the resolution should be lower e.g. 50 or 25
...@@ -292,7 +292,7 @@ template<> cv::viz::WCircle cv::viz::Widget::cast<cv::viz::WCircle>() ...@@ -292,7 +292,7 @@ template<> cv::viz::WCircle cv::viz::Widget::cast<cv::viz::WCircle>()
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// cylinder widget implementation /// cylinder widget implementation
cv::viz::WCylinder::WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, double radius, int numsides, const Color &color) cv::viz::WCylinder::WCylinder(const Point3f& pt_on_axis, const Point3f& axis_direction, float radius, int numsides, const Color &color)
{ {
const Point3f pt2 = pt_on_axis + axis_direction; const Point3f pt2 = pt_on_axis + axis_direction;
vtkSmartPointer<vtkLineSource> line = vtkSmartPointer<vtkLineSource>::New(); vtkSmartPointer<vtkLineSource> line = vtkSmartPointer<vtkLineSource>::New();
...@@ -355,7 +355,7 @@ template<> cv::viz::WCube cv::viz::Widget::cast<cv::viz::WCube>() ...@@ -355,7 +355,7 @@ template<> cv::viz::WCube cv::viz::Widget::cast<cv::viz::WCube>()
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// coordinate system widget implementation /// coordinate system widget implementation
cv::viz::WCoordinateSystem::WCoordinateSystem(double scale) cv::viz::WCoordinateSystem::WCoordinateSystem(float scale)
{ {
vtkSmartPointer<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New(); vtkSmartPointer<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New();
axes->SetOrigin(0, 0, 0); axes->SetOrigin(0, 0, 0);
...@@ -593,7 +593,7 @@ template<> cv::viz::WGrid cv::viz::Widget::cast<cv::viz::WGrid>() ...@@ -593,7 +593,7 @@ template<> cv::viz::WGrid cv::viz::Widget::cast<cv::viz::WGrid>()
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// text3D widget implementation /// text3D widget implementation
cv::viz::WText3D::WText3D(const String &text, const Point3f &position, double text_scale, bool face_camera, const Color &color) cv::viz::WText3D::WText3D(const String &text, const Point3f &position, float text_scale, bool face_camera, const Color &color)
{ {
vtkSmartPointer<vtkVectorText> textSource = vtkSmartPointer<vtkVectorText>::New(); vtkSmartPointer<vtkVectorText> textSource = vtkSmartPointer<vtkVectorText>::New();
textSource->SetText(text.c_str()); textSource->SetText(text.c_str());
...@@ -1032,7 +1032,7 @@ struct cv::viz::WCameraPosition::ProjectImage ...@@ -1032,7 +1032,7 @@ struct cv::viz::WCameraPosition::ProjectImage
} }
}; };
cv::viz::WCameraPosition::WCameraPosition(double scale) cv::viz::WCameraPosition::WCameraPosition(float scale)
{ {
vtkSmartPointer<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New(); vtkSmartPointer<vtkAxes> axes = vtkSmartPointer<vtkAxes>::New();
axes->SetOrigin(0, 0, 0); axes->SetOrigin(0, 0, 0);
...@@ -1074,7 +1074,7 @@ cv::viz::WCameraPosition::WCameraPosition(double scale) ...@@ -1074,7 +1074,7 @@ cv::viz::WCameraPosition::WCameraPosition(double scale)
WidgetAccessor::setProp(*this, actor); WidgetAccessor::setProp(*this, actor);
} }
cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, double scale, const Color &color) cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, float scale, const Color &color)
{ {
vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New(); vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New();
float f_x = K(0,0); float f_x = K(0,0);
...@@ -1116,7 +1116,7 @@ cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, double scale, const ...@@ -1116,7 +1116,7 @@ cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, double scale, const
} }
cv::viz::WCameraPosition::WCameraPosition(const Vec2f &fov, double scale, const Color &color) cv::viz::WCameraPosition::WCameraPosition(const Vec2f &fov, float scale, const Color &color)
{ {
vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New(); vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New();
...@@ -1154,7 +1154,7 @@ cv::viz::WCameraPosition::WCameraPosition(const Vec2f &fov, double scale, const ...@@ -1154,7 +1154,7 @@ cv::viz::WCameraPosition::WCameraPosition(const Vec2f &fov, double scale, const
setColor(color); setColor(color);
} }
cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, const Mat &image, double scale, const Color &color) cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, const Mat &image, float scale, const Color &color)
{ {
CV_Assert(!image.empty() && image.depth() == CV_8U); CV_Assert(!image.empty() && image.depth() == CV_8U);
float f_y = K(1,1); float f_y = K(1,1);
...@@ -1168,7 +1168,7 @@ cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, const Mat &image, do ...@@ -1168,7 +1168,7 @@ cv::viz::WCameraPosition::WCameraPosition(const Matx33f &K, const Mat &image, do
WidgetAccessor::setProp(*this, actor); WidgetAccessor::setProp(*this, actor);
} }
cv::viz::WCameraPosition::WCameraPosition(const Vec2f &fov, const Mat &image, double scale, const Color &color) cv::viz::WCameraPosition::WCameraPosition(const Vec2f &fov, const Mat &image, float scale, const Color &color)
{ {
CV_Assert(!image.empty() && image.depth() == CV_8U); CV_Assert(!image.empty() && image.depth() == CV_8U);
float fovy = fov[1] * 180.0f / CV_PI; float fovy = fov[1] * 180.0f / CV_PI;
...@@ -1220,7 +1220,7 @@ struct cv::viz::WTrajectory::ApplyPath ...@@ -1220,7 +1220,7 @@ struct cv::viz::WTrajectory::ApplyPath
} }
}; };
cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, int display_mode, const Color &color, double scale) cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, int display_mode, const Color &color, float scale)
{ {
vtkSmartPointer<vtkAppendPolyData> appendFilter = vtkSmartPointer<vtkAppendPolyData>::New(); vtkSmartPointer<vtkAppendPolyData> appendFilter = vtkSmartPointer<vtkAppendPolyData>::New();
...@@ -1316,7 +1316,7 @@ cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, int display ...@@ -1316,7 +1316,7 @@ cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, int display
WidgetAccessor::setProp(*this, actor); WidgetAccessor::setProp(*this, actor);
} }
cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, double scale, const Color &color) cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Matx33f &K, float scale, const Color &color)
{ {
vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New(); vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New();
float f_x = K(0,0); float f_x = K(0,0);
...@@ -1360,7 +1360,7 @@ cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Matx3 ...@@ -1360,7 +1360,7 @@ cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Matx3
setColor(color); setColor(color);
} }
cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, double scale, const Color &color) cv::viz::WTrajectory::WTrajectory(const std::vector<Affine3f> &path, const Vec2f &fov, float scale, const Color &color)
{ {
vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New(); vtkSmartPointer<vtkCamera> camera = vtkSmartPointer<vtkCamera>::New();
...@@ -1409,7 +1409,7 @@ template<> cv::viz::WTrajectory cv::viz::Widget::cast<cv::viz::WTrajectory>() ...@@ -1409,7 +1409,7 @@ template<> cv::viz::WTrajectory cv::viz::Widget::cast<cv::viz::WTrajectory>()
/////////////////////////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////////////////////////
/// spheres trajectory widget implementation /// spheres trajectory widget implementation
cv::viz::WSpheresTrajectory::WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length, double init_sphere_radius, double sphere_radius, cv::viz::WSpheresTrajectory::WSpheresTrajectory(const std::vector<Affine3f> &path, float line_length, float init_sphere_radius, float sphere_radius,
const Color &line_color, const Color &sphere_color) const Color &line_color, const Color &sphere_color)
{ {
vtkSmartPointer<vtkAppendPolyData> appendFilter = vtkSmartPointer<vtkAppendPolyData>::New(); vtkSmartPointer<vtkAppendPolyData> appendFilter = vtkSmartPointer<vtkAppendPolyData>::New();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment