Riz*_*606 8 matlab image-processing image-segmentation
我是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',...)
Run Code Online (Sandbox Code Playgroud)

因为您已将问题域呈现为 CT 图像。我有一个很好的建议给你,提取脑组织区域。您可以做出一个很好的假设。
一个很好的假设:大脑区域除了颅骨之外没有任何骨骼(正常情况下),并且根据 CT 的一些特性,您可以通过查找 Hounsfield 轻松提取(或移除)骨骼(在本例中为颅骨)规模(http://en.wikipedia.org/wiki/Hounsfield_scale)
0) 要获得正确的 housefield 单位,您需要三个元素 i) 原始像素值 ii) 重新缩放斜率 iii) 重新缩放截距(所有三个元素都可以位于原始 dicom 标题中,并且 HU 可以根据我们的高中数学知识来计算:y=mx+b,因为您有截距、斜率和输入值)。
1)一旦知道骨头在哪里,您只需减去图像即可得到颅骨周围的任何东西。
2)在查看你的matlab代码后,我确信你可以执行步骤1)从剩余部分中分割出正确的区域。