ResizedImageInfo

Function

This data structure is added to record the resizing mode during model pre-processing in an image task, which is used for coordinate restoration during model post-processing.

Structure Definition

class ResizedImageInfo {
public:
    
ResizedImageInfo() {}
    ResizedImageInfo(uint32_t wResize, uint32_t hResize, uint32_t wOriginal, uint32_t hOriginal, ResizeType rType,
        float kARScaling) : widthResize(wResize), heightResize(hResize), widthOriginal(wOriginal),
        heightOriginal(hOriginal), resizeType(rType), keepAspectRatioScaling(kARScaling) {}
    uint32_t widthResize = 0;
    uint32_t heightResize = 0;
    uint32_t widthOriginal = 0;
    uint32_t heightOriginal = 0;
    ResizeType resizeType = RESIZER_STRETCHING;
    float keepAspectRatioScaling = 0;
};

Parameter Description

Parameter

Description

widthResize

Width of the resized image, that is, the input width of the model

heightResize

Height of the resized image, that is, the input height of the model

widthOriginal

Image width prior to resizing

heightOriginal

Image height prior to resizing

resizeType

Image resizing mode (enumeration)

  • RESIZER_STRETCHING: stretch mode, which is the default resizing mode.
  • RESIZER_TF_KEEP_ASPECT_RATIO: proportional resizing, corresponding to the Fast R-CNN resizing mode of the TensorFlow framework.
  • RESIZER_MS_KEEP_ASPECT_RATIO: proportionally resizes the image to maximize the area of the specified width and height.

keepAspectRatioScaling

Proportional resizing ratio. This parameter is valid only for proportional resizing.