Function mindspore::dataset::GaussianBlur

Function Documentation

bool mindspore::dataset::GaussianBlur(const LiteMat &src, LiteMat &dst, const std::vector<int> &ksize, double sigmaX, double sigmaY = 0.f, PaddBorderType pad_type = PaddBorderType::PADD_BORDER_DEFAULT)

Filter the image by a Gaussian kernel.

Parameters
  • src[in] LiteMat image to be processed. Only LiteMat of type UINT8 is supported now.

  • dst[in] LiteMat image after processing.

  • ksize[in] The size of Gaussian kernel. It should be a vector of size 2 as {kernel_x, kernel_y}, both value of which should be positive and odd.

  • sigmaX[in] The Gaussian kernel standard deviation of width. It should be a positive value.

  • sigmaY[in] The Gaussian kernel standard deviation of height (default=0.f). It should be a positive value, or will use the value of sigmaX.

  • pad_type[in] The padding type used while filtering (default=PaddBorderType::PADD_BORDER_DEFAULT).

    • PaddBorderType.PADD_BORDER_CONSTANT, fills the border with constant values.

    • PaddBorderType.PADD_BORDER_REPLICATE, fills the border with replicate mode.

    • PaddBorderType.PADD_BORDER_REFLECT_101, fills the border with reflect 101 mode.

    • PaddBorderType.PADD_BORDER_DEFAULT, default pad mode, use reflect 101 mode.

Returns

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;

/* Blur image */
GaussianBlur(lite_mat_src, lite_mat_dst, {3, 5}, 3, 3);
std::cout << lite_mat_dst.width_ << " " << lite_mat_dst.height_ << " " << lite_mat_dst.channel_ << std::endl;