8

我是 MATLAB 新手,我想知道我可以从指定边界内提取图像的一部分,基于区分颜色(在我的情况下为红色边界),该函数,首先跟踪图像的边界,然后它提取该特定边界内的图像部分。我附上了我的图像(人头图像),我想从头部提取大脑部分,图像的其他部分应该被忽略。我试图找到边缘,使用以下代码(它显示 1 表示边界,0 表示无边界),但它只显示 0。

任何帮助将不胜感激。

附上的 PS 图像显示了原始图像和带边界的图像....代码将处理带边界的图像,并将提取位于该边界内的图像部分。

下面是我试过的代码:

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',...)

在此处输入图像描述

4

2 回答 2

4

因为您已将问题域呈现为 CT 图像。我有一个很好的建议给你提取脑组织区域。你可以做出一个很好的假设。

一个很好的假设:大脑区域除了头盖骨之外没有骨骼(正常情况),并且基于 CT 的某些特性,您可以通过查找 Hounsfield 轻松提取(或移除)骨骼(在这种情况下为头盖骨)规模(http://en.wikipedia.org/wiki/Hounsfield_scale

0)要获得正确的housefield单位,您需要三个元素i)原始像素值ii)重新缩放斜率iii)重新缩放截距(所有三个都可以位于原始dicom标题中,HU可以根据我们的高中数学知识计算:y=mx+b,因为你有截距、斜率和输入值)。

1)一旦你知道骨头在哪里,你只需要减去你的图像来得到任何以颅骨为界的东西。

2)在查看您的 matlab 代码时,我确定您可以执行步骤 1)从剩余部分中分割出正确的区域。

于 2011-07-15T08:55:13.113 回答
3

只是为了记录。数学代码:

在此处输入图像描述

编辑

如果只想提取大脑而不追踪轮廓,其实更简单:

在此处输入图像描述

于 2011-07-16T03:37:55.253 回答