Class trifinger_object_tracking::CubeVisualizer

class CubeVisualizer

Visualise object pose in the camera images.

The draw_cube() method can be used to project the object into the camera images and draw it either as wireframe or with filled faces for visualisation/debugging purposes.

Public Functions

inline CubeVisualizer(BaseCuboidModel::ConstPtr cube_model, const std::array<trifinger_cameras::CameraParameters, N_CAMERAS> &camera_params)
Parameters:
  • cube_model – Model of the object that is visualised.

  • camera_params – Camera calibration parameters.

inline CubeVisualizer(BaseCuboidModel::ConstPtr cube_model, const std::array<std::string, N_CAMERAS> &camera_calib_files)
Parameters:
  • cube_model – Model of the object that is visualised.

  • camera_calib_files – Paths to the camera parameter files.

std::array<cv::Mat, N_CAMERAS> draw_cube(const std::array<cv::Mat, N_CAMERAS> &images, const ObjectPose &object_pose, bool fill_faces = false, float opacity = 0.5)

Draw the object into the images at the specified pose.

Parameters:
  • images – Images from the cameras. The images need to be ordered in the same way as the camera calibration parameters that are passed to the constructor.

  • object_posePose of the object.

  • fill_faces – If false (default), only a monochrome wireframe of the object is drawn. If true, the faces of the cuboid are filled with the corresponding colours. The latter allows to verify the orientation (i.e. which face is pointing into which direction) but occludes more of the image.

  • opacity – Opacity of the visualisation (in range [0, 1]).

Returns:

Images with the object visualisation.

std::array<cv::Mat, N_CAMERAS> draw_circle(const std::array<cv::Mat, N_CAMERAS> &images, const ObjectPose &object_pose, bool fill = true, float opacity = 0.5, float scale = 1.0)

Draw a circle into the images enclosing the object at the specified pose.

Parameters:
  • images – Images from the cameras. The images need to be ordered in the same way as the camera calibration parameters that are passed to the constructor.

  • object_posePose of the object.

  • fill – If true a filled circle is drawn with some transparency. If false, only a solid contour is drawn.

  • opacity – Opacity of the visualisation (in range [0, 1]).

  • scale – Scale factor for the circle size. At 1.0 the cube is just fully enclosed.

Returns:

Images with the object visualisation.

inline CubeVisualizer(BaseCuboidModel::ConstPtr cube_model, const std::array<trifinger_cameras::CameraParameters, N_CAMERAS> &camera_params)
Parameters:
  • cube_model – Model of the object that is visualised.

  • camera_params – Camera calibration parameters.

inline CubeVisualizer(BaseCuboidModel::ConstPtr cube_model, const std::array<std::string, N_CAMERAS> &camera_calib_files)
Parameters:
  • cube_model – Model of the object that is visualised.

  • camera_calib_files – Paths to the camera parameter files.

std::array<cv::Mat, N_CAMERAS> draw_cube(const std::array<cv::Mat, N_CAMERAS> &images, const ObjectPose &object_pose, bool fill_faces = false, float opacity = 0.5)

Draw the object into the images at the specified pose.

Parameters:
  • images – Images from the cameras. The images need to be ordered in the same way as the camera calibration parameters that are passed to the constructor.

  • object_posePose of the object.

  • fill_faces – If false (default), only a monochrome wireframe of the object is drawn. If true, the faces of the cuboid are filled with the corresponding colours. The latter allows to verify the orientation (i.e. which face is pointing into which direction) but occludes more of the image.

  • opacity – Opacity of the visualisation (in range [0, 1]).

Returns:

Images with the object visualisation.

std::array<cv::Mat, N_CAMERAS> draw_circle(const std::array<cv::Mat, N_CAMERAS> &images, const ObjectPose &object_pose, bool fill = true, float opacity = 0.5, float scale = 1.0)

Draw a circle into the images enclosing the object at the specified pose.

Parameters:
  • images – Images from the cameras. The images need to be ordered in the same way as the camera calibration parameters that are passed to the constructor.

  • object_posePose of the object.

  • fill – If true a filled circle is drawn with some transparency. If false, only a solid contour is drawn.

  • opacity – Opacity of the visualisation (in range [0, 1]).

  • scale – Scale factor for the circle size. At 1.0 the cube is just fully enclosed.

Returns:

Images with the object visualisation.

Public Static Attributes

static constexpr unsigned int N_CAMERAS = 3