b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

canny算子边缘检测_roberts算子边缘检测_canny 正方体

电脑杂谈  发布时间:2017-03-13 21:10:06  来源:网络整理

canny算子边缘检测canny算子边缘检测

canny算子边缘检测,详细地代码,希望对大家有帮助

function CVHomework1

% r = imread('132194.jpg');

% I=rgb2gray(r);

I = imread('rice.png');

BW = canny_edge(I, 1.7);

figure,imshow(I)

figure,imshow(BW)

% Canny边缘检测的函数

% Input:

% a: input image

% sigma: Gaussian的均方差

function e=canny_edge(a,sigma)

a = double(a); % 将图像像素数据转换为double类型

[m,n] = size(a);

e = repmat(logical(uint8(0)),m,n);% 生成初始矩阵

OffGate = 0.0001;

Perc = 0.7;

Th = 0.4;

pw = 1:30;% hardcoding. But it's large enough if sigma isn't too large

canny 正方体_roberts算子边缘检测_canny算子边缘检测

sig2 = sigma * sigma;% 方差

width = max(find(exp(-(pw.*pw)/(2*sig2)) > OffGate));% 寻找截断点

t = (-width:width);

len = 2*width+1;

t3=[t-0.5;t;t+0.5];

dgau = (-t.*exp(-(t.*t)/(2*sig2))/sig2).'; % 一阶高斯函数的导数

ra = size(a,1);% 图像行数

ca = size(a,2);% 图像列数

ay = 255*a;

ax = 255*a';

完整见附件


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/jisuanjixue/article-37358-1.html

    相关阅读
      发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

      热点图片
      拼命载入中...