# mindspore::dataset::vision [![View Source On Gitee](./_static/logo_source.png)](https://gitee.com/mindspore/docs/blob/r1.2/docs/api_cpp/source_en/vision.md) ## HWC2CHW \#include <[vision.h](https://gitee.com/mindspore/mindspore/blob/r1.2/mindspore/ccsrc/minddata/dataset/include/vision.h)> ```cpp std::shared_ptr HWC2CHW() ``` Convert the channel of the input image from (H, W, C) to (C, H, W). - Returns Return a HwcToChw operator. ## CenterCrop \#include <[vision_lite.h](https://gitee.com/mindspore/mindspore/blob/r1.2/mindspore/ccsrc/minddata/dataset/include/vision_lite.h)> ```cpp std::shared_ptr CenterCrop(std::vector size) ``` Crop the center area of the input image to the given size. - Parameters - `size`: The output size of the resized image. If the size is a single value, the image will be resized to this value with the same image aspect ratio. If the size has 2 values, it should be (height, width). - Returns Return a CenterCrop operator. ## Crop \#include <[vision_lite.h](https://gitee.com/mindspore/mindspore/blob/r1.2/mindspore/ccsrc/minddata/dataset/include/vision_lite.h)> ```cpp std::shared_ptr Crop(std::vector coordinates, std::vector size) ``` Crop an image based on the location and crop size. - Parameters - `coordinates`: The starting location of the crop. - `size`: Size of the cropped area. - Returns Return a Crop operator. ## Decode \#include <[vision_lite.h](https://gitee.com/mindspore/mindspore/blob/r1.2/mindspore/ccsrc/minddata/dataset/include/vision_lite.h)> ```cpp std::shared_ptr Decode(bool rgb = true) ``` Decode the input image. - Parameters - `rgb`: Whether to decode in RGB mode. - Returns Return a Decode operator. ## Normalize \#include <[vision_lite.h](https://gitee.com/mindspore/mindspore/blob/r1.2/mindspore/ccsrc/minddata/dataset/include/vision_lite.h)> ```cpp std::shared_ptr Normalize(std::vector mean, std::vector std) ``` Normalize the input image with the given mean and standard deviation. - Parameters - `mean`: The mean value to do normalization. - `std`: The standard deviation value to do normalization. - Returns Return a Normalize operator. ## Resize \#include <[vision_lite.h](https://gitee.com/mindspore/mindspore/blob/r1.2/mindspore/ccsrc/minddata/dataset/include/vision_lite.h)> ```cpp std::shared_ptr Resize(std::vector size, InterpolationMode interpolation = InterpolationMode::kLinear) ``` Resize the input image to the given size. - Parameters - `size`: The output size of the resized image. If the size is a single value, the image will be resized to this value with the same image aspect ratio. If the size has 2 values, it should be (height, width). - `interpolation`: An enumeration for the mode of interpolation. - kLinear, Linear interpolation. - kNearestNeighbour, Nearest Interpolation. - kCubic, Bicubic interpolation. - kArea, Area interpolation. - Returns Return a Resize operator.