Matlab中显示Edge的函数
edge(Binary Image图片对象, edge类型[, 阈值 ])
比如 edge(img, 'sobel')
可选的edge有 'sobel', 'prewitt', 'prewitt', 'log', 'roberts', 'zerocross', 'canny'
function showEdge( imgPath , edgeType)
%Show the original image and the edge result in the same window.
close all;
% Read Image
img = imread(imgPath);
% convert to binary image
bi = im2bw(img);
result1=edge(bi, edgeType);
% Show original Image and Edge Image
subplot(1, 2, 1);
imshow(img);
subplot(1, 2, 2);
imshow(result1);
end
比如:
showEdge('a.jpg', 'log');