Function mindspore::dataset::Merge

Function Documentation

bool mindspore::dataset::Merge(const std::vector<LiteMat> &mv, LiteMat &dst)

Create a multi-channel image out of several single-channel arrays.

参数
  • mv[in] Single channel data.

  • dst[in] Output image data.

返回

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);
std::vector<LiteMat> lite_mat_dst;

/* Extract all channels of image */
Split(lite_mat_src, lite_mat_dst);

/* Merge all channels to an image */
LiteMat lite_mat_dst2;
Merge(lite_mat_dst, lite_mat_dst2);