AspectRatioPostImageInfo

Function

Inherits the PostImageInfo class and adds image resizing properties.

Structure Definition

struct AspectRatioPostImageInfo : PostImageInfo {
    enum ResizeType {
        RESIZER_STRETCHING = 0,
        RESIZER_TF_KEEP_ASPECT_RATIO,
        RESIZER_MS_KEEP_ASPECT_RATIO,
        RESIZER_ONLY_PADDING,
        RESIZER_KEEP_ASPECT_RATIO_LONG,
        RESIZER_KEEP_ASPECT_RATIO_SHORT,
        RESIZER_RESCALE,
        RESIZER_RESCALE_DOUBLE,
        RESIZER_MS_YOLOV4
    };
    float keepAspectRatioScaling = 0;
    ResizeType resizeType;
};

Parameter Description

Parameter

Input/Output

Description

keepAspectRatioScaling

Input

Image resizing ratio

resizeType

Input

Image resizing mode

  • RESIZER_STRETCHING: stretch mode.
  • RESIZER_TF_KEEP_ASPECT_RATIO: Fast R-CNN resizing mode.
  • RESIZER_MS_KEEP_ASPECT_RATIO: proportional resizing.
  • RESIZER_ONLY_PADDING: padding based on the original length and width.
  • RESIZER_KEEP_ASPECT_RATIO_LONG: proportional resizing based on the maximum edge.
  • RESIZER_KEEP_ASPECT_RATIO_SHORT: proportional resizing based on the minimum edge.
  • RESIZER_RESCALE: proportional resizing based on the smaller value of the length and width ratio.
  • RESIZER_RESCALE_DOUBLE: proportional resizing based on the smaller value of the length and width ratio twice.
  • RESIZER_MS_YOLOV4: YOLOv4 resizing mode.