Customizing Pre-Processing - 2.0 English

Vitis AI Library User Guide (UG1354)

Document ID
UG1354
Release Date
2022-01-20
Version
2.0 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 Vitis-AI/tools/Vitis-AI-Library/dpu_task/include/vitis/ai/dpu_task.hpp 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