我有几张需要找到边缘的图像。我尝试过使用matlab中的vision.EdgeDetector系统对象,并在这里给出了示例:http://www.mathworks.com/help/vision/ref/vision.edgedetectorclass.html
他们给出了一个例子
hedge = vision.EdgeDetector;
hcsc = vision.ColorSpaceConverter('Conversion','RBG to intensity')
hidtypeconv = vision.ImageDataTypeConverter('OutputDataType',single');
img = step(hcsc, imread('picture.png'))
img1 = step(hidtypeconv, ing);
edge = step(hedge,img1);
imshow(edges);我在代码中完全遵循了这一点。
然而,这段代码并没有生成我想要的所有边缘,似乎Matlab只能提取整个图像中大约一半的边缘。有没有不同的方法可以找到所有的边,或者有什么方法可以改进Matlab中的vision.EdgeDetector对象?
发布于 2013-08-21 03:44:24
默认情况下,hedge = vision.EdgeDetector的阈值为20。尝试将其更改为hedge = vision.EdgeDetector(' Threshold ', value ),并尝试使用 value ,看看哪个值最适合您。
发布于 2014-09-13 04:34:48
尝试:
imgGray = rgb2gray(imgRGB);
imgEdge = edge(imgGray,'canny');这将为您提供大多数边缘点,如果不是,则相应地更改参数THRESH和SIGMA。另外,还可以检查以下其他方法:
help edge你不必使用vision.EdgeDetector系统,有些事情没有它们会更容易!;)
https://stackoverflow.com/questions/18255249
复制相似问题