37 auto frame_coordinates = frame->getCoordinateSystem();
39 auto detection_frame_coordinates = group.
begin()->getProperty<
DetectionFrame>().getFrame()->getCoordinateSystem();
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 = frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(
ImageCoordinate(
48 stamp_top_left.m_x, stamp_top_left.m_y)));
49 auto coord2 = frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(
ImageCoordinate(
50 stamp_top_left.m_x + width, stamp_top_left.m_y)));
51 auto coord3 = frame_coordinates->worldToImage(detection_frame_coordinates->imageToWorld(
ImageCoordinate(
52 stamp_top_left.m_x + width, stamp_top_left.m_y + height)));
53 auto coord4 = 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;
68 auto frame_image = frame->getSubtractedImage();
71 if (max_coord.
m_x < 0 || max_coord.
m_y < 0 || min_coord.
m_x >= frame_image->getWidth() || min_coord.
m_y >= frame_image->getHeight()) {
78 max_coord.
m_x =
std::min(frame_image->getWidth() - 1, max_coord.
m_x);
79 max_coord.
m_y =
std::min(frame_image->getHeight() - 1, max_coord.
m_y);