Function mindspore::dataset::ExtractChannel
- Defined in File image_process.h 
Function Documentation
- 
bool mindspore::dataset::ExtractChannel(LiteMat &src, LiteMat &dst, int col)
- Extract image channel by index. - 参数
- src – [in] Input image data. 
- dst – [in] Output image data. 
- col – [in] The serial number of the channel. 
 
- 返回
- Return true if transform successfully. 样例
- /* Assume p_rgb is a pointer that points to an image with shape (width, height, channel) */ LiteMat lite_mat_src(width, height, channel, (void *)p_rgb, LDataType::UINT8); LiteMat lite_mat_dst; /* Extract the first channel of image */ ExtractChannel(lite_mat_src, lite_mat_dst, 0); std::cout << lite_mat_dst.width_ << " " << lite_mat_dst.height_ << " " << lite_mat_dst.channel_ << std::endl;