42 auto stamp_top_left = detection_group_stamp.getTopLeft();
43 auto width = detection_group_stamp.getStamp().
getWidth();
44 auto height = detection_group_stamp.getStamp().getHeight();
47 auto coord1 = measurement_frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(
ImageCoordinate(
48 stamp_top_left.m_x, stamp_top_left.m_y)));
49 auto coord2 = measurement_frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(
ImageCoordinate(
50 stamp_top_left.m_x + width, stamp_top_left.m_y)));
51 auto coord3 = measurement_frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(
ImageCoordinate(
52 stamp_top_left.m_x + width, stamp_top_left.m_y + height)));
53 auto coord4 = measurement_frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(
ImageCoordinate(
54 stamp_top_left.m_x, stamp_top_left.m_y + height)));
63 min_coord.
m_x = int(min_x);
64 min_coord.
m_y = int(min_y);
65 max_coord.
m_x = int(max_x) + 1;
66 max_coord.
m_y = int(max_y) + 1;
69 if (max_coord.
m_x < 0 || max_coord.
m_y < 0 ||
70 min_coord.
m_x >= measurement_frame_info.getWidth() || min_coord.
m_y >= measurement_frame_info.getHeight()) {
77 max_coord.
m_x =
std::min(measurement_frame_info.getWidth() - 1, max_coord.
m_x);
78 max_coord.
m_y =
std::min(measurement_frame_info.getHeight() - 1, max_coord.
m_y);