Package org.photonvision.vision.objects
Class Letterbox
java.lang.Object
org.photonvision.vision.objects.Letterbox
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Letterbox
letterbox
(org.opencv.core.Mat frame, org.opencv.core.Mat letterboxed, org.opencv.core.Size newShape, org.opencv.core.Scalar color) Resize the frame to the new shape and "letterbox" it.resizeDetections
(List<NeuralNetworkPipeResult> unscaled) Resizes the detections to the original frame size.
-
Constructor Details
-
Letterbox
public Letterbox(double dx, double dy, double scale)
-
-
Method Details
-
letterbox
public static Letterbox letterbox(org.opencv.core.Mat frame, org.opencv.core.Mat letterboxed, org.opencv.core.Size newShape, org.opencv.core.Scalar color) Resize the frame to the new shape and "letterbox" it.Letterboxing is the process of resizing an image to a new shape while maintaining the aspect ratio of the original image. The new image is padded with a color to fill the remaining space.
- Parameters:
frame
-letterboxed
-newShape
-color
-- Returns:
-
resizeDetections
Resizes the detections to the original frame size.- Parameters:
unscaled
- The detections to resize- Returns:
- The resized detections
-