Class Letterbox

java.lang.Object
org.photonvision.vision.objects.Letterbox

public class Letterbox extends Object
  • 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

      public List<NeuralNetworkPipeResult> resizeDetections(List<NeuralNetworkPipeResult> unscaled)
      Resizes the detections to the original frame size.
      Parameters:
      unscaled - The detections to resize
      Returns:
      The resized detections