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