急求 sobel算子检测边缘 Matlab程序代码 sobel算子提取边缘,用边缘点统计直方图代码程序 matl...

\u5173\u4e8e\u56fe\u50cf\u5904\u7406\uff0c\u5229\u7528sobel\u7b97\u5b50\u8fb9\u7f18\u68c0\u6d4b\u7684Matlab\u7a0b\u5e8f

\u8fd9\u5f88\u660e\u663e\u554a\uff0c\u4f60\u6ca1\u6709\u5b9a\u4e49g\u51fd\u6570\u3002\u770b\u4f60\u7a0b\u5e8f\u7684\u610f\u601d\u662f\u5148\u68c0\u6d4b\u51fa\u8fb9\u7f18\uff0c\u56e0\u4e3a\u8fb9\u7f18\u4e2d\u7684\u7ebf\u90fd\u662f\u767d\u8272\u7684\uff0c\u7136\u540e\u5c31\u662f\u7528for \u548c if\u8bed\u53e5\u628a\u8fb9\u7f18\u7ecf\u8fc7\u5904\u7406\uff0c\u4e5f\u5c31\u662f\u5c06\u8fb9\u7f18\u4e2d\u767d\u8272\u70b9\u53d8\u4e3ag,\u8fd9\u5c31\u8981\u770b\u4f60\u5177\u4f53\u60f3\u4ee5\u4f55\u79cd\u65b9\u5f0f\u589e\u5f3a\u4e86\uff0c\u5982\u679c\u662f\u5bf9\u6570\u53d8\u6362\u7684\u8bdd\uff0c\u4f60\u53ef\u4ee5\u5148\u8ba9g(:,:)=log((ps(:,:))+1)\uff08\u5c06\u8fd9\u6761\u8bed\u53e5\u653e\u5728for\u8bed\u53e5\u7684\u4e0a\u9762\uff09;\u8fd9\u6837\u589e\u5f3a\u7684\u7ed3\u679c\u5c31\u662f\u6269\u5c55\u4f4e\u503c\u7070\u5ea6\uff0c\u538b\u7f29\u9ad8\u503c\u7070\u5ea6\uff0c\u5f53\u7136\u4e86\uff0c\u8fd8\u6709\u5f88\u591a\u5176\u5b83\u589e\u5f3a\u65b9\u6cd5\uff0c\u4f60\u53ef\u4ee5\u5177\u4f53\u518d\u627e\u627e\u56fe\u50cf\u589e\u5f3a\u8fd9\u65b9\u9762\u7684\u8d44\u6599\u3002

\u89e3\u51b3\u65b9\u68481\uff1a
\u76f4\u63a5\u7528\u7f09\u9f0e\u5149\u522e\u53f1\u9499\u7678\u6c34\u542b\u60caifft();\u4f8b\u5982\u4fe1\u53f7x
y=fft(x);%\u5bf9\u4fe1\u53f7\u5085\u91cc\u53f6\u53d8\u6362\u5230\u9891\u57df
z=ifft(y);%\u5bf9\u4fe1\u53f7y\u5085\u91cc\u53f6\u53cd\u53d8\u6362\u5230\u65f6\u57df\uff0c

\u89e3\u51b3\u65b9\u68482\uff1a
\u5de5\u5177\u7bb1\u554a\u3002IFFT()\u51fd\u6570

f=imread('peppers.png'); % 读入图像
f=rgb2gray(f); % 灰度转换
f=im2double(f); % 数据类型转换
% 使用垂直Sobel算子,自动选择阈值
[VSFAT Threshold]=edge(f,'sobel','vertical'); % 边缘探测
figure, imshow(f),title('Original Image'), % 显示原始图像
figure,imshow(VSFAT),title('Sobel Filter - Automatic Threshold'); % 显示边缘探测图像
%使用水平和垂直Sobel算子,自动选择阈值
SFST=edge(f,'sobel',Threshold);
figure,imshow(SFST),title('Sobel Filter (Horizontal and Vertical)'); % 显示边缘探测图像
%使用指定45度角Sobel算子滤波器,指定阈值
s45=[-2 -1 0;-1 0 1;0 1 2];
SFST45=imfilter(f,s45,'replicate');
SFST45=SFST45>=Threshold;
figure,imshow(SFST45),title('Sobel Filter (45 Degree)'); % 显示边缘探测图像
%使用指定-45度角Sobel算子滤波器,指定阈值
sm45=[0 1 2;-1 0 1;-2 -1 0];
SFSTM45=imfilter(f,sm45,'replicate');
SFSTM45=SFSTM45>=Threshold;
figure,imshow(SFSTM45),title('Sobel Filter (-45 Degree)'); % 显示边缘探测图像

扩展阅读:sobel算子边缘 计算过程 ... sobel算子的去躁能力 ... sobel算子题目和答案 ... 边缘检测canny ... matlab sobel算子边缘检测 ... sobel算子代码 ... roberts算子边缘检测 ... sobel算子和拉普拉斯算子 ... sobel边缘检测算法步骤 ...

本站交流只代表网友个人观点,与本站立场无关
欢迎反馈与建议,请联系电邮
2024© 车视网