【发布时间】:2011-10-05 22:23:56
【问题描述】:
我是 MATLAB 新手,我想知道我可以根据区分颜色(在我的情况下为红色边界)从指定边界内提取图像的一部分,该函数首先跟踪图像的边界,然后它提取该特定边界内的图像部分。我有我的图像(人头图像),我想从头部提取大脑部分,应该忽略图像的其他部分。我试图找到边缘,使用以下代码(它显示 1 表示边界,0 表示无边界),但它只显示 0。
任何帮助将不胜感激。
附:附加的图像显示了原始图像和带边界的图像....代码将处理带边界的图像,并将提取位于该边界内的图像部分。
下面是我试过的代码:
BW = edge(x)
BW = edge(x,'sobel')
BW = edge(x,'sobel',thresh)
BW = edge(x,'sobel',thresh,direction)
[BW,thresh] = edge(x,'sobel',...)
BW = edge(x,'prewitt')
BW = edge(x,'prewitt',thresh)
BW = edge(x,'prewitt',thresh,direction)
[BW,thresh] = edge(x,'prewitt',...)
BW = edge(x,'roberts')
BW = edge(x,'roberts',thresh)
[BW,thresh] = edge(x,'roberts',...)
BW = edge(x,'log')
BW = edge(x,'log',thresh)
BW = edge(x,'log',thresh,sigma)
[BW,threshold] = edge(x,'log',...)
BW = edge(x,'zerocross',thresh,h)
[BW,thresh] = edge(x,'zerocross',...)
BW = edge(x,'canny')
BW = edge(x,'canny',thresh)
BW = edge(x,'canny',thresh,sigma)
[BW,threshold] = edge(x,'canny',...)
【问题讨论】:
标签: matlab image-processing image-segmentation