CN106447676B - A kind of image partition method based on fast density clustering algorithm - Google Patents

A kind of image partition method based on fast density clustering algorithm Download PDF

Info

Publication number
CN106447676B
CN106447676B CN201610887803.2A CN201610887803A CN106447676B CN 106447676 B CN106447676 B CN 106447676B CN 201610887803 A CN201610887803 A CN 201610887803A CN 106447676 B CN106447676 B CN 106447676B
Authority
CN
China
Prior art keywords
pixel
image
value
distance
obtains
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.)
Active
Application number
CN201610887803.2A
Other languages
Chinese (zh)
Other versions
CN106447676A (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.)
Zhejiang University of Technology ZJUT
Original Assignee
Zhejiang University of Technology ZJUT
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 Zhejiang University of Technology ZJUT filed Critical Zhejiang University of Technology ZJUT
Priority to CN201610887803.2A priority Critical patent/CN106447676B/en
Publication of CN106447676A publication Critical patent/CN106447676A/en
Application granted granted Critical
Publication of CN106447676B publication Critical patent/CN106447676B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

A kind of image partition method based on fast density clustering algorithm, comprising the following steps: the 1) natural image to be processed for one is pre-processed first and initialized, including filtering noise reduction, gray-level registration, area dividing and scaling etc.;2) calculating of similarity distance, obtains the correlation between pixel then carrying out data point to the subgraph for completing change of scale;3) parallel dividing processing is then carried out in each width subgraph, including decision diagram is drawn based on density clustering algorithm, is determined cluster centre based on decision diagram progress residual analysis and is compared based on similarity distance and sorts out the left point on archeus subgraph;4) then the subgraph after the completion of segmentation is merged, carries out secondary reunion class and obtains the segmentation result figure of original size size.The present invention, which provides one kind, can automatically determine segmentation classification number, and realizing segmentation, accuracy rate is higher, the image partition method to parameter robust based on fast density clustering algorithm.

Description

