Customizing Pre-Processing - 3.5 English

Vitis AI Library User Guide (UG1354)

Document ID
Release Date
3.5 English

Before convolution neural network processing, image data generally needs to be pre-processed. The basics of some pre-processing techniques that can be applied to any kind of data are as follows:

  • Mean subtraction
  • Normalization
  • PCA and Whitening

Call the setMeanScaleBGR function to implement the mean subtraction and normalization, as shown in the following figure. See the Vitis-AI/src/vai_library/dpu_task/include/vitis/ai/dpu_task.hpp file for details.

Figure 1. setMeanScaleBGR Example

Call the cv::resize function to scale the image, as shown in the following figure.

Figure 2. cv::resize Example