中值滤波
//中值滤波
private void btn_mediaBlur_Click(object sender, EventArgs e)
{
int num = Convert.ToInt32(numForMediaBlur.Value);
//第三个参数必须为奇数
if ((num % 2) != 0 && ib_original.Image != null)
{
Bitmap bmp = ib_original.Image.Bitmap;
Mat src = new Image<Bgr, byte>(bmp).Mat;
Mat dst = new Mat();
CvInvoke.MedianBlur(src, dst, Convert.ToInt32(numForMediaBlur.Value));
ib_result.Image = dst;
}
else
{
MessageBox.Show("参数只能为奇数");
}
}
均值滤波
//均值滤波
private void btn_blur_Click(object sender, EventArgs e)
{
if (ib_original.Image != null)
{
Bitmap bmp =