Summary of the invention
The purpose of the present invention is to provide a kind of infrared target contours segmentation methods based on dual Kmeans cluster, with solution
Certainly since the energy radiation profiles of helicopter are extremely uneven, fuselage sections are difficult the problem of separating from background.
In order to solve the above-mentioned technical problem, the technical scheme is that provide it is a kind of based on dual Kmeans cluster
Infrared target contours segmentation method, comprising:
Step 1, since any one frame image, determine the central point of target by local probability distribution algorithm, save institute
State center position, grayscale information;
Image is carried out first time Kmeans cluster by step 2, and the central point of the target is as initialization cluster centre;
Step 3, using being polymerized to every class area information, merger area it is maximum it is a kind of be background, remaining several classes are as mesh
Mark;
Target in first time cluster result is corresponded to original image position disposition 0 by step 4, carries out Kmeans cluster again;
Step 5 repeats step 3, the target after obtaining secondary cluster;
Step 6 carries out skeletal extraction and singular point rejecting to the result after secondary cluster, obtains final output;
Step 7, segmentation terminate, and obtain objective contour.
Further, carry out again Kmeans cluster to obtain after the classification of target with cluster obtained target for the first time and close
And obtain the segmentation result of final goal.
Further, for helicopter image, data sample is the gray value of each pixel, utilizes the difference of gray value
Property clustered, if defining K value be 4.
Infrared target contours segmentation method provided by the invention based on dual Kmeans cluster is calculated based on Kmeans cluster
Method, and positioning of the local probability distribution algorithm to target's center is combined, can be had using the secondary splitting method that Kmeans is clustered
Effect ground excavates helicopter fuselage and propeller information, realizes the segmentation to the non-uniform infrared target of Energy distribution, can carry on the back
Under the premise of scape is more gentle, it is rapidly and accurately partitioned into target.
Specific embodiment
Below in conjunction with the drawings and specific embodiments to the infrared target wheel proposed by the present invention based on dual Kmeans cluster
Wide dividing method is described in further detail.According to following explanation and claims, advantages and features of the invention will be more clear
Chu.It should be noted that attached drawing is all made of very simplified form and using non-accurate ratio, only to conveniently, lucidly
Aid in illustrating the purpose of the embodiment of the present invention.
Core of the invention thought is, the infrared target contours segmentation provided by the invention based on dual Kmeans cluster
Method is based on Kmeans clustering algorithm, and combines positioning of the local probability distribution algorithm to target's center, is clustered using Kmeans
Secondary splitting method can effectively excavate helicopter fuselage and propeller information, realize non-uniform to Energy distribution infrared
The segmentation of target can rapidly and accurately be partitioned into target under the premise of background is more gentle.
The step of Fig. 2 is the infrared target contours segmentation method provided in an embodiment of the present invention based on dual Kmeans cluster
Flow diagram.Referring to Fig. 2, a kind of infrared target contours segmentation method based on dual Kmeans cluster is provided, including following
Step:
S21, since any one frame image, the central point of target is determined by local probability distribution algorithm, described in preservation
Center position, grayscale information;
S22, image is carried out to first time Kmeans cluster, the central point of the target is as initialization cluster centre;
S23, using being polymerized to every class area information, merger area it is maximum it is a kind of be background, remaining several classes are as target;
S24, the target in first time cluster result is corresponded to original image position disposition 0, carries out Kmeans cluster again;
S25, S23, the target after obtaining secondary cluster are repeated;
S26, skeletal extraction and singular point rejecting are carried out to the result after secondary cluster, obtain final output;
S27, segmentation terminate, and obtain objective contour.
Infrared target contours segmentation method provided in an embodiment of the present invention based on dual Kmeans cluster first passes through local
Probability distribution Distribution Algorithm determines the central point of target, then according to Kmeans clustering algorithm, is finally obtained according to skeletal extraction
Precise boundary.
Kmeans algorithm is a kind of clustering algorithm to find broad application.It is divided into data set not by iterative process
Same classification, so that the criterion function of evaluation clustering performance is optimal, so that in each cluster generated between compact, class
It is independent.Kmeans algorithm can regard the special case of many follow-up works (NMF, graph-cut) as.Calculate data sample it
Between apart from when, various distance metrics can be selected according to actual needs, the most commonly used is Euclidean distances.Euclidean distance is public
Formula is as follows:
Kmeans clustering algorithm evaluates clustering performance using error sum of squares criterion function.It is defined as follows:
Kmeans algorithm steps are as follows:
A, initial cluster center is determined for each class;
B, each sample is distributed to closest classification according to the smallest principle of Euclidean distance;
C, use sample in each classification as new cluster centre;
D, B is repeated, C changes cluster centre no longer;
E, terminate, obtain k cluster result.
In embodiments of the present invention, infrared target contours segmentation object is helicopter image, and data sample is each pixel
The gray value of point, is clustered using the otherness of gray value.If enabling K=2, region at engine can only obtain;If enabling K=
3, it can only obtain engine section, engine and fuselage intersection;If enabling K=4, entire fuselage profile can be obtained.Fig. 3 a is
Kmeans clustering algorithm, under conditions of k=2, the segmentation result of target are used under IR Scene provided in an embodiment of the present invention
Figure;Fig. 3 b is that Kmeans clustering algorithm, under conditions of k=3, target are used under IR Scene provided in an embodiment of the present invention
Segmentation result figure;Fig. 3 c is that Kmeans clustering algorithm is used under IR Scene provided in an embodiment of the present invention, in the condition of k=4
Under, the segmentation result figure of target.It still can only be by helicopter engine partial segmentation in k=2 and k=3 referring to Fig. 3 a to 3c
Out;K=4 can effectively excavate engine section, engine and fuselage intersection, fuselage, background these fourth types useful information.
Wherein the classification where background occupies image major part, and the ratio that remaining three classes occupies image is smaller.Therefore, these three types can root
According to area can merger be one kind.
However directly adopt Kmeans be polymerized to multiclass have the disadvantage in that first, the selection that initializes center can be to target
Segmentation result impacts, and cluster result is unstable, and there are certain randomnesss.Due to initializing the difference of cluster centre, cause
Larger difference occurs for cluster result.Objective contour full segmentation can may be come out for the first time, it next time can only be by engine
Partial segmentation comes out.If second, data itself are difficult to be polymerized to multiclass, such as only two class samples, but the setting of K value is larger, at this time
Cluster result can have empty class phenomenon.It needs to reject empty class, or even there are whole image is a kind of unusual existing
As.Third, due to helicopter engine part and fuselage grey value difference it is excessive, the guarantor that single Clustering Effect can not be stable
Card, propeller part may not be able to preferably be split.
It based on this, is improved using two kinds of thinkings, first, being determined in target using the method that local probability distribution is distributed
The heart, sets it to the initial cluster center of one type, and this method can guarantee that image can at least be polymerized to 2 classes, will not go out
Existing whole image is a kind of singularity;Second, output cannot be stablized by being directed to single cluster result, the present invention proposes
The thought of secondary cluster.The gray value of target part is set 0 on first time cluster result, then carries out a Kmeans cluster,
To overcome helicopter engine part and the excessive phenomenon of fuselage grey value difference.The embodiment of the present invention will be situated between from two parts
It continues:
(1) local probability distribution
Since the variation that natural background energy radiates in infrared image is generally all than more gentle, and the ash between background pixel
Degree is relevant, therefore the high bright part of target or target can regard the isolated singularity in gentle background as, correspond to
High frequency section in image.Especially for the helicopter image in the embodiment of the present invention, engine section can regard gentle back as
Singular point in scape, fuselage and background may be regarded as gentle background.Engine location i.e. target's center is determined by such method.
In the subrange of target (engine section), background variation generally will not too acutely, target and neighborhood background
Comparison is obvious, thus, target point grey scale pixel value and local pixel and ratio it is larger.By in local gray probability distribution map
The detection of corresponding target may be implemented in the detection of upper comparison greater probability value.
If f (x, y) is the gray value in sequence image at a certain frame image midpoint (x, y), (2r+ centered on (x, y)
1) × (2r+1) in local, the ratio of total gray value in the gray value and local that p (x, y) is point (x, y) is defined, it may be assumed that
This is known as the local gray probability of the point, with the local gray probability of all the points within point (x, y) local scope it
Be 1.
In general, in (2r+1) centered on point (x, y) × (2r+1) local:
When intensity profile is uniform,
When there is the higher pixel of other gray values in the gray value or local that f (x, y) is less than surrounding pixel point,
When f (x, y) is higher than other pixels in its neighborhood,And the pixel is higher, p
(x, y) is bigger.
Therefore, the singular point in smooth background can be detected by the size that p (x, y) is compared in calculating, Fig. 4 is that the present invention is real
The local probability distribution graph of the target of example offer is provided.Referring to shown in Fig. 4, which shows target corresponding to the engine section
Position at have biggish response.Response maximum is the center for being regarded as corresponding target, by max (p (x,
Y) coordinate record corresponding to) is the central point of target, the helicopter engine in the embodiment of the present invention can be positioned, as it
The initial target center of middle one kind.
(2) secondary Kmeans cluster
It is directed to the unstable situation of single cluster result, the embodiment of the present invention proposes the thought of secondary cluster.Fig. 5 a
For the result schematic diagram of first time provided in an embodiment of the present invention segmentation.Referring to Fig. 5 a, first time cluster result can not allow people
Satisfied, the cluster result is similar with using threshold value, the region growing growth result of scheduling algorithm, can only be by helicopter engine portion
It separates, and does not have the profile of helicopter.
Fig. 5 b is the result schematic diagram of zero-setting operation provided in an embodiment of the present invention.Referring to Fig. 5 b, by the way that first time is divided
It target part zero setting in original image in result is cut, at this time effectively rejects the high bright part of helicopter engine, at this time image
After rejecting most bright part, the otherness of fuselage and background is available preferably to be embodied intensity profile.Fig. 5 c is the present invention
The result schematic diagram for second of segmentation that embodiment provides.Referring to Fig. 5 c, clustering again to image at this time can be effectively
Obtain the profile of entire fuselage.
Although no matter first time segmentation result is preferable or poor under most of scene, secondary Kmeans cluster can be with
Obtain the more complete profile of target, including propeller information.But since shear-resistant membrane makes the edge blurry of target, most
The result that secondary Kmeans is clustered eventually can make objective contour expand, so that losing certain profile indicates ability.
In view of this, the embodiment of the present invention shrinks objective contour using the thinking of corrosion, to obtain compared with subject to
True ground objective contour information.The profile of target more shunk is obtained first with thinning algorithm.
Skeleton in region can use jackshaft (MAT) and be defined as follows: each of the region R that a frame is b
Point p finds the nearest neighbor point in b.If p is bigger than such Neighbor Points, the skeleton that we claim p to belong to R.We will gradually delete
The first lap pixel of objective contour, second circle pixel etc., while there can be no target disconnections.In view of datum target of the invention
Be not it is very big, still delete target profile outermost pixel, become apparent helicopter body contour feature.Then
In order to reject burr, singular point etc., the highlight regions for being less than or equal to two pixels are set 0 and can rejected and made an uproar by us using connectivity
Sound shadow is rung.Finally our result indicate that the profile of target, the propeller of helicopter can be separated accurately, it is
Next key position extraction etc. lays the foundation.
In embodiments of the present invention, image is polymerized to k class (in embodiments of the present invention first with Kmeans clustering algorithm
K=4), merger then is carried out by all kinds of sizes, becomes two classes, it (or is the one of target that one kind, which is target, in these two types
Part), another kind of is background (a part that may include target).The corresponding gray value of classification where target is set 0, is obtained
Image carries out Kmeans cluster (k=4 and identical above) again, based on all kinds of size merger at two classes.Obtaining target
Classification after with cluster obtained target for the first time and merge, the segmentation result of final goal can be obtained.Finally in order to inhibit
The influence of shear-resistant membrane carries out skeletal extraction to final result, burr is rejected.
Obviously, those skilled in the art can carry out various changes and deformation without departing from essence of the invention to the present invention
Mind and range.In this way, if these modifications and changes of the present invention belongs to the range of the claims in the present invention and its equivalent technologies
Within, then the present invention is also intended to include these modifications and variations.