A kind of image partition method based on fast density clustering algorithm
Technical field
The invention belongs to technical field of image processing, and in particular to a kind of image partition method.
Background technique
Image segmentation is one of key technology of image procossing, is widely used, and main task is to divide the image into several Specifically, region with unique properties, region inside has strong similitude, each interregional with strong otherness.Meanwhile image Segmentation is also that the important step of data analysis and understanding is carried out to image, is the key that by image procossing to image analysis.It is existing Image partition method mainly divides following a few classes: the dividing method based on boundary, the dividing method based on region and based on specific Theoretical dividing method etc..After the completion of image segmentation, the target extracted can be used for image, semantic identification, picture search etc. Field, so the quality of image segmentation result will directly affect the accuracy of subsequent identification or search.
Due to the ambiguity and complexity of image, all kinds of images can be generally applicable to currently without general segmentation theory Segmentation, the partitioning algorithm proposed is greatly both for particular problem, therefore there is still a need for constantly explore new segmentation Algorithm and segmentation theory, this is also the purpose studied herein.Dividing method based on boundary be by detection gray level or There is person's structure the place of mutation to be split the determination on boundary, including common first order differential operator have Roberts operator, Prewitt operator and Sobel operator, Second Order Differential Operator have Laplace operator and Kirsh operator etc..Wang Junmin is " based on micro- The edge detection and its application of point operator " in Roberts operator, Prewitt operator, Sobel operator, Laplace operator, The basic principle of LOG operator is analyzed, and summarizes the advantage and disadvantage of various operators.Canny proposes a kind of new edge detection Method, it is optimal on the step change type edge influenced by white noise, but there are the discontinuous situations in boundary.Miao Jiaqing is " adaptive Dictionary improve Canny operator CT image segmentation " in canny operator is improved using self-adapting dictionary learning algorithm.Base Dividing method in region includes Parallel Regional Partition technology and serial domain decomposition technique.Most typical Parallel Regional Partition skill Art is thresholding method, and key is determining segmentation threshold, therefore derives global threshold, adaptive threshold, optimal threshold again Etc..Chen Ningning is in " realization of several threshold segmentation algorithms is compared with " to histogram thresholding method, iterative method and great Jin The common threshold value such as method determines that method is comprehensively compared, and Ma Yinghui et al. will be traditional in " color image segmentation method summary " Grey relevant dynamic matrix be applied to color image, obtain better segmentation effect using the more color informations of color image.Region Growth method and split degree method be two kinds of typical serial regional development and technologies, carries out growth criterion and split degree criterion is set Meter, the processing of cutting procedure subsequent step will be judged according to the result of historical steps and be determined.As each subject is many There are many image partition methods combined with some specific theories, method, including base in the it is proposed of new theory and new method Image segmentation in genetic algorithm, the image segmentation based on artificial neural network, the image segmentation based on objective function optimization, base Image segmentation in clustering, the image segmentation based on MRF, image segmentation based on fuzzy set theory etc..
With the appearance of new clustering methods various in recent years, many image segmentation sides based on clustering algorithm have been derived Method, compared to the dividing method of other specific theories, the image partition method based on clustering provides one for image segmentation A new thinking.Meanwhile it has recently been demonstrated that comprehensively utilizing the location information between the colouring information of image, pixel, office The texture information in portion region and the contextual information of pixel, can greatly promote segmentation result.Figure based on clustering algorithm As dividing method is also known as feature space clustering procedure, the key that the problem of dividing the image into is converted to clustering problem is empty using feature Between point indicate image space in corresponding pixel, according to their aggregation results in feature space to feature space point carry out Segmentation, then maps them into original image space, obtains final segmentation result.Classical clustering algorithm has Fuzzy C-means, K-means, Ncut, SLIC, Mean-shift etc..Alex et al. proposes a kind of novel cluster centre side of portraying Method provides a kind of new thinking for the design of clustering algorithm, is based on the image segmentation of clustering algorithm progress herein, together When it is huge for high time complexity of the former clustering algorithm when handling big data quantity and high spatial complexity and image data amount Contradiction, propose a series of solution.
Summary of the invention
Have the sensitivity of cluster centre existing for the image partition method based on clustering algorithm, parameter dependence to overcome Greatly, adaptivity is poor, the deficiency that can not accurately automatically determine of segmentation class number of clusters, can automatically determine point the present invention provides one kind Cut that classification number, accuracy rate is higher for segmentation, the image partition method to parameter robust based on fast density clustering algorithm.
The technical solution adopted by the present invention to solve the technical problems is:
A kind of image partition method based on fast density clustering algorithm: it the described method comprises the following steps:
1) it initializes, process is as follows:
1.1) area dividing operation is carried out first, and the image to be processed for one includes the pixel of M row N column, warp After crossing pretreatment, 2 are divided the image intoW1×2W2Width subgraph, obtained sub-graph size areBefore wherein Z [f] is To bracket function;
1.2) change of scale operation then is carried out to image, the subgraph after the completion of piecemeal is subjected to scaling processing, i.e., Subgraph having a size of a*b is become into a1*b1, wherein a1=a/ksizeAnd b1=b/ksize, ksize> 1;During scaling, because It include there are three pixel value, so the method using weak sampling carries out change of scale, by image to be processed for each pixel Retain the important clustering information of original image while the pixel number for including is reduced as far as possible;
2) it is calculated based on the similarity of pixel value and location information distance, process is as follows:
2.1) the natural image I to be processed for one includes M row N column pixel, enables n=M*N, then pixel data CollectionIn the characteristic information that has of each pixel include three chrominance channel component values under RGB color space, as R, G, B Three pixel values;And be to the right Y-axis using the image upper left corner as coordinate origin, horizontal line, vertical line is downwards for the two of X-axis Coordinate value (x, y) under dimensional plane rectangular coordinate system;
2.2) d is setpThe similarity distance of (p1, p2) between two pixels, similarity distance calculation formula are as follows:
dp(p1, p2)=θ dp_rgb(p1,p2)+(1-θ)dp_xy(p1,p2) (3)
In formula (1), r1, g1, b1 and r2, g2, b2 respectively represent the pixel value of pixel p1, p2 under RGB color space, dp_rgbIndicate the distance between the pixel under the space;In formula (2), x1, y1 and x2, y2 respectively represent pixel p1, p2 straight Coordinate value in angular coordinate system, dp_xyIndicate distance between pixel in the coordinate system, in formula (3), θ is weight factor, is used To adjust the contribution that color distance and positional distance determine similarity;
3) Density Clustering for automatically determining cluster centre, operates subgraph, and process is as follows:
3.1) the similarity distance between image slices vegetarian refreshments is calculated, it is known that there are dualities for the similarity distance of pixel, i.e., dp(p1, p2)=dp(p2, p1), and dp(p1, p1)=0, therefore similarity distance is stored as upper three that diagonal line data are zero Angular moment battle array { Dpij};
3.2) density value for calculating each pixel, obtains density matrixCalculation formula is as follows:
Wherein function
In formula (4), ρiIndicate pixel piDensity value, the set of pixels of imageCorresponding index set is Is ={ 1,2 ..., M*N }, dij=dp(pi, pj) indicates the similarity distance between two pixels;
3.3) distance value for calculating each pixel, obtains distance matrixEach pixel piDistance value definition For δi, first look for comparing piThe big pixel of density obtains set S'={ pj, then search S' in piDistance it is nearest Pixel pj', then obtain δi=dp(pi,pj');
3.4) it is obtained according to step 3.2) and step 3.3)WithDecision diagram is drawn, obtains indicating pixel The discrete function δ of density and distance relationi=f (ρi);
3.5) unitary linear fit is carried out by the discrete data point in ρ-δ relational graph, obtains matched curve yδ=kxρ+b0WithCalculate the residual values ε of each data pointδi=yδiiAnd ερi=xρii, draw residual error histogram εδi- h and ερi- h carries out normal approach with bell-shaped curve respectively, obtains variance yields σδAnd σρ, it is in outside confidence interval using the determination of λ σ principle Singular point as cluster centre, be denoted as cδAnd cρ
3.6) discrete function γ=f of bivariate is obtained by decision diagramγ(ρ, δ) carries out the fitting on binary inclined-plane, is intended Conjunction plane is zγ=b1+b2ρ+b3δ calculates the residual values ε of each data pointγi=yγi(ρ,δ)-γi(ρ, δ) it is straight to draw residual error Side figure εγi- h carries out normal approach also with bell-shaped curve, obtains variance yields σγ, confidence area is in using the determination of λ σ principle Between outer singular point as cluster centre, be denoted as cγ
Wherein function fγIt is the binary function about variable ρ and δ, be corresponding to the coordinate value in three-dimensional space (ρ, δ, fγ), then define bivariate discrete function are as follows:
In formula (5), take the logarithm of the product of density value and distance value as functional value;1 is added to be in order to be zero in density, D is fallen in withoutcFormula is still set up when in radius;It indicates to correspond to original image piPoint and its four neighborhoods totally five pictures The density value of vegetarian refreshments adds up and increases the weighted value that constituent density determines cluster centre;
3.7) cluster centre determined by step 3.5) and step 3.6) is taken into union, obtained in the final cluster of image Heart cδργ=cδ∪cρ∪cγResidual pixel point is sorted out then according to nearest neighbouring rule for the set comprising η element, And homogeneous region is filled with the pixel value of cluster centre point;
3.8) step 3.1) is repeated to operation 3.7) to every width subgraph, then each width subgraph is merged, obtains intermediate knot Fruit figure;
4) secondary reunion class, process are as follows:
4.1) the intermediate result figure as obtained in step 3.8) zooms to the scale of needs, using color distance dp_rgb The measuring similarity index of (p1, p2) as reunion class calculatesWithρ-δ relational graph is drawn, discrete function is obtained δi=f (ρi);
4.2) δ obtained by step 4.1)i=f (ρi) relationship calculating bivariate discrete function γ=fγ(ρ, δ) carries out two The fitting on first inclined-plane calculates the residual values ε of each data pointγi=yγi(ρ,δ)-γi(ρ, δ) draws residual error histogram εγi- h, Normal approach is carried out also with bell-shaped curve, obtains variance yields σγ, it is in using the determination of λ σ principle unusual outside confidence interval Point is used as cluster centre, is denoted as cγ
It 4.3) will be by cluster centre c that step 4.2) obtainsγScale playback is carried out in spatial domain, obtains original size The cluster centre of intermediate result figure sorts out residual pixel point according to nearest neighbouring rule, and with the pixel value of cluster centre Fill homogeneous region.
Further, in the step 3.2), dcIt is a positive real number, for portraying with pixel piFor the center of circle, dcFor radius Circumference, and density value ρiAs fall in the pixel number of circumferential inner;It is cumulative with channel each under color space pixel value With the pixel p of maximummaxWith each channel pixel value it is cumulative and minimum at pixel pminBetween similarity distance 2% is used as dcValue, calculation formula are as follows:
In formula (6),If indicating in piece image, have multiple pixels pixel value under color space cumulative and It is equal, all in maximum or the smallest situation, to be then averaged, i.e.,
Further, in the step 3.7), finally obtained cluster centre cδργBe analyzed by cubic regression it is poly- Class center cδ、cρ、cγIt takes union to obtain, when showing the result figure of cluster segmentation, uses the cluster obtained in the case of over-segmentation The pixel value at center fills such cluster region.
Further, in the step 4.2), the judgment basis that the cluster centre of secondary reunion class automatically determines no longer makes Use cδ、cρ、cγUnion, only to γ value carry out histogram analysis.
Technical concept of the invention are as follows: the image partition method based on fast density clustering algorithm, to natural image Segmentation classification number can be automatically determined in segmentation, realizing segmentation, accuracy rate is higher, image segmentation to parameter robust.For a width Natural image to be processed comprising M row N column pixel, is pre-processed, including filtering and noise reduction, gray-level registration etc. first;So The piecemeal that image is carried out to region afterwards, obtains the subgraph of equidimension;In order to guarantee the rapidity of algorithm, while comprehensively considering the time Each width subgraph is carried out the scaling of equal proportion, the subgraph after obtaining change of scale by the integrality of complexity and clustering information;So The calculating of similarity distance, obtains the correlation between pixel carrying out data point to the subgraph for completing change of scale afterwards;Then Parallel dividing processing is carried out in each width subgraph, including decision diagram is drawn based on density clustering algorithm, is carried out based on decision diagram Residual analysis, which is determined cluster centre and compared based on similarity distance, sorts out the left point on archeus subgraph;Then will Subgraph after the completion of segmentation merges, and carries out reunion class and obtains the segmentation result figure of original size size.The fusion of image includes pair Adjacent area in subgraph on cut-off rule is merged and is merged to the adjacent area on subgraph piecemeal boundary line, thus obtains intermediate knot Fruit figure.Finally, the intermediate result slightly merged is carried out secondary reunion class, non-conterminous homogeneous region is merged, is obtained final Result figure.
Beneficial effects of the present invention are mainly manifested in: can automatically determine the segmentation classification number of image, final segmentation knot Fruit accuracy rate is higher, reduces the sensitivity to parameter problem of image segmentation process.It is on true picture the experimental results showed that, should Algorithm has good applicability and precision, effectively can carry out adaptivenon-uniform sampling to image, and obtains preferable segmentation effect Fruit.
Detailed description of the invention
Fig. 1 is the flow chart that scaling is carried out to image.
Fig. 2 is the stored digital model schematic of natural image.
Fig. 3 is to carry out the flow chart that unitary linear fit searches cluster centre to subgraph according to ρ-δ relationship, is obtained in cluster Heart cδAnd cρ, wherein (a) is to look for cluster centre cδ, (b) it is to look for cluster centre cρ
Fig. 4 is by γ=fγ(ρ, δ) function carries out the fitting of binary inclined-plane and searches cluster centre cγFlow chart.
Fig. 5 is the flow chart for automatically determining final cluster centre.
Fig. 6 is the flow chart of the image partition method based on fast density clustering algorithm.
Specific embodiment
The invention will be further described below in conjunction with the accompanying drawings.
Referring to Fig.1~Fig. 6, a kind of image partition method based on fast density clustering algorithm, comprising the following steps:
1) it initializes, in order to accelerate the processing speed of algorithm, reduces the processing time, mainly pass through area dividing and ruler herein Degree converts collective effect to reduce picture size, while can retain the most important information searched for cluster centre, mistake again Journey is as follows:
1.1) area dividing operation is carried out first, and the image to be processed for one includes the pixel of M row N column, warp After crossing the pretreatment such as noise reduction filtering, 2 are divided the image intoW1×2W2Width subgraph, obtained sub-graph size areIts Middle Z [f] is preceding to bracket function;
1.2) in order to further decrease the pixel number that image to be processed includes, ruler is carried out to the subgraph after the completion of piecemeal Scaling processing is spent, i.e., the subgraph having a size of a*b is become into a1*b1, wherein a1=a/ksizeAnd b1=b/ksize, ksize> 1.? During scaling, because each pixel includes to carry out change of scale using the method for weak sampling there are three pixel value, Retain the important clustering information of original image while pixel number to be processed is reduced as far as possible.
Specific scaling algorithm flow is as shown in Figure 1, wherein the function of imresize (I, [a1, b1]) function is using height Image I change of scale is a1*b1 by method down-sampled again after this is fuzzy.It, can by the transformation of the piecemeal and scale in region Data volume to be processed is reduced in tolerance interval, thus speed up processing.
2) it is calculated based on the similarity of pixel value and location information distance, process is as follows:
2.1) the natural image I to be processed for one includes M row N column pixel, enables n=M*N, then pixel data CollectionIn the characteristic information that has of each pixel include three chrominance channel component values under RGB color space, as R is (red Color), three pixel values of G (green), B (blue);And be to the right Y-axis using the image upper left corner as coordinate origin, horizontal line, Vertical line is the coordinate value (x, y) under the two-dimensional surface rectangular coordinate system of X-axis downwards.Then define the table of each pixel on image Show that form is pi(ri,gi,bi,xi,yi), it is illustrated in figure 2 stored digital model of two pixels in natural image.
2.2) it when progress similarity distance determines, is calculated using Euclidean distance, p1, p2 represent two different pictures Vegetarian refreshments, the then color difference and position difference obtained between two pixels can be expressed as follows with color distance and positional distance:
R1, g1, b1 and r2, g2, b2 respectively represent the pixel value of pixel p1, p2 under RGB color space in formula (1), dp_rgbIndicate the distance between the pixel under the space;X1, y1 and x2, y2 respectively represent pixel p1, p2 at right angle in formula (2) Coordinate value in coordinate system, dp_xyDistance between the pixel of expression in the coordinate system.Pixel value is different with the dimension of coordinate value, Therefore internal normalization has been carried out to these two types of information in formula, has obtained the unified good results of weight.Because of this paper subsequent processing Image each pixel value be with 8 binary storages, therefore when carrying out pixel value normalization use 28- 1 conduct A reference value.M, it is that every row has N number of pixel that N, which represents the size of input picture, often shows M pixel.
2.3) the similarity distance d between two pixels is finally calculatedp(p1, p2), distance value is bigger to illustrate that difference is bigger, phase Lower like spending, the calculation formula of similarity distance is as follows:
dp(p1, p2)=θ dp_rgb(p1,p2)+(1-θ)dp_xy(p1,p2) (3)
In formula (3), θ is weight factor, the contribution determined to adjust color distance and positional distance to similarity.
Similarity distance is applied not only to clustering, after determining cluster centre, also needs to arrive according to each pixel The similarity distance of cluster centre determines that it belongs to situation, and segmentation result is obtained after the completion of all pixels point is sorted out.In phase Like joined location information in degree distance calculating, the interaction between farther away pixel of meeting on spatial position is weaker, Image data setData volume it is less when, it will lead to not smooth enough the problem at segmentation block edges, handed in vision Friendly relation are not met on mutually.To solve this problem, the conversion that obtained segmentation result figure is carried out to color space, by RGB The color space HSV is converted to, median filtering then is carried out to the V channel information for characterizing light levels under HSV model, then again HSV is converted to RGB model to export, obtains the segmentation result figure of vision close friend.
3) Density Clustering for automatically determining cluster centre, operates subgraph, and process is as follows:
Definition 1 sets the image I for a width comprising n pixel, corresponds to two one-dimensional data matrixes,Indicate close Matrix is spent,Indicate distance matrix, size is all 1 row n column.The i-th column data and original graph of density matrix or distance matrix The mapping relations of Mx row Nx column pixel are as follows as in:
I=N (Mx-1)+Nx (7)
3.1) the similarity distance between image slices vegetarian refreshments is calculated, it is known that there are dualities for the similarity distance of pixel, i.e., dp(p1, p2)=dp(p2, p1), and dp(p1, p1)=0, therefore similarity distance is stored as upper three that diagonal line data are zero Angular moment battle array { Dpij};
3.2) density value for calculating each pixel, obtains density matrixCalculation formula is as follows:
Wherein function
In formula (4), ρiIndicate pixel piDensity value, the set of pixels of imageCorresponding index set is Is ={ 1,2 ..., M*N }, dij=dp(pi, pj) indicates the similarity distance between two pixels;
In order to reduce space complexity when operation, to increase regular hour complexity as cost, the present invention uses one The improved density matrix calculation method of kind, specific density matrix algorithm steps are as follows:
3.2.1) one width of input includes the digital picture I and lookup radius d of M row N column pixelc, setting circulation initial value, I1=j1=1, i2=j2=1, i=1, the memory space of density of distribution matrix, are denoted asN=M*N, initial value are set to 0;
3.2.2 the similarity distance for) calculating pixel (i1, j1) and point (i2, j2) in image, is denoted as dp(p(i1,j1), p(i2,j2)), if dp(p(i1,j1),p(i2,j2)) > dc, then ρii+ 0, on the contrary ρii+1;
3.2.3) j2=j2+1, if j2≤N, return step 3.2.2), on the contrary j2=1 is enabled, execute step 3.2.4);
3.2.4) i2=i2+1, if i2≤M, return step 3.2.2), on the contrary i2=1 is enabled, execute step 3.2.5);
3.2.5) j1=j1+1, i=i+1, if j1≤N, return step 3.2.2), on the contrary j1=1 is enabled, execute step 3.2.6);
3.2.6) i1=i1+1, if i1≤M, return step 3.2.2), on the contrary i1=1 is enabled, execute step 3.2.7);
3.2.7 finally obtained density matrix) is exported
It is not to be previously stored { Dp in algorithm aboveijAnd then determine, but calculating each pixel When density value, all similarity distance of calculated in advance time pixel and other n-1 pixel, in the density for completing the point After calculating, the space for storing similarity distance is discharged, greatly reduces memory consumption when operation in this way.
3.3) distance value for calculating each pixel, obtains distance matrixEach pixel piDistance value definition For δi, first look for comparing piThe big pixel of density obtains set S'={ pj, then search S' in piDistance it is nearest Pixel pj', then obtain δi=dp(pi, pj'), specific distance matrix algorithm are as follows:
3.3.1 the density matrix in step 3.2) is ranked up from big to small), obtains orderly new density matrixArray of indexes is calculated according to the mapping relations for defining 1 simultaneouslySave new density matrixWith The mapping relations of position between each pixel of original image, setting circulation initial value i1=j1=1, ind1=1;
3.3.2 density maxima ρ ') is calculated1Corresponding pixel pρ'1With the distance value of rest of pixels point, calculation formula is δ _ temp (1, ind)=dp(p(i1,j1),pρ'1);
3.3.3) j1=j1+1, ind1=ind1+1, if j1≤N, return step 3.3.2), on the contrary j1=1 is enabled, it executes Step 3.3.4);
3.3.4) i1=i1+1, if i1≤M, return step 3.3.2), on the contrary i1=1 is enabled, execute step 3.3.5);
3.3.5 the maximum value of δ _ temp (1, ind)) is searched, as the similarity distance value of the maximum pixel of density, i.e., δ'1=MAX δ _ temp (1, i) | i ∈ (1, n) };
3.3.6) setting circulation initial value i1=2, i2=1;
3.3.7 residual pixel point) is calculatedThe distance value of the pixel big to the density ratio point, calculation formula be δ _ Temp (1, i2)=dp(pρ'i1,pρ'i2);
3.3.8) i2=i2+1, if i2≤i1-1, return step 3.3.7), on the contrary take its minimum value as similarity away from From value, i.e. δ 'i1=MIN δ _ temp (1, i) | and i ∈ (1, i2) }, execute step 3.3.9);
3.3.9) i1=i1+1, if i1≤M*N, return step 3.3.7), otherwise execute step 3.3.10);
3.3.10) by indexingIt willIt is mapped to and original density matrixThe corresponding distance in position Storage unitExport distance matrix
3.4) it is obtained according to step 3.2) and step 3.3)WithDecision diagram is drawn, obtains indicating pixel The discrete function δ of density and distance relationi=f (ρi);
3.5) unitary linear fit is carried out by the discrete data point in ρ-δ relational graph, obtains matched curve yδ=kxρ+b0WithCalculate the residual values ε of each data pointδi=yδiiAnd ερi=xρii, draw residual error histogram εδi- h and ερi- h carries out normal approach with bell-shaped curve respectively, obtains variance yields σδAnd σρ, it is in outside confidence interval using the determination of λ σ principle Singular point as cluster centre, be denoted as cδAnd cρ, algorithm flow chart is as shown in Figure 3;
It defines 2 and sets function fγIt is the binary function about variable ρ and δ, be corresponding to the coordinate value in three-dimensional space (ρ, δ, fγ), then define bivariate discrete function are as follows:
In formula (5), take the logarithm of the product of density value and distance value as functional value;1 is added to be in order to be zero in density, D is fallen in withoutcFormula is still set up when in radius, and there is no actual physical meanings;There are contexts between the pixel of image Information also includes contextual information equally in corresponding density battle array, thereforeIt indicates to correspond to original image piPoint and its four The density value of neighborhood totally five pixels it is cumulative and, increase the weighted value that constituent density determines cluster centre.
3.6) by discrete function γ=f of the bivariate in definition 2γ(ρ, δ) carries out the fitting on binary inclined-plane, is intended Conjunction plane is zγ=b1+b2ρ+b3δ calculates the residual values ε of each data pointγi=yγi(ρ,δ)-γi(ρ, δ) it is straight to draw residual error Side figure εγi- h carries out normal approach also with bell-shaped curve, obtains variance yields σγ, confidence area is in using the determination of λ σ principle Between outer singular point as cluster centre, be denoted as cγ, algorithm flow chart is as shown in Figure 4;
3.7) cluster centre determined by step 3.5) and step 3.6) is taken into union, obtained in the final cluster of image Heart cδργ=cδ∪cρ∪cγResidual pixel point is sorted out then according to nearest neighbouring rule for the set comprising η element, Algorithm flow chart is as shown in Figure 5;
Finally obtained cluster centre cδργIt is the cluster centre c analyzed by cubic regressionδ、cρ、cγUnion is taken to obtain , over-segmentation is easily caused in this way, i.e., can finally divide the image into many zonules.Although the segmentation result obtained in this way exists Similarity in region is very high, i.e., internal to have strong interaction, but interregional otherness is not but high, this is not our institutes Desired cluster result.This just needs to carry out fusion treatment in the next steps, and the high different zones of similarity are reconsolidated Together.In order to facilitate fusion treatment, when showing the result figure of cluster segmentation, using in the cluster obtained in the case of over-segmentation The pixel value of the heart fills such cluster region, while can possess more friendly visual effect.
3.8) step 3.1) is all repeated to every width subgraph to operation 3.7), obtains a segmentation result of every width subgraph Figure, then the segmentation result figure of each width subgraph is merged, obtain intermediate result figure.
4) secondary reunion class, process are as follows:
4.1) the scaling method for intermediate result figure foundation Fig. 1 that step 3.8) obtains is zoomed to the scale of needs, Using dp_rgb(p1, p2) is used as measuring similarity index, calculates according to density matrix algorithm and distance matrix algorithmWithρ-δ relational graph is drawn, discrete function δ is obtainedi=f (ρi);
Because the detailed information that original image includes is completely capped in the intermediate result figure after primary cluster, So the contradiction of information integrity and algorithm complexity is no longer so sharp in secondary reunion class, also there is no need to carry out area again The piecemeal in domain need to only scale the images to the scale of needs.In secondary reunion class, used measuring similarity refers to Mark is dp_rgb(p1, p2), because of dp(p1, p2) be added characterization location information coordinate value after, remote picture in spatial domain Interaction force between vegetarian refreshments just dies down, and the purpose of secondary reunion class is exactly to merge non-adjacent homogeneous region, So color distance d is used onlyp_rgb(p1,p2);
4.2) δ obtained by step 4.1)i=f (ρi) relationship calculate bivariate discrete function γ=fγ(ρ, δ) is carried out The fitting on binary inclined-plane calculates the residual values ε of each data pointγi=yγi(ρ,δ)-γi(ρ, δ) draws residual error histogram εγi- H carries out normal approach using bell-shaped curve, obtains variance yields σγ, the singular point being in outside confidence interval is determined using λ σ principle As cluster centre, it is denoted as cγ
4.3) position of cluster centre in step 4.2) is carried out to scale playback in spatial domain, intermediate result figure is obtained and exists Cluster centre under original size sorts out residual pixel point, fills homogeneous region with the pixel value of cluster centre.It is secondary Weight clustering algorithm is as follows:
4.3.1) input includes the intermediate result figure I_temp and search radius d of M row N column pixelc
4.3.2 I_temp) is subjected to scaling according to scaling rule, obtains I_temp';
4.3.3 it) is first depending on the density matrix that density matrix algorithm calculates I_temp', is calculated according to distance matrix algorithm The distance matrix of I_temp' carries out histogram analysis and automatically determines singular point as cluster then according to 2 calculating γ values are defined The position of cluster centre is finally carried out scale playback, obtains the cluster centre position under original scale, calculating at this time by center All take dp_rgb(p1, p2) is used as measuring similarity index;
4.3.4) according to apart from nearest principle, i.e. similarity maximum principle is sorted out, by the rest of pixels point of I_temp It is included into the class cluster nearest apart from oneself, obtains secondary reunion class as a result, and exporting final result figure I_result.

