MCPcopy Create free account
hub / github.com/davisking/dlib / preprocess_image

Function preprocess_image

examples/dnn_yolo_train_ex.cpp:134–137  ·  view source on GitHub ↗

In this example, YOLO expects square images, and we choose to transform them by letterboxing them.

Source from the content-addressed store, hash-verified

132
133// In this example, YOLO expects square images, and we choose to transform them by letterboxing them.
134rectangle_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.

Callers 1

mainFunction · 0.85

Calls 3

letterbox_imageFunction · 0.85
rectangle_transformClass · 0.50
invFunction · 0.50

Tested by

no test coverage detected