CN102855624A - Image segmentation method based on generalized data field and Normalized cut (Ncut) algorithm - Google Patents

Image segmentation method based on generalized data field and Normalized cut (Ncut) algorithm Download PDF

Info

Publication number
CN102855624A
CN102855624A CN2012102656143A CN201210265614A CN102855624A CN 102855624 A CN102855624 A CN 102855624A CN 2012102656143 A CN2012102656143 A CN 2012102656143A CN 201210265614 A CN201210265614 A CN 201210265614A CN 102855624 A CN102855624 A CN 102855624A
Authority
CN
China
Prior art keywords
grid
image
value
sigma
algorithm
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012102656143A
Other languages
Chinese (zh)
Other versions
CN102855624B (en
Inventor
王树良
李英
尹进飞
陈其良
李伟
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Wuhan University WHU
Original Assignee
Wuhan University WHU
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Wuhan University WHU filed Critical Wuhan University WHU
Priority to CN201210265614.3A priority Critical patent/CN102855624B/en
Publication of CN102855624A publication Critical patent/CN102855624A/en
Application granted granted Critical
Publication of CN102855624B publication Critical patent/CN102855624B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Analysis (AREA)

Abstract

本发明提供一种基于广义数据场和Ncut算法的图像分割方法,首先,将特征空间划分为层次网格,第一层网格和第二层网格,同时形成与之对应的网格特征空间Ωs和Ωb,第一层每8个相邻小网格形成第二层的一个大网格;然后通过运用GDF算法基于第二层网格计算得到第一层网格的势值分布。基于势值分布,再将第一层网格进行聚类,聚类结果映射到图像上,从而实现对于一幅图像的初始分割操作,将其划分为不同的彼此不相交的区域;最后,基于图像初始分割的结果构建无向加权图后,运用基于区域的Ncut算法来合并性质相同的区域,直至达到最佳图像分割结果。本发明在图像分割上具有快速、简单、准确的优点。

The present invention provides a kind of image segmentation method based on generalized data field and Ncut algorithm. First, the feature space is divided into hierarchical grids, the first layer grid and the second layer grid, and the corresponding grid feature space is formed at the same time. Ω s and Ω b , every 8 adjacent small grids in the first layer form a large grid in the second layer; then the potential value distribution of the grid in the first layer is calculated based on the grid in the second layer by using the GDF algorithm. Based on the potential value distribution, the first layer of grids is clustered, and the clustering results are mapped to the image, so as to realize the initial segmentation operation for an image and divide it into different mutually disjoint regions; finally, based on After the undirected weighted graph is constructed based on the results of the initial image segmentation, the region-based Ncut algorithm is used to merge regions with the same properties until the best image segmentation result is achieved. The invention has the advantages of fast, simple and accurate image segmentation.

Description

一种基于广义数据场和Ncut算法的图像分割方法An Image Segmentation Method Based on Generalized Data Field and Ncut Algorithm

技术领域 technical field

本发明属于图像处理技术领域,特别涉及一种基于广义数据场和Ncut算法的图像分割方法。The invention belongs to the technical field of image processing, in particular to an image segmentation method based on a generalized data field and an Ncut algorithm.

背景技术 Background technique

图像分割就是将一幅图像划分为有意义且不重合的区域,每块区域几乎具有相同的性质,这是图像处理研究中重要的环节,同时也是计算机视觉中重要的研究课题;目标检测、特征提取、目标识别都依赖准确的图像分割技术,由于图像分割技术作为图像处理中一项基础工作,因此得到了较为广泛的应用,各种分割算法相继被提出。Image segmentation is to divide an image into meaningful and non-overlapping areas, and each area has almost the same properties. This is an important link in image processing research, and it is also an important research topic in computer vision; target detection, feature Both extraction and target recognition rely on accurate image segmentation technology. Since image segmentation technology is a basic work in image processing, it has been widely used, and various segmentation algorithms have been proposed one after another.

在众多分割算法中,非参数聚类是其中最简单且应用最为广范的一种图像分割算法,非参数聚类方法大致可以划分为两类:层次聚类和密度估计;层次聚类技术依据数据点之间的距离进行分类,这样往往导致较高的计算复杂性,以及不能为数据聚类直接定义一个有意义的停止准则,这意味着不同的数据集需要设置不同的停止准则;基于密度估计的非参数聚类的基本原理是在特征空间中用经验概率密度函数描绘数据集的特征分布,特征空间中的密集区域对应密度函数的局部最大值(即顶点),一旦确定了顶点的位置,便可以根据特征空间的局部结构确定聚类结果,例如,mean shift(MS)是一种非参数图像聚类算法,但是单独的MS算法对窗宽参数的选择很敏感,即针对不同的参数设置,该算法的分割结果有差异性很大,而且是一种很耗时的分割算法,因此,在实际运用中,该算法的分割结果可能会出现过多的分割区域、错误的分割以及在分割进程中花费太多的时间。Among many segmentation algorithms, non-parametric clustering is the simplest and most widely used image segmentation algorithm. Non-parametric clustering methods can be roughly divided into two categories: hierarchical clustering and density estimation; hierarchical clustering technology based on The distance between data points is classified, which often leads to high computational complexity, and cannot directly define a meaningful stopping criterion for data clustering, which means that different data sets need to set different stopping criteria; based on density The basic principle of the estimated non-parametric clustering is to use the empirical probability density function to describe the characteristic distribution of the data set in the feature space. The dense area in the feature space corresponds to the local maximum (ie, the vertex) of the density function. Once the position of the vertex is determined , the clustering result can be determined according to the local structure of the feature space, for example, mean shift (MS) is a non-parametric image clustering algorithm, but the individual MS algorithm is very sensitive to the selection of window width parameters, that is, for different parameters setting, the segmentation results of this algorithm are very different, and it is a very time-consuming segmentation algorithm. Therefore, in practical applications, the segmentation results of this algorithm may appear too many segmentation regions, wrong segmentation and in the Too much time is being spent in the splitting process.

在一些提出的算法中,为了改善MS的分割结果,集成了基于图的分割方法,基于图的方法也是图像分割中非常重要的一类,例如有normalized cuts(Ncut),average association,minimum cut等等;在这些方法中,把每个像素点看作一个顶点,相邻的点之间由一条边连接,而两个点的不相似度量作为边的权重,从而构造一个无向加权图,与其他基于图的分割算法相比,Ncut算法的应用较为广泛,为了克服MS图像分割算法的缺点,将MS算法与递归Ncut算法相互结合,称其为MS-Ncut,MS-Ncut算法首先通过MS算法得到包含很多碎块的初始分割图像,然后根据这些过分割的块建立一个无向加权图,采用Ncut算法修正初始分割结果,在Ncut运算过程中,每个结点生成辅助子节点虽然在一定程度上进一步优化了分割结果,但是对于MS-Ncut中出现的问题并没有从根本上解决,而且大大增加了算法的时间复杂度。In some proposed algorithms, in order to improve the segmentation results of MS, graph-based segmentation methods are integrated. Graph-based methods are also a very important category in image segmentation, such as normalized cuts (Ncut), average association, minimum cut, etc. etc.; in these methods, each pixel point is regarded as a vertex, adjacent points are connected by an edge, and the dissimilarity measure of two points is used as the weight of the edge, so as to construct an undirected weighted graph, and Compared with other graph-based segmentation algorithms, the Ncut algorithm is widely used. In order to overcome the shortcomings of the MS image segmentation algorithm, the MS algorithm is combined with the recursive Ncut algorithm, which is called MS-Ncut. The MS-Ncut algorithm first passes the MS algorithm. Obtain an initial segmented image containing many fragments, and then build an undirected weighted graph based on these over-segmented blocks, and use the Ncut algorithm to correct the initial segmentation results. During the Ncut operation, each node generates auxiliary child nodes to a certain extent. The segmentation results are further optimized, but the problems in MS-Ncut are not fundamentally solved, and the time complexity of the algorithm is greatly increased.

发明内容 Contents of the invention

为了得到更好的分割结果,避免出现上述的问题,本发明提出了一种新的图像分割算法—一种基于广义数据场和Ncut算法的图像分割方法,该方法能够通过集成广义数据场GDF与Ncut两种算法,简单、迅速、准确地将一幅图像划分为逻辑上有意义的区域。In order to obtain better segmentation results and avoid the above-mentioned problems, the present invention proposes a new image segmentation algorithm—an image segmentation method based on generalized data field and Ncut algorithm, which can integrate generalized data field GDF and Ncut two algorithms, simply, quickly and accurately divide an image into logically meaningful regions.

为解决上述技术问题,本发明采用如下技术方案:In order to solve the problems of the technologies described above, the present invention adopts the following technical solutions:

1、一种基于广义数据场和Ncut算法的图像分割方法,包括以下步骤,1, a kind of image segmentation method based on generalized data field and Ncut algorithm, comprises the following steps,

步骤1、层次网格的划分以及势值估计,具体包括以下步骤,Step 1, the division of the hierarchical grid and the estimation of the potential value, specifically include the following steps,

步骤1.1、将图像的RGB颜色特征空间转换为L*u*v*或L*a*b*颜色特征空间,将L*u*v*或L*a*b*颜色特征空间Ω划分为2N×2N×2N个小网格作为第一层网格,计算每个小网格内数据点的均值,并以此作为该小网格的特征值,形成一个新的特征空间ΩsStep 1.1, convert the RGB color feature space of the image into L*u*v* or L*a*b* color feature space, and divide the L*u*v* or L*a*b* color feature space Ω into 2N ×2N×2N small grids are used as the first layer of grids, and the mean value of the data points in each small grid is calculated, and this is used as the eigenvalue of the small grid to form a new feature space Ω s ;

步骤1.2将八邻域小网格合并成为一个大网格作为第二层网格,形成一个新的特征空间Ωb及其相应的网格空间坐标值;Step 1.2 Merge the eight-neighborhood small grids into a large grid as the second layer grid to form a new feature space Ω b and its corresponding grid space coordinate values;

步骤1.3根据势值估计公式计算第一层网格内每个小网格的势值

Figure BDA00001919392700021
Step 1.3 Calculate the potential value of each small grid in the first layer grid according to the potential value estimation formula
Figure BDA00001919392700021

Figure BDA00001919392700022
Figure BDA00001919392700022

在特征空间Ωb中,

Figure BDA00001919392700024
表示坐标为(ith,jth,kth)的网格,
Figure BDA00001919392700025
是(ith,jth,kth)网格的质量, f i u j u k u = ( f i u j u k u ( 1 ) , f i u j u k u ( 2 ) , f i u j u k u ( 3 ) ) , w i u j u k u = Q i u j u k u × e - ( x - x i u j u k u σ X ) 2 + ( y - y i u j u k u σ Y ) 2 ,
Figure BDA00001919392700028
是位于网格(ith,jth,kth)内数据点的数量,
Figure BDA00001919392700029
是对应于网格(ith,jth,kth)的空间坐标值,σX和σY是空间影响因子,σ=ch=c(h1,h2,h3)T,σj=chj,j=1、2、3,c是比例常数,h=(h1,h2,h3)T是核密度估计的窗宽,K(x)为单位势函数;In the feature space Ωb ,
Figure BDA00001919392700024
represents a grid with coordinates (i th , j th , k th ),
Figure BDA00001919392700025
is the quality of the (i th , j th , k th ) grid, f i u j u k u = ( f i u j u k u ( 1 ) , f i u j u k u ( 2 ) , f i u j u k u ( 3 ) ) , w i u j u k u = Q i u j u k u × e - ( x - x i u j u k u σ x ) 2 + ( the y - the y i u j u k u σ Y ) 2 ,
Figure BDA00001919392700028
is the number of data points located in the grid (i th , j th , k th ),
Figure BDA00001919392700029
is the spatial coordinate value corresponding to the grid (i th , j th , k th ), σ X and σ Y are the spatial influence factors, σ=ch=c(h 1 , h 2 , h 3 ) T , σ j = ch j , j=1, 2, 3, c is a constant of proportionality, h=(h 1 , h 2 , h 3 ) T is the window width of kernel density estimation, K(x) is a unit potential function;

步骤2、根据小网格的势值分布,对小网格聚类,将聚类结果映射到图像,图像划分为不同的彼此不相交的区域,具体步骤为:Step 2. According to the potential value distribution of the small grid, cluster the small grid, map the clustering result to the image, and divide the image into different regions that do not intersect with each other. The specific steps are:

步骤2.1.对步骤1.3中的公式求偏导,得到公式:Step 2.1. Calculate the partial derivative of the formula in step 1.3 to obtain the formula:

Figure BDA00001919392700031
Figure BDA00001919392700031

Figure BDA00001919392700032
利用其计算第一层网格中每个小网格的偏导,并以此来确定所有的顶点网格,通过六邻域模式组合顶点网格来描绘聚类{Ck}k=1,…,v,其中Ck至少包含一个顶点网格;
Figure BDA00001919392700032
Use it to calculate the partial derivative of each small grid in the first layer grid, and use this to determine all vertex grids, and combine the vertex grids through the six-neighborhood mode to describe the cluster {C k } k=1, ..., v , where C k contains at least one vertex mesh;

步骤2.2对于每一个k=1,2,…,v,聚类Ck中的顶点网格作为初始数据点,沿着梯度值上升的方向搜索网格,直到梯度值不再上升即为止,将沿路搜索到的小网格划分到聚类Ck中;Step 2.2 For each k=1, 2, ..., v, the vertex grid in the cluster C k is used as the initial data point, and the grid is searched along the direction of gradient value increase until the gradient value no longer increases, that is, So far, the small grids searched along the road are divided into clusters C k ;

步骤2.3搜索完毕后,对于每一个聚类Ck,k=1,2,…,v,将每一聚类内所有的数据点映射到图像上,并合并在空间上数据点个数少于M(20≤M≤100)个点的图像碎块,一幅图像被划分为R块不重合的初始区域Ωi,i=1,2,…,R;After the search in step 2.3, for each cluster C k , k=1, 2, ..., v, map all the data points in each cluster to the image, and combine the number of data points less than Image fragments of M (20≤M≤100) points, an image is divided into an initial area Ω i where R blocks do not overlap, i=1, 2, ..., R;

步骤3、运用基于区域的Ncut算法合并过分分割的区域;其中所用到的计算权重矩阵W的公式为:Step 3. Use the region-based Ncut algorithm to merge over-segmented regions; the formula used to calculate the weight matrix W is:

ww (( ii ,, jj )) ==

11 nno ii ΣΣ ff ∈∈ ΩΩ ii ee -- [[ || || ff -- Ff jj || || σσ II ]] 22 ++ 11 nno jj ΣΣ ff ∈∈ ΩΩ jj ee -- [[ || || ff -- Ff ii || || σσ II ]] 22 00 ..

2、根据权利要求1所述的一种基于广义数据场和Ncut算法的图像分割方法,其特征在于:所述步骤3具体包括以下步骤,2. A method for image segmentation based on generalized data field and Ncut algorithm according to claim 1, characterized in that: said step 3 specifically comprises the following steps,

步骤3.1基于步骤2.3中得到的不重和的初始区域构建一个无向加权图G=(V,E,W),V是图像的顶点,E是连接顶点的边的集合,W是权重矩阵,根据公式 w ( i , j ) = Step 3.1 constructs an undirected weighted graph G=(V, E, W) based on the initial region obtained in step 2.3, where V is the vertex of the image, E is the set of edges connecting the vertices, W is the weight matrix, According to the formula w ( i , j ) =

11 nno ii ΣΣ ff ∈∈ ΩΩ ii ee -- [[ || || ff -- Ff jj || || σσ II ]] 22 ++ 11 nno jj ΣΣ ff ∈∈ ΩΩ jj ee -- [[ || || ff -- Ff ii || || σσ II ]] 22 00

计算权重矩阵W;Calculate the weight matrix W;

步骤3.2通过权重矩阵W计算对角矩阵D,Step 3.2 calculates the diagonal matrix D through the weight matrix W,

其中D(i,i)=∑j w(i,j);where D(i, i) = ∑ j w(i, j);

步骤3.3解方程(D-W)y=λDy,得到特征值和相应的特征向量,确定第二小的特征向量;Step 3.3 solves equation (D-W) y=λDy, obtains eigenvalue and corresponding eigenvector, determines the second smallest eigenvector;

步骤3.4根据公式

Figure BDA00001919392700043
找出分割点,即Ncut值最小时的点,用第二小的特征向量二分图的顶点,将图像分割为两个子图;Step 3.4 According to the formula
Figure BDA00001919392700043
Find the segmentation point, that is, the point where the Ncut value is the smallest, and use the vertices of the second smallest eigenvector bipartite graph to divide the image into two subgraphs;

步骤3.5对于二分割得到的子图,分别计算权重矩阵,并重复步骤3.2至3.4;In step 3.5, for the subgraphs obtained by the two-partition, calculate the weight matrix respectively, and repeat steps 3.2 to 3.4;

步骤3.6重复步骤3.5,直到Ncut值超出给定的阀值。Step 3.6 Repeat step 3.5 until the Ncut value exceeds the given threshold.

下面分别对本发明所用的理论或原理进行介绍:Theories or principles used in the present invention are introduced respectively below:

受到物理场的启发,物质的微粒子之间的相互作用和描述被引入到抽象的数学领域,于是形成了数据场;数据通过数据辐射将其数据能量从样本空间辐射到整个母体空间,接受数据能量并被数据辐射所覆盖的空间,叫做数据场;数据场可视为一个充满数据能量的空间,数据通过自己的数据场,对场中的另一数据发射能量;数据场中的数据点之间会相互辐射能量,这些能量相互叠加形成数据场的势;已知空间

Figure BDA00001919392700044
中包含n个对象的数据集D={x1,x2,…,xn}。认为每个对象具有一定质量的质点或核子,其周围存在一个作用场,位于场内的任何对象都将受到其他对象的联合作用,由此在整个空间上确定了一个数据场。数据场中任一点x∈Ω的势值可以表示为Inspired by the physical field, the interaction and description between the particles of matter are introduced into the abstract mathematical field, thus forming a data field; the data radiates its data energy from the sample space to the entire matrix space through data radiation, and accepts the data energy The space covered by data radiation is called the data field; the data field can be regarded as a space full of data energy, and the data transmits energy to another data in the field through its own data field; between data points in the data field will radiate energy to each other, and these energies are superimposed on each other to form the potential of the data field; the known space
Figure BDA00001919392700044
A dataset D={x 1 ,x 2 ,…,x n } containing n objects in . It is considered that each object has a particle or nucleus with a certain mass, and there is an action field around it, and any object located in the field will be jointly affected by other objects, thus determining a data field in the entire space. The potential value of any point x∈Ω in the data field can be expressed as

其中K(x)为单位势函数。σ用于控制对象间的相互作用力程,称为影响因子。借鉴核密度估计中核满足的条件,K(x)应当满足:∫K(x)dx=1,∫xK(x)dx=0,0<R(K)=∫K(x)2dx<∞.质量mi,mi≥0为对象Xi的质量,假设满足归一化条件和一定的收敛性,即有where K(x) is the unit potential function. σ is used to control the interaction force range between objects, which is called influence factor. Referring to the conditions satisfied by the kernel in kernel density estimation, K(x) should satisfy: ∫K(x)dx=1, ∫xK(x)dx=0, 0<R(K)=∫K(x) 2 dx<∞ .The mass m i , m i ≥ 0 is the mass of the object Xi , assuming that the normalization condition and certain convergence are met, that is,

&Sigma;&Sigma; ii == 11 nno mm ii == 11 ,, mm ii &GreaterEqual;&Greater Equal; 00 andand limlim nno &RightArrow;&Right Arrow; &infin;&infin; nsupnsup 11 &le;&le; ii &le;&le; nno {{ mm ii }} == 11 ..

在多维数据场中,整个数据场中的势函数估计(1)中影响因子σ在不同维上取值相同,这意味着每个观测数据点的能量分布向各个方向均匀散开。但是通常情况下,不同维的数据具有不同的属性。σ应当是各向异性的,即σ的取值在不同方向上是不同的。此外,当数据在不同方向上有不同的变异性,或数据几乎位于一个低维流形上时,认为各个方向都有同样的尺度得到的估计往往不太理想。因此,在多维数据场中,为了得到更好的数据场势函数估计,我们通过矩阵H来取代影响因子σ,给出了广义数据场势函数估计。其公式为:In a multidimensional data field, the influence factor σ in the potential function estimation (1) in the entire data field takes the same value in different dimensions, which means that the energy distribution of each observed data point spreads out uniformly in all directions. But usually, data of different dimensions have different properties. σ should be anisotropic, that is, the value of σ is different in different directions. In addition, when the data have different variability in different directions, or the data lie almost on a low-dimensional manifold, the estimation obtained by assuming that all directions have the same scale is often not ideal. Therefore, in the multi-dimensional data field, in order to obtain a better estimate of the data field potential function, we replace the influence factor σ by the matrix H, and give a generalized data field potential function estimate. Its formula is:

Figure BDA00001919392700052
Figure BDA00001919392700052

其中,H为与影响因子有关的p×p正定常数阵,P表示多维空间的维数,P=1、2、3;为了方便,取H=σA,其中σ>0,|A|=1。势函数K为实值多维数据场势函数。为了便于计算,取H为正定三角矩阵,基于(3)式的一种简化势函数估计Among them, H is a p×p positive constant matrix related to the impact factor, P represents the dimension of multidimensional space, P=1, 2, 3; for convenience, H=σA, where σ>0,|A|=1 . The potential function K is a real-valued multidimensional data field potential function. For the convenience of calculation, H is taken as a positive definite triangular matrix, and a simplified potential function estimation based on (3)

Figure BDA00001919392700053
Figure BDA00001919392700053

其中σj为第j维的影响因子。例如,如果数据对象是二维的,则,j=1,2。Where σ j is the impact factor of the jth dimension. For example, if the data object is two-dimensional, j=1,2.

本发明提出了一种新型的聚类算法,该算法基于分层网格结构势值估计,该算法能有效提高运算速度,称之为下山法;对比爬山法聚类过程,第一步是发现势值估计的顶点(极大值点),合并位于六领域内的顶点,作为每一类的聚类中心,然后沿着聚类中心搜索网格以此来发现聚类,最后所有含有数据点的网格被分到一个聚类中;本发明采用的聚类过程是从山顶点出发不断向下移动,直到梯度不再增加为止;势值的顶点是位于0点的梯度值,即

Figure BDA00001919392700054
The present invention proposes a new type of clustering algorithm, which is based on the estimation of the potential value of the layered grid structure. The vertices (maximum points) of the potential value estimation, merge the vertices located in the six domains, as the cluster center of each class, and then search the grid along the cluster center to find the cluster, and finally all the data points containing The grid of is divided into a cluster; the clustering process that the present invention adopts starts from the top of the mountain and moves downward continuously until the gradient no longer increases; the vertex of the potential value is the gradient value at 0, that is
Figure BDA00001919392700054

一副图像的分割可以选择在各种不同的色彩空间下执行,对于提出的算法,有必要选择一个最合适的彩色空间分割图像,以达到最优的分割效果。目前,在图像分割领域最普遍采用L*u*v*与L*a*b*两种颜色空间,这是因为通过L*u*v*和L*a*b*空间显示的色彩差异与特征空间中欧式几何距离所表达的色彩差异相一致;在上述两种情况中,L*都表示亮度坐标,唯一的区别是色度坐标有所不同。对于新提出来的算法,两种颜色空间上得到的结果并没有明显的区别,因此可以选取在任一色彩空间上分割图像。本发明采用L*u*v*颜色空间作为特征空间完成图像分割过程。The segmentation of an image can be performed in various color spaces. For the proposed algorithm, it is necessary to select the most suitable color space to segment the image in order to achieve the optimal segmentation effect. At present, L*u*v* and L*a*b* two color spaces are most commonly used in the field of image segmentation, because the color difference displayed by the L*u*v* and L*a*b* space is different from that of The color difference expressed by the Euclidean geometric distance in the feature space is consistent; in the above two cases, L* represents the luminance coordinate, and the only difference is that the chromaticity coordinate is different. For the newly proposed algorithm, there is no obvious difference in the results obtained in the two color spaces, so you can choose to segment the image in any color space. The present invention uses the L*u*v* color space as the feature space to complete the image segmentation process.

1.层次网格划分1. Hierarchical grid division

无监督聚类算法在事先不知道聚类个数的前提下,基于样本中数据点之间的内在距离将输入数据点分为多个类,即,那些在距离上相近的数据点最有可能被归为同一类;因此,为了降低算法的复杂度,我们在特征空间划分网格,网格内的点被提前看作属于同一类;具体来说,在特征空间形成多维的网格结构,每一个特征数据点都被投入其中一个确定的小网格内。例如,一个三维颜色空间,数据对象可以映射到N1×N2×N3的网格矩阵中;位于同一网格的数据点被认为属于一类。The unsupervised clustering algorithm divides the input data points into multiple classes based on the intrinsic distance between the data points in the sample without knowing the number of clusters in advance, that is, those data points with similar distances are the most likely are classified into the same class; therefore, in order to reduce the complexity of the algorithm, we divide the grid in the feature space, and the points in the grid are regarded as belonging to the same class in advance; specifically, a multi-dimensional grid structure is formed in the feature space, Each feature data point is put into one of the determined small grids. For example, in a three-dimensional color space, data objects can be mapped into an N 1 ×N 2 ×N 3 grid matrix; data points located in the same grid are considered to belong to a class.

本发明将特征空间划分为两层网格,其中第二层网格结构的划分是基于第一次网格划分的结果。首先将特征空间划分为体积为2N×2N×2N的小网格结构作为第一层网格划分,再将每个相邻的八邻域小网格合并成为一个大网格,并以此作为第二层网格。The present invention divides the feature space into two layers of grids, wherein the division of the second layer grid structure is based on the result of the first grid division. First, the feature space is divided into a small grid structure with a volume of 2N×2N×2N as the first layer of grid division, and then each adjacent eight-neighborhood small grid is merged into a large grid, and this is used as Second layer grid.

2.势值估计2. Potential value estimation

利用特征空间的分层网格结构,本发明提出了一个新的势值估计方法。将特征空间Ω划分为2N×2N×2N个小网格对象,计算每个小网格内数据点的均值,并以此作为该小网格的特征值,于是基于特征空间Ω形成了一个新的特征空间Ωs,对应空间坐标轴的算术平均值作为网格的空间坐标值;然后合并八邻域小网格成为一个大网格作为第二层网格,于是得到一个新的特征空间Ωb及其相应的网格空间坐标值;对于特征空间Ωb,用

Figure BDA00001919392700071
表示坐标为(ith,jth,kth)的网格,Utilizing the hierarchical grid structure of the feature space, the present invention proposes a new potential value estimation method. Divide the feature space Ω into 2N×2N×2N small grid objects, calculate the mean value of the data points in each small grid, and use it as the eigenvalue of the small grid, then form a new grid object based on the feature space Ω The characteristic space Ω s of the corresponding spatial coordinate axis is used as the spatial coordinate value of the grid; then the eight-neighborhood small grids are merged into a large grid as the second layer grid, and a new feature space Ω is obtained b and its corresponding grid space coordinates; for the feature space Ω b , use
Figure BDA00001919392700071
represents a grid with coordinates (i th , j th , k th ),

其中

Figure BDA00001919392700072
Figure BDA00001919392700073
是(ith,jth,kth)网格的质量。因此对于任意的 &ForAll; f = ( f ( 1 ) , f ( 2 ) , f ( 3 ) ) T &Element; &Omega; s , 空间坐标为(x,y),势值估计公式为:in
Figure BDA00001919392700072
Figure BDA00001919392700073
is the quality of the (i th , j th , k th ) grid. Therefore for any &ForAll; f = ( f ( 1 ) , f ( 2 ) , f ( 3 ) ) T &Element; &Omega; the s , The space coordinates are (x, y), and the potential value estimation formula is:

其中, w i u j u k u = Q i u j u k u &times; e - ( x - x i u j u k u &sigma; X ) 2 + ( y - y i u j u k u &sigma; Y ) 2 ,

Figure BDA00001919392700077
是位于网格(ith,jth,kth)内数据点的数量,
Figure BDA00001919392700078
对应于网格(ith,jth,kth)的空间坐标值,σX和σY是空间影响因子。通过模拟物理学中核场的势值分布得到K(·),K(·)与高斯核函数成比例;为了提高该算法的准确性,影响因子σ应该针对不同维设置不同的值;多元势值函数K定义作为3个一维势值函数的乘积。in, w i u j u k u = Q i u j u k u &times; e - ( x - x i u j u k u &sigma; x ) 2 + ( the y - the y i u j u k u &sigma; Y ) 2 ,
Figure BDA00001919392700077
is the number of data points located in the grid (i th , j th , k th ),
Figure BDA00001919392700078
Corresponding to the spatial coordinate values of the grid (i th , j th , k th ), σ X and σ Y are spatial influencing factors. K(·) is obtained by simulating the potential value distribution of the nuclear field in physics, and K(·) is proportional to the Gaussian kernel function; in order to improve the accuracy of the algorithm, the influencing factor σ should be set to different values for different dimensions; multivariate potential value The function K is defined as the product of 3 one-dimensional potential functions.

因为势值估计类似于核密度估计,通过设置影响因子σ能够改善算法性能,σ是网格宽度h的倍数,即:σ=ch=c(h1,h2,h3)T,其中c是比例常数,h=(h1,h2,h3)T是核密度估计的窗宽;用户可以自适应地调节c的值,从而获得不同层次的图像分割结果;h值可以通过使用Sheather-Jones插入法获得。Because the potential value estimation is similar to the kernel density estimation, the performance of the algorithm can be improved by setting the influence factor σ, σ is a multiple of the grid width h, that is: σ=ch=c(h 1 , h 2 , h 3 ) T , where c is a constant of proportionality, h=(h 1 , h 2 , h 3 ) T is the window width of kernel density estimation; the user can adjust the value of c adaptively to obtain image segmentation results of different levels; the value of h can be obtained by using Sheather - Obtained by Jones insertion.

3.聚类算法3. Clustering algorithm

本发明提出了一种新的聚类算法,该算法基于网格结构的势值分布,能够有效提高运算速度,称之为下山法。对比爬山法聚类过程,第一步是发现势值估计的顶点即极大值点,然后没着每个顶点向下搜索以此来发现聚类,最后所有的小网格被聚类。多峰值性与任意形状的聚类是特征空间的特有属性,本发明提出的聚类过程是从山顶出发不断向下移动,直到梯度值不再增加为止,势值的顶点是位于0点的梯度值,即

Figure BDA00001919392700079
The invention proposes a new clustering algorithm, which is based on the potential value distribution of the grid structure and can effectively improve the operation speed, which is called the downhill method. Compared with the clustering process of the hill-climbing method, the first step is to find the vertex of the potential value estimation, that is, the maximum point, and then search downwards without each vertex to find clusters, and finally all the small grids are clustered. Multi-peak and arbitrary-shape clustering are unique properties of the feature space. The clustering process proposed by the present invention starts from the top of the mountain and moves downward continuously until the gradient value no longer increases. The apex of the potential value is the gradient at point 0 value, ie
Figure BDA00001919392700079

Figure BDA00001919392700081
Figure BDA00001919392700081

Figure BDA00001919392700082
Figure BDA00001919392700082

从任意一个顶点出发,按照梯度值增加的方向不断搜索,顶点以及被搜索的小网格归为一个聚类。在下山法过程中,不像爬山法,没有出现重复搜索相同的小网格,因此简化了搜索的过程。Starting from any vertex, search continuously according to the increasing direction of the gradient value, and the vertex and the small grid being searched are classified into a cluster. In the downhill method, unlike the hillclimb method, there is no repeated search of the same small grid, thus simplifying the search process.

4.基于区域的Ncut算法4. Region-based Ncut algorithm

图像分割可以被看作是一个图的最优分割。在一张图像上构造一个无向加权G=(V,E,W),V是图像的顶点,E是连接顶点的边的集合,W是权重矩阵;每条边上的权重w(u,v)是顶点u和v相似性测量函数,这个构造的图通过最小化cut值,被分为两个不相交的子图A和B,cut被定义如下:Image segmentation can be viewed as an optimal segmentation of a graph. Construct an undirected weighted G=(V, E, W) on an image, V is the vertex of the image, E is the set of edges connecting the vertices, W is the weight matrix; the weight w on each edge (u, v) is the similarity measure function of vertices u and v, this constructed graph is divided into two disjoint subgraphs A and B by minimizing the value of cut, cut is defined as follows:

cut(A,B)=∑u∈A,v∈Bw(u,v).cut(A, B) = ∑ u ∈ A, v ∈ B w(u, v).

然而上述公式最小化cut标准倾向于划分出许多孤立的顶点,为了克服这个缺点,标准的cut,即Ncut算法被提出,定义如下:However, the above formula minimizes the cut standard and tends to divide many isolated vertices. In order to overcome this shortcoming, the standard cut, namely the Ncut algorithm, is proposed and defined as follows:

NcutNcut (( AA ,, BB )) == cutcut (( AA ,, BB )) assocassoc (( AA ,, VV )) ++ cutcut (( AA ,, BB )) assocassoc (( BB ,, VV ))

最小化上述Ncut公式,得到最优划分,上述公式用矩阵的形式重新表示为:Minimize the above Ncut formula to obtain the optimal division, and the above formula is re-expressed in matrix form as:

minmin xx NcutNcut (( xx )) == ythe y TT (( DD. -- WW )) ythe y ythe y TT DyDy

其中D为对角矩阵,D(i,i)=∑j w(i,j),本发明利用GDF算法得到的初始块构建图G=(V,E,W),把每一块看作一个节点,每对相邻的节点通过一条边连接,边上权重反映两块区域属性的相似性,即属于图像中同一对象的可能性;假定一副图像被分割成N个不重合的区域Ωi(i=1,2,…,R),该区域包含了ni个特征数据点,Fi(i=1,2,…,R)对应于每个区域Ωi中的数据点的平均值,每条边的权重值能够通过计算相邻区域的相似性得到,i块与j块的权重即为Wherein D is a diagonal matrix, D (i, i)=∑ j w (i, j), the present invention utilizes the initial block construction graph G=(V, E, W) that GDF algorithm obtains, regards each block as a Each pair of adjacent nodes is connected by an edge, and the weight on the edge reflects the similarity of the attributes of the two regions, that is, the possibility of belonging to the same object in the image; suppose an image is divided into N non-overlapping regions Ω i (i=1, 2,..., R), this region contains n i feature data points, F i (i=1, 2,..., R) corresponds to the average value of the data points in each region Ω i , the weight value of each edge can be obtained by calculating the similarity of adjacent regions, and the weight of block i and block j is

ww (( ii ,, jj )) ==

11 nno ii &Sigma;&Sigma; ff &Element;&Element; &Omega;&Omega; ii ee -- [[ || || ff -- Ff jj || || &sigma;&sigma; II ]] 22 ++ 11 nno jj &Sigma;&Sigma; ff &Element;&Element; &Omega;&Omega; jj ee -- [[ || || ff -- Ff ii || || &sigma;&sigma; II ]] 22 ifif &Omega;&Omega; ii andand &Omega;&Omega; jj areadjacentarea jacent 00 otherwiseotherwise

其中,‖.‖是求矢量的值,σI是固定的影响因子。Among them, ‖.‖ is the value of the vector, and σ I is a fixed influence factor.

与现有技术相比,本发明采用的广义数据场GDF与Ncut算法结合的图像分割方法,其采用网格划分进行聚类,并采用基于块的Ncut算法把图像分割成具有不同特征意义的块,降低了时间复杂度,大大提高了分割的运行速度,使图像的分割速度更快、更精确。Compared with the prior art, the image segmentation method combined with the generalized data field GDF and the Ncut algorithm adopted in the present invention adopts grid division for clustering, and uses the block-based Ncut algorithm to segment the image into blocks with different characteristic meanings , reduces the time complexity, greatly improves the running speed of the segmentation, and makes the image segmentation faster and more accurate.

附图说明 Description of drawings

图1是本发明的流程图;Fig. 1 is a flow chart of the present invention;

图2是本发明实施例的原始图;Fig. 2 is the original figure of the embodiment of the present invention;

图3是本发明的设置界面图;Fig. 3 is a setting interface diagram of the present invention;

图4是本发明实施例的L*u*v*特征空间集合图;Fig. 4 is an L*u*v* feature space collection diagram of an embodiment of the present invention;

图5是本发明实施例的基于网格的特征空间的集合图;Fig. 5 is a set diagram of a grid-based feature space according to an embodiment of the present invention;

图6是本发明实施例的通过使用GDF算法完成的聚类结果图;FIG. 6 is a clustering result diagram completed by using the GDF algorithm according to an embodiment of the present invention;

图7是本发明实施例的通过使用GDF算法完成的聚类结果图;FIG. 7 is a clustering result diagram completed by using the GDF algorithm according to an embodiment of the present invention;

图8是本发明实施例的初始图像分割结果图;Fig. 8 is an initial image segmentation result diagram of an embodiment of the present invention;

图9是本发明实施例的范围域层次的Ncut算法产生的权重图;FIG. 9 is a weight diagram generated by the Ncut algorithm of the range domain hierarchy according to an embodiment of the present invention;

图10是本发明实施例的最终图像分割结果图;Fig. 10 is the final image segmentation result figure of the embodiment of the present invention;

图11是本发明与其他经典图像分割算法的对比试验图;Fig. 11 is the comparative test figure of the present invention and other classical image segmentation algorithms;

图12是本发明与其他经典图像分割算法运行时对比结果。Fig. 12 is the running-time comparison result of the present invention and other classical image segmentation algorithms.

具体实施方式 Detailed ways

下面结合附图所示的实施例对本发明作进一步说明。The present invention will be further described below in conjunction with the embodiments shown in the accompanying drawings.

以附图2为例,在分割图像前需要做的准备工作:首先,将彩色图像kingfisher.jpg数据点的坐标(x,y)处理成RGB三色值,并以文本文件形式保存数据点RGB坐标值;然后读取文本文件,获取该图像所有数据点的RGB颜色值,并将该值映射到图像空间,形成完整的图像显示出来,同时统计数据点的个数为122500个。原始图像的大小是350×350;最后输入算法参数,默认情况下,单边小网格数2N=12,大网格维度数=2,特征空间Simga-L=C=2.1,特征空间Simga-U=C=2.1,特征空间Simga-V=C=2.1,坐标空间Simga-X=70,坐标空间Simga-Y=70,聚类平滑阂值M=40,分块Simga-Matrix=15,辅助结点个数=3,Ncut分割阂值=0.25,*(times of)的三个值分别为4.8054、2.6593、4.8318,分别表示h1、h2、h3,如图3所示。Taking the attached picture 2 as an example, the preparatory work that needs to be done before segmenting the image: First, process the coordinates (x, y) of the data point of the color image kingfisher.jpg into RGB three-color values, and save the data point RGB in the form of a text file Coordinate value; then read the text file, get the RGB color value of all data points of the image, and map the value to the image space to form a complete image to display, and the number of statistical data points is 122,500. The size of the original image is 350×350; finally input the algorithm parameters, by default, the number of unilateral small grids 2N=12, the number of large grid dimensions=2, the feature space Simga-L=C=2.1, the feature space Simga- U=C=2.1, feature space Simga-V=C=2.1, coordinate space Simga-X=70, coordinate space Simga-Y=70, clustering smoothing threshold M=40, block Simga-Matrix=15, auxiliary The number of nodes = 3, the Ncut segmentation threshold = 0.25, and the three values of *(times of) are 4.8054, 2.6593, and 4.8318, representing h 1 , h 2 , and h 3 , as shown in FIG. 3 .

具体的分割方法包括以下步骤:The specific segmentation method includes the following steps:

步骤1、  层次网格的划分以及势值估计,具体包括以下步骤,Step 1, the division of the hierarchical grid and the estimation of the potential value, specifically include the following steps,

步骤1.1、将图像的RGB颜色特征空间转换为L*u*v*颜色特征空间,将该图像所有数据点的初始颜色值(R,G,B)转换为相对应的颜色特征空间值(L,U,V),图4为转换后的数据点的空间分布,将L*u*v*颜色特征空间Ω划分为12×12×12个小网格作为第一层网格,计算每个小网格内数据点的均值,并以此作为该小网格的特征值,形成一个新的特征空Ωs,如图5所示;Step 1.1, convert the RGB color feature space of the image into an L*u*v* color feature space, and convert the initial color values (R, G, B) of all data points of the image into corresponding color feature space values (L , U, V), Figure 4 shows the spatial distribution of the converted data points, the L*u*v*color feature space Ω is divided into 12×12×12 small grids as the first layer of grids, and each The mean value of the data points in the small grid is used as the eigenvalue of the small grid to form a new characteristic space Ω s , as shown in Figure 5;

步骤1.2将八邻域小网格合并成为一个大网格作为第二层网格,形成一个新的特征空间Ωb及其相应的网格空间坐标值;Step 1.2 Merge the eight-neighborhood small grids into a large grid as the second layer grid to form a new feature space Ω b and its corresponding grid space coordinate values;

步骤1.3根据势值估计公式计算第一层网格内每个小网格的势值

Figure BDA00001919392700101
Step 1.3 Calculate the potential value of each small grid in the first layer grid according to the potential value estimation formula
Figure BDA00001919392700101

Figure BDA00001919392700103
Figure BDA00001919392700103

在特征空间Ωb中,

Figure BDA00001919392700104
表示坐标为(ith,jth,kth)的网格,
Figure BDA00001919392700105
是(ith,jth,kth)网格的质量, f i u j u k u = ( f i u j u k u ( 1 ) , f i u j u k u ( 2 ) , f i u j u k u ( 3 ) ) , w i u j u k u = Q i u j u k u &times; e - ( x - x i u j u k u &sigma; X ) 2 + ( y - y i u j u k u &sigma; Y ) 2 ,
Figure BDA00001919392700108
是位于网格(ith,jth,kth)内数据点的数量,
Figure BDA00001919392700109
是对应于网格(ith,jth,kth)的空间坐标值,σX和σY是空间影响因子,实施例中σX和σY取固定值70,σ=th=c(h1,h2,h3)T,σj=chj,j=1、2、3,c是比例常数,c的取值范围是[2.0,2.5].,本实施例中取值为2.1,h=(h1,h2,h3)T是核密度估计的窗宽,h值通过使用Sheather-Jones插入法获得,K(x)为单位势函数;In the feature space Ωb ,
Figure BDA00001919392700104
represents a grid with coordinates (i th , j th , k th ),
Figure BDA00001919392700105
is the quality of the (i th , j th , k th ) grid, f i u j u k u = ( f i u j u k u ( 1 ) , f i u j u k u ( 2 ) , f i u j u k u ( 3 ) ) , w i u j u k u = Q i u j u k u &times; e - ( x - x i u j u k u &sigma; x ) 2 + ( the y - the y i u j u k u &sigma; Y ) 2 ,
Figure BDA00001919392700108
is the number of data points located in the grid (i th , j th , k th ),
Figure BDA00001919392700109
is the spatial coordinate value corresponding to the grid (i th , j th , k th ), σ X and σ Y are spatial impact factors, and in the embodiment, σ X and σ Y take a fixed value of 70, σ=th=c(h 1 , h 2 , h 3 ) T , σ j =ch j , j=1, 2, 3, c is a proportional constant, and the value range of c is [2.0, 2.5]. In this embodiment, the value is 2.1 , h=(h 1 , h 2 , h 3 ) T is the window width of kernel density estimation, h value is obtained by using the Sheather-Jones interpolation method, K(x) is the unit potential function;

步骤2、根据小网格的势值分布,对小网格聚类,将聚类结果映射到图像,图像划分为不同的彼此不相交的区域,具体步骤为:Step 2. According to the potential value distribution of the small grid, cluster the small grid, map the clustering result to the image, and divide the image into different regions that do not intersect with each other. The specific steps are:

步骤2.1.对步骤1.3中的公式求偏导,得到公式:Step 2.1. Calculate the partial derivative of the formula in step 1.3 to obtain the formula:

Figure BDA00001919392700111
Figure BDA00001919392700111

Figure BDA00001919392700112
利用其计算第一层网格中每个小网格的偏导,并以此来确定所有的顶点网格,通过六邻域模式组合顶点网格来描绘聚类{Ck}k=1,…,v,其中Ck至少包含一个顶点网格;
Figure BDA00001919392700112
Use it to calculate the partial derivative of each small grid in the first layer grid, and use this to determine all vertex grids, and combine the vertex grids through the six-neighborhood mode to describe the cluster {C k } k=1, ..., v , where C k contains at least one vertex mesh;

步骤2.2对于每一个k=1,2,…,v,聚类Ck中的顶点网格作为初始数据点,沿着梯度值上升的方向搜索网格,直到梯度值不再上升即

Figure BDA00001919392700113
为止,将沿路搜索到的小网格划分到聚类Ck中;Step 2.2 For each k=1, 2, ..., v, the vertex grid in the cluster C k is used as the initial data point, and the grid is searched along the direction of gradient value increase until the gradient value no longer increases, that is,
Figure BDA00001919392700113
So far, the small grids searched along the road are divided into clusters C k ;

步骤2.3搜索完毕后,对于每一个聚类Ck,k=1,2,…,v,将每一聚类内所有的数据点映射到图像上,并合并在空间上数据点个数少于40个点的图像碎块,一幅图像被划分为R个不重合的初始区域Ωi,i=1,2,…,R;After the search in step 2.3, for each cluster C k , k=1, 2, ..., v, map all the data points in each cluster to the image, and combine the number of data points less than For 40-point image fragments, an image is divided into R non-overlapping initial regions Ω i , i=1, 2, ..., R;

对于(L,U,V)颜色特征空间的每一维,挑选出在该方向偏导数的局部最大值的所有小网格,于是形成了三个集合;计算三个集合的交集作为候选顶点集合,如果两个候选聚类在六邻域内包括相同的小网格,则依次合并这两个候选顶点集合,直至所有的候选顶点集合均被处理,这样确保了任意两个集合中没有相同的元素,将得到新的顶点集合作为类的初始聚类中心,依据下山法搜索网格,进行聚类,聚类结果如图6和图7所示,其中图7为L*u*v*平面的投影,本实施例中产生了15个聚类,并以五种颜色与三种符号呈现出来,即{blue,red,yellow,black,green}

Figure BDA00001919392700114
{.,*,+}。For each dimension of the (L, U, V) color feature space, select all the small grids with the local maximum value of the partial derivative in this direction, thus forming three sets; calculate the intersection of the three sets as the candidate vertex set , if two candidate clusters include the same small grid in the six-neighborhood, then merge the two candidate vertex sets in turn until all candidate vertex sets are processed, which ensures that there are no identical elements in any two sets , the new vertex set will be obtained as the initial clustering center of the class, and the grid will be searched according to the downhill method for clustering. The clustering results are shown in Figure 6 and Figure 7, where Figure 7 is the L*u*v* plane Projection, 15 clusters are generated in this example, and presented in five colors and three symbols, namely {blue, red, yellow, black, green}
Figure BDA00001919392700114
{.,*,+}.

根据产生的聚类结果,为每一个小网格以及小网格内的数据点分配类号,同时记录那些参与聚类计算的所有数据点,本实施例中共有121406个点记录,平滑前损失点1094个,占总数0.0089,损失点被分配到与其颜色的欧式距离最近的那一类中,将聚类结果映射到平面空间,得到不相交的块,然后进行平滑操作,即将那些包含数据点小于平滑阈值(M=40)的块视为碎片,把这些碎片都分配到周围邻域中最大的那个块中,并更改碎片内数据点的类号,结果如图8所示。步骤3、运用基于区域的Ncut算法合并过分分割的区域,具体步骤为:According to the generated clustering results, assign a class number to each small grid and the data points in the small grid, and record all the data points that participate in the clustering calculation. In this embodiment, there are 121,406 point records in total, and the loss before smoothing There are 1094 points, accounting for 0.0089 of the total. The loss point is assigned to the category with the closest Euclidean distance to its color, and the clustering result is mapped to the plane space to obtain disjoint blocks, and then smoothed, that is, those containing data points Blocks smaller than the smoothing threshold (M=40) are regarded as fragments, and these fragments are assigned to the largest block in the surrounding neighborhood, and the class number of the data points in the fragments is changed. The result is shown in Figure 8. Step 3, using the region-based Ncut algorithm to merge over-segmented regions, the specific steps are:

步骤3.1基于步骤2.3中得到的不重和的初始区域构建一个无向加权图G=(V,E,W),V是图像的顶点,E是连接顶点的边的集合,W是权重矩阵,根据公式 w ( i , j ) = Step 3.1 constructs an undirected weighted graph G=(V, E, W) based on the initial region obtained in step 2.3, where V is the vertex of the image, E is the set of edges connecting the vertices, W is the weight matrix, According to the formula w ( i , j ) =

11 nno ii &Sigma;&Sigma; ff &Element;&Element; &Omega;&Omega; ii ee -- [[ || || ff -- Ff jj || || &sigma;&sigma; II ]] 22 ++ 11 nno jj &Sigma;&Sigma; ff &Element;&Element; &Omega;&Omega; jj ee -- [[ || || ff -- Ff ii || || &sigma;&sigma; II ]] 22 00

计算权重矩阵W;Calculate the weight matrix W;

步骤3.2通过权重矩阵W计算对角矩阵D,Step 3.2 calculates the diagonal matrix D through the weight matrix W,

其中D(i,i)=∑jw(i,j);where D(i, i) = ∑ j w(i, j);

步骤3.3解方程(D-W)y=λDy,得到特征值和相应的特征向量,确定第二小的特征向量;Step 3.3 solves equation (D-W) y=λDy, obtains eigenvalue and corresponding eigenvector, determines the second smallest eigenvector;

步骤3.4根据公式

Figure BDA00001919392700123
找出分割点,即Ncut值最小时的点,用第二小的特征向量二分图的顶点,将图像分割为两个子图;Step 3.4 According to the formula
Figure BDA00001919392700123
Find the segmentation point, that is, the point where the Ncut value is the smallest, and use the vertices of the second smallest eigenvector bipartite graph to divide the image into two subgraphs;

步骤3.5对于二分割得到的子图,分别计算权重矩阵,并重复步骤3.2至3.4;In step 3.5, for the subgraphs obtained by the two-partition, calculate the weight matrix respectively, and repeat steps 3.2 to 3.4;

步骤3.6重复步骤3.5,直到Ncut值超出给定的阀值。Step 3.6 Repeat step 3.5 until the Ncut value exceeds the given threshold.

Claims (2)

1. An image segmentation method based on a generalized data field and an Ncut algorithm is characterized in that: comprises the following steps of (a) carrying out,
step 1, hierarchical grid division and potential value estimation, which specifically comprises the following steps,
step 1.1, converting the RGB color feature space of the image into L u v or L a b color feature space, dividing L u v or L a b color feature space Ω into 2N × 2N small grids as the first layer grid, calculating the average value of the data points in each small grid, and forming a new special grid by using the average value as the feature value of the small gridSign space omegas
Step 1.2, combining the eight-neighborhood small grids into a large grid serving as a second-layer grid to form a new feature space omegabAnd its corresponding grid space coordinate value;
step 1.3, potential value of each small grid in the first layer grid is calculated according to the potential value estimation formula
Figure FDA00001919392600011
Figure FDA00001919392600013
In the eigenspace omegabIn (1),representing coordinates of (i)th,jth,kth) The grid of (a) is formed,is (i)th,jth,kth) The quality of the grid is such that, f i u j u k u = ( f i u j u k u ( 1 ) , f i u j u k u ( 2 ) , f i u j u k u ( 3 ) ) , w i u j u k u = Q i u j u k u &times; e - ( x - x i u j u k u &sigma; X ) 2 + ( y - y i u j u k u &sigma; Y ) 2 ,
Figure FDA00001919392600018
is located in the grid (i)th,jth,kth) The number of inner data points is,
Figure FDA00001919392600019
is corresponding to the grid (i)th,jth,kth) Is empty ofInter-coordinate value, σXAnd σYIs a spatial influence factor, σ ═ ch ═ c (h)1,h2,h3)T,σj=chjJ =1,2, 3, c is a proportionality constant, h ═ h (h)1,h2,h3)TIs the window width of the kernel density estimate, k (x) is the unit potential function;
step 2, clustering the small grids according to potential value distribution of the small grids, mapping clustering results to images, and dividing the images into different mutually disjoint areas, wherein the specific steps are as follows:
step 2.1, solving the partial derivative of the formula in the step 1.3 to obtain a formula:
Figure FDA000019193926000110
calculating partial derivatives of each small mesh in the first layer mesh, determining all vertex meshes according to the partial derivatives, and describing the cluster { C by combining the vertex meshes through a six-neighborhood modek}k=1,…,vIn which C iskComprising at least one vertex mesh;
step 2.2 for each k ═ 1,2, …, v, cluster CkUsing the vertex grid as the initial data point, searching the grid along the direction of rising gradient value until the gradient value does not rise any more
Figure FDA00001919392600022
By now, the small grids searched along the road are divided into clusters CkPerforming the following steps;
step 2.3 after the search is completed, for each cluster CkK is 1,2, …, v, mapping all data points in each cluster to an image, merging image fragments with the number of data points less than M (20 is less than or equal to M is less than or equal to 100) points on space, and dividing an image into R misaligned initial regions omegai,i=1,2,…,R;
Step 3, combining the over-divided regions by using a region-based Ncut algorithm; the formula for calculating the weight matrix W is:
w ( i , j ) =
1 n i &Sigma; f &Element; &Omega; i e - [ | | f - F j | | &sigma; I ] 2 + 1 n j &Sigma; f &Element; &Omega; j e - [ | | f - F i | | &sigma; I ] 2 0 .
2. an image segmentation method based on generalized data fields and Ncut algorithm according to claim 1, characterized in that: the step 3 specifically comprises the following steps of,
step 3.1 constructs an undirected weighted graph G ═ V, E, W based on the non-summed initial regions obtained in step 2.3, V being the vertices of the image and E being the edges connecting the verticesSet, W is a weight matrix, according to the formula w ( i , j ) =
1 n i &Sigma; f &Element; &Omega; i e - [ | | f - F j | | &sigma; I ] 2 + 1 n j &Sigma; f &Element; &Omega; j e - [ | | f - F i | | &sigma; I ] 2 0
Calculating a weight matrix W;
step 3.2 calculates the diagonal matrix D by the weight matrix W,
where D (i, i) ═ Σjw(i,j);
Step 3.3, solving an equation (D-W) y which is lambda Dy to obtain a characteristic value and a corresponding characteristic vector, and determining a second small characteristic vector;
step 3.4 according to the formula
Figure FDA00001919392600031
Finding out a segmentation point, namely a point with the minimum Ncut value, and segmenting the image into two sub-images by using the vertex of the second small feature vector bipartite graph;
step 3.5, calculating a weight matrix for the subgraphs obtained by the two divisions respectively, and repeating the steps 3.2 to 3.4;
step 3.6 repeats step 3.5 until the value of Ncut exceeds a given threshold.
CN201210265614.3A 2012-07-23 2012-07-23 A kind of image partition method based on broad sense data fields and Ncut algorithm Active CN102855624B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210265614.3A CN102855624B (en) 2012-07-23 2012-07-23 A kind of image partition method based on broad sense data fields and Ncut algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210265614.3A CN102855624B (en) 2012-07-23 2012-07-23 A kind of image partition method based on broad sense data fields and Ncut algorithm