Claims (4)

1. a kind of image partition method based on fast density clustering algorithm, it is characterised in that: the described method comprises the following steps:
1) it initializes, process is as follows:
1.1) area dividing operation is carried out first, and the image to be processed for one includes the pixel of M row N column, by pre- After processing, 2 are divided the image intoW1×2W2Width subgraph, obtained sub-graph size areWherein Z [f] is preceding to taking Integral function;
1.2) change of scale operation then is carried out to image, the subgraph after the completion of piecemeal is subjected to scaling processing, i.e., by ruler The very little subgraph for a*b becomes a1*b1, wherein a1=a/ksizeAnd b1=b/ksize, ksize> 1;During scaling, because often A pixel includes that there are three pixel values, so the method using weak sampling carries out change of scale, is including by image to be processed Pixel number reduce while as far as possible retain original image important clustering information;
2) it is calculated based on the similarity of pixel value and location information distance, process is as follows:
2.1) the natural image I to be processed for one includes M row N column pixel, enables n=M*N, then pixel data setIn the characteristic information that has of each pixel include three chrominance channel component values under RGB color space, as R, G, B Three pixel values;And be to the right Y-axis using the image upper left corner as coordinate origin, horizontal line, vertical line is downwards for the two dimension of X-axis Coordinate value (x, y) under plane right-angle coordinate;
2.2) d is setpThe similarity distance of (p1, p2) between two pixels, similarity distance calculation formula are as follows:
dp(p1, p2)=θ dp_rgb(p1,p2)+(1-θ)dp_xy(p1,p2) (3)
In formula (1), r1, g1, b1 and r2, g2, b2 respectively represent the pixel value of pixel p1, p2 under RGB color space, dp_rgb Indicate the distance between the pixel under the space;In formula (2), x1, y1 and x2, y2 respectively represent pixel p1, p2 and sit at right angle Coordinate value in mark system, dp_xyDistance between the pixel of expression in the coordinate system;In formula (3), θ is weight factor, to adjust Save the contribution that color distance and positional distance determine similarity;
3) Density Clustering for automatically determining cluster centre, operates subgraph, and process is as follows:
3.1) the similarity distance between image slices vegetarian refreshments is calculated, it is known that there are dualities, i.e. d for the similarity distance of pixelp(p1, P2)=dp(p2, p1), and dp(p1, p1)=0, therefore similarity distance is stored as the upper triangular matrix that diagonal line data are zero {Dpij};
3.2) density value for calculating each pixel, obtains density matrixCalculation formula is as follows:
In formula (4), ρiIndicate pixel piDensity value, the set of pixels of imageCorresponding index set is Is=1, 2 ..., M*N }, dij=dp(pi, pj) indicates the similarity distance between two pixels;
3.3) distance value for calculating each pixel, obtains distance matrixEach pixel piDistance value be defined as δi, It first looks for comparing piThe big pixel of density obtains set S'={ pj, then search S' in piThe nearest pixel of distance pj', then obtain δi=dp(pi,pj');
3.4) it is obtained according to step 3.2) and step 3.3)WithDecision diagram is drawn, obtains indicating pixel point density With the discrete function δ of distance relationi=f (ρi);
3.5) unitary linear fit is carried out by the discrete data point in ρ-δ relational graph, obtains matched curve yδ=kxρ+b0WithCalculate the residual values ε of each data pointδi=yδiiAnd ερi=xρii, draw residual error histogram εδi- h and ερi- h carries out normal approach with bell-shaped curve respectively, obtains variance yields σδAnd σρ, it is in outside confidence interval using the determination of λ σ principle Singular point as cluster centre, be denoted as cδAnd cρ
3.6) discrete function γ=f of bivariate is obtained by decision diagramγ(ρ, δ) carries out the fitting on binary inclined-plane, it is flat to obtain fitting Face is zγ=b1+b2ρ+b3δ calculates the residual values ε of each data pointγi=yγi(ρ,δ)-γi(ρ, δ) draws residual error histogram εγi- h carries out normal approach also with bell-shaped curve, obtains variance yields σγ, it is in outside confidence interval using the determination of λ σ principle Singular point as cluster centre, be denoted as cγ
Wherein function fγIt is the binary function about variable ρ and δ, is (ρ, δ, f corresponding to the coordinate value in three-dimensional spaceγ), then Define bivariate discrete function are as follows:
In formula (5), take the logarithm of the product of density value and distance value as functional value;Add 1 to be to be zero in density, that is, does not have D is fallen in a littlecFormula is still set up when in radius;It indicates to correspond to original image piPoint and its four neighborhoods totally five pixels Density value it is cumulative and, increase the weighted value that constituent density determines cluster centre;
3.7) cluster centre determined by step 3.5) and step 3.6) is taken into union, obtains the final cluster centre of image cδργ=cδ∪cρ∪cγResidual pixel point is sorted out then according to nearest neighbouring rule for the set comprising η element, and Homogeneous region is filled with the pixel value of cluster centre point;
3.8) step 3.1) is repeated to operation 3.7) to every width subgraph, then each width subgraph is merged, obtains intermediate result figure;
4) secondary reunion class, process are as follows:
4.1) the intermediate result figure as obtained in step 3.8) zooms to the scale of needs, using color distance dp_rgb(p1, P2 it) as the measuring similarity index of reunion class, calculatesWithρ-δ relational graph is drawn, discrete function δ is obtainedi= f(ρi);
4.2) δ obtained by step 4.1)i=f (ρi) relationship calculating bivariate discrete function γ=fγ(ρ, δ) it is oblique to carry out binary The fitting in face calculates the residual values ε of each data pointγi=yγi(ρ,δ)-γi(ρ, δ) draws residual error histogram εγi- h, equally Normal approach is carried out using bell-shaped curve, obtains variance yields σγ, determine that the singular point being in outside confidence interval is made using λ σ principle For cluster centre, it is denoted as cγ
It 4.3) will be by cluster centre c that step 4.2) obtainsγScale playback is carried out in spatial domain, obtains the centre of original size Residual pixel point is sorted out according to nearest neighbouring rule, and is filled with the pixel value of cluster centre by the cluster centre of result figure Homogeneous region.
2. the image partition method as described in claim 1 based on fast density clustering algorithm, it is characterised in that: the step 3.2) in, dcIt is a positive real number, for portraying with pixel piFor the center of circle, dcFor the circumference of radius, and density value ρiAs fall In the pixel number of circumferential inner;With the cumulative pixel p with maximum of channel each under color space pixel valuemaxWith it is each Pixel p at a channel pixel value is cumulative and minimumminBetween similarity distance 2% be used as dcValue, calculation formula is such as Under:
In formula (6),If indicating in piece image, there is multiple pixels pixel value under color space cumulative and phase Deng all in maximum or the smallest situation, to be then averaged, i.e.,
3. the image partition method as claimed in claim 1 or 2 based on fast density clustering algorithm, it is characterised in that: described In step 3.7), finally obtained cluster centre cδργIt is the cluster centre c analyzed by cubic regressionδ、cρ、cγTake union It obtains, when showing the result figure of cluster segmentation, fills class using the pixel value of the cluster centre obtained in the case of over-segmentation Cluster region.
4. the image partition method as claimed in claim 1 or 2 based on fast density clustering algorithm, it is characterised in that: described In step 4.2), the judgment basis that the cluster centre of secondary reunion class automatically determines does not use cδ、cρ、cγUnion, it is only right γ value carries out histogram analysis.
CN201610887803.2A 2016-10-12 2016-10-12 A kind of image partition method based on fast density clustering algorithm Active CN106447676B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610887803.2A CN106447676B (en) 2016-10-12 2016-10-12 A kind of image partition method based on fast density clustering algorithm

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610887803.2A CN106447676B (en) 2016-10-12 2016-10-12 A kind of image partition method based on fast density clustering algorithm

