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/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