# 一种拉普拉斯算子实现数字图像边缘检测

• 虫虫123456
了解作者
• matlab
开发工具
• 427.7KB
文件大小
• rar
文件格式
• 0
收藏次数
• 5 积分
下载积分
• 0
下载次数
• 2022-07-04 22:38
上传日期

aVBGk4VkWk.rar
• 拉普拉斯算子来实现对图像的边缘检测laplacian
• laplacian
• laplacian.m
506B
• LOG_testing_sigma.m
511B
• laplacian.asv
501B
• log_4.m
650B
• building.bmp
100.1KB
• log_5.m
623B
• log_1.m
531B
• log_4.asv
660B
• log_3.m
354B
• log_2.m
188B
• 1.bmp
192.1KB
• blur_log.m
1.9KB
• laplace.m
1.4KB
• test_1.bmp
192.1KB
• coin_2.jpg
42.1KB
• 2.bmp
192.1KB
• log_5.asv
551B
• test_3.bmp
192.1KB
• test_2.bmp
65.1KB
• laplacian_o.asv
210B
• coin.jpg
93.9KB

clear; clc; Orig = imread('D:\MATLAB实验材料\拉普拉斯算子来实现对图像的边缘检测laplacian\laplacian\1.bmp'); I = rgb2gray(Orig); [x,y] = size(I); % to obscure a clear pic LEN=20; THETA=45; PSF=fspecial('motion',LEN,THETA); MF=imfilter(I,PSF,'circular'); [p_5,t_5] = edge(I,'log'); p_5 = double(p_5); MF_t = MF; for i = 1 : (x) for j = 1 : (y) if (p_5(i,j) == 255) for m = 1 : 10 for n = 1 : 10 if(MF(i+m,j+n)>200) MF(i+m,j+n) = MF(i+m,j+n) * 10; if (MF(i+m,j+n)>255) MF(i+m,j+n) = 255; end else MF(i+m,j+n) = MF(i+m,j+n) / 10; if (MF(i+m,j+n)<100) MF(i+m,j+n) = 0; end end if(MF(i-m,j-n)>200) MF(i-m,j-n) = MF(i-m,j-n) * 10; if (MF(i-m,j-n)>255) MF(i-m,j-n) = 255; end else MF(i-m,j-n) = MF(i-m,j-n) / 10; if (MF(i-m,j-n)<100) MF(i-m,j-n) = 0; end end end end end end end figure; subplot(2,2,1);imshow(I);title('original pic'); subplot(2,2,2);imshow(MF_t);title('blurry pic'); subplot(2,2,3);imshow(p_5);title('LOG of clear pic'); subplot(2,2,4);imshow(MF);title('MF strengthened');

相关推荐