Multi-curve automatic tracking connection method and device
Technical field
The present invention relates to Flame Image Process, particularly multi-curve automatic tracking connection method and device.
Background technology
Blood vessel in the medical domain detects, palmmprint detects, cell detection, and the high voltage transmission line in the power domain detects or the like, all need in the above-mentioned field to be applied to the curve tracking technique, so the research of curve tracking technique has great significance.
There is following problem in traditional curve tracking technique: 1) to the noise image sensitivity; 2) can't follow the tracks of the curve of many intersections; 3) can't follow the tracks of the curve that disappearance reappears again; 4) can't follow the tracks of the curve that takes off change; 5) can't automatically follow the tracks of every curve of connection; Whether 6) can't differentiate curve makes a mistake and follow the tracks of to connect.
In sum, press for the many curves that propose the many curves in simple, the effective tracking connection of a kind of energy complex scene at present and follow the tracks of method of attachment and device.
Summary of the invention
In view of this, fundamental purpose of the present invention is to realize simple, effectively to follow the tracks of the many curves that connect in the actual scene.
For achieving the above object, according to first aspect of the present invention, provide a kind of multi-curve automatic tracking connection method, this method comprises the steps:
Step (101) is carried out Filtering Processing to obtain the smoothed image of described present image to present image;
Step (102) is extracted the check point of described smoothed image;
Step (103) is obtained the curve point and the junction curve of described smoothed image;
Whether the described curve of step (104) analysis abnormal conditions takes place and correspondingly handles; And
Step (105) judges that the present image inner curve detects the also curve of output that whether finishes.
Described method comprises the steps:
Step (101) is carried out Filtering Processing to obtain the smoothed image of described present image to present image;
Step (102) is extracted the check point of described smoothed image;
Step (103) is obtained the curve point and the junction curve of described smoothed image;
Whether the described curve of step (104) analysis abnormal conditions takes place and correspondingly handles; And
Step (105) judges that the present image inner curve detects the also curve of output that whether finishes.
Preferably, step (101) adopts Gauss's smooth function that present image is carried out Filtering Processing, and establishing present image is that (x y), passes through the smoothed image I that obtains after the Filtering Processing to I
σ(x y) is I
σ(x, y)=I (x, y) * g
σ(x, y);
Wherein, g
σ(* represents convolution algorithm, the kernel function g that Gauss is level and smooth for x, y) the level and smooth kernel function of expression Gauss
σ(x, y) value of middle σ is relevant with the pixel wide of curve, satisfies
Wherein, ω represents the pixel wide of curve.
Preferably, step (102) may further comprise the steps:
Step (1021) is obtained the eigenwert and the normal direction of absolute value maximum of Hessian matrix of every of the smoothed image of present image;
Step (1022) adopts subjunctive to judge whether the smoothed image every bit of present image is check point;
Step (1023) is the eigenwert of the absolute value maximum of the Hessian matrix of the check point curvature intensity as this check point, with the check point of curvature intensity maximum as initial search point; And
Step (1024) is determined the angle of the bearing of trend of check point.
Preferably, in the step (1021), (x, y) the Hessian matrix of Gou Jianing is point in the present image
Calculate the eigenwert and the proper vector of Hessian matrix, with the vectorial normal direction (n of the eigenwert characteristic of correspondence of absolute value maximum as point
x, n
y); Wherein, r
Xx(x, y), r
Xy(x, y), r
Yy(x, y) the expression point (x, y) with the shade of gray difference of eight adjacent side points around it, its computing formula is as follows:
r
xx(x,y)=|I(x-1,y)+I(x+1,y)-I(x,y)|
r
yy(x,y)=|I(x,y-1)+I(x,y+1)-I(x,y)|
r
xy(x,y)=|I(x-1,y-1)+I(x+1,y+1)-I(x-1,y+1)-I(x+1,y-1)|
Wherein, the gray-scale value of I () remarked pixel point ();
In the step (1022), (x is on the curve some y) to postulated point, and (x, adjacent side point (x+p y) set up an office
x, y+p
y) along normal direction (n
x, n
y) first order derivative be 0, calculate (p
x, p
y), if satisfy
Think that then (x y) is check point to point, otherwise thinks that (x y) is not check point to point;
Preferably, in the step (1024), the angle of the bearing of trend of check point is
Preferably, step (103) comprises the steps:
Step (1031) is determined n check point in the neighborhood around along the bearing of trend of current curves point, calculate the differential seat angle of the bearing of trend of each check point and current curves point respectively, get the check point of angle with smallest difference correspondence, if the curvature of this check point intensity>first threshold T1, think that then this check point is doubtful next curve point and changes step (1032) over to, otherwise think that current curves point is the breakaway poing of current curves, changes the processing of step (104) over to, wherein, 0.3≤T1≤2.5;
Step (1032) is as if the differential seat angle>second threshold value T2 of the bearing of trend of doubtful next curve point on the current curves and current curves point, think that then step (1033) may take place to intersect and change over to current curves, otherwise with doubtful next curve point next curve point as current curves, connect next curve point and current curves point, and next curve point returned step (1032) as the current curves point, wherein, π/12≤T2≤π/3.
Step (1033) is determined a future position at the bearing of trend of current curves point, with this future position is that the center determines that one is the region of search of radius with R, in this region of search, detect whether there is the check point that satisfies curve its own inertial feature with current point then, if exist, think that then current curves intersects, the check point of curve its own inertial feature next curve point as current curves will be satisfied, and connect next curve point and current curves point, and next curve point returned step (1031) as the current curves point, otherwise with doubtful next curve point next curve point as current curves, connect next curve point and current curves point, and next curve point is returned step (1031) as current point; Wherein, 3≤R≤8 and R are integer.
Preferably, curve its own inertial feature refers to all approximately equals of the angle of bearing of trend adjacent on the curve and this curvature intensity of 2, the differential seat angle of adjacent bearing of trend on the curve<the 3rd threshold value T3, and this curvature intensity difference minimum of 2 at 2 at 2, wherein, π/12≤T3≤π/3.
Preferably, step (104) comprises the steps:
Step (1041) judges whether current curves curve takes place interrupt, and the curve that interrupts is connected; With
Step (1042) judges whether current curves curve takes place disappear, and the curve that disappears is connected;
Wherein, in the step (1041), at first determining a future position at the bearing of trend of the breakaway poing of current curves, is that the center determines that one is the region of search of radius with R with this future position; In this region of search, detect whether there is the check point that satisfies curve its own inertial feature with this breakaway poing then, if exist, think that then current curves interrupts, connect this breakaway poing and this check point, and this check point returned step (103) as the current curves point, otherwise carry out step (1042), wherein, 3≤R≤8 and R are integer;
In the step (1042), bearing of trend along breakaway poing, the gray-scale value of check point that carries out the present image of length L adds up, if the mean value of the mean value of the gray-scale value of the present image that accumulated value>current curves upper curve point is corresponding or the gray-scale value of accumulated value<present image, think that then current curves disappears, in the point that satisfies condition, the point of angle difference and current some angle difference minimum is as breakaway poing, with this breakaway poing and length along the bearing of trend of this breakaway poing is that the check point of L is connected, and this check point returned step (103) as the current curves point, stop otherwise think that current curves is followed the tracks of; Wherein, 10≤L≤30 and L are integer.
Preferably, step (105) comprises the steps:
Step (1051) judges whether current curves connects accurately; With
Step (1052) is judged whether the present image inner curve detects to finish and export and is connected correct curve;
Wherein, in the step (1051), the number N1 that puts on the current curves that the tracking of output stops in the statistic procedure (104), the point of statistics on the current curves belongs to the number N2 of check point in the bianry image of current smoothed image, if N2/N1>the 4th threshold value T4, it is correct to think that then current curves connects, otherwise thinks that the gray-scale value that belongs to the point on the current curves on current curves connection error and the bianry image with smoothed image is made as 0, wherein, 0.25≤T4≤0.75;
In the step (1052), at first extract the correct current curves of connection in the step (1051), the gray-scale value that belongs to the check point of current curves point simultaneously in the bianry image with current smoothed image is made as 0; Whether the curve of judging present image then detects and finishes, if the number of check point in the bianry image of current smoothed image<the 5th threshold value T5, think that then the detection of present image inner curve finishes, and all curves that extract in the output present image, otherwise the tracking that changes the new curve of step (103) beginning over to connects, wherein, 10≤T5≤50 and T5 are integer.
According to another aspect of the present invention, a kind of multi-curve automatic tracking coupling arrangement is provided, this device comprises:
The image filtering processing unit is used for present image is carried out the smoothed image that Filtering Processing is obtained present image;
The check point extraction unit is used to extract the check point of smoothed image;
The curve acquisition unit is used to obtain the curve point and the junction curve of smoothed image;
The curve abnormality analytic unit is used for analytic curve and whether abnormal conditions take place and correspondingly handles; With
Curve detection finishes and judges and output unit, is used to judge that the present image inner curve detects the also curve of output that whether finishes.
Preferably, described check point extraction unit comprises: the eigenwert of point and the acquisition module of normal direction are used to obtain the eigenwert and the normal direction of absolute value maximum of Hessian matrix of every of the smoothed image of present image; The check point judge module, whether the smoothed image every bit that is used to adopt subjunctive to judge present image is check point; Cover half piece is really put in the calculating of the curvature intensity of check point and initial search, be used for the eigenwert of the absolute value maximum of the Hessian matrix of check point curvature intensity as this check point, with the check point of curvature intensity maximum as initial search point; With check point bearing of trend angle cover half piece really, be used for determining the angle of the bearing of trend of check point.
Preferably, described curve abnormality analytic unit comprises: curve interrupts judging and processing module be used to judge whether current curves curve takes place interrupt, and the curve that interrupts is connected; Disappear with curve and to judge and processing module be used to judge whether current curves curve takes place disappear, and the curve that disappears is connected.
Preferably, curve extracts and detects the judging unit that finishes and comprises: the correct connection judgment module of curve is used to judge whether current curves connects accurately; Finish with curve detection and to judge and the curve extraction module, be used to judge whether the present image inner curve detects finishes and export the correct curve of connection.
The method that multi-curve automatic tracking provided by the present invention connects has been got rid of the noise image interference that tracking connects to curve by present image being carried out Filtering Processing; And whether exist the check point that satisfies curve its own inertial feature with the current curves point to follow the tracks of many curves that intersect by detecting; By detecting the curve whether exist the check point that satisfies curve its own inertial feature with breakaway poing to follow the tracks of interruption; Connect breakaway poing and follow the tracks of the curve that takes off change along the check point of the bearing of trend of breakaway poing.The method that multi-curve automatic tracking provided by the present invention connects also has judges whether follow the tracks of the current curves that stops connects function accurately.
Description of drawings
Fig. 1 is the process flow diagram of the method for multi-curve automatic tracking connection provided by the present invention;
Fig. 2 is the process flow diagram of the step (102) of method provided by the present invention;
Fig. 3 is the process flow diagram of the step (104) of method provided by the present invention;
Fig. 4 is the process flow diagram of the step (105) of method provided by the present invention;
Fig. 5 is the frame diagram of the device of multi-curve automatic tracking connection provided by the present invention;
Fig. 6 is the frame diagram of Device Testing point extraction module provided by the present invention;
Fig. 7 is the frame diagram of the curve abnormality analysis module of device provided by the present invention;
Fig. 8 judges for the curve detection of device provided by the present invention finishes and the frame diagram of output module.
Embodiment
For making the purpose, technical solutions and advantages of the present invention clearer, below in conjunction with embodiment and accompanying drawing, the present invention is described in more detail.
Fig. 1 represents the process flow diagram according to multi-curve automatic tracking connection method of the present invention.As shown in Figure 1, comprise according to multi-curve automatic tracking connection method of the present invention:
Step (101) is carried out Filtering Processing to obtain the smoothed image of described present image to present image;
Step (102) is extracted the check point of described smoothed image;
Step (103) is obtained the curve point and the junction curve of described smoothed image;
Whether the described curve of step (104) analysis abnormal conditions takes place and correspondingly handles; And
Step (105) judges that the present image inner curve detects the also curve of output that whether finishes.
Step (101):
Adopt Gauss's smooth function that present image (wherein, the image that present image receives in the time of can being true-time operation also can be one section current frame image in the video) is carried out Filtering Processing, to obtain level and smooth image.If present image is that (x, y) ((x y) is point (x, gray-scale value y)) in the present image, through the smoothed image I that obtains after the existing Filtering Processing technical finesse to I to I
σ(x, y) (I
σ(x y) is that point (x, gray-scale value y)) is in the smoothed image of present image
I
σ(x,y)=I(x,y)*g
σ(x,y)
Wherein, g
σ(* represents convolution algorithm for x, y) the level and smooth kernel function of expression Gauss.The kernel function g that Gauss is level and smooth
σ(x, y) value of middle σ is relevant with the pixel wide of curve, satisfies
Wherein ω represents the pixel wide of curve.
Step (102):
Utilize the second order Grad of every some gray-scale value of smoothed image of present image to make up the Hessian matrix, the eigenwert and the proper vector of this Hessian matrix are analyzed, with the check point in the smoothed image that obtains present image.Fig. 2 shows the process flow diagram according to step of the present invention (102).As shown in Figure 2, step (102) comprising:
Step (1021) is obtained the eigenwert and the normal direction of absolute value maximum of Hessian matrix of every of the smoothed image of present image.(x, the Hessian matrix of structure y) is picture point
Calculate the eigenwert and the proper vector of Hessian matrix,
With the vectorial normal direction (n of the eigenwert characteristic of correspondence of absolute value maximum as point
x, n
y).Wherein, r
Xx(x, y), r
Xy(x, y), r
Yy(x, y) the expression point (x, y) with the shade of gray difference of eight adjacent side points around it, its computing formula is as follows:
r
xx(x,y)=|I(x-1,y)+I(x+1,y)-I(x,y)|
r
yy(x,y)=|I(x,y-1)+I(x,y+1)-I(x,y)|
r
xy(x,y)=|I(x-1,y-1)+I(x+1,y+1)-I(x-1,y+1)-I(x+1,y-1)|
Wherein, the gray-scale value of I () remarked pixel point ().
Step (1022) adopts subjunctive to judge whether the smoothed image every bit of present image is check point.(x is on the curve some y) to postulated point, and (x, adjacent side point (x+p y) set up an office
x, y+p
y) along normal direction (n
x, n
y) first order derivative be 0, can calculate (p
x, p
y), if satisfy
Think that then (x y) is check point to point, otherwise thinks that (x y) is not check point to point.Make up one with the corresponding bianry image of current smoothed image, the gray-scale value of check point is made as 255 in this bianry image, the gray-scale value of non-check point is made as 0.
Step (1023), with the maximum absolute feature value of eigenwert of the absolute value maximum of the Hessian matrix of check point curvature intensity as this check point, with the check point of curvature intensity maximum as initial search point.
Step (1024) is determined the angle of the bearing of trend of check point.The angle of the bearing of trend of check point is
Step (103):
This step obtain current smoothed image bianry image curve point and connect these curve point to form curve, its step comprises:
Step (1031) along the bearing of trend of current curves point (initial value of current curves point is initial search point) determine in the neighborhood around n check point (promptly in current point is 4 * 4 modules at center along the check point of the bearing of trend existence of current detection point, these check points are defined as the check point of current point), calculate the differential seat angle of the bearing of trend of each check point and current curves point respectively, get the check point of angle with smallest difference correspondence, if the curvature of this check point intensity>first threshold T1, think that then this check point is doubtful next curve point and changes step (1032) over to, otherwise think that current curves point is the breakaway poing of current curves, changes the processing of step (104) over to.
Step (1032) is as if the differential seat angle>second threshold value T2 of the bearing of trend of doubtful next curve point on the current curves and current curves point, think that then step (1033) may take place to intersect and change over to current curves, otherwise with doubtful next curve point next curve point as current curves (being current some place curve), connect next curve point and current curves point, and next curve point is returned step (1031) as the current curves point.
Step (1033) is determined a future position at the bearing of trend of current curves point, with this future position is that the center determines that one is the region of search of radius with R, in this region of search, detect whether there is the check point that satisfies curve its own inertial feature with current point then, if exist, think that then current curves intersects, the check point of curve its own inertial feature next curve point as current curves will be satisfied, and connect next curve point and current curves point, and next curve point returned step (1031) as the current curves point, otherwise with doubtful next curve point next curve point as current curves, connect next curve point and current curves point, and next curve point is returned step (1031) as current point.
Wherein, curve its own inertial feature refers to all approximately equals of the angle of bearing of trend adjacent on the curve and this curvature intensity of 2 at 2, the differential seat angle of promptly adjacent 2 bearing of trend<the 3rd threshold value T3 and 2 s' curvature intensity difference minimum.Wherein, 0.3≤T1≤2.5, π/12≤T2≤π/3,3≤R≤8 and R are integer, π/12≤T3≤π/3.
Step (104):
What curve connected comprises that unusually curve interrupts and curve disappears.Fig. 3 shows the process flow diagram according to step of the present invention (104).As shown in Figure 3, step (104) comprising:
Step (1041) is judged whether current curves curve takes place interrupt, and the curve that interrupts is connected.Utilize curve its own inertial feature, current curves is interrupted detecting.At first determine a future position at the bearing of trend of the breakaway poing of current curves, with this future position is that the center determines that one is the region of search of radius with R, in this region of search, detect whether there is the check point that satisfies curve its own inertial feature with this breakaway poing then, if exist, think that then current curves interrupts, connect this breakaway poing and this check point, and this check point is returned step (103) as the current curves point, otherwise carry out step (1042).
Step (1042) is judged whether current curves curve takes place disappear, and the curve that disappears is connected.Bearing of trend along breakaway poing, the gray-scale value of check point that carries out the present image of certain-length L adds up, if the mean value of the mean value of the gray-scale value of the present image that accumulated value>current curves upper curve point is corresponding or the gray-scale value of accumulated value<present image, think that then current curves disappears, with this breakaway poing and length along the bearing of trend of this breakaway poing is that the check point of L is connected, and this check point returned step (103) as the current curves point, stop otherwise think that current curves is followed the tracks of.
Wherein, 10≤L≤30 and L are integer.
Step (105):
Fig. 4 shows the process flow diagram according to step of the present invention (105).As shown in Figure 4, step (105) comprising:
Step (1051) judges whether current curves connects accurately.The number N1 that puts on the current curves that the tracking of output stops in the statistic procedure (104), the point of statistics on the current curves belongs to the number N2 of check point in the bianry image of current smoothed image, if N2/N1>the 4th threshold value T4, it is correct to think that then current curves connects, otherwise thinks that the gray-scale value that belongs to the point on the current curves on current curves connection error and the bianry image with smoothed image is made as 0.
Step (1052) is judged whether the present image inner curve detects to finish and export and is connected correct curve.At first extract the correct current curves of connection in the step (1051), the gray-scale value that belongs to the check point of current curves point simultaneously in the bianry image with current smoothed image is made as 0.Whether the curve of judging present image then detects and finishes, if the number of check point in the bianry image of current smoothed image<the 5th threshold value T5, think that then the detection of present image inner curve finishes, and all curves that extract in the output present image, otherwise change the tracking connection that step (103) begins new curve over to.
Wherein, 0.25≤T4≤0.75 is preferably 0.5.10≤T5≤50 and T5 are integer.
Corresponding to the multi-curve automatic tracking coupling arrangement, Fig. 5 shows the frame diagram according to multi-curve automatic tracking coupling arrangement of the present invention.As shown in Figure 5, comprise according to multi-curve automatic tracking coupling arrangement of the present invention:
Image filtering processing unit 1 is used for present image is carried out the smoothed image that Filtering Processing is obtained present image;
Check point extraction unit 2 is used to extract the check point of smoothed image;
Curve acquisition unit 3 is used to obtain the curve point and the junction curve of smoothed image;
Curve abnormality analytic unit 4 is used for analytic curve and whether abnormal conditions take place and correspondingly handles; With
Curve detection finishes and judges and output unit 5, is used to judge that the present image inner curve detects the also curve of output that whether finishes.
Corresponding to step (102), Fig. 6 shows the frame diagram according to check point extraction unit 2 of the present invention.As shown in Figure 6, comprise according to check point extraction unit 2 of the present invention: the eigenwert of point and the acquisition module of normal direction are used to obtain the eigenwert and the normal direction of absolute value maximum of Hessian matrix of every of the smoothed image of present image; Check point judge module 22, whether the smoothed image every bit that is used to adopt subjunctive to judge present image is check point; Cover half piece 23 is really put in the calculating of the curvature intensity of check point and initial search, be used for the eigenwert of the absolute value maximum of the Hessian matrix of check point curvature intensity as this check point, with the check point of curvature intensity maximum as initial search point; With check point bearing of trend angle cover half piece 24 really, be used for determining the angle of the bearing of trend of check point.
Corresponding to step (104), Fig. 7 has provided the frame diagram according to curve abnormality analytic unit 4 of the present invention.As shown in Figure 7, comprise according to curve abnormality analytic unit 4 of the present invention: curve interrupts judging and processing module 41 be used to judge whether current curves curve takes place interrupt, and the curve that interrupts is connected; Disappear with curve and to judge and processing module 42 be used to judge whether current curves curve takes place disappear, and the curve that disappears is connected.
Corresponding to step (105), Fig. 8 shows the frame diagram that extracts and detect the judging unit 5 that finishes according to curve of the present invention.As shown in Figure 8, extracting and detect the judging unit 5 that finishes according to curve of the present invention comprises: the correct connection judgment module 51 of curve is used to judge whether current curves connects accurately; Finish with curve detection and to judge and curve extraction module 52, be used to judge whether the present image inner curve detects finishes and export the correct curve of connection.
Can detect curve in the video image simply, exactly according to multi-curve automatic tracking connection method of the present invention and device.
The above; being preferred embodiment of the present invention only, is not to be used to limit protection scope of the present invention, is to be understood that; the present invention is not limited to implementation as described herein, and these implementation purpose of description are to help those of skill in the art to put into practice the present invention.Any those of skill in the art are easy to be further improved without departing from the spirit and scope of the present invention and perfect, therefore the present invention only is subjected to the restriction of the content and the scope of claim of the present invention, and its intention contains all and is included in alternatives and equivalent in the spirit and scope of the invention that is limited by claims.