18 #ifndef __VISUALIZATION_H__ 19 #define __VISUALIZATION_H__ 25 #include <yarp/os/all.h> 26 #include <yarp/sig/all.h> 27 #include <yarp/dev/all.h> 29 #include <opencv2/opencv.hpp> 40 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> >
portImgIn;
42 yarp::os::BufferedPort<yarp::sig::ImageOf<yarp::sig::PixelRgb> >
portImgOut;
60 yarp::sig::Vector point,point1;
61 yarp::sig::Vector point2D;
62 std::deque<int> Color;
67 yarp::sig::Matrix R,H,K;
71 yarp::os::Mutex mutex;
80 std::deque<yarp::sig::Vector> &
points;
83 yarp::sig::ImageOf<yarp::sig::PixelRgb> *
imgIn;
86 SuperqVisualization(
int rate,
const std::string &_eye,
const std::string &_what_to_plot, yarp::sig::Vector &_x, yarp::sig::Vector &_x_filtered,
87 std::deque<int> &_Color, yarp::dev::IGazeControl *_igaze,
const yarp::sig::Matrix _K, std::deque<yarp::sig::Vector> &_points,
88 const int &_vis_points,
const int &_vis_step);
101 bool showSuperq(yarp::sig::Vector &x_to_show);
108 yarp::sig::Vector
from3Dto2D(
const yarp::sig::Vector &point3D);
131 void setPar(
const std::string &par_name,
const std::string &value);
138 void setPar(
const std::string &par_name,
const int &value);
146 void setColor (
const int &
r,
const int &
g,
const int &
b);
153 void setPar(
const yarp::os::Property &newOptions,
bool first_time);
159 yarp::os::Property
getPar();
yarp::dev::IGazeControl * igaze
Gaze Control interface.
yarp::sig::Vector & superq_filtered
Filtered superquadric.
yarp::os::Property getPar()
Get parameters for visualization.
std::string eye
Eye camera selected.
yarp::sig::Vector from3Dto2D(const yarp::sig::Vector &point3D)
Compute 2D pixels from 3D points.
yarp::sig::Vector & superq
Estimated superquadric.
This class shows the point cloud used for modeling or the estimated superquadric overlapped on the ca...
yarp::os::BufferedPort< yarp::sig::ImageOf< yarp::sig::PixelRgb > > portImgIn
Input image port.
bool showPoints()
Show point cloud on the image.
bool showSuperq(yarp::sig::Vector &x_to_show)
Show reconstructed superquadric on the image.
yarp::sig::ImageOf< yarp::sig::PixelRgb > * imgIn
Input image.
double getTime()
Get time required for visualization.
std::deque< yarp::sig::Vector > & points
Object point cloud.
double t_vis
Time for visualization.
void setColor(const int &r, const int &g, const int &b)
Set color for visualization.
void interruptPorts()
Interrupt ports functionalities.
virtual bool threadInit()
Init function of RateThread.
std::string what_to_plot
String used for deciding what to plot: "points" or "superq".
int vis_step
Number of visualization step.
int r
R value for visualization.
int b
Blue value for visualization.
void setPar(const std::string &par_name, const std::string &value)
Set a given parameter equal to a string.
virtual void run()
Run function of RateThread.
yarp::os::BufferedPort< yarp::sig::ImageOf< yarp::sig::PixelRgb > > portImgOut
Output image port *.
int g
Green value for visualization.
virtual void threadRelease()
Release function of RateThread.
int vis_points
Number of points used for visualization.