Background technology
In mankind's activity, image is the most frequently used information carrier, and its reason is because the intuitive of image on the one hand, things represents by objectively, without the need to being subject to the impact of description person's subjective factor, being that the mankind can analyze image rapidly and understand on the other hand, obtaining image information instantaneously.
Image Engineering can be divided into image procossing, graphical analysis and image interpretation three part, and image procossing mainly gathers image, obtains image information, and carries out pretreated process to it, the technology such as main application image collection, image enhaucament, filtering; Graphical analysis mainly obtains characteristics of image and describes and interested target, and this process mainly comprises Iamge Segmentation and feature extraction; Image understanding is according to characteristics of image, studies the further feature of image, and this process relates to the contents such as target identification, scene description.Image procossing occupies critical role in Image Engineering, and on the one hand, Iamge Segmentation is the basis of target statement and pattern measurement, plays an important role to graphical analysis; On the other hand, image Segmentation Technology and image is converted into more abstract form based on the objective expression of cutting techniques, characteristic measuring techniques, and greatly reducing the data volume of the required process of image understanding, this makes further high layer analysis, image understanding and artificial intelligence become possibility.Image Segmentation Technology has been widely used in the various aspects of real life, as medical image analysis, remote Sensing Image Analysis, intelligent traffic administration system etc.
Image Segmentation Technology based on level set has become the focus direction splitting area research in recent years, comparatively unified model and framework are formed at present, it allows the topological structure of curve in evolutionary process to change, and also can obtain good segmentation result to multiple goal with the segmentation being communicated with target more.Existing level-set segmentation model has following several method:
1. based on the level-set segmentation methods of image boundary.This method is the velocity function of the gradient information tectonic level collection utilizing image, makes evolution curve approach objective contour.People [the Li C. such as such as Li, Xu C., Gui C.and Fox M., " Levelset evolution without re-initialization:a new variational formulation ", IEEE Conference onComputer Vision and Pattern Recognition, San Diego, CA, USA, pp.430-436, Jun.2005] proposing one need not initialized variational method, and the method, by definition penalty term, makes level set function close to symbolic measurement.The curve evolvement of this level-set segmentation methods based on image boundary depends on image gradient, and the Grad bounded of real image, boundary stops function can not be zero, and curve may pass border, and when picture noise is excessive, segmentation result is also undesirable.
2. based on the level-set segmentation methods of image-region.This method is the energy functional utilizing the area information of image to build level set.People [the T.Chan and L.Vese such as such as Chan, " Active contours without edges ", IEEETransactions on Image Processing, vol.10, no.2, pp.266-277,2001] by Mumford-Shah solution to model is reduced to piecewise constant, propose Chan-Vese model, can be used for the meaningless or ill-defined image of segmentation gradient, but undesirable for the image segmentation that gray scale is uneven.
3. based on the level-set segmentation methods of picture shape priori.This method is the energy functional utilizing the shape prior of image to build level set.People [the Cremers D. such as such as Cremers, Osher S.J.and Soatto S., " Kernel densityestimation and intrinsic alignment for shape priors in level set segmentation ", InternationalJournal of Computer Vision, vol.69, no.3, pp.335-351, Sep.2006] utilize Density Estimator, use shape prior constructs the difference between level set function and given embedding shape, shape difference subitem is joined in Chan-Vese parted pattern, this method does not rely on the restricted hypothesis of Gaussian distribution, allow multiplephase when obvious training shapes is encoded accurately.But this dividing method makes calculated amount greatly increase, reduce the segmentation efficiency of image.
Although the above-mentioned level-set segmentation methods based on image boundary, image-region and shape prior can complete Iamge Segmentation preferably, but these methods are responsive to the initialized location of level set, cannot obtain the segmentation result of global optimum, and the solving speed of model is slow, segmentation efficiency is low.
Summary of the invention
The object of the invention is to the deficiency for above-mentioned prior art, propose a kind of level set image segmentation method cutting optimization based on super-pixel and figure, to improve segmentation efficiency and the segmentation precision of image.
Technical thought of the present invention is: by adopting the super-pixel generation technique of simple linear iteration cluster, accelerate the splitting speed of image, cut the method for optimization by employing figure, reduce the susceptibility of level set being carried out to initialized location, obtain the segmentation result of global optimum.Implementation step comprises as follows:
(1) image I to be split is divided into M block, each block is a super-pixel, obtains the super-pixel SP={sp of image I
1..., sp
k..., sp
m, wherein sp
krepresent a kth super-pixel, k=1,2 ..., M;
(2) each selection pixel in each super-pixel, utilizes this M pixel to form new images I
s;
(3) according to Chan-Vese model, new images I is built
senergy functional E
cV, it is expressed as
Wherein, Ω represents image area, and μ is non-negative parameter, λ
1and λ
2be positive parameter, φ represents evolution curve,
ε is constant and ε → 0, c
inand c
outrepresent the inside and outside gray average of closed curve respectively;
(4) to the energy functional E built
cVcarry out discrete statement, its discrete form is as follows:
Wherein, x
pbe defined as image I
sin the two-valued variable of each pixel,
p=(x, y) ∈ Ω, φ (p) represent the value of the level set function at pixel p place, x
pand x
qbe respectively new images I
sin the two-valued variable of two different pixels point p and q, be connected if p with q is axle, weight w
pq=1, be connected if p with q is diagonal angle, then weight
represent
(5) use figure cuts technical optimization energy functional, realizes new images I
ssegmentation:
(5.1) the evolution curve of initialization level set;
(5.2) according to the discrete form of level set energy functional
the data item E of calculating chart
p(x
p) and smooth item E
p,q(x
p, x
q), it is expressed as:
E
p(x
p)=λ
1|I
s-c
in|
2x
p+λ
2|I
s-c
out|
2(1-x
p)
E
p,q(x
p,x
q)=μw
pq(x
p(1-x
q)+x
q(1-x
p))
(5.3) the data item E of figure is utilized
p(x
p), smooth item E
p,q(x
p, x
q) and weight matrix design of graphics, obtained the minimal cut of figure by min-cut algorithm, upgrade x
pvalue;
(5.4) compare the energy size that min-cut algorithm uses front and back, if the energy before using the energy after min-cut algorithm to be less than algorithm use, then return step (5.2), continue iterative computation; If both are equal, then stop iteration;
(5.5) according to x
pvalue determination new images I
sthe attribute of middle pixel: if x
p=0, then x
pcorresponding pixel is background, if x
p=1, then x
pcorresponding pixel is target, completes new images I
ssegmentation;
(6) according to new images I
ssegmentation result, complete the segmentation to image I;
New images I
sin each pixel correspondence image I in a super-pixel, if new images I
sin pixel be background, then corresponding in image I super-pixel is also background, if new images I
sin pixel be target, then corresponding in image I super-pixel is also target, thus completes the segmentation to image I.
Compared to the prior art, the present invention has the following advantages:
1) the present invention adopts simple linear iteration clustering technique, generate the super-pixel of image to be split, a pixel is selected in each super-pixel, these pixels selected are utilized to form new image, because the size of new images is far smaller than original image, can calculated amount be greatly reduced in follow-up calculating, improve the efficiency of Iamge Segmentation.
2) traditional energy functional optimization generally adopts gradient descent method, the step-length of the method is selected to have a great impact iterations, and can only local minimum be obtained, the figure that the present invention adopts cuts the mode of technology as a kind of optimization energy functional, the global minimum of energy functional can be tried to achieve, reduce the susceptibility of level set being carried out to initialized location, improve the precision of Iamge Segmentation.
Embodiment
Below in conjunction with accompanying drawing, 1 couple of the present invention is described in further detail.
Step 1, is divided into M block by image I to be split, and each block is a super-pixel, obtains the super-pixel SP of image I.
The method of existing generation super-pixel has canonical to cut algorithm, mean shift algorithm, rapid drift algorithm and simple linear Iterative Clustering etc., because simple linear Iterative Clustering uses simple, counting yield is high, has developed into the common method that super-pixel generates.The present invention adopts simple linear Iterative Clustering, and generate the super-pixel SP of image I to be split, its step is as follows:
(1.1) rgb color space of image to be split is transformed to CIELAB color space;
(1.2) the expectation number M of super-pixel is inputted;
(1.3) with size be
grid interval pixel is sampled, obtain initial cluster centre C
k=[l
k, a
k, b
k, x
k, y
k]
t, k=1,2 ..., M, wherein, N represents image pixel number, [l
k, a
k, b
k] for CIELAB color space pixel color vector, l
krepresent brightness, a
k, b
krepresent color opposition dimension, x
k, y
kfor location of pixels;
(1.4) according to the minimal gradient position of 3 × 3 neighborhoods, cluster centre is moved on to seed position;
(1.5) initialized pixel i and cluster centre C
kdistance d (i)=∞, label l (i)=-1 of initialization recording pixel i classification;
(1.6) for each cluster centre C
k, calculate C
kin neighbouring 2S × 2S region, each pixel is to cluster centre C
kdistance D, if D < d (i), then make d (i)=D, l (i)=k;
(1.7) calculate new cluster centre and residual error E, wherein residual error E is defined as the L2 norm of successively twice cluster centre position;
(1.8) compare the threshold value T of residual error E and setting, if E≤T, then stop upgrading, otherwise be back to step (1.6), continue to upgrade cluster centre and residual error, until residual error E≤T;
(1.9) pixel being k by the category label that step (1.6) obtains is combined as one piece of super-pixel sp
k, from 1 to M, k is traveled through, is combined into M super-pixel, completes the division to image I, obtain the super-pixel SP={sp of image I
1..., sp
k..., sp
m, wherein sp
krepresent a kth super-pixel, k=1,2 ..., M.
Step 2, each selection pixel in each super-pixel, utilizes this M pixel to form new images I
s.
(2.1) gray average of each super-pixel is calculated:
Wherein, μ (k) is a kth super-pixel sp
kgray average, m
krepresent super-pixel sp
kmiddle number of pixels;
(2.2) at super-pixel sp
kin choose | sp
k(j)-μ (k) | the pixel that minimum value is corresponding, k=1,2 ..., M;
(2.3) new images I is formed with the pixel chosen
s.
Step 3, according to Chan-Vese model, builds new images I
slevel set energy functional.
On the basis of Mumford-Shah model, Chan and Vese proposes the level set Image Segmentation Model based on region, the energy functional E of this model
cVbe defined as smooth item E
smoothwith data item E
datasum, that is:
E
CV=E
smooth+E
data。
For solving energy functional E
cV, introduce Heaviside function
and dirac measure
wherein, ε is constant and ε → 0, and φ represents evolution curve.
Solve new images I
sthe concrete steps of level set energy functional as follows:
(3.1) the smooth item E of calculated level collection energy functional
smooth:
E
smoothbe defined as the length of closed curve, its computing formula is:
Wherein, Ω represents image area, and μ is non-negative parameter, and φ represents evolution curve,
for the divergence of φ;
(3.2) the data item E of calculated level collection energy functional
data:
E
data=λ
1∫
Ω|I
s-c
in|
2H(φ)dxdy
,
+λ
2∫
Ω|I
s-c
out|
2(1-H(φ))dxdy
Wherein, λ
1and λ
2be respectively data item conitnuous forms E
datathe coefficient of Section 1 and Section 2, I
srepresent new images, Ω represents image area, c
inand c
outrepresent the interior gray average of closed curve and outer gray average respectively, account form is as follows:
(3.3) new images I is calculated
senergy functional E
cV, it is expressed as:
Step 4, to the level set energy functional E built
cVcarry out discrete statement.
According to new images I
slevel set energy functional E
cV, respectively to E
cVsmooth item and data item carry out discrete statement, and concrete steps are as follows:
(4.1) x is defined
pfor new images I
sin the two-valued variable of each pixel,
wherein, p=(x, y) ∈ Ω, Ω represents image area;
(4.2) discrete form of the smooth item of level set energy functional is solved
Wherein, μ is non-negative parameter, x
pand x
qbe respectively new images I
sin the two-valued variable of two different pixels point p and q, be connected if p with q is axle, then weight w
pq=1, be connected if p with q is diagonal angle, then weight
(4.3) discrete form of the data item of level set energy functional is solved
Wherein, λ '
1with λ '
2be respectively data item discrete form
the coefficient of Section 1 and Section 2, I
srepresent new images, c
inand c
outbe respectively the interior gray average of closed curve and outer gray average, account form is as follows:
(4.4) level of aggregation collection energy functional E
cVthe discrete form of smooth item
with the discrete form of data item
obtain E
cVdiscrete form:
Step 5, use figure cuts technical optimization energy functional, realizes new images I
ssegmentation.
(5.1) the evolution curve of initialization level set;
(5.2) according to the discrete form of level set energy functional
the data item E of calculating chart
p(x
p) and smooth item E
p,q(x
p, x
q), it is expressed as:
E
p(x
p)=λ
3|I
s-c
in|
2x
p+λ
4|I
s-c
out|
2(1-x
p),
E
p,q(x
p,x
q)=μw
pq(x
p(1-x
q)+x
q(1-x
p)),
Wherein, λ
3and λ
4be respectively the data item E of figure
p(x
p) Section 1 and the coefficient of Section 2;
(5.3) the data item E of figure is utilized
p(x
p), smooth item E
p,q(x
p, x
q) and weight matrix design of graphics, obtained the minimal cut of figure by min-cut algorithm, upgrade x
pvalue;
(5.4) compare the energy size that min-cut algorithm uses front and back, if the energy before using the energy after min-cut algorithm to be less than algorithm use, then return step (5.2), continue iterative computation; If both are equal, then stop iteration;
(5.5) according to x
pvalue determination new images I
sthe attribute of middle pixel: if x
p=0, then x
pcorresponding pixel is background, if x
p=1, then x
pcorresponding pixel is target, completes new images I
ssegmentation.
Step 6, according to new images I
ssegmentation result, complete the segmentation to image I to be split.
New images I
sin the corresponding image I to be split of each pixel in a super-pixel, if new images I
sin pixel be background, then corresponding in image I to be split super-pixel is also background, if new images I
sin pixel be target, then corresponding in image I to be split super-pixel is also target, thus completes the segmentation to image I to be split.
Effect of the present invention can further illustrate by using following emulation experiment
1, simulated conditions
The present invention is Intel (R) Core (TM) i5 2.80GHZ, internal memory 4G, WINDOWS 7 in operating system at central processing unit, uses the emulation that MATLAB software carries out.
2, content is emulated
Emulation 1, with the present invention and existing Chan-Vese model, natural image is split, result as shown in Figure 2, wherein:
Fig. 2 (a) is with Chan-Vese model to the initialization of natural image,
The result that Fig. 2 (b) is split natural image for using Chan-Vese model,
Fig. 2 (c) uses Chan-Vese model to the binary map of the result that natural image is split,
Fig. 2 (d) uses the present invention to the initialization of natural image,
The result that Fig. 2 (e) is split natural image for using the present invention,
Fig. 2 (f) is for using the present invention to the binary map of the result that natural image is split.
Comparison diagram 2 (c) and Fig. 2 (f), can find out that the present invention is good to natural image segmentation effect, can obtain the segmentation result of global optimum.
Emulation 2, with the present invention and existing Chan-Vese model, noise image is split, result as shown in Figure 3, wherein:
Fig. 3 (a) uses Chan-Vese model to the initialization of noise image,
The result that Fig. 3 (b) is split noise image for using Chan-Vese model,
Fig. 3 (c) uses Chan-Vese model to the binary map of the result that noise image is split,
Fig. 3 (d) uses the present invention to the initialization of noise image,
The result that Fig. 3 (e) is split noise image for using the present invention,
Fig. 3 (f) is for using the present invention to the binary map of the result that noise image is split.
Comparison diagram 3 (c) and Fig. 3 (f), can find out that the present invention is to noise robustness, also can obtain good segmentation result under noise existent condition.
Emulation 3, with the present invention and existing Chan-Vese model, artificial image is split, result as shown in Figure 4, wherein:
Fig. 4 (a) uses Chan-Vese model to the initialization of artificial image,
The result that Fig. 4 (b) is split artificial image for using Chan-Vese model,
Fig. 4 (c) uses Chan-Vese model to the binary map of the result that artificial image is split,
Fig. 4 (d) uses the present invention to the initialization of artificial image,
The result that Fig. 4 (e) is split artificial image for using the present invention,
Fig. 4 (f) is for using the present invention to the binary map of the result that artificial image is split.
Comparison diagram 4 (c) and Fig. 4 (f), can find out that the present invention is good to artificial image segmentation effect, can obtain the segmentation result of global optimum.
Emulation 1, emulation 2 and emulation 3 time used and iterations as shown in table 1:
Table 1.
As can be seen from Table 1, compared with Chan-Vese model, the present invention only needs iteration several times just can obtain segmentation result, and the Iamge Segmentation time used is far smaller than Chan-Vese model, and the segmentation efficiency of image has greatly improved.