Summary of the invention
The defect existing in image cutting procedure in order to alleviate said method, the present invention, from the conspicuousness of definition transitional region, proposes a kind of New image segmentation method based on remarkable transitional region, has improved accuracy and robustness that image is cut apart.
The present invention adopts following scheme to realize: a kind of image partition method based on remarkable transitional region, is characterized in that comprising the steps:
Step S01: read image to be split;
Step S02: the transitional region of extracting image;
Step S03: filter out remarkable transitional region;
Step S04: determine segmentation threshold, carry out Threshold segmentation, obtain binarization segmentation result;
Step S05: final segmentation result is screened, obtains in performance objective region.
In an embodiment of the present invention, the detailed process in the extraction image transition region in described step S02 is as follows:
Step S021: selected neighborhood window size m, calculates each pixel p according to formula (1)
i,jthe gray variance of corresponding m × m neighborhood window Ω, wherein f (x, y) represents pixel p in window Ω
x,ygray scale,
represent the gray average of window Ω:
Step S022: the matrix that builds the corresponding local variance of all pixels:
In formula, n
hand n
wheight and the width of representative image respectively;
Step S023: all elements in matrix L v is carried out to descending sort, local variance value is arranged to forward pixel corresponding to a α N element and be considered as transitional region pixel, the sum of all pixels of N representative image, α is a parameter; All transitional region pixels have formed the transitional region of image, and its formalized description is a two values matrix TR, wherein 1 and 0 represent respectively transitional region pixel and rest of pixels point.
In an embodiment of the present invention, the detailed process that filters out remarkable transitional region in described step S03 is as follows:
Step S031: pixel in bianry image TR is mapped as to the node in figure, calculates the pixel number that in all connected components that under 8 connectivity structures, transitional region pixel forms, each connected component comprises;
Step S032: the transitional region connected component that has maximum pixels is considered as to remarkable transitional region, and its formalized description is a two values matrix STR, wherein 1 and 0 represents respectively remarkable transitional region pixel and rest of pixels point.
In an embodiment of the present invention, determine segmentation threshold in described step S04, carry out the process of Threshold segmentation and be divided into two large steps, the first is determined candidate's threshold interval, and it two is to determine segmentation threshold from candidate's threshold interval, carries out Threshold segmentation;
The process of described definite candidate's threshold interval is as follows:
Step S0411: the gray average T that calculates transitional region pixel
m;
Step S0412: determine that candidate's threshold interval R is:
R=[t
1 t
2]∩[0 255] (3)
t
1=T
m-0.2×σ (4)
t
2=T
m+0.2×σ (5)
Wherein, σ represents the gray standard deviation of entire image;
The process of described definite segmentation threshold, execution Threshold segmentation is as follows:
Step S0421: an arbitrarily selected gray scale t from candidate's threshold interval, asks its corresponding Threshold segmentation result B according to following formula
t;
Step S0422: calculate B
tthe number of middle target pixel points and background pixel point, if object pixel number N
obe greater than background pixel number N
b, to B
tcarry out following turning operation:
The object of above-mentioned turning operation is 1 and 0 to represent respectively real object pixel and background pixel in the binarization segmentation result guaranteeing after Threshold segmentation;
Step S0423: calculate B
tthe pixel number that middle target and significantly transitional region are overlapping:
Step S0424: determine segmentation threshold T* according to following formula:
Step S0425: using T* as global threshold, carry out Threshold segmentation, obtain image binaryzation segmentation result B
t*.
In an embodiment of the present invention, performance objective region screening in described step S05, the detailed process that obtains final segmentation result is as follows:
Step S051: calculate B
t*middle target pixel points and background pixel point number, if object pixel number is greater than background pixel number, to B
t*carry out and B
tidentical turning operation, to guarantee B
t*in 1 and 0 represent respectively real object pixel and background pixel;
Step S052: the overlapping pixel number of each target connected component and remarkable transitional region under calculating 8 connectivity structures, if number is 0, this target connected component is become to background, from segmentation result, rejected;
Step S053: execute the B after above-mentioned rejecting operation
t*be final segmentation result.
In an embodiment of the present invention, also comprise and adopt misclassification error ME (Misclassification Error) to evaluate the quality of cutting apart rear image.
The present invention is analyzing on the basis of existing image Segmentation Technology defect, has proposed a kind of new image segmentation algorithm based on remarkable transitional region.New algorithm has overcome the defect that global threshold is cut apart substantially, has promoted greatly segmentation effect, also have simple, easily realize, real-time is good, the feature of good stability.
Embodiment
Below in conjunction with drawings and Examples, the present invention will be further described.
As shown in Figure 1, the invention provides a kind of image partition method based on remarkable transitional region, it is characterized in that comprising the steps:
Step S01: read image to be split;
Step S02: the transitional region of extracting image;
Step S03: filter out remarkable transitional region;
Step S04: determine segmentation threshold, carry out Threshold segmentation, obtain binarization segmentation result;
Step S05: final segmentation result is screened, obtains in performance objective region.
In embodiments of the present invention, in above-mentioned process flow diagram, the detailed process of extracting image transition region 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 f (x, y) represents pixel p in window Ω
x,ygray scale,
represent the gray average of window Ω, σ is the symbol that represents standard deviation in mathematics, it square just refer to variance:
(2) build the matrix of the corresponding local variances of all pixels:
In formula, n
hand n
wheight and the width of representative image respectively.
(3) all elements in matrix L v is carried out to descending sort, local variance value is arranged to forward pixel corresponding to a α N element and be considered as transitional region pixel, the sum of all pixels of N representative image, α is a parameter.All transitional region pixels have formed the transitional region of image, and its formalized description is a two values matrix TR, wherein 1 and 0 represent respectively transitional region pixel and rest of pixels point.
In above-mentioned process flow diagram, the detailed process that filters out remarkable transitional region is as follows:
(1) pixel in bianry image TR is mapped as to the node in figure, calculates the pixel number that in all connected components that under 8 connectivity structures, transitional region pixel forms, each connected component comprises;
(2) the transitional region connected component that has maximum pixels is considered as to remarkable transitional region, its formalized description is a two values matrix STR, wherein 1 and 0 represents respectively remarkable transitional region pixel and rest of pixels point.
Determine segmentation threshold, carry out the process of Threshold segmentation and be divided into two large steps, the first is determined candidate's threshold interval, and it two is to determine segmentation threshold from candidate's threshold interval, carries out Threshold segmentation.
The process of determining candidate's threshold interval is as follows:
(1) the gray average T of calculating transitional region pixel
m.
(2) determine that candidate's threshold interval R is:
R=[t
1 t
2]∩[0 255] (3)
t
1=T
m-0.2×σ (4)
t
2=T
m+0.2×σ (5)
Wherein, σ represents the gray standard deviation of entire image;
The process of determining segmentation threshold, execution Threshold segmentation is as follows:
(1) an arbitrarily selected gray scale t from candidate's threshold interval, asks its corresponding Threshold segmentation result B according to following formula
t.
(2) calculate B
tthe number of middle target pixel points and background pixel point, if object pixel number N
obe greater than background pixel number N
b, to B
tcarry out following turning operation:
The object of above-mentioned turning operation is 1 and 0 to represent respectively real object pixel and background pixel in the binarization segmentation result guaranteeing after Threshold segmentation.
(3) calculate B
tthe pixel number that middle target and significantly transitional region are overlapping:
(4) according to following formula, determine segmentation threshold T*:
(5) using T* as global threshold, carry out Threshold segmentation, obtain image binaryzation segmentation result B
t*.
The screening of performance objective region, the detailed process that obtains final segmentation result is as follows:
(1) calculate B
t*middle target pixel points and background pixel point number, if object pixel number is greater than background pixel number, to B
t*carry out and B
tidentical turning operation, to guarantee B
t*in 1 and 0 represent respectively real object pixel and background pixel.
(2) the overlapping pixel number of each target connected component and remarkable transitional region under calculating 8 connectivity structures, if number is 0, becomes background by this target connected component, from segmentation result, is rejected.
(3) execute the B after above-mentioned rejecting operation
t*be final segmentation result.
In order to quantize the whole bag of tricks, cut apart the difference of quality, the present invention adopts misclassification error ME (Misclassification Error) to evaluate the quality of cutting apart rear image.ME reflection background pixel is mistakenly classified as target, and object pixel is divided into the number percent of background by mistake.For two class segmentation problems, ME can be expressed as simply:
(11) in formula, B
oand F
orepresent respectively the set of reference picture background pixel and object pixel, B
tand F
tfor the set of background pixel in segmentation result and object pixel, | .| represents the number of set element.Reference picture is observed to obtain according to our vision manually.The span of ME is that the perfection that 0 to 1,0 expression inerrancy classification occurs is cut apart, and 1 represents all situations of mis-classification of all pixels.The value of ME is larger, and it is poorer that correspondence is cut apart the quality of rear image.
The a series of images that we are 200 × 200 to resolution has carried out emulation experiment, uses Matlab7.0 programming, and experiment operates in the Duo i5-3317CPU of 1.7GHz Intel, on the Thinkpad of the association notebook of 4GB internal memory.Algorithm of the present invention and classical edge detection operator (Canny), famous standard are cut algorithm (Ncut), isoperimetric figure cuts algorithm (Isocut), the global threshold partitioning algorithm (PWT) based on Parzen window setting technique, local auto-adaptive Threshold Segmentation Algorithm (Niblack), dual threshold Binarization methods (DTIB) and three kinds of Threshold Segmentation Algorithm (LE, LGLD and MLE) based on transitional region and contrasts.LE adopts 7 × 7 local window, and LGLD, MLE and algorithm of the present invention all adopt 3 × 3 local window, and 4 kinds of algorithms extract the transitional region pixel of similar number.What obtain due to Canny, Ncut and tri-kinds of methods of Isocut is edge image, is not suitable for carrying out the quantitative quality assessment of cutting apart with ME.Therefore, we only show the segmentation result of three kinds of methods in the visual segmentation result of every group of experiment, for reader, carry out segmentation effect comparison intuitively.
Test the natural image that contains median size target by 10 width for first group and form, the parameter alpha relevant to transitional region number of pixels is set to 0.03.Table 1 has provided various algorithms are cut apart gained ME measure value to every width image.From table, data can be observed, the segmentation result correspondence of algorithm of the present invention to front 8 width images minimum ME value, show the mistake point rate minimum of algorithm of the present invention, segmentation effect is best.To last two width images, algorithm of the present invention has obtained respectively second and the 3rd little ME value, and the mistake point rate that shows algorithm of the present invention is in all algorithms or smaller, and segmentation effect is comparatively desirable.Visual segmentation result shown in Fig. 2 has also confirmed the validity of algorithm of the present invention, and in figure, each row from top to bottom represents respectively the segmentation result (Canny, Ncut, Isocut, PWT, DTIB, Niblack, LGLD, LE, MLE and algorithm of the present invention) of original image, desirable segmentation result, 10 kinds of algorithms.
Test the natural image that contains little target by 4 width for second group and form, the parameter alpha relevant to transitional region number of pixels is set to 0.01.Fig. 3 has shown the visual segmentation result of various algorithms to this group image, and in figure, each row from left to right represent respectively the segmentation result (Canny, Ncut, Isocut, PWT, DTIB, Niblack, LGLD, LE, MLE and algorithm of the present invention) of original image, desirable segmentation result, 10 kinds of algorithms.As we can see from the figure, algorithm gained segmentation result of the present invention is the most approaching with the desirable segmentation result that in figure, the 2nd row are corresponding, and segmentation effect is good.The quantitative quality evaluation result of cutting apart of table 2 shows, algorithm of the present invention has been obtained minimum mistake point rate ME to front 3 width images, and last width figure has been obtained to the second little mistake point rate, further confirmed the segmentation effect that algorithm of the present invention is good.
The 3rd group of experiment contains multiobject natural image by 4 width and forms.Carry out in the process of this group experiment, we have omitted and from transitional region, have picked out this step of remarkable transitional region, because single remarkable transitional region often can only corresponding single target, and the image of this group experiment comprises multiple goal, should have multiple remarkable transitional regions.For this reason, we dispense remarkable transitional region and screen this step, but extracted all transitional regions are directly considered as to remarkable transitional region, and then carry out follow-up algorithm steps.Table 3 has provided various algorithms are cut apart gained ME measure value to every width image.From table, data can be observed, and algorithm of the present invention has been obtained minimum ME value to front 3 width images, shows the mistake point rate minimum of algorithm of the present invention, and segmentation effect is best.To last piece image, algorithm of the present invention has obtained the second little mistake point rate, and segmentation effect is only second to DTIB.Visual segmentation result shown in Fig. 4 has further confirmed the validity of algorithm of the present invention.
Algorithm of the present invention relates to two parameters, i.e. m and α.In the process that these two parameters are all extracted in image transition region, use, m represents neighborhood window size, and α is for determining transitional region pixel number.In order to provide the zone of reasonableness of algorithm parameter, we discuss respectively two parameters.One of them parameter is fixed in employing, and the mode that changes another parameter is tested the totally 14 width images of first group and second group experiment.
Table 4~5 have provided respectively under 7 kinds of different neighborhood windows, test of heuristics gained ME value of the present invention.From table 4~5, m is less on the impact of algorithm performance of the present invention for local window size.Therefore, the preferred span of m is 3~15.In order to improve the operational efficiency of algorithm, the value of m is 3 conventionally.
Table 6~7 have provided respectively under 5 kinds of α, the ME value that during m=3, algorithm of the present invention is corresponding.From table 6~7, the impact that the performance of algorithm of the present invention on first group of image changed by α value is less, and the impact that changed by α value is larger.In general, algorithm of the present invention is insensitive to parameter m, more responsive to parameter alpha.The preferred value of α is determined by rule of thumb according to target sizes in image.
The foregoing is only preferred embodiment of the present invention, all equalizations of doing according to the present patent application the scope of the claims change and modify, and all should belong to covering scope of the present invention.