Summary of the invention
In order to alleviate the defect that said method exists in image segmentation process, the present invention from definition transitional region significance, it is proposed to a kind of New image segmentation method based on notable transitional region, improve image segmentation accuracy and robustness.
The present invention adopts below scheme to realize: a kind of image partition method based on notable transitional region, it is characterised in that comprise the steps:
Step S01: read image to be split;
Step S02: extract the transitional region of image;
Step S03: filter out notable transitional region;
Step S04: determine segmentation threshold, perform Threshold segmentation, obtain binarization segmentation result;
Step S05: performance objective region is screened, obtained final segmentation result.
In an embodiment of the present invention, the detailed process extracting image transition zone in described step S02 is as follows:
Step S021: selected neighborhood window size m, calculate each pixel p according to formula (1)i,jThe gray variance of corresponding m × m neighborhood window Ω, wherein (x y) represents pixel p in window Ω to fx,yGray scale,Represent the gray average of window Ω:
Step S022: build the matrix of all pixel correspondence local variances:
In formula, nhAnd nwThe height of difference representative image and width;
Step S023: all elements in matrix L v is carried out descending, arranges local variance value pixel corresponding to the N number of element of forward α and is considered as transitional region pixel, the sum of all pixels of N representative image, and α is a parameter;All transitional region pixels constitute the transitional region of image, and its formalized description is a two values matrix TR, wherein 1 and 0 represent transitional region pixel and rest of pixels point respectively.
In an embodiment of the present invention, the detailed process filtering out notable transitional region in described step S03 is as follows:
Step S031: pixel in bianry image TR is mapped as the node in figure, calculates the pixel number that in all connected components that under 8 connectivity structures, transitional region pixel is constituted, each connected component comprises;
Step S032: the transitional region connected component having maximum pixel is considered as notable transitional region, its formalized description is a two values matrix STR, wherein 1 and 0 represents notable transitional region pixel and rest of pixels point respectively.
In an embodiment of the present invention, determining segmentation threshold in described step S04, the process performing Threshold segmentation is divided into two big steps, and the first determines that candidate thresholds is interval, and it two is determine segmentation threshold from candidate thresholds interval, performs Threshold segmentation;
Described determine that the interval process of candidate thresholds is as follows:
Step S0411: calculate the gray average T of transitional region pixelm;
Step S0412: determine that candidate thresholds interval R is:
R=[t1t2]∩[0255](3)
t1=Tm-0.2×σ(4)
t2=Tm+0.2×σ(5)
Wherein, σ represents the gray standard deviation of entire image;
Described determine segmentation threshold, perform Threshold segmentation process as follows:
Step S0421: an arbitrarily selected gray scale t from candidate thresholds interval, the Threshold segmentation result B of its correspondence is sought according to following formulat;
Step S0422: calculate BtThe number of middle target pixel points and background pixel point, if object pixel number NoMore than background pixel number Nb, then to BtPerform following turning operation:
The purpose of above-mentioned turning operation be to ensure that Threshold segmentation after binarization segmentation result in 1 and 0 represent real object pixel and background pixel respectively;
Step S0423: calculate BtThe pixel number that middle target is overlapping with notable transitional region:
Step S0424: determine segmentation threshold T* according to following formula:
Step S0425: using T* as global threshold, performs Threshold segmentation, it is thus achieved that image binaryzation segmentation result BT*。
In an embodiment of the present invention, performance objective region screening in described step S05, it is thus achieved that the detailed process of final segmentation result is as follows:
Step S051: calculate BT*Middle target pixel points and background pixel point number, if object pixel number is more than background pixel number, then to BT*Perform and BtIdentical turning operation, to ensure BT*In 1 and 0 represent real object pixel and background pixel respectively;
Step S052: calculate the pixel number that under 8 connectivity structures, each target connected component is overlapping with notable transitional region, if number is 0, then this target connected component is become background, rejected from segmentation result;
Step S053: performed the B after above-mentioned rejecting operationT*It is final segmentation result.
In an embodiment of the present invention, also include adopting misclassification error ME (MisclassificationError) to evaluate the quality of image after segmentation.
The present invention is analyzing on the basis of existing image Segmentation Technology defect, it is proposed that a kind of new image segmentation algorithm based on notable transitional region.New algorithm substantially overcomes the defect of global threshold segmentation, improves segmentation effect greatly, also has that realization simple, easy, real-time be good, the feature of good stability.
Detailed description of the invention
Below in conjunction with drawings and Examples, the present invention will be further described.
As it is shown in figure 1, the present invention provides a kind of image partition method based on notable transitional region, it is characterised in that comprise the steps:
Step S01: read image to be split;
Step S02: extract the transitional region of image;
Step S03: filter out notable transitional region;
Step S04: determine segmentation threshold, perform Threshold segmentation, obtain binarization segmentation result;
Step S05: performance objective region is screened, obtained final segmentation result.
In embodiments of the present invention, in above-mentioned flow chart, the detailed process extracting image transition zone is as follows:
(1) selected neighborhood window size m, calculates each pixel p according to formula (1)i,jThe gray variance of corresponding m × m neighborhood window Ω, wherein (x y) represents pixel p in window Ω to fx,yGray scale,Representing the gray average of window Ω, σ is the symbol representing standard deviation in mathematics, it square refer to variance:
(2) matrix of all pixel correspondence local variances is built:
In formula, nhAnd nwThe height of difference representative image and width.
(3) all elements in matrix L v being carried out descending, local variance value arranges pixel corresponding to the N number of element of forward α and is considered as transitional region pixel, the sum of all pixels of N representative image, α is a parameter.All transitional region pixels constitute the transitional region of image, and its formalized description is a two values matrix TR, wherein 1 and 0 represent transitional region pixel and rest of pixels point respectively.
In above-mentioned flow chart, the detailed process filtering out notable transitional region is as follows:
(1) pixel in bianry image TR is mapped as the node in figure, calculates the pixel number that in all connected components that under 8 connectivity structures, transitional region pixel is constituted, each connected component comprises;
(2) the transitional region connected component having maximum pixel being considered as notable transitional region, its formalized description is a two values matrix STR, wherein 1 and 0 represents notable transitional region pixel and rest of pixels point respectively.
Determining segmentation threshold, the process performing Threshold segmentation is divided into two big steps, and the first determines that candidate thresholds is interval, and it two is determine segmentation threshold from candidate thresholds interval, performs Threshold segmentation.
Determine that the process in candidate thresholds interval is as follows:
(1) the gray average T of transitional region pixel is calculatedm。
(2) determine that candidate thresholds interval R is:
R=[t1t2]∩[0255](3)
t1=Tm-0.2×σ(4)
t2=Tm+0.2×σ(5)
Wherein, σ represents the gray standard deviation of entire image;
Determine segmentation threshold, perform Threshold segmentation process as follows:
(1) an arbitrarily selected gray scale t from candidate thresholds interval, seeks the Threshold segmentation result B of its correspondence according to following formulat。
(2) B is calculatedtThe number of middle target pixel points and background pixel point, if object pixel number NoMore than background pixel number Nb, then to BtPerform following turning operation:
The purpose of above-mentioned turning operation be to ensure that Threshold segmentation after binarization segmentation result in 1 and 0 represent real object pixel and background pixel respectively.
(3) B is calculatedtThe pixel number that middle target is overlapping with notable transitional region:
(4) segmentation threshold T* is determined according to following formula:
(5) using T* as global threshold, Threshold segmentation is performed, it is thus achieved that image binaryzation segmentation result BT*。
Performance objective region is screened, it is thus achieved that the detailed process of final segmentation result is as follows:
(1) B is calculatedT*Middle target pixel points and background pixel point number, if object pixel number is more than background pixel number, then to BT*Perform and BtIdentical turning operation, to ensure BT*In 1 and 0 represent real object pixel and background pixel respectively.
(2) calculate the pixel number that under 8 connectivity structures, each target connected component is overlapping with notable transitional region, if number is 0, then this target connected component is become background, rejected from segmentation result.
(3) B after above-mentioned rejecting operation has been performedT*It is final segmentation result.
In order to quantify the difference of various method segmentation quality, the present invention adopts misclassification error ME (MisclassificationError) to evaluate the quality of image after segmentation.ME reflects that background pixel is mistakenly classified as target, and object pixel is divided into the percentage ratio of background by mistake.For two class segmentation problems, ME can be simply expressed as:
(11) in formula, BOAnd FORepresent the set of reference picture background pixel and object pixel, B respectivelyTAnd FTFor the set of background pixel in segmentation result and object pixel, |. | represent the number of set element.Reference picture Visual Observations Observations according to us manually obtains.The span of ME is 0 to 1, the 0 perfect segmentation representing that inerrancy classification occurs, and 1 represents the situation of all pixels all mistake classification.The value of ME is more big, and after corresponding segmentation, the quality of image is more poor.
The a series of images that resolution is 200 × 200 has been carried out emulation experiment by us, uses Matlab7.0 programming, and experiment operates on association's Thinkpad notebook of 1.7GHz Intel Duo i5-3317CPU, 4GB internal memory.Inventive algorithm and classical edge detection operator (Canny), famous standard cuts algorithm (Ncut), isoperimetric figure cuts algorithm (Isocut), contrast based on the global threshold partitioning algorithm (PWT) of Parzen window setting technique, local auto-adaptive Threshold Segmentation Algorithm (Niblack), dual threshold Binarization methods (DTIB) and three kinds of Threshold Segmentation Algorithm based on transitional region (LE, LGLD and MLE).LE adopts the local window of 7 × 7, and LGLD, MLE and inventive algorithm all adopt the local window of 3 × 3, and 4 kinds of algorithms extract equal number of transitional region pixel.What obtain due to tri-kinds of methods of Canny, Ncut and Isocut is edge image, is not suitable for carrying out quantitative segmentation quality evaluation with ME.Therefore, we only show the segmentation result of three kinds of methods in the visualization segmentation result often organize experiment, carry out segmentation effect intuitively for reader and compare.
Testing the natural image being contained median size target by 10 width for first group to constitute, the parameter alpha relevant to transitional region number of pixels is set to 0.03.Table 1 gives the ME measure value that each image is split gained by various algorithm.Data from table are it is observed that inventive algorithm is to the corresponding minimum ME value of the segmentation result of front 8 width images, it was shown that the mistake of inventive algorithm divides rate minimum, and segmentation effect is best.To last two width images, inventive algorithm obtains second and the 3rd little ME value respectively, it was shown that the mistake of inventive algorithm divides rate in all algorithms or smaller, and segmentation effect is ideal.Visualization segmentation result shown in Fig. 2 also demonstrate that the effectiveness of inventive algorithm, and in figure, each row from top to bottom represents the segmentation result (Canny, Ncut, Isocut, PWT, DTIB, Niblack, LGLD, LE, MLE and inventive algorithm) of original image, desirable segmentation result, 10 kinds of algorithms respectively.
Testing the natural image being contained Small object by 4 width for second group to constitute, the parameter alpha relevant to transitional region number of pixels is set to 0.01.Fig. 3 illustrates the various algorithm visualization segmentation result to this group image, and in figure, each row from left to right represent the segmentation result (Canny, Ncut, Isocut, PWT, DTIB, Niblack, LGLD, LE, MLE and inventive algorithm) of original image, desirable segmentation result, 10 kinds of algorithms respectively.From the figure, it can be seen that inventive algorithm gained segmentation result and the 2nd desirable segmentation result corresponding to row in figure closest to, segmentation effect is good.Last width figure, it is shown that front 3 width images are achieved minimum mistake point rate ME by inventive algorithm, is achieved the second little mistake point rate, further demonstrate that the segmentation effect that inventive algorithm is good by the segmentation quantitative quality evaluation of table 2.
3rd group of experiment is contained multiobject natural image by 4 width and constitutes.Perform in the process of this group experiment, we eliminate and pick out this step of notable transitional region from transitional region, because single notable transitional region often can only corresponding single target, and the image that this group is tested comprises multiple target, it should have multiple notable transitional region.For this, we dispense notable transitional region and screen this step, but all transitional regions extracted directly are considered as notable transitional region, and then perform follow-up algorithm steps.Table 3 gives the ME measure value that each image is split gained by various algorithm.Data from table are it is observed that front 3 width images are achieved minimum ME value by inventive algorithm, it was shown that the mistake of inventive algorithm divides rate minimum, and segmentation effect is best.To last piece image, inventive algorithm obtains the second little mistake point rate, and segmentation effect is only second to DTIB.Visualization segmentation result shown in Fig. 4 further demonstrate that the effectiveness of inventive algorithm.
Inventive algorithm relates to two parameters, i.e. m and α.The two parameter is all used in the process that image transition zone is extracted, and m represents neighborhood window size, and α is used for determining transitional region pixel number.In order to provide the zone of reasonableness of algorithm parameter, two parameters are discussed by respectively.One of them parameter is fixed in employing, and the totally 14 width images of first group and second group experiment have been tested by the mode changing another parameter.
Table 4~5 sets forth under 7 kinds of different neighborhood windows, inventive algorithm test gained ME value.From table 4~5 it can be seen that local window size m is less on the impact of inventive algorithm performance.Therefore, the preferred span of m is 3~15.In order to improve the operational efficiency of algorithm, the value of usual m is 3.
Table 6~7 sets forth under 5 kinds of α, the ME value that during m=3, inventive algorithm is corresponding.From table 6~7 it can be seen that inventive algorithm performance on first group of image is less by the impact of α value change, and it is subject to the impact that α value changes bigger on second group of image.In general, inventive algorithm is insensitive to parameter m, and parameter alpha is more sensitive.The preferred value of α is determined by rule of thumb according to target sizes in image.
The foregoing is only presently preferred embodiments of the present invention, all equalizations done according to the present patent application the scope of the claims change and modify, and all should belong to the covering scope of the present invention.