Publications (2)

Publication Number Publication Date
CN106447676A CN106447676A (en) 2017-02-22
CN106447676B true CN106447676B (en) 2019-01-22

Family

ID=58173418

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610887803.2A Active CN106447676B (en) 2016-10-12 2016-10-12 A kind of image partition method based on fast density clustering algorithm

Country Status (1)

Country Link
CN (1) CN106447676B (en)

Families Citing this family (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109426458B (en) * 2017-09-04 2022-05-17 阿里巴巴集团控股有限公司 Method and device for printing relation graph
CN108109150B (en) * 2017-12-15 2021-02-05 上海兴芯微电子科技有限公司 Image segmentation method and terminal
CN109959885B (en) * 2017-12-26 2021-04-30 深圳先进技术研究院 Imaging method based on binary decision tree, device and storage medium thereof
CN108229471B (en) * 2017-12-27 2023-10-27 南京晓庄学院 Line structure analysis method of offline handwriting text
CN108595585B (en) * 2018-04-18 2019-11-12 平安科技(深圳)有限公司 Sample data classification method, model training method, electronic equipment and storage medium
CN109410236B (en) * 2018-06-12 2021-11-30 佛山市顺德区中山大学研究院 Method and system for identifying and redefining reflecting points of fluorescence staining images
CN108986122B (en) * 2018-08-01 2021-03-02 重庆大学 Intelligent reconstruction method for indoor parking guide map
CN109145964B (en) * 2018-08-01 2020-09-08 武汉大学 Method and system for realizing image color clustering
CN110096607B (en) * 2019-04-17 2021-01-15 广州思德医疗科技有限公司 Method and device for acquiring label picture
CN110070547A (en) * 2019-04-18 2019-07-30 北京市商汤科技开发有限公司 Image processing method and device, electronic equipment and storage medium
CN110263804B (en) * 2019-05-06 2021-08-03 杭州电子科技大学 Medical image segmentation method based on safe semi-supervised clustering
CN110348521A (en) * 2019-07-12 2019-10-18 创新奇智(重庆)科技有限公司 Image procossing clustering method and its system, electronic equipment
CN110751654B (en) * 2019-08-30 2022-06-28 稿定(厦门)科技有限公司 Image matting method, medium, equipment and device
CN110751228B (en) * 2019-10-28 2023-04-07 西京学院 Crop pathological change leaf detection method based on improved k-means algorithm
CN111179283A (en) * 2019-12-30 2020-05-19 深圳市商汤科技有限公司 Image semantic segmentation method and device and storage medium
CN113256645B (en) * 2021-04-12 2023-07-28 中国计量大学 Color image segmentation method based on improved density clustering
CN116090163B (en) * 2022-11-14 2023-09-22 深圳大学 Mosaic tile color selection method and related equipment
CN116385435B (en) * 2023-06-02 2023-09-26 济宁市健达医疗器械科技有限公司 Pharmaceutical capsule counting method based on image segmentation
CN117522864B (en) * 2024-01-02 2024-03-19 山东旭美尚诺装饰材料有限公司 European pine plate surface flaw detection method based on machine vision

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976348A (en) * 2010-10-21 2011-02-16 中国科学院深圳先进技术研究院 Image clustering method and system
CN103150731A (en) * 2013-03-07 2013-06-12 南京航空航天大学 Fuzzy clustering image segmenting method
CN103456017A (en) * 2013-09-08 2013-12-18 西安电子科技大学 Image segmentation method of semi-supervised weight kernel fuzzy clustering based on seed set
CN104504266A (en) * 2014-12-24 2015-04-08 中国科学院深圳先进技术研究院 Graph partitioning method based on shortest path and density clustering
CN105931236A (en) * 2016-04-19 2016-09-07 武汉大学 Fuzzy C-means clustering initial clustering center automatic selection method facing image segmentation
CN105930862A (en) * 2016-04-13 2016-09-07 江南大学 Density peak clustering algorithm based on density adaptive distance

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101976348A (en) * 2010-10-21 2011-02-16 中国科学院深圳先进技术研究院 Image clustering method and system
CN103150731A (en) * 2013-03-07 2013-06-12 南京航空航天大学 Fuzzy clustering image segmenting method
CN103456017A (en) * 2013-09-08 2013-12-18 西安电子科技大学 Image segmentation method of semi-supervised weight kernel fuzzy clustering based on seed set
CN104504266A (en) * 2014-12-24 2015-04-08 中国科学院深圳先进技术研究院 Graph partitioning method based on shortest path and density clustering
CN105930862A (en) * 2016-04-13 2016-09-07 江南大学 Density peak clustering algorithm based on density adaptive distance
CN105931236A (en) * 2016-04-19 2016-09-07 武汉大学 Fuzzy C-means clustering initial clustering center automatic selection method facing image segmentation

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Color Image Segmentation Using Fast Density-Based Clustering Method;Yujie Li et al;《Springer-Verlag Berlin Heidelberg》;20121231;第593-598页 *

Also Published As

Publication number Publication date
CN106447676A (en) 2017-02-22

Similar Documents

Publication Publication Date Title
CN106447676B (en) A kind of image partition method based on fast density clustering algorithm
CN107169487B (en) Salient object detection method based on superpixel segmentation and depth feature positioning
Cheng et al. Outdoor scene image segmentation based on background recognition and perceptual organization
CN108537239B (en) Method for detecting image saliency target
CN102096816B (en) Multi-scale multi-level image segmentation method based on minimum spanning tree
CN104504410A (en) Three-dimensional face recognition device and method based on three-dimensional point cloud
CN108710916B (en) Picture classification method and device
CN104077605A (en) Pedestrian search and recognition method based on color topological structure
CN113963222B (en) High-resolution remote sensing image change detection method based on multi-strategy combination
CN111583279A (en) Super-pixel image segmentation method based on PCBA
Guo et al. A method of automatic cell counting based on microscopic image
Chabrier et al. Optimization-based image segmentation by genetic algorithms
Li et al. Maximum cohesive grid of superpixels for fast object localization
CN102663723A (en) Image segmentation method based on color sample and electric field model
Pahwa et al. Locating 3D object proposals: A depth-based online approach
CN109816051A (en) A kind of harmful influence cargo characteristic point matching method and system
CN103399863B (en) Image search method based on the poor characteristic bag of edge direction
Belhaouari et al. Optimized K-means algorithm
CN107610136B (en) Salient object detection method based on convex hull structure center query point sorting
Wang et al. Classification of high spatial resolution remote sensing images based on decision fusion
Li et al. The research on traffic sign recognition based on deep learning
CN109741358A (en) Superpixel segmentation method based on the study of adaptive hypergraph
CN116824379A (en) Laser point cloud building contour progressive optimization method based on multidimensional features
CN106611418A (en) Image segmentation algorithm
Yang et al. 3-D geometry enhanced superpixels for RGB-D data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant