RGB888_U8 to RGB (or BGR)

  • Scenario:

    Assume that AIPP inputs an RGB888_U8 image and outputs an RGB image. The input image size is 250 x 250, and the valid data region starts from the (0, 0) pixel coordinates in the upper-left corner. For the original network model, C is 3, and H and W are 240.

  • AIPP configurations involved in this scenario:
    • Enable the cropping (crop) function.
    • Set the horizontal and vertical coordinates (load_start_pos_h and load_start_pos_w) of the cropping start position to 0.
    • Do not need to configure the crop_size_w and crop_size_h parameters. In this case, the width and height of the cropped image size (crop_size[W|H]) are obtained from the width and height of the --input_shape option used during model conversion, and the 240 x 240 region is selected starting from the (0, 0) coordinates.
    • Do not need to configure the rbuv_swap_switch, csc_switch, and corresponding CSC matrix parameters.
  • The following is an example of the AIPP configuration file:
    aipp_op {
        aipp_mode: static
        input_format: RGB888_U8
        csc_switch: false
        related_input_rank: 0
        src_image_size_w: 250
        src_image_size_h: 250
        crop: true
        load_start_pos_w: 0
        load_start_pos_h: 0
        # If the original model requires the BGR format, set rbuv_swap_switch to true.
        rbuv_swap_switch: false
        # The normalization parameters are set as required. In this sample, these parameters are set to default values, so the pixel values are not changed.
        # The configured normalization parameters are applied to channels after channel swap.
    }