Class RGB2GRAY

Inheritance Relationships

Base Type

Class Documentation

class RGB2GRAY : public mindspore::dataset::TensorTransform

RGB2GRAY TensorTransform.

Convert a RGB image or color image to a grayscale one.

说明

Convert RGB image or color image to grayscale image.

Public Functions

RGB2GRAY() = default

Constructor.

Example
/* Define operations */
auto decode_op = vision::Decode();
auto rgb2gray_op = vision::RGB2GRAY();

/* dataset is an instance of Dataset object */
dataset = dataset->Map({decode_op, rgb2gray_op},  // operations
                       {"image"});                // input columns

~RGB2GRAY() = default

Destructor.