mass switch from Affine3f to Affine3d

This commit is contained in:
Anatoly Baksheev
2014-01-01 19:58:41 +04:00
parent b1c0bf1fee
commit 186853a50f
15 changed files with 238 additions and 169 deletions

View File

@@ -58,10 +58,10 @@ namespace cv
namespace viz
{
//! takes coordiante frame data and builds transfrom to global coordinate frame
CV_EXPORTS Affine3f makeTransformToGlobal(const Vec3f& axis_x, const Vec3f& axis_y, const Vec3f& axis_z, const Vec3f& origin = Vec3f::all(0));
CV_EXPORTS Affine3d makeTransformToGlobal(const Vec3d& axis_x, const Vec3d& axis_y, const Vec3d& axis_z, const Vec3d& origin = Vec3d::all(0));
//! constructs camera pose from position, focal_point and up_vector (see gluLookAt() for more infromation)
CV_EXPORTS Affine3f makeCameraPose(const Vec3f& position, const Vec3f& focal_point, const Vec3f& y_dir);
CV_EXPORTS Affine3d makeCameraPose(const Vec3d& position, const Vec3d& focal_point, const Vec3d& y_dir);
//! retrieves a window by its name. If no window with such name, then it creates new.
CV_EXPORTS Viz3d get(const String &window_name);
@@ -101,10 +101,7 @@ namespace cv
///////////////////////////////////////////////////////////////////////////////////////////////
/// Read/write poses and trajectories
CV_EXPORTS bool readPose(const String& file, Affine3f& pose, const String& tag = "pose");
CV_EXPORTS bool readPose(const String& file, Affine3d& pose, const String& tag = "pose");
CV_EXPORTS void writePose(const String& file, const Affine3f& pose, const String& tag = "pose");
CV_EXPORTS void writePose(const String& file, const Affine3d& pose, const String& tag = "pose");
CV_EXPORTS void writeTrajectory(const std::vector<Affine3f>& traj, const String& files_format = "pose%05d.xml", int start = 0, const String& tag = "pose");

View File

@@ -70,19 +70,19 @@ namespace cv
Viz3d& operator=(const Viz3d&);
~Viz3d();
void showWidget(const String &id, const Widget &widget, const Affine3f &pose = Affine3f::Identity());
void showWidget(const String &id, const Widget &widget, const Affine3d &pose = Affine3d::Identity());
void removeWidget(const String &id);
Widget getWidget(const String &id) const;
void removeAllWidgets();
void setWidgetPose(const String &id, const Affine3f &pose);
void updateWidgetPose(const String &id, const Affine3f &pose);
Affine3f getWidgetPose(const String &id) const;
void setWidgetPose(const String &id, const Affine3d &pose);
void updateWidgetPose(const String &id, const Affine3d &pose);
Affine3d getWidgetPose(const String &id) const;
void setCamera(const Camera &camera);
Camera getCamera() const;
Affine3f getViewerPose();
void setViewerPose(const Affine3f &pose);
Affine3d getViewerPose();
void setViewerPose(const Affine3d &pose);
void resetCameraViewpoint(const String &id);
void resetCamera();

View File

@@ -111,9 +111,9 @@ namespace cv
public:
Widget3D() {}
void setPose(const Affine3f &pose);
void updatePose(const Affine3f &pose);
Affine3f getPose() const;
void setPose(const Affine3d &pose);
void updatePose(const Affine3d &pose);
Affine3d getPose() const;
void setColor(const Color &color);
@@ -264,21 +264,22 @@ namespace cv
//! Displays trajectory of the given path either by coordinate frames or polyline
WTrajectory(const std::vector<Affine3f> &path, int display_mode = WTrajectory::PATH, float scale = 1.f, const Color &color = Color::white());
WTrajectory(const std::vector<Affine3d> &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
WTrajectoryFrustums(const std::vector<Affine3f> &path, const Matx33f &K, float scale = 1.f, const Color &color = Color::white());
WTrajectoryFrustums(const std::vector<Affine3d> &path, const Matx33f &K, float scale = 1.f, 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.f, const Color &color = Color::white());
WTrajectoryFrustums(const std::vector<Affine3d> &path, const Vec2f &fov, float scale = 1.f, const Color &color = Color::white());
};
class CV_EXPORTS WTrajectorySpheres: public Widget3D
{
public:
WTrajectorySpheres(const std::vector<Affine3f> &path, float line_length = 0.05f, float init_sphere_radius = 0.021f,
WTrajectorySpheres(const std::vector<Affine3d> &path, float line_length = 0.05f, float init_sphere_radius = 0.021f,
float sphere_radius = 0.007f, const Color &line_color = Color::white(), const Color &sphere_color = Color::white());
};
@@ -300,9 +301,9 @@ namespace cv
WCloudCollection();
//! Each point in cloud is mapped to a color in colors
void addCloud(InputArray cloud, InputArray colors, const Affine3f &pose = Affine3f::Identity());
void addCloud(InputArray cloud, InputArray colors, const Affine3d &pose = Affine3d::Identity());
//! All points in cloud have the same color
void addCloud(InputArray cloud, const Color &color = Color::white(), const Affine3f &pose = Affine3f::Identity());
void addCloud(InputArray cloud, const Color &color = Color::white(), const Affine3d &pose = Affine3d::Identity());
};
class CV_EXPORTS WCloudNormals : public Widget3D