Updated on 2022-03-13 GMT+08:00

Crop/Padding Configuration

Currently, AIPP supports image resize by crop and padding.

Figure 1 Image resize

For YUV420SP_U8 images, the values of load_start_pos_w, load_start_pos_h, crop_size_w, and crop_size_h4 must be even numbers. The width/height of the cut out image must be the same as W/ H defined in the network input.

A configuration example is as follows:

aipp_op {
    aipp_mode: static
    input_format : YUV400_U8

    src_image_size_w :320
    src_image_size_h :240

    crop :true
    load_start_pos_w :10
    load_start_pos_h :20
    crop_size_w :50
    crop_size_h :60
    
    padding : true
    left_padding_size :10
    right_padding_size :20
    top_padding_size :10
    bottom_padding_size :20
}