
基于canny算子的边缘检测技术 的matlab程序 要程序可以用的 麻烦你了 100
1个回答
展开全部
I=imread(‘yxl.tif’);%读取图像
imshow(I) %显示原图像
BW3=edge(I,' canny',0.2); %canny图像边缘提取
figure,imshow(BW3) %显示canny图像
Canny方法不容易受噪声干扰,能够检测到真正的弱边缘。
下面附上其他的一些程序希望对你有用:
直方图均衡化:
>> I=imread('ck.bmp');
>> J=rgb2gray(I);
>> H=histeq(J); %计算和显示灰度图像J的直方图
>> subplot(2,2,1),imshow(J)
>> subplot(2,2,2),imshow(H)
>> subplot(2,2,3),imhist(J) %显示原始图像直方图
>> subplot(2,2,4),imhist(H) %显示均衡化后图像的直方图
直方图规定化:
>> I=imread('0.jpg');
>> J=histeq(I,32); %均衡化成32个灰度级的直方图
>> [counts,x]=imhist(J); %返回直方图图像向量counts
>> Q=imread('0.jpg');
>> figure,
>> subplot(2,2,1),imshow(Q);
>> subplot(2,2,2),imhist(Q);
>> M=histeq(Q,counts); %将原始图像Q的直方图变成指定向量counts
>> subplot(2,2,3),imshow(M);
>> subplot(2,2,4),imhist(M);
加入各种噪声:
M=imread('dl011.jpg') %读取MATLAB中的名为dl011.jpg的图像
subplot(3,3,1)
imshow(M) %显示原始图像
title('original')
P1=imnoise(M,'gaussian',0.02) %加入高斯躁声
subplot(3,3,2)
imshow(P1) %加入高斯躁声后显示图像
title('gaussian noise');
P2=imnoise(M,'salt & pepper',0.02) %加入椒盐躁声
subplot(3,3,3)
imshow(P2) %%加入椒盐躁声后显示图像
title('salt & pepper noise');
g=medfilt2(P1) %对高斯躁声中值滤波
subplot(3,3,5)
imshow(g)
title('medfilter gaussian')
h=medfilt2(P2) %对椒盐躁声中值滤波
subplot(3,3,6)
imshow(h)
title('medfilter salt & pepper noise')
l=[1 1 1 %对高斯躁声算术均值滤波
1 1 1
1 1 1];
l=l/9;
k=conv2(P1,l)
subplot(3,3,8)
imshow(k,[])
title('arithmeticfilter gaussian')
%对椒盐躁声算术均值滤波
d=conv2(P2,l)
subplot(3,3,9)
imshow(d,[])
title('arithmeticfilter salt & pepper noise')
imshow(I) %显示原图像
BW3=edge(I,' canny',0.2); %canny图像边缘提取
figure,imshow(BW3) %显示canny图像
Canny方法不容易受噪声干扰,能够检测到真正的弱边缘。
下面附上其他的一些程序希望对你有用:
直方图均衡化:
>> I=imread('ck.bmp');
>> J=rgb2gray(I);
>> H=histeq(J); %计算和显示灰度图像J的直方图
>> subplot(2,2,1),imshow(J)
>> subplot(2,2,2),imshow(H)
>> subplot(2,2,3),imhist(J) %显示原始图像直方图
>> subplot(2,2,4),imhist(H) %显示均衡化后图像的直方图
直方图规定化:
>> I=imread('0.jpg');
>> J=histeq(I,32); %均衡化成32个灰度级的直方图
>> [counts,x]=imhist(J); %返回直方图图像向量counts
>> Q=imread('0.jpg');
>> figure,
>> subplot(2,2,1),imshow(Q);
>> subplot(2,2,2),imhist(Q);
>> M=histeq(Q,counts); %将原始图像Q的直方图变成指定向量counts
>> subplot(2,2,3),imshow(M);
>> subplot(2,2,4),imhist(M);
加入各种噪声:
M=imread('dl011.jpg') %读取MATLAB中的名为dl011.jpg的图像
subplot(3,3,1)
imshow(M) %显示原始图像
title('original')
P1=imnoise(M,'gaussian',0.02) %加入高斯躁声
subplot(3,3,2)
imshow(P1) %加入高斯躁声后显示图像
title('gaussian noise');
P2=imnoise(M,'salt & pepper',0.02) %加入椒盐躁声
subplot(3,3,3)
imshow(P2) %%加入椒盐躁声后显示图像
title('salt & pepper noise');
g=medfilt2(P1) %对高斯躁声中值滤波
subplot(3,3,5)
imshow(g)
title('medfilter gaussian')
h=medfilt2(P2) %对椒盐躁声中值滤波
subplot(3,3,6)
imshow(h)
title('medfilter salt & pepper noise')
l=[1 1 1 %对高斯躁声算术均值滤波
1 1 1
1 1 1];
l=l/9;
k=conv2(P1,l)
subplot(3,3,8)
imshow(k,[])
title('arithmeticfilter gaussian')
%对椒盐躁声算术均值滤波
d=conv2(P2,l)
subplot(3,3,9)
imshow(d,[])
title('arithmeticfilter salt & pepper noise')
本回答被网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?

2023-08-15 广告
通常情况下,我们会按照结构模型把系统产生的数据分为三种类型:结构化数据、半结构化数据和非结构化数据。结构化数据,即行数据,是存储在数据库里,可以用二维表结构来逻辑表达实现的数据。最常见的就是数字数据和文本数据,它们可以某种标准格式存在于文件...
点击进入详情页
本回答由光点科技提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询