【发布时间】:2018-05-03 19:50:36
【问题描述】:
我有一个脚本,它获取图像并应用一些边缘检测方法,例如 canny、sobel 和 log。当我运行该文件时,会在边缘为白色的地方绘制一个图形。
有没有办法将边缘的颜色更改为首选颜色?
function cw1
im0 = imread('lighthouse.png');
im = rgb2gray(im0);
im3 = edge(im,'canny');
im4 = edge(im, 'sobel');
im5 = edge(im, 'log');
im2 = my_edge1(im);
subplot(3,2,1), subimage(im); title ('Original'); axis off
subplot(3,2,2), subimage(im2); title ('My Edge'); axis off
subplot(3,2,3), subimage(im3); title ('Canny'); axis off
subplot(3,2,4), subimage(im4); title ('Sobel'); axis off
subplot(3,2,5), subimage(im5); title ('Log'); axis off
end
【问题讨论】:
-
密切相关/重复:Contour detection in MATLAB
标签: image matlab colors matlab-figure edge-detection