Summary of the invention
The object of the invention is for the problems referred to above, a kind of one dimension digital image adaptive Boundary Detection extraction algorithm is provided, can practically disturb and exist the detection box at all kinds of layered images edge in situation to extract with various noise jamming, especially system self.
For achieving the above object, as shown in Figure 1, performing step is as follows for algorithm of the present invention:
Original one dimension image is carried out to Butterworth low-pass filtering, obtain the filtering image of filtering high-frequency interferencing signal;
Fuzzy Calculation division is carried out in filtered one dimension image region to be detected, obtain the non-core layering fringe region (comprising start edge region and terminating edge region) in horizontal ordinate dimension, core layering fringe region;
Signal data in two regions that obtain is carried out to further amplitude and slope characteristics and extract, and be converted into characteristic quantity with correspondence mappings is one by one carried out in horizontal ordinate region, finally layering to be detected edge is belonged to class division;
According to layering to be detected edge, belong to class and adopt respectively algorithms of different to process, extract layering edge horizontal ordinate information.
Described original one dimension image adopts Butterworth LPF to carry out the filtering of high-frequency interferencing signal.
Described Fuzzy Calculation adopts statistics with histogram method, comprising:
A. layering to be detected border amplitude is divided into N amplitude interval: [f
min+ nd, f
min+ (n+1) d] (n=0,1,2 ... N-1), d=(f wherein
max-f
min)/N, f
minfor signal minimum amplitude, f
maxfor signal maximum amplitude;
B. interval according to divided N amplitude, successively the image layered borderline region amplitude of one dimension is carried out to statistics with histogram, obtain N class frequency (P
1, P
2p
n) and shine upon one by one corresponding abscissa zone [x
i, x
i+1], (i=0,1 ..., N-1).N amplitude interval division take do not occur abscissa zone overlapping be basic demand, and N >=3.
C. in horizontal ordinate dimension, from initial amplitude region, start self-adaptation and search start edge region,
when k=0, be initial frequency P
0=P
0.If frequency P
k+1/ P
k>=α, continues to carry out
otherwise stop, obtaining cumulative frequency P
k+1and the interval [x of respective coordinates
s, x
s+ (k+1) d
x], d wherein
x=(x
o-x
s)/N.
D. in horizontal ordinate dimension, from termination amplitude region, start self-adaptation and search terminating edge region,
when m=1, be initial frequency P
0=P
n.If frequency P
m-1/ p
m>=β, continues to carry out
otherwise stop, obtaining cumulative frequency P
m+1and corresponding abscissa zone [x
s+ (m+1) d
x, x
o].
E. according to above frequency accumulation, calculate, obtain core layering fringe region [x
s+ (k+1) d
x, x
s+ (m+1) d
x] and non-core layering fringe region (wherein start edge region is [x
s, x
s+ (k+1) d
x], terminating edge region is [x
s+ (m+1) d
x, x
o]).Parameter alpha in steps d and e, β is generally identical, specifically can carry out differentiation setting according to different testing requirements.
Described carries out curve fitting to layering fringe region to be detected, and employing method is least square fitting, and matching number of times is secondary, and after matching, curve table is shown
Described to obtaining in two regions signal data, carry out further amplitude and slope characteristics and extract and need to construct two variablees:
f wherein
xfor raw data after filtering,
for curve amplitude after matching, A is feature extraction interval censored data collection;
wherein k round numbers, is subregion length, for treating evaluation region, further segments the individual features amount of calculating; Respectively to non-core layering fringe region (comprising start edge region and terminating edge region) and core layering fringe region carry out CV and
characteristic quantity calculate, when CV>=φ, judge that this region curve amplitude and matched curve amplitude integral body differ greatly, be disturbed relatively seriously, tracing pattern is irregular, otherwise is disturbed less; When
judge that the better curve of this horizontal ordinate near zone slope consistance is comparatively precipitous, be positioned at core layering fringe region, otherwise be positioned at non-core layering fringe region; , according to these two characteristic quantities, three layers of dividing in conjunction with previous step, can substantially carry out region and belong to class division, comprise altogether four kinds of situations: the one, and core layering fringe region disturbs more, and non-core layering fringe region disturbs less; The 2nd, core layering fringe region disturbs few, and non-core layering fringe region disturbs many; The 3rd, core layering fringe region disturbs many, and non-core layering fringe region disturbs many; The 4th, core layering fringe region disturbs few, and non-core layering fringe region disturbs few.
Described designs corresponding algorithm according to not belonging to class together, and wherein belonging to class one, two corresponding algorithms is self-adaptation circulation searching method, belongs to class two correspondence mappings methods, belongs to the above the whole bag of tricks of class four and all can.Described genus class one, three corresponding algorithms are self-adaptation circulation searching method, comprising:
A. in start edge region and terminating edge area coverage, search corresponding peak value, valley and respective coordinates point thereof successively: (x
min, F
min) and (x
max, F
max);
B. respectively from x
l=x
minand x
r=x
maxto T=1/2* (x
max+ x
min) direction searches flex point
set traversal lookup result and be respectively x
aand x
i;
C. adopt subsidiary condition to judge, if search horizontal ordinate x, meet
wherein Ψ is horizontal ordinate threshold value, and γ is amplitude thresholds coefficient,
for slope threshold value, think to search substantially to meet the requirements;
If d. both sides traversals is searched coordinate and all met this requirement, according to following priority rule, judge: 1. compare | T-x
a| with | T-x
i|, difference is little preferentially to be chosen; 2. compare
With
Difference is little preferentially to be chosen; If both sides traversal lookup result only has one to meet, choose this result; If all do not meet new initial seek coordinate x be set
l=x
a+ l, x
r=x
i+ l (supposes x herein
aand x
ithe traversal first that is respectively initiation region and stops region is searched coordinate points), wherein l searches horizontal ordinate for traversal and upgrades step-length, and then repeating step b, c, until satisfy condition.
Described designs corresponding algorithm according to not belonging to class together, and wherein belonging to the corresponding algorithm of class two is reflection method, comprising:
A. at [x
s, x
o] interval (set x herein
s, x
obe respectively the corresponding extreme value coordinate points in initiation region and termination region) each horizontal ordinate is mapped to another manifold, its mapping relations are
wherein w is for getting rid of window length, and mainly for preventing disturbing the impact on mapping result near mapping point point, L is that mapping gathers window length;
B. traversal is gathered after searching mapping, obtains C
max=max{C (x) | x ∈ [x
s, x
o], corresponding horizontal ordinate is required;
Described designs corresponding algorithm according to not belonging to class together, wherein belongs to the corresponding algorithm of class four and can adopt self-adaptation circulation searching method or reflection method.
Embodiment
For further understanding summary of the invention of the present invention, Characteristic, hereby exemplify following examples, and coordinate accompanying drawing to be described in detail as follows:
Flow process of the present invention as shown in Figure 1, comprises step: (1) adopts Butterworth low-pass filtering to carry out the filtering of high frequency clutter; (2) Fuzzy Calculation division is carried out in filtered one dimension image region to be detected, obtain the non-core layering fringe region (comprising start edge region and terminating edge region) in horizontal ordinate dimension, core layering fringe region; (3) signal data in two regions that obtain is carried out to further amplitude and slope characteristics and extract, and be converted into characteristic quantity with correspondence mappings is one by one carried out in horizontal ordinate region, finally layering to be detected edge is belonged to class division; (4) according to layering to be detected edge, belong to class and adopt respectively algorithms of different to process, extract layering edge horizontal ordinate information.
Each step is specific as follows:
Step (1): adopt Butterworth low-pass filtering to carry out high frequency clutter filtering Butterworth LPF and can keep preferably low frequency signal, the high-frequency interferencing signal of filtering simultaneously.
Step (2): region U to be detected carries out Fuzzy Calculation division to filtered one dimension image, obtains the non-core layering fringe region U in horizontal ordinate dimension
1(comprising start edge region and terminating edge region), core layering fringe region U
2, U=U wherein
2∪ U
2, treatment scheme as shown in Figure 2, is processed rear layering edge dividing condition, as shown in Figure 3
A. layering to be detected border amplitude is divided into the interval S of N amplitude
n: [f
min+ nd, f
min+ (n+1) d] (n=0,1,2 ... N-1), d=(f wherein
max-f
min)/N, f
minfor signal minimum amplitude, f
maxfor signal maximum amplitude;
B. interval according to divided N amplitude, successively the image layered borderline region amplitude of one dimension is carried out to statistics with histogram, obtain N class frequency (P
0, P
1p
n-1) and shine upon one by one corresponding abscissa zone H
i: [x
i, x
i+1] (i=0,1 ..., N-1).N amplitude interval division principle take do not occur abscissa zone overlapping be basic demand, generally N >=3.
C. setting initial abscissa zone, left side is [x
0, x
1], x wherein
0=x
s, initial cumulative frequency p=P
0.For the accumulation computation process of 2≤k≤N-1, the P if frequency value satisfies condition
k+1/ P
k>=α, carries out frequency accumulation
otherwise stop, obtaining cumulative frequency P
k+1and corresponding interval U
1l: [x
s, x
s+ (k+1) d
x], this interval is start edge region.
D. set initial abscissa zone, right side for [x
n-1, x
n], x wherein
n=x
o, initial cumulative frequency p=P
n-1.For the accumulation computation process of 2≤m≤N-1, if frequency P
n-m/ P
m>=β, carries out frequency accumulation
otherwise stop, obtaining cumulative frequency P
m+1and the genus class division of region, corresponding district, comprising altogether four kinds of situations: a core layering fringe region disturbs more, non-core layering fringe region disturbs less; Two core layering fringe regions disturb few, and non-core layering fringe region disturbs many; Three core layering fringe regions disturb many, and non-core layering fringe region disturbs many; Four core layering fringe regions disturb few, and non-core layering fringe region disturbs few.Calculating
time, core layering fringe region and non-core layering fringe region can Further Division be that subregion is further to judge.
Step (4): belong to class according to layering to be detected edge and adopt respectively algorithms of different to process, extract layering edge horizontal ordinate information, as shown in Figure 5
For belonging to class one, three, adopt self-adaptation circulation searching method, mainly comprise:
A. setting layering fringe region U to be detected interval is [x
s, x
o], initialization coordinate i=x
s, j=x
o.Along with i is increasing progressively successively, near horizontal ordinate xs, traversal is searched respective magnitudes extreme value, along with j successively decreases successively, at horizontal ordinate x
onear traversal is searched respective magnitudes extreme value, finally can obtain peak value corresponding to curve start edge region and terminating edge region, valley and corresponding horizontal ordinate thereof: (x
min, F
min) and (x
max, F
max);
B. setting respectively both sides, to search origin coordinates be x
l=x
minand x
r=x
max, respectively to T=1/2* (x
max+ x
min) direction searches flex point
set lookup result first and be respectively x
aand x
i;
C. adopt subsidiary condition to judge, if search horizontal ordinate x, meet
wherein Ψ is horizontal ordinate threshold value, and γ is amplitude thresholds coefficient,
for slope threshold value, think to search substantially to meet the requirements;
If d. both sides traversals is searched coordinate and all met this requirement, according to following priority rule, judge: 1. compare | T-x
a| with | T-x
i|, difference little person preferentially choose; 2. compare
with
difference little person preferentially choose; If both sides traversal lookup result only has one to meet, choose this result; If all do not meet new initial seek coordinate x be set
l=x
a+ l, x
r=x
i+ l (supposes x herein
aand x
ithe traversal first that is respectively initiation region and stops region is searched coordinate points), wherein l searches horizontal ordinate for traversal and upgrades step-length, and precision is closely related with searching, and then repeating step b, c, until meet qualifications.
For belonging to class two, adopt reflection method, as shown in Figure 6, mainly comprise:
B. at [x
s, x
o] interval (set x herein
s, x
obe respectively the corresponding extreme value coordinate points in initiation region and termination region) each horizontal ordinate x is mapped to another manifold Q, its mapping relations are
wherein w is for getting rid of window length, and mainly for preventing disturbing the impact on mapping result near mapping point point, L is that mapping gathers window length;
C. traversal is gathered Q after searching mapping, obtains C
max=max{C (x) | x ∈ [x
s, x
o], corresponding horizontal ordinate x
qfor required;
The embodiment above the invention process example being provided is described in detail, applied specific case herein principle of the present invention and embodiment are set forth, the explanation of above embodiment is just for helping to understand method of the present invention and core concept; , for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention meanwhile.