43 auto stamp_top_left = detection_group_stamp.getMin();
44 auto width = detection_group_stamp.
getWidth();
45 auto height = detection_group_stamp.getHeight();
49 bool bad_coordinates =
false;
51 coord1 = measurement_frame_coordinates->worldToImage(
52 detection_frame_coordinates->imageToWorld(
ImageCoordinate(stamp_top_left.m_x, stamp_top_left.m_y)));
53 coord2 = measurement_frame_coordinates->worldToImage(
54 detection_frame_coordinates->imageToWorld(
ImageCoordinate(stamp_top_left.m_x + width, stamp_top_left.m_y)));
55 coord3 = measurement_frame_coordinates->worldToImage(
56 detection_frame_coordinates->imageToWorld(
ImageCoordinate(stamp_top_left.m_x + width, stamp_top_left.m_y + height)));
57 coord4 = measurement_frame_coordinates->worldToImage(
58 detection_frame_coordinates->imageToWorld(
ImageCoordinate(stamp_top_left.m_x, stamp_top_left.m_y + height)));
61 bad_coordinates =
true;
71 min_coord.
m_x = int(min_x);
72 min_coord.
m_y = int(min_y);
73 max_coord.
m_x = int(max_x) + 1;
74 max_coord.
m_y = int(max_y) + 1;
77 if (bad_coordinates || max_coord.
m_x < 0 || max_coord.
m_y < 0 ||
78 min_coord.
m_x >= measurement_frame_info.getWidth() || min_coord.
m_y >= measurement_frame_info.getHeight()) {
85 max_coord.
m_x =
std::min(measurement_frame_info.getWidth() - 1, max_coord.
m_x);
86 max_coord.
m_y =
std::min(measurement_frame_info.getHeight() - 1, max_coord.
m_y);