现在的位置: 首页 > 综合 > 正文

ITK 中几种 区域增长 方法介绍

2017年10月27日 ⁄ 综合 ⁄ 共 3522字 ⁄ 字号 评论关闭

1 Region Growing

区域增长算法的基本思想:先选择一个种子区域(通常为一个像素或一些像素点),认为这个种子区域是在被分割的对象范围之内。所选种子区域的邻域像素会被计算从而决定它是否包含在该种子区域里。如果根据某种准则,种子区域的邻域像素应该包含进来,则该邻域像素会被包含到种子区域中去,然后判断下一个像素点,最终种子区域会越来越大,当所有的像素点判断完毕,分割结束。

根据判断像素点是否位于种子区域内,区域增长算法主要有如下类型:

1.1 Connected Threshold 连通阈值

基本思想:估算像素点的灰度值是否在一个指定的范围内。

类:itk::ConnectedThresholdImageFilter

itk::ConnectedThresholdImageFilter使用了一种叫做Flood
fill iterator
的迭代器。在使用这个类时用户要指定像素值的最小值lower threshold和最大值upper
threshold
,像素值位于lower thresholdupper
threshold
的像素会被认为是位于种子区域内。

如果图像中含有噪声将会影响区域增长能力,所以在进行区域增长分割时,对图像进行一些边缘保持的平滑处理,如使用类itk::CurvatureFlowImageFilter

itk::ConnectedThresholdImageFilter的输出是二进制图像文件,即除了提取的图像区域外,其他区域的像素值均为零。提取的图像区域的像素值可通过方法SetReplaceValue()函数进行设置。另外还要提供一个种子点对这个类进行初始化,也就是通过方法SetSeed(Index)传递该种子的索引值。

缺点:对于不连通的区域,尽管像素值符合要求,也分割不出来。

1.2 Otsu Segmentation

Otsu算法,即大津法,由大津于1979年提出,对图像Image,记t为前景与背景的分割阈值,前景点数占图像比例为w0,平均灰度为u0;背景点数占图像比例为w1,平均灰度为u1。图像的总平均灰度为:u=w0*u0+w1*u1。从最小灰度值到最大灰度值遍历t,当t使得值g=w0*(u0-u)2+w1*(u1-u)2 最大时t即为分割的最佳阈值。对大津法可作如下理解:该式实际上就是类间方差值,阈值t分割出的前景和背景两部分构成了整幅图像,而前景取值u0,概率为w0,背景取值u1,概率为w1,总均值为u,根据方差的定义即得该式。因方差是灰度分布均匀性的一种度量,方差值越大,说明构成图像的两部分差别越大,当部分目标错分为背景或部分背景错分为目标都会导致两部分差别变小,因此使类间方差最大的分割意味着错分概率最小。

类:itk::OtsuThresholdImageFilter

itk::OtsuThresholdImageFilter的方法SetOutsideValue()/SetInsideValue()设置位于阈值范围外/内的像素值;SetNumberOfHistogramBins()设置用于计算分割阈值的直方图的灰度级数。

 

类:itk::OtsuMultipleThresholdsCalculator

itk::OtsuMultipleThresholdsCalculator的作用主要是输入一幅图像的直方图,并且指定要计算的Otsu阈值个数,该类可以计算指定个数的Otsu阈值,使得图像的类间方差(between-class
variance)
最大。而图像的直方图可以通过类itk::Statistics::ScalorImageToHistogramGenerator进行计算。

1.3 Neighborhood Connected

类:itk::NeighborhoodConnectedImageFilter

NeighborhoodConnectedImageFilter与类ConnectedThresholdImageFilter的区别

当一个像素的灰度值位于用户定义的灰度值范围内时,类ConnectedThresholdImageFilter会把它包含到种子区域里去;只有当一个像素的一个像素及其邻域像素的灰度值满足用户定义的灰度范围内时,类NeighborhoodConnectedImageFilter才会把这个像素包含到种子区域中去,邻域的半径大小由用户来设定。

The operation of this filter is equivalent to applying the ConnectedThresholdImageFilter followed by mathematical morphology erosion using a structuring element of the same shape as
the neighborhood provided to the NeighborhoodConnectedImageFilter.

The larger the neighborhood, the more stable this filter will be against noise in the input image, but also the longer the computing time will be.

1.4 Confidence Connected

类:itk::ConfidenceConnectedImageFilter

基本思想:首先计算当前区域中包含的所有像素点的灰度值的期望和标准差,根据用户指定的因子(乘以标准差)计算以期望为中心的灰度值范围。如果邻域像素的灰度值位于这个范围内的话就被包含进种子区域,否则就被排除。当遍历了所有的邻域像素,即认为迭代完成;再进行下一次迭代过程。下一次迭代时,像素点的灰度值期望和标准差是以新的像素区域为基础进行计算的。

式中m指灰度值的期望,σ指标准差,f是用户指定的因子。X是特定的邻域像素,I()指代图像。

1.5 Isolated Connected

类:itk::IsolatedConnectedImageFilter

In this filter two seeds (SetSeed1()/SetSeed2()) and a lower threshold (SetLower()) are provided
by the user. The filter will grow a region connected to the first seed and not connected to the second one. In order to do this, the filter finds an intensity value that could be used as upper threshold for the first seed. A binary search is used to find the
value that separates both seeds.

This filter is intended to be used in cases where adjacent anatomical structures are difficult to separate. Selecting one seed in one structure and the other seed in the adjacent structure
creates the appropriate setup for computing the threshold that will separate both structures.

1.6 Confidence Connected in Vector Images

类:itk::VectorConfidenceConnectedImageFilter

The basic difference between the scalar and vector version is that the vector version uses the covariance matrix (协方差矩阵)
instead of a variance (
方差), and a vector mean (向量期望)
instead of a scalar mean. The membership of a vector pixel value to the region is measured using the Mahalanobis distance as implemented in the class itk::Statistics::MahalanobisDistanceThresholdImageFunction.

form:http://blog.163.com/jacky_ling0/blog/static/137392571201092183013782/

抱歉!评论已关闭.