1 #ifndef ED_SENSOR_INTEGRATION_TOOLS_FITTER_VIZ_H_
2 #define ED_SENSOR_INTEGRATION_TOOLS_FITTER_VIZ_H_
11 #include <opencv2/highgui/highgui.hpp>
46 int x_p1 = origin_x + floor(rel_point1.
x * resolution);
47 int y_p1 = origin_y - floor(rel_point1.
y * resolution);
48 int x_p2 = origin_x + floor(rel_point2.
x * resolution);
49 int y_p2 = origin_y - floor(rel_point2.
y * resolution);
51 if (x_p1 < 0 || x_p2 < 0|| x_p1 >= canvas.cols || x_p2 >= canvas.cols)
56 if (y_p1 < 0 || y_p2 < 0|| y_p1 >= canvas.rows || y_p2 >= canvas.rows)
63 cv::Point point1_p(x_p1, y_p1);
64 cv::Point point2_p(x_p2, y_p2);
65 cv::line(canvas, point1_p, point2_p, colour, 1);
80 for (
unsigned int i=0; i < shape.
size(); i++)
82 for (
unsigned int j=0; j < shape[i].
size()-1; j++)
84 drawLine(canvas, shape[i][j], shape[i][j+1], pose, resolution, origin_x, origin_y, colour);
86 drawLine(canvas, shape[i][0], shape[i][shape[0].size()-1], pose, resolution, origin_x, origin_y, colour);
91 int x_p_ent = origin_x + floor(pose.
t.
x * resolution);
92 int y_p_ent = origin_y - floor(pose.
t.
y * resolution);
94 cv::Point Entity_center(x_p_ent, y_p_ent);
95 cv::circle(canvas, Entity_center, 3, colour, cv::FILLED);
127 if (estimateEntityPose)
135 std::cout <<
"Fitted entity not printed in image because of a fitter error" <<
std::endl;
140 uint half_nranges = nranges/2;
141 float fx = fitterdata.
fx;
142 for (
unsigned int i = 0; i < nranges; ++i)
144 float x_m = fitterdata.
sensor_ranges[i] * ((
static_cast< float >(i) - half_nranges) / fx);
157 cv::Point centerCircle(x_p, y_p);
164 #endif // ED_SENSOR_INTEGRATION_TOOLS_FITTER_VIZ_H_