当前位置:   article > 正文

matlab log边缘检测,[转载]Matlab多种图像边缘检测方法

log算子边缘检测 matlab代码

1、用Prewitt算子检测图像的边缘

I = imread('bacteria.BMP');

BW1 =

edge(I,'prewitt',0.04); % 0.04为梯度阈值

figure(1);

imshow(I);

figure(2);

imshow(BW1);

2、用不同σ值的LoG算子检测图像的边缘

I = imread('bacteria.BMP');

BW1 = edge(I,'log',0.003); % σ=2

imshow(BW1);title('σ=2')

BW1 = edge(I,'log',0.003,3); % σ=3

figure, imshow(BW1);title('σ=3')

3、用Canny算子检测图像的边缘

I = imread('bacteria.BMP');

imshow(I);

BW1 = edge(I,'canny',0.2);

figure,imshow(BW1);

4、图像的阈值分割

I=imread('blood1.tif');

imhist(I); % 观察灰度直方图, 灰度140处有谷,确定阈值T=140

I1=im2bw(I,140/255); %

im2bw函数需要将灰度值转换到[0,1]范围内

figure,imshow(I1);

5、用水线阈值法分割图像

afm = i

本文内容由网友自发贡献,转载请注明出处:https://www.wpsshop.cn/w/盐析白兔/article/detail/846146
推荐阅读
相关标签
  

闽ICP备14008679号