【Matlab学习笔记】【图像滤波去噪】以-4,-8为中心的拉普拉斯滤波器

  • Post author:
  • Post category:其他



以-4,-8为中心的拉普拉斯滤波器:


 %使用中心为-4,-8的拉普拉斯滤波器,
    clc;
    clear all;
    J=imread('eight.tif');  %输入图像
    I=rgb2gray(J);
    subplot(221),imshow(I);
    title('灰度图像');
    w4=[1 1 1;
        1 -4 1;
        1 1 1];
    w8=[1 1 1;
        1 -8 1;
        1 1 1];
    f=im2double(I);
    g4=f-imfilter(f,w4,'replicate');
    g8=f-imfilter(f,w8,'replicate');
    subplot(222),imshow(f);
    title('转换为double型后图像');
    subplot(223),imshow(g4);
    title('中心为-4的拉普拉斯滤波');
    subplot(224),imshow(g8);
    title('中心为-8的拉普拉斯滤波');


实验结果:





转自:


Matlab图像滤波