Publications (2)

Publication Number Publication Date
CN102855624A true CN102855624A (en) 2013-01-02
CN102855624B CN102855624B (en) 2015-09-16

Family

ID=47402186

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210265614.3A Active CN102855624B (en) 2012-07-23 2012-07-23 A kind of image partition method based on broad sense data fields and Ncut algorithm

Country Status (1)

Country Link
CN (1) CN102855624B (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103679760A (en) * 2013-12-05 2014-03-26 河海大学 Color image segmentation method based on Normalized cut
CN105069787A (en) * 2015-08-04 2015-11-18 浙江慧谷信息技术有限公司 Image joint segmentation algorithm based on consistency function space mapping
CN107871321A (en) * 2016-09-23 2018-04-03 南开大学 Image segmentation method and device
CN112116715A (en) * 2019-06-20 2020-12-22 三星电子株式会社 Method and apparatus for efficient interpolation

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060247525A1 (en) * 2005-04-28 2006-11-02 Zhimin Huo Segmentation of lesions in ultrasound images
CN101923712A (en) * 2010-08-03 2010-12-22 苏州大学 Gene Chip Image Segmentation Method Based on Particle Swarm Optimization K-means Clustering Algorithm
CN102222234A (en) * 2011-07-14 2011-10-19 苏州两江科技有限公司 Image object extraction method based on mean shift and K-means clustering technology
CN102254326A (en) * 2011-07-22 2011-11-23 西安电子科技大学 Image segmentation method by using nucleus transmission

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060247525A1 (en) * 2005-04-28 2006-11-02 Zhimin Huo Segmentation of lesions in ultrasound images
CN101923712A (en) * 2010-08-03 2010-12-22 苏州大学 Gene Chip Image Segmentation Method Based on Particle Swarm Optimization K-means Clustering Algorithm
CN102222234A (en) * 2011-07-14 2011-10-19 苏州两江科技有限公司 Image object extraction method based on mean shift and K-means clustering technology
CN102254326A (en) * 2011-07-22 2011-11-23 西安电子科技大学 Image segmentation method by using nucleus transmission

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
伊怀锋 等: "基于均值偏移的彩色图像分割算法", 《计算机应用》 *
席秋波: "基于Ncut的图像分割算法研究", 《中国优秀硕士学位论文全文数据库》 *
陈彦至 等: "Ncut 在图像分割中的应用", 《计算机技术与发展》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103679760A (en) * 2013-12-05 2014-03-26 河海大学 Color image segmentation method based on Normalized cut
CN103679760B (en) * 2013-12-05 2016-06-22 河海大学 Color image segmentation method based on Normalized cut
CN105069787A (en) * 2015-08-04 2015-11-18 浙江慧谷信息技术有限公司 Image joint segmentation algorithm based on consistency function space mapping
CN107871321A (en) * 2016-09-23 2018-04-03 南开大学 Image segmentation method and device
CN107871321B (en) * 2016-09-23 2021-08-27 南开大学 Image segmentation method and device
CN112116715A (en) * 2019-06-20 2020-12-22 三星电子株式会社 Method and apparatus for efficient interpolation

Also Published As

Publication number Publication date
CN102855624B (en) 2015-09-16

Similar Documents

Publication Publication Date Title
Dey et al. Defining and computing curve-skeletons with medial geodesic function
CN101706950B (en) High-performance implementation method for multi-scale segmentation of remote sensing images
CN111881933B (en) A hyperspectral image classification method and system
CN103177450B (en) A kind of image scene segmentation of Component-Based Development centralized procurement sample combines method for solving with layering
CN105046689B (en) A kind of interactive stereo-picture fast partition method based on multi-level graph structure
CN104408733B (en) Object random walk-based visual saliency detection method and system for remote sensing image
CN104167013B (en) Volume rendering method for highlighting target area in volume data
CN103530882B (en) Improved image segmentation method based on picture and color texture features
CN106296680B (en) A region-based multi-feature fusion high-resolution remote sensing image segmentation method
CN104123417B (en) A Method of Image Segmentation Based on Cluster Fusion
CN110363236B (en) Hyperspectral Image Extreme Learning Machine Clustering Method Based on Space Spectrum Joint Hypergraph Embedding
CN106611421A (en) SAR image segmentation method based on feature learning and sketch line constraint
CN110796667A (en) Color image segmentation method based on improved wavelet clustering
CN113344103B (en) Hyperspectral remote sensing image ground object classification method based on hypergraph convolution neural network
CN104680546A (en) Image salient object detection method
CN102855624B (en) A kind of image partition method based on broad sense data fields and Ncut algorithm
Song et al. Joint graph learning and video segmentation via multiple cues and topology calibration
CN109741358B (en) A Superpixel Segmentation Method Based on Adaptive Hypergraph Learning
CN105913451B (en) A kind of natural image superpixel segmentation method based on graph model
CN109213886A (en) Image retrieval method and system based on image segmentation and fuzzy pattern recognition
CN105303546A (en) Affinity propagation clustering image segmentation method based on fuzzy connectedness
CN109636809B (en) Image segmentation level selection method based on scale perception
CN108388901B (en) Collaborative significant target detection method based on space-semantic channel
CN106023184A (en) Depth significance detection method based on anisotropy center-surround difference
CN103310452B (en) The image partition method that a kind of weight automatically selects

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant