Class Description
It is used for image processing by providing APIs for image encoding, decoding, resizing, and cropping.
The ImageProcessor object cannot be concurrently used in multiple threads. If multiple threads need to use the same ImageProcessor object, ensure that the lock is mutually exclusive.
The ImageProcessor class involves resource allocation on the device, which conflicts with the scope of MxDeInit. Therefore, the scope of the ImageProcessor class must be smaller than the scope of MxDeInit.
Supported Models
Atlas inference product
Atlas 800I A2 inference product
Actual Image Width and Height and Aligned Image Width and Height
As illustrated in Figure 1, ImageProcessor has some restrictions due to hardware capabilities. To speed up read and write, the height and width of the image are aligned to the specified size, without affecting the valid region, so invalid data is padded rightwards and downwards to align the image to the specified size.
When resizing an image, the ImageProcessor processes the image based on the original height and width of the image.
