In this example, YOLO expects square images, and we choose to transform them by letterboxing them.
| 132 | |
| 133 | // In this example, YOLO expects square images, and we choose to transform them by letterboxing them. |
| 134 | rectangle_transform preprocess_image(const matrix<rgb_pixel>& image, matrix<rgb_pixel>& output) |
| 135 | { |
| 136 | return rectangle_transform(inv(letterbox_image(image, output))); |
| 137 | } |
| 138 | |
| 139 | // YOLO outputs the bounding boxes in the coordinate system of the input (letterboxed) image, so we need to convert them |
| 140 | // back to the original image. |
no test coverage detected