/// <summary> /// foamliu, 2009/02/09, 灰度图像膨胀 /// /// </summary> /// <param name="bmp"></param> /// <returns></returns> public static Bitmap GrayValueDilation(Bitmap bmp) { int width, height; int[][] mat, filtered; Bitmap newBmp; ImageConvert.Bitmap2Mat(bmp, out mat, out width, out height); GrayScaleImageLib.Dilation(mat, StructuringElement.N4, out filtered); ImageConvert.Mat2Bitmap(filtered, width, height, out newBmp); return(newBmp); }
public static Bitmap Dilation(Bitmap bmp) { int width, height; int[][][] mat, filtered = new int[3][][]; Bitmap newBmp; ImageConvert.Bitmap2MatColor(bmp, out mat, out width, out height); GrayScaleImageLib.Dilation(mat[0], StructuringElement.N4, out filtered[0]); GrayScaleImageLib.Dilation(mat[1], StructuringElement.N4, out filtered[1]); GrayScaleImageLib.Dilation(mat[2], StructuringElement.N4, out filtered[2]); ImageConvert.Mat2BitmapColor(filtered, width, height, out newBmp); return(newBmp); }