CN107507199A - A kind of image partition method and system - Google Patents
A kind of image partition method and system Download PDFInfo
- Publication number
- CN107507199A CN107507199A CN201710729705.0A CN201710729705A CN107507199A CN 107507199 A CN107507199 A CN 107507199A CN 201710729705 A CN201710729705 A CN 201710729705A CN 107507199 A CN107507199 A CN 107507199A
- Authority
- CN
- China
- Prior art keywords
- threshold values
- sets
- generation
- generation sets
- fitness value
- 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.)
- Pending
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/11—Region-based segmentation
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T7/00—Image analysis
- G06T7/10—Segmentation; Edge detection
- G06T7/136—Segmentation; Edge detection involving thresholding
Landscapes
- Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Image Analysis (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a kind of image partition method and system, this method obtains multiple first generation sets of threshold values and iterations, and carries out explosive treatment to each first generation sets of threshold values and obtain multiple sets of threshold values set, records Number Of Bursts;Sets of threshold values set includes first generation sets of threshold values and second generation sets of threshold values;By calculating the fitness value of first generation sets of threshold values, second generation sets of threshold values, the sets of threshold values corresponding to maximum adaptation angle value is determined;Judge whether Number Of Bursts are less than iterations;If sets of threshold values corresponding to maximum adaptation angle value is then carried out into explosive treatment again, sets of threshold values set and Number Of Bursts are updated;If otherwise by sets of threshold values corresponding to maximum adaptation angle value be defined as segmentation figure as when optimum segmentation threshold value group.Therefore, using method of the present invention, the optimum segmentation threshold value group of multi-threshold image segmentation efficiently can be accurately obtained, and avoids the situation for being absorbed in locally optimal solution, there is good stability, improve image segmentation and segmentation efficiency.
Description
Technical field
The present invention relates to image processing field, more particularly to a kind of image partition method and system.
Background technology
Image processing techniques comes into the digital information epoch, and the status of image Segmentation Technology is also increasingly heavier to closing
Will.The purpose of image Segmentation Technology is to select the part that pictures subsequent analysis needs, and reaches the effect of optimization image.Image
Cutting techniques are all widely used in different fields such as national defense and military, medicine, Aero-Space.
Image segmentation is to divide the image into several regions specific, with unique properties and propose interesting target
Technology and process.It is by the committed step of image procossing to graphical analysis.Existing image partition method mainly divides following several
Class:Dividing method based on threshold value, the dividing method based on region, the dividing method based on edge and based on particular theory
Dividing method etc..Researcher also updates original image partition method and some new theory and Xin Fang of other subject
Method is split for image, it is proposed that many new dividing methods, for example with maximum variance between clusters or Particle Swarm Optimization
Method carries out image segmentation.Wherein maximum variance between clusters (Otsu) are also referred to as Otsu algorithm, are proposed simultaneously by Japanese National People's Congress Tianjin
Name, the image segmentation that maximum variance between clusters are divided into pixel for the half-tone information according to image prospect and background is excellent
Change algorithm, but this method is lifted to after multi thresholds, it is computationally intensive, and then the situation for causing to be actually applied cans be counted on one's fingers;And
There is the problem of precocious too fast in particle swarm optimization algorithm, i.e., when solving image segmentation optimal solution, be easily absorbed in locally optimal solution shape
Condition, and then cause image segmentation poor.Therefore, image segmentation and segmentation efficiency how are improved, is image processing techniques
It is badly in need of technical problems to be solved in field.
The content of the invention
It is an object of the invention to provide a kind of image partition method and system, the image partition method calculates simply, and
When solving image segmentation optimal solution, it is not easy to be absorbed in locally optimal solution situation, there is good stability, improve image segmentation
With segmentation efficiency.
To achieve the above object, the invention provides following scheme:
A kind of image partition method, described image dividing method include:
Obtain multiple first generation sets of threshold values and iterations;The first generation sets of threshold values represents the multi thresholds point of segmentation figure picture
Cut group;
Explosive treatment is carried out to each first generation sets of threshold values, obtains multiple sets of threshold values set, and record Number Of Bursts;
Each sets of threshold values set includes multiple caused by a first generation sets of threshold values and first generation sets of threshold values blast
Second generation sets of threshold values;
The first generation sets of threshold values, the fitness of the second generation sets of threshold values in each sets of threshold values set of calculating
Value, obtains multigroup fitness value set;
To the fitness value in fitness value set described in every group according to arranging from big to small, determine first in every group
Sets of threshold values corresponding to fitness value;First fitness value is the maximum adaptation angle value in the fitness value set;It is described
Sets of threshold values is the first generation sets of threshold values or is the second generation sets of threshold values;
Judge whether the Number Of Bursts are less than the iterations, obtain the first judged result;
If first judged result represents that the Number Of Bursts are less than the iterations, by first fitness
The sets of threshold values carries out explosive treatment corresponding to value, updates the sets of threshold values set and the Number Of Bursts;
If first judged result represents that the Number Of Bursts are equal to or more than the iterations, by multiple institutes
The first fitness value is stated according to being arranged from big to small, selects the sets of threshold values corresponding to the first fitness value of maximum to be defined as
Segmentation figure as when optimum segmentation threshold value group.
Optionally, it is described to obtain multiple first generation sets of threshold values and iterations, specifically include:
Treat segmentation figure picture and carry out binary conversion treatment, obtain gray level image;
The segmentation number of plies set according to user, to the gray level image random initializtion, obtains multiple first generation sets of threshold values;
The quantity of element in the first generation sets of threshold values subtracts one for the segmentation number of plies quantity;
The blast cycle-index set according to user, obtain iterations.
Optionally, it is described that explosive treatment is carried out to each first generation sets of threshold values, multiple sets of threshold values set are obtained, specifically
Including:
Determine the region of search;
Explosive treatment is carried out to the first generation sets of threshold values, generates second generation sets of threshold values;
Judge that the second generation sets of threshold values whether in the region of search, obtains the second judged result;
If second judged result represents that the second generation sets of threshold values in the region of search, retains described second
For sets of threshold values;
If second judged result represents the second generation sets of threshold values not in the region of search, to the search
Second generation sets of threshold values outside section carries out mapping displacement operation processing, it is determined that the second generation sets of threshold values after processing is located at the search
In section;The sets of threshold values set includes the second generation sets of threshold values after first generation sets of threshold values, second generation sets of threshold values and processing.
Optionally, judging the second generation sets of threshold values whether in the region of search, obtain the second judged result it
Before, in addition to:
The part second generation sets of threshold values randomly selected is carried out at the processing of blast displacement operation and Gauss displacement operation
Reason, obtains new second generation sets of threshold values.
Optionally, the first generation sets of threshold values calculated in each sets of threshold values set, the second generation threshold value
The fitness value of group, obtains multigroup fitness value set, specifically includes:
The first generation sets of threshold values, the second generation threshold value in each sets of threshold values set are calculated according to below equation
The fitness value of group, obtains multigroup fitness value set:Its
Middle σ (x1,x2,...,xn) represent the fitness value of the first generation sets of threshold values or the second generation sets of threshold values, ωiAnd ωjFor
The probability that image segmentation any two area pixel points occur, μiAnd μjSplit the average in any two region for image.
Present invention also offers a kind of image segmentation system, described image segmenting system includes:
Acquisition module, for obtaining multiple first generation sets of threshold values and iterations;The first generation sets of threshold values represents segmentation
The multi-threshold segmentation group of image;
Sets of threshold values set obtains module, for carrying out explosive treatment to each first generation sets of threshold values, obtains multiple thresholds
Value group set, and record Number Of Bursts;Each sets of threshold values set includes a first generation sets of threshold values and described the
Multiple second generation sets of threshold values caused by the blast of generation sets of threshold values;
Fitness value set obtains module, for calculate the first generation sets of threshold values in each sets of threshold values set,
The fitness value of the second generation sets of threshold values, obtain multigroup fitness value set;
Sets of threshold values determining module, for the fitness value in fitness value set described in every group according to carrying out from big to small
Arrangement, determines sets of threshold values corresponding to the first fitness value in every group;First fitness value is in the fitness value set
Maximum adaptation angle value;The sets of threshold values is the first generation sets of threshold values or is the second generation sets of threshold values;
First judged result obtains module, for judging whether the Number Of Bursts are less than the iterations, obtains
One judged result;
Sets of threshold values set and Number Of Bursts update module, for representing that the Number Of Bursts are small when first judged result
When the iterations, then the sets of threshold values corresponding to first fitness value is subjected to explosive treatment, updates the threshold
The set of value group and the Number Of Bursts;
Optimum segmentation threshold value group determining module, for when first judged result represent the Number Of Bursts be equal to or
During more than the iterations, then by multiple first fitness values according to being arranged from big to small, the of maximum is selected
Sets of threshold values corresponding to one fitness value be defined as segmentation figure as when optimum segmentation threshold value group.
Optionally, the acquisition module, is specifically included:
Gray level image obtains unit, carries out binary conversion treatment for treating segmentation figure picture, obtains gray level image;
First generation sets of threshold values acquiring unit, it is first at random to the gray level image for the segmentation number of plies set according to user
Beginningization, obtain multiple first generation sets of threshold values;The quantity of element in the first generation sets of threshold values subtracts for the segmentation number of plies quantity
One;
Iterations acquiring unit, for the blast cycle-index set according to user, obtain iterations.
Optionally, the sets of threshold values set obtains module, specifically includes:
The region of search determines, for determining the region of search;
Second generation sets of threshold values generation unit, for carrying out explosive treatment to the first generation sets of threshold values, generate second generation threshold
Value group;
Second judged result obtains unit, for judging that the second generation sets of threshold values whether in the region of search, obtains
To the second judged result;
Second generation sets of threshold values stick unit, for representing the second generation sets of threshold values described when second judged result
When in the region of search, then retain the second generation sets of threshold values;
Second generation sets of threshold values determining unit after processing, if representing the second generation threshold value for second judged result
Group then carries out mapping displacement operation processing, really not in the region of search to the second generation sets of threshold values outside the region of search
Second generation sets of threshold values after fixed processing is located in the region of search;The sets of threshold values set includes first generation sets of threshold values, second
For the second generation sets of threshold values after sets of threshold values and processing.
Optionally, the sets of threshold values set obtains module, in addition to:
New second generation sets of threshold values obtains unit, is exploded for the part second generation sets of threshold values to randomly selecting
Displacement operation processing and the processing of Gauss displacement operation, obtain new second generation sets of threshold values.
Optionally, the fitness value set obtains module, specifically includes:
Fitness value set obtains unit, for calculating described the in each sets of threshold values set according to below equation
The fitness value of generation sets of threshold values, the second generation sets of threshold values, obtain multigroup fitness value set:Wherein σ (x1,x2,...,xn) represent the first generation threshold value
The fitness value of group or the second generation sets of threshold values, ωiAnd ωjSplit what any two area pixel points occurred for image
Probability, μiAnd μjSplit the average in any two region for image.
According to specific embodiment provided by the invention, the invention discloses following technique effect:
The invention provides a kind of image partition method and system, this method obtains multiple first generation sets of threshold values and changed first
Generation number, and explosive treatment is carried out to each first generation sets of threshold values, multiple sets of threshold values set are obtained, record Number Of Bursts;Wherein,
The sets of threshold values set includes first generation sets of threshold values and second generation sets of threshold values;Secondly by the institute calculated in the sets of threshold values set
First generation sets of threshold values, the fitness value of the second generation sets of threshold values are stated, determines maximum adaptation angle value institute in the sets of threshold values set
Corresponding sets of threshold values;Furthermore by judging whether Number Of Bursts are less than the iterations;If then by maximum adaptation angle value pair
The sets of threshold values answered carries out explosive treatment again, updates sets of threshold values set and Number Of Bursts;If otherwise by all sets of threshold values set
Sets of threshold values corresponding to maximum fitness value be defined as segmentation figure as when optimum segmentation threshold value group.It can be seen that the present invention uses class
The method of fireworks blast algorithm is similar to, the optimum segmentation threshold value group in multi-threshold image segmentation efficiently can be accurately obtained, keep away
Exempt to be absorbed in locally optimal solution situation using prior art, there is good stability, improve image segmentation and segmentation efficiency.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to institute in embodiment
The accompanying drawing needed to use is briefly described, it should be apparent that, drawings in the following description are only some implementations of the present invention
Example, for those of ordinary skill in the art, without having to pay creative labor, can also be according to these accompanying drawings
Obtain other accompanying drawings.
Fig. 1 is the schematic flow sheet of image partition method of the embodiment of the present invention;
Fig. 2 is the structural representation of image segmentation system of the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation describes, it is clear that described embodiment is only part of the embodiment of the present invention, rather than whole embodiments.It is based on
Embodiment in the present invention, those of ordinary skill in the art are obtained every other under the premise of creative work is not made
Embodiment, belong to the scope of protection of the invention.
It is an object of the invention to provide a kind of image partition method and system, the image partition method calculates simply, and
When solving image segmentation optimal solution, it is not easy to be absorbed in locally optimal solution situation, there is good stability, improve image segmentation
With segmentation efficiency.
In order to efficiently accurately obtain the optimum segmentation threshold value group in multi-threshold image segmentation, the present invention is proposed with multi thresholds
Image segmentation design object function, the process for seeking multi-threshold image segmentation object function is converted into the group to multidimensional for variable
Solve problems are closed, and optimization computing is iterated to solution with fireworks algorithm.
In order to facilitate the understanding of the purposes, features and advantages of the present invention, it is below in conjunction with the accompanying drawings and specific real
Applying mode, the present invention is further detailed explanation.
Image is split:Exactly divide the image into several regions specific, with unique properties and propose mesh interested
Target technology and process.It is by the committed step of image procossing to graphical analysis.Existing image partition method mainly divide with
Under several classes:Dividing method based on threshold value, the dividing method based on region, the dividing method based on edge and based on specific reason
Dividing method of opinion etc..Since nineteen ninety-eight, researcher updates original image partition method and other subject
Some new theories and new method are split for image, it is proposed that many new dividing methods.The target extracted after image segmentation
It can be used for the fields such as image, semantic identification, picture search.
Fireworks algorithm (FireworksAlgorithm, FWA) be by the night sky fireworks explode inspiration and propose one
Kind of groups intelligent algorithm.The position vector of each fireworks represents every group of solution, and blast on high produces filial generation spark, and filial generation spark is again
Continue to explode, iterate so as to complete the search to solution.The spark quantity that good fireworks generate within the specific limits is more, receives
Hold back speed;And the spark negligible amounts that the fireworks of difference generate within the specific limits, hunting zone also accordingly increases.Fireworks are calculated
Method includes local and ability of searching optimum mechanism, and spark number and explosive range are different from caused by fireworks explosion time.Fireworks are calculated
Method starts iteration, until reaching end condition, i.e., full successively using the operator that explodes, mutation operator, mapping ruler and selection strategy
The required precision of sufficient problem reaches maximal function assessment number.Therefore, using the faster convergence rate of fireworks algorithm and
Preferable search capability is come to find globally optimal solution be a kind of good application process.Wherein, fireworks algorithm includes as follows several
Individual step:
(1) some fireworks are randomly generated in specific solution space, each fireworks represents a solution of solution space.
(2) fitness value of each fireworks is calculated according to fitness function, and spark is produced according to fitness value.Spark
Number be to be calculated based on the thought of the immune concentration in immunology, i.e. the better fireworks of fitness value produce pyrophoric number
Mesh is more.
(3) actual conditions of the fireworks attribute in reality and combination search problem, are produced in the radiation space of fireworks
Light a fire flower.Each spark represents a solution in solution space.In order to ensure the diversity of population, it is necessary to be carried out suitably to fireworks
Variation, such as Gaussian mutation.
(4) calculate population optimal solution, determine whether meet require, if meet if stop search, do not meet then after
Continuous iteration.The best solution and other solutions of selection that the initial value of iteration obtains for this circulation.
Maximum variance between clusters:Itd is proposed by the big Tianjin of Japanese scholars (Nobuyuki Otsu) in 1979, be a kind of adaptive
The method that the threshold value answered determines, is called Otsu algorithm, abbreviation OTSU.It is the gamma characteristic by image, divides the image into background
With two parts of target.Inter-class variance between background and target is bigger, illustrates that the difference of the two parts of pie graph picture is got over
Greatly, when partial target mistake is divided into background or part background mistake is divided into target and can all cause the two part difference to diminish.Therefore, make
The maximum segmentation of inter-class variance means misclassification probability minimum.Graythresh functions use maximum between-cluster variance in Matlab
Method obtains the threshold value of image.
Threshold method:Gray scale or coloured image are converted to the black white image of high-contrast, it is possible to specify some color range conduct
Threshold value.All pixels brighter than threshold value are converted to white;And all pixels darker than threshold value are converted to black.
Fig. 1 is the schematic flow sheet of image partition method of the embodiment of the present invention, as shown in figure 1, image provided by the invention
Dividing method specifically includes following steps:
Step 101:Obtain multiple first generation sets of threshold values and iterations;The first generation sets of threshold values represent segmentation figure as
Multi-threshold segmentation group.
Step 102:Explosive treatment is carried out to each first generation sets of threshold values, obtains multiple sets of threshold values set, and record
Number Of Bursts;Each sets of threshold values set includes a first generation sets of threshold values and first generation sets of threshold values blast production
Raw multiple second generation sets of threshold values.
Step 103:Calculate the first generation sets of threshold values in each sets of threshold values set, the second generation sets of threshold values
Fitness value, obtain multigroup fitness value set.
Step 104:To the fitness value in fitness value set described in every group according to arranging from big to small, it is determined that often
Sets of threshold values corresponding to first fitness value in group;First fitness value is the maximum adaptation degree in the fitness value set
Value;The sets of threshold values is the first generation sets of threshold values or is the second generation sets of threshold values.
Step 105:Judge whether the Number Of Bursts are less than the iterations, obtain the first judged result.
Step 106:If first judged result represents that the Number Of Bursts are less than the iterations, by described the
The sets of threshold values carries out explosive treatment corresponding to one fitness value, updates the sets of threshold values set and the Number Of Bursts.
Step 107:If first judged result represents that the Number Of Bursts are equal to or more than the iterations,
By multiple first fitness values according to being arranged from big to small, the threshold value corresponding to the first fitness value of maximum is selected
Group be defined as segmentation figure as when optimum segmentation threshold value group.
Wherein, step 101 specifically includes:
Treat segmentation figure picture and carry out binary conversion treatment, obtain gray level image.
The segmentation number of plies set according to user, to the gray level image random initializtion, obtains multiple first generation sets of threshold values;
The quantity of element in the first generation sets of threshold values subtracts one for the segmentation number of plies quantity.
The blast cycle-index set according to user, obtain iterations.
Step 102 obtains multiple sets of threshold values set using the fireworks algorithm based on roulette strategy.Based on roulette strategy
The basic thought of fireworks algorithm be:
1) some fireworks are randomly generated in solution space, fitness is calculated using fitness function after being initialized to it
Be worth and assessed, then i-th (i=1,2 ..., n) spark number caused by individual fireworks blast is:
S in formula (2)iRepresent spark number caused by i-th of fireworks blast;M is expressed as spark number caused by n fireworks
Mesh sum;ymax=max (f (xi)) maximum of fitness corresponding to expression fireworks;f(xi) represent to fit corresponding to i-th of fireworks
Answer angle value.
2) because the fireworks of better performances have large effect to filial generation, population diversity is easily reduced, it is necessary to certain
Spark quantity S in radius is limited, as shown in formula (3):
S in formula (2)min、SmaxThe spark minimum threshold and max-thresholds defined for system.
3) in order to ensure the diversity of population, it is necessary to suitably be made a variation to partial spark
Spark blast displacement operation handles formula and is:
In formula (4)Represent position of a-th of spark in c dimensions, random numbers of the rand (- 1,1) between [- 1,1];R
Represent the region of search.
Spark Gauss displacement operation handles formula:
In formula (5)Position of a-th of spark in c dimensions is represented, Gaussian (- 1,1) represents average value as 1, standard
Variance is 1 Gaussian Profile.
4) whether the spark for judging variation and the position for the spark not made a variation are beyond region of search R, if so, then needing root
Spark is mapped in region of search R according to mapping displacement operation formula;
Formula (6) is mapping displacement operation formula, whereinRepresent position of a-th of spark in c dimensions;Represent c dimensions
On the region of search upper limit;Represent the region of search lower limit in c dimensions.
5) in each iteration, all individuals (including spark caused by a fireworks and the fireworks) use roulette
The optimum individual selected of strategy it is selected enter it is of future generation.Other individuals calculate selected probability according to formula (7):
D (x in formula (7)a,xb) represent any two xaAnd xbThe difference of the distance between individual, i.e. fitness value, y (xb)
Represent xbFitness value;C represents Wei Daidu;Which generation the Wei Daidu represents.
6) judge that the maximum iteration of setting reaches no, if reaching, terminate iteration, otherwise continue executing with the 1) step.
Step 102 comprises the following steps:
Step 1021:Determine the region of search;The embodiment of the present invention is preferential, determines the maximum gradation value and most of gray level image
Small gray value, compare the absolute value of maximum gradation value and minimum gradation value, choose smaller absolute value as the region of search upper limit, choosing
The opposite number of smaller absolute value is taken as region of search lower limit.
Step 1022:Explosive treatment is carried out to the first generation sets of threshold values according to formula (2), generates second generation sets of threshold values,
And suitable second generation sets of threshold values is selected according to formula (3).
Step 1023:In order to ensure the diversity of second generation sets of threshold values, according to formula (4) and formula (5), to randomly selecting
The part second generation sets of threshold values carry out explode displacement operation processing and Gauss displacement operation processing, obtain new second generation threshold
Value group.
Step 1024:Judge that second generation sets of threshold values whether in the region of search, obtains the second judged result;Wherein,
Second generation sets of threshold values herein includes not carrying out the second generation sets of threshold values that displacement operation processing is handled with Gauss displacement operation of exploding
Second generation sets of threshold values with the processing of blast displacement operation and the processing of Gauss displacement operation is carried out, i.e., do not carry out blast position to all
Move the second generation sets of threshold values of operation processing and the processing of Gauss displacement operation and carry out explode displacement operation processing and Gauss displacement behaviour
Whether the second generation sets of threshold values dealt with is all judged, see it in the region of search.
Step 1025:If second judged result represents second generation sets of threshold values in the region of search, retaining should
Second generation sets of threshold values.
Step 1026:If second judged result represents second generation sets of threshold values not in the region of search, according to public affairs
Formula (6) carries out mapping displacement operation processing, the second generation sets of threshold values after processing is located in the region of search.Now, it is described
Sets of threshold values set includes the first generation sets of threshold values and second generation sets of threshold values in the region of search.
The image that maximum variance between clusters are divided into pixel according to the half-tone information of image in two regions splits optimization
Algorithm, but it is huge to the amount of calculation after multi thresholds due to being lifted, and the situation for causing to be actually applied cans be counted on one's fingers.Had in recent years not
Few scholar proposes various Swarm Intelligence Algorithms and optimized, such as particle swarm optimization algorithm, but particle swarm optimization algorithm is deposited
Precocious too fast the problem of.Therefore, the present invention proposes the image that fireworks algorithm is combined with multi thresholds maximum variance between clusters
Dividing method.This method can effectively play the optimizing ability of fireworks algorithm, and be contrasted with traditional particle cluster algorithm, tool
There is good stability, obtain preferable image segmentation and segmentation efficiency.
The basic thought of single threshold maximum variance between clusters is to divide the image into prospect and background by single threshold value.When two
When the class variance in region takes maximum, that is, complete the single threshold segmentation of the image.Assuming that the pixel sum of image is Q, then
Jth gray value all pixels points occur probability be:
Pj=Qj/Q (8);
Formula (8) QjFor its pixel number.Assuming that split according to threshold value x, then the pixel number of foreground area and background region
The probability of appearance is respectively:
And it is according to the inter-class variance in threshold value x two regions divided:
σ (x)=ω0(μ0-μ)2+ω1(μ1-μ)2(11);
μ is image grand mean in formula (11), μ0And μ1The respectively average of target area and background area.When σ (x) takes most
During big value, x is the optimal solution of single threshold maximum between-cluster variance algorithm.
And the image segmentation based on multi thresholds, can be according to the above method.Assuming that image gray levels are L, use
Sets of threshold values set x1,x2,...,xn(0≤x1≤x2...≤xn≤ L-1) divide the image into for n+1 different sections when, then this
Population variance is between the class in a little sections:(1);Wherein σ (x1,x2,...,xn)
Represent the fitness value of the first generation sets of threshold values or the second generation sets of threshold values, middle ωiAnd ωjFor image segmentation any two
The probability that individual area pixel points occur, μiAnd μjSplit the average in any two region for image.Other algorithms stability,
Can not obtain preferable balance in image segmentation and segmentation efficiency, and due to the limitation of optimizing ability can bring it is huge
Amount of calculation.Method proposed by the present invention can effectively play the optimizing ability of fireworks algorithm, and enter with traditional particle cluster algorithm
Row contrast, has good stability, obtains preferable image segmentation and segmentation efficiency.Especially, fireworks algorithm unlike
PSO algorithms are the same, and fireworks algorithm is not easy to be absorbed in locally optimal solution, have good stability in segmentation.
Step 103 specifically includes:
The first generation sets of threshold values, the second generation threshold value in each sets of threshold values set are calculated according to formula (1)
The fitness value of group.
The present invention proposes to use fireworks algorithm optimization multi-threshold image segmentation method that it is excellent to solve classical intelligence to a certain extent
Change the problems such as caused poorly efficient and precocious during algorithm is applied in this field.And test result indicates that fireworks algorithm threshold value compared with
The segmentation effect as particle cluster algorithm can be obtained when few, precocity is not easy compared with multidate ratio in threshold value, stability is more preferable, improves
Image segmentation and segmentation efficiency.
To reach above-mentioned purpose, present invention also offers a kind of image segmentation system, Fig. 2 is image point of the embodiment of the present invention
The structural representation of system is cut, as shown in Fig. 2 described image segmenting system includes:
Acquisition module 201, for obtaining multiple first generation sets of threshold values and iterations;The first generation sets of threshold values represents to divide
Cut the multi-threshold segmentation group of image.
Sets of threshold values set obtains module 202, for carrying out explosive treatment to each first generation sets of threshold values, obtains multiple
Sets of threshold values set, and record Number Of Bursts;Each sets of threshold values set includes a first generation sets of threshold values and described
Multiple second generation sets of threshold values caused by the blast of first generation sets of threshold values.
Fitness value set obtains module 203, for calculating the first generation threshold value in each sets of threshold values set
The fitness value of group, the second generation sets of threshold values, obtain multigroup fitness value set.
Sets of threshold values determining module 204, for the fitness value in fitness value set described in every group according to from big to small
Arranged, determine sets of threshold values corresponding to the first fitness value in every group;First fitness value is the fitness value collection
Maximum adaptation angle value in conjunction;The sets of threshold values is the first generation sets of threshold values or is the second generation sets of threshold values.
First judged result obtains module 205, for judging whether the Number Of Bursts are less than the iterations, obtains
First judged result.
Sets of threshold values set and Number Of Bursts update module 206, for representing the blast time when first judged result
When number is less than the iterations, then the sets of threshold values corresponding to first fitness value is subjected to explosive treatment, updates institute
State sets of threshold values set and the Number Of Bursts.
Optimum segmentation threshold value group determining module 207, for representing that the Number Of Bursts are equal to when first judged result
Or during more than the iterations, then by multiple first fitness values according to being arranged from big to small, selection is maximum
The first fitness value corresponding to sets of threshold values be defined as segmentation figure as when optimum segmentation threshold value group.
Wherein, the acquisition module 201, is specifically included:
Gray level image obtains unit, carries out binary conversion treatment for treating segmentation figure picture, obtains gray level image.
First generation sets of threshold values acquiring unit, it is first at random to the gray level image for the segmentation number of plies set according to user
Beginningization, obtain multiple first generation sets of threshold values;The quantity of element in the first generation sets of threshold values subtracts for the segmentation number of plies quantity
One.
Iterations acquiring unit, for the blast cycle-index set according to user, obtain iterations.
The sets of threshold values set obtains module 202, specifically includes:
The region of search determines, for determining the region of search.
Second generation sets of threshold values generation unit, for carrying out explosive treatment to the first generation sets of threshold values, generate second generation threshold
Value group.
New second generation sets of threshold values obtains unit, is exploded for the part second generation sets of threshold values to randomly selecting
Displacement operation processing and the processing of Gauss displacement operation, obtain new second generation sets of threshold values.
Second judged result obtains unit, for judging second generation sets of threshold values whether in the region of search, obtains
Two judged results.Wherein, second generation sets of threshold values herein includes not carrying out at the processing of blast displacement operation and Gauss displacement operation
The second generation sets of threshold values of reason and the second generation sets of threshold values for carrying out the processing of blast displacement operation and the processing of Gauss displacement operation, i.e., to institute
Some does not carry out the second generation sets of threshold values and carry out blast displacement operation that displacement operation is handled and Gauss displacement operation is handled of exploding
Whether the second generation sets of threshold values of processing and the processing of Gauss displacement operation is all judged, see it in the region of search.
Second generation sets of threshold values stick unit, for representing the second generation sets of threshold values described when second judged result
When in the region of search, then retain the second generation sets of threshold values.
Second generation sets of threshold values determining unit after processing, if representing the second generation threshold value for second judged result
Group then carries out mapping displacement operation processing, really not in the region of search to the second generation sets of threshold values outside the region of search
Second generation sets of threshold values after fixed processing is located in the region of search;Now, the sets of threshold values set includes being located at the region of search
Interior first generation sets of threshold values and second generation sets of threshold values.
The fitness value set obtains module 203, specifically includes:
Fitness value set obtains unit, for calculating described the in each sets of threshold values set according to below equation
The fitness value of generation sets of threshold values, the second generation sets of threshold values, obtain multigroup fitness value set:Wherein σ (x1,x2,...,xn) represent the first generation threshold value
The fitness value of group or the second generation sets of threshold values, ωiAnd ωjSplit what any two area pixel points occurred for image
Probability, μiAnd μjSplit the average in any two region for image.
The invention provides a kind of multi-Level Threshold Image Segmentation system based on fireworks algorithm, by randomly generating fireworks, often
Individual fireworks represent a sets of threshold values, and it is segmentation threshold number that it, which ties up algebraically, carry out explosive treatment to each fireworks, then evaluation is every
The quality of sets of threshold values representated by fireworks or spark, the search being combined by mother for fireworks search and the search of filial generation spark
Strategy is continuously updated sets of threshold values set, so as to rapidly and accurately find optimum segmentation threshold value group, finally obtains corresponding segmentation
Image.Test result indicates that it is higher using fireworks efficiency of algorithm and be not easy to be absorbed in locally optimal solution, achieve good be divided into
Fruit.
Each embodiment is described by the way of progressive in this specification, what each embodiment stressed be and other
The difference of embodiment, between each embodiment identical similar portion mutually referring to.For system disclosed in embodiment
For, because it is corresponded to the method disclosed in Example, so description is fairly simple, related part is said referring to method part
It is bright.
Specific case used herein is set forth to the principle and embodiment of the present invention, and above example is said
It is bright to be only intended to help the method and its core concept for understanding the present invention;Meanwhile for those of ordinary skill in the art, foundation
The thought of the present invention, in specific embodiments and applications there will be changes.In summary, this specification content is not
It is interpreted as limitation of the present invention.
Claims (10)
1. a kind of image partition method, it is characterised in that described image dividing method includes:
Obtain multiple first generation sets of threshold values and iterations;The first generation sets of threshold values represents the multi-threshold segmentation of segmentation figure picture
Group;
Explosive treatment is carried out to each first generation sets of threshold values, obtains multiple sets of threshold values set, and record Number Of Bursts;Each
The sets of threshold values set is included multiple second caused by a first generation sets of threshold values and first generation sets of threshold values blast
For sets of threshold values;
The first generation sets of threshold values, the fitness value of the second generation sets of threshold values in each sets of threshold values set of calculating, are obtained
To multigroup fitness value set;
To the fitness value in fitness value set described in every group according to arranging from big to small, the first adaptation in every group is determined
Sets of threshold values corresponding to angle value;First fitness value is the maximum adaptation angle value in the fitness value set;The threshold value
Group is the first generation sets of threshold values or is the second generation sets of threshold values;
Judge whether the Number Of Bursts are less than the iterations, obtain the first judged result;
If first judged result represents that the Number Of Bursts are less than the iterations, by first fitness value pair
The sets of threshold values answered carries out explosive treatment, updates the sets of threshold values set and the Number Of Bursts;
If first judged result represents that the Number Of Bursts are equal to or more than the iterations, by multiple described the
One fitness value selects the sets of threshold values corresponding to the first fitness value of maximum to be defined as splitting according to being arranged from big to small
Optimum segmentation threshold value group during image.
2. image partition method according to claim 1, it is characterised in that described to obtain multiple first generation sets of threshold values and change
Generation number, is specifically included:
Treat segmentation figure picture and carry out binary conversion treatment, obtain gray level image;
The segmentation number of plies set according to user, to the gray level image random initializtion, obtains multiple first generation sets of threshold values;It is described
The quantity of element in first generation sets of threshold values subtracts one for the segmentation number of plies quantity;
The blast cycle-index set according to user, obtain iterations.
3. image partition method according to claim 1, it is characterised in that described to enter to each first generation sets of threshold values
Row explosive treatment, multiple sets of threshold values set are obtained, are specifically included:
Determine the region of search;
Explosive treatment is carried out to the first generation sets of threshold values, generates second generation sets of threshold values;
Judge that the second generation sets of threshold values whether in the region of search, obtains the second judged result;
If second judged result represents that the second generation sets of threshold values in the region of search, retains the second generation threshold
Value group;
If second judged result represents the second generation sets of threshold values not in the region of search, to the region of search
Outer second generation sets of threshold values carries out mapping displacement operation processing, it is determined that the second generation sets of threshold values after processing is located at the region of search
It is interior;The sets of threshold values set includes the second generation sets of threshold values after first generation sets of threshold values, second generation sets of threshold values and processing.
4. image partition method according to claim 3, it is characterised in that judge the second generation sets of threshold values whether
In the region of search, before obtaining the second judged result, in addition to:
Explode displacement operation processing and the processing of Gauss displacement operation are carried out to the part second generation sets of threshold values randomly selected, obtained
To new second generation sets of threshold values.
5. image partition method according to claim 1, it is characterised in that described to calculate in each sets of threshold values set
The first generation sets of threshold values, the fitness value of the second generation sets of threshold values, obtain multigroup fitness value set, specifically include:
The first generation sets of threshold values in each sets of threshold values set, the second generation sets of threshold values are calculated according to below equation
Fitness value, obtain multigroup fitness value set:Wherein σ
(x1,x2,...,xn) represent the fitness value of the first generation sets of threshold values or the second generation sets of threshold values, ωiAnd ωjFor image
Split the probability that any two area pixel points occur, μiAnd μjSplit the average in any two region for image.
6. a kind of image segmentation system, it is characterised in that described image segmenting system includes:
Acquisition module, for obtaining multiple first generation sets of threshold values and iterations;The first generation sets of threshold values represents segmentation figure picture
Multi-threshold segmentation group;
Sets of threshold values set obtains module, for carrying out explosive treatment to each first generation sets of threshold values, obtains multiple sets of threshold values
Set, and record Number Of Bursts;Each sets of threshold values set includes a first generation sets of threshold values and the first generation
Multiple second generation sets of threshold values caused by sets of threshold values blast;
Fitness value set obtains module, for calculating the first generation sets of threshold values in each sets of threshold values set, described
The fitness value of second generation sets of threshold values, obtain multigroup fitness value set;
Sets of threshold values determining module, for the fitness value in fitness value set described in every group according to arranging from big to small
Row, determine sets of threshold values corresponding to the first fitness value in every group;First fitness value is in the fitness value set
Maximum adaptation angle value;The sets of threshold values is the first generation sets of threshold values or is the second generation sets of threshold values;
First judged result obtains module, for judging whether the Number Of Bursts are less than the iterations, obtains first and sentences
Disconnected result;
Sets of threshold values set and Number Of Bursts update module, for representing that the Number Of Bursts are less than institute when first judged result
When stating iterations, then the sets of threshold values corresponding to first fitness value is subjected to explosive treatment, updates the sets of threshold values
Set and the Number Of Bursts;
Optimum segmentation threshold value group determining module, for representing that the Number Of Bursts are equal to or more than when first judged result
During the iterations, then by multiple first fitness values according to being arranged from big to small, the first of maximum is selected to fit
Answer the sets of threshold values corresponding to angle value be defined as segmentation figure as when optimum segmentation threshold value group.
7. image segmentation system according to claim 6, it is characterised in that the acquisition module, specifically include:
Gray level image obtains unit, carries out binary conversion treatment for treating segmentation figure picture, obtains gray level image;
First generation sets of threshold values acquiring unit, for the segmentation number of plies set according to user, to the gray level image random initializtion,
Obtain multiple first generation sets of threshold values;The quantity of element in the first generation sets of threshold values subtracts one for the segmentation number of plies quantity;
Iterations acquiring unit, for the blast cycle-index set according to user, obtain iterations.
8. image segmentation system according to claim 6, it is characterised in that the sets of threshold values set obtains module, specifically
Including:
The region of search determines, for determining the region of search;
Second generation sets of threshold values generation unit, for carrying out explosive treatment to the first generation sets of threshold values, generate second generation sets of threshold values;
Second judged result obtains unit, for judging the second generation sets of threshold values whether in the region of search, obtains
Two judged results;
Second generation sets of threshold values stick unit, for representing the second generation sets of threshold values in the search when second judged result
When in section, then retain the second generation sets of threshold values;
Second generation sets of threshold values determining unit after processing, if representing the second generation sets of threshold values not for second judged result
In the region of search, then the second generation sets of threshold values outside the region of search is carried out mapping displacement operation processing, it is determined that place
Second generation sets of threshold values after reason is located in the region of search;The sets of threshold values set includes first generation sets of threshold values, second generation threshold
Second generation sets of threshold values after value group and processing.
9. image segmentation system according to claim 8, it is characterised in that the sets of threshold values set obtains module, also wraps
Include:
New second generation sets of threshold values obtains unit, and blast displacement is carried out for the part second generation sets of threshold values to randomly selecting
Operation processing and the processing of Gauss displacement operation, obtain new second generation sets of threshold values.
10. image segmentation system according to claim 6, it is characterised in that the fitness value set obtains module, tool
Body includes:
Fitness value set obtains unit, for calculating the first generation in each sets of threshold values set according to below equation
The fitness value of sets of threshold values, the second generation sets of threshold values, obtain multigroup fitness value set:Wherein σ (x1,x2,...,xn) represent the first generation threshold value
The fitness value of group or the second generation sets of threshold values, ωiAnd ωjSplit what any two area pixel points occurred for image
Probability, μiAnd μjSplit the average in any two region for image.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710729705.0A CN107507199A (en) | 2017-08-23 | 2017-08-23 | A kind of image partition method and system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710729705.0A CN107507199A (en) | 2017-08-23 | 2017-08-23 | A kind of image partition method and system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN107507199A true CN107507199A (en) | 2017-12-22 |
Family
ID=60692467
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710729705.0A Pending CN107507199A (en) | 2017-08-23 | 2017-08-23 | A kind of image partition method and system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107507199A (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109889833A (en) * | 2019-03-04 | 2019-06-14 | 中科院成都信息技术股份有限公司 | A kind of method for compressing image based on improvement binary system fireworks algorithm |
CN110853010A (en) * | 2019-11-11 | 2020-02-28 | 江苏君英天达人工智能研究院有限公司 | High-speed railway cable detection method based on FWA and SM |
CN112801892A (en) * | 2021-01-11 | 2021-05-14 | 中国民航大学 | FFWA-based self-adaptive Canny aircraft skin infrared image edge detection method |
CN113362296A (en) * | 2021-05-31 | 2021-09-07 | 山东大学 | Tunnel crack extraction method and system |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103366362A (en) * | 2013-04-17 | 2013-10-23 | 昆明理工大学 | Glowworm optimization algorithm-based ore zone image segmentation method |
CN106960226A (en) * | 2017-04-11 | 2017-07-18 | 陕西师范大学 | A kind of soft subspace MR image clustering algorithms based on fireworks algorithm |
-
2017
- 2017-08-23 CN CN201710729705.0A patent/CN107507199A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103366362A (en) * | 2013-04-17 | 2013-10-23 | 昆明理工大学 | Glowworm optimization algorithm-based ore zone image segmentation method |
CN106960226A (en) * | 2017-04-11 | 2017-07-18 | 陕西师范大学 | A kind of soft subspace MR image clustering algorithms based on fireworks algorithm |
Non-Patent Citations (2)
Title |
---|
MIAO MA 等: "Multi-level Image Thresholding based on Improved Fireworks Alogorithm", 《2017 13TH INTERNATIONAL CONFERENCE ON NATURAL COMPUTATION, FUZZY SYSTEMS AND KNOWLEDGE DISCOVERY (ICNC-FSKD 2017)》 * |
MILAN TUBA 等: "Multilevel Image Thresholding by Fireworks Algorithm", 《2015 25TH INTERNATIONAL CONFERENCE RADIOELEKTRONIKA(RADIOELEKTRONIKA)》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109889833A (en) * | 2019-03-04 | 2019-06-14 | 中科院成都信息技术股份有限公司 | A kind of method for compressing image based on improvement binary system fireworks algorithm |
CN109889833B (en) * | 2019-03-04 | 2021-04-16 | 中科院成都信息技术股份有限公司 | Image compression method based on improved binary firework algorithm |
CN110853010A (en) * | 2019-11-11 | 2020-02-28 | 江苏君英天达人工智能研究院有限公司 | High-speed railway cable detection method based on FWA and SM |
CN110853010B (en) * | 2019-11-11 | 2022-05-13 | 江苏君英天达人工智能研究院有限公司 | High-speed railway cable detection method based on FWA and SM |
CN112801892A (en) * | 2021-01-11 | 2021-05-14 | 中国民航大学 | FFWA-based self-adaptive Canny aircraft skin infrared image edge detection method |
CN112801892B (en) * | 2021-01-11 | 2022-07-01 | 中国民航大学 | FFWA-based self-adaptive Canny aircraft skin infrared image edge detection method |
CN113362296A (en) * | 2021-05-31 | 2021-09-07 | 山东大学 | Tunnel crack extraction method and system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110188824B (en) | Small sample plant disease identification method and system | |
CN108596258B (en) | Image classification method based on convolutional neural network random pooling | |
CN112750140B (en) | Information mining-based disguised target image segmentation method | |
CN107507199A (en) | A kind of image partition method and system | |
CN107392919B (en) | Adaptive genetic algorithm-based gray threshold acquisition method and image segmentation method | |
CN112614077A (en) | Unsupervised low-illumination image enhancement method based on generation countermeasure network | |
CN105631415A (en) | Video pedestrian recognition method based on convolution neural network | |
CN112597993B (en) | Patch detection-based countermeasure model training method | |
CN108038507A (en) | Local receptor field extreme learning machine image classification method based on particle group optimizing | |
CN109101999B (en) | Support vector machine-based cooperative neural network credible decision method | |
CN107045717A (en) | The detection method of leucocyte based on artificial bee colony algorithm | |
CN113724354B (en) | Gray image coloring method based on reference picture color style | |
Ying et al. | Human ear recognition based on deep convolutional neural network | |
CN108154235A (en) | A kind of image question and answer inference method, system and device | |
CN107945199A (en) | Infrared Image Segmentation and system based on bat algorithm and Otsu algorithm | |
CN109712160A (en) | Improved lion group algorithm is combined to realize carrying out image threshold segmentation method based on generalized entropy | |
CN110659680B (en) | Image patch matching method based on multi-scale convolution | |
CN106780501A (en) | Based on the image partition method for improving artificial bee colony algorithm | |
CN115376008A (en) | Method and device for identifying plant diseases and insect pests, electronic equipment and storage medium | |
CN116385832A (en) | Bimodal biological feature recognition network model training method | |
CN115272774A (en) | Sample attack resisting method and system based on improved self-adaptive differential evolution algorithm | |
CN113361466A (en) | Multi-modal cross-directed learning-based multi-spectral target detection method | |
CN111382684B (en) | Angle robust personalized facial expression recognition method based on antagonistic learning | |
CN110110651B (en) | Method for identifying behaviors in video based on space-time importance and 3D CNN | |
CN116824232A (en) | Data filling type deep neural network image classification model countermeasure training method |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20171222 |
|
RJ01 | Rejection of invention patent application after publication |