Summary of the invention
In view of this, fundamental purpose of the present invention is to realize and can simply, effectively identifies the curve in actual scene.
For achieving the above object, according to first aspect of the present invention, provide a kind of Curves Recognition method based on the search of Bezier reference mark, the method comprising the steps of:
First step, carries out Gaussian smoothing, Hessian calculating and the operation of Hessian image thinning to present image, obtains Hessian refined image;
Second step, user, according to actual curve position, demarcates 3 reference mark on video image;
Third step, according to 3 reference mark, adopts Bezier curve to build modelling and obtains Bezier curve;
The 4th step, obtains detection curve the output in Hessian refined image according to Bezier curve and 3 reference mark.
In wherein said first step, Gaussian smoothing is to adopt Gaussian smoothing function to present image (wherein, the image that present image receives in the time of can being true-time operation, also can be one section of current frame image in video) carry out filtering processing, to obtain current smoothed image, specific as follows: establishing present image is
(
be point in present image
gray-scale value), the smoothed image obtaining after processing after filtering
(
be the interior point of smoothed image of present image
gray-scale value) be
Wherein,
the kernel function that represents Gaussian smoothing,
represent convolution algorithm.The kernel function of Gaussian smoothing
in
value relevant with the width of line, meet
, wherein
the pixel wide that represents line.
In described first step, Hessian calculates and comprises:
Step a) is utilized every point in current smoothed image
the second order Grad of gray-scale value build Hessian matrix
, the eigenwert of calculating Hessian matrix
, wherein,
,
,
represent point
with the shade of gray difference of eight adjacent side points around, its computing formula is as follows:
Wherein,
represent pixel
gray-scale value;
If the eigenwert of certain any Hessian matrix in step b) smoothed image
, TH1 ∈ [4.2,4.9], thinks that this point is Hessian point, otherwise this point of filtering, thereby obtain Hessian image.
In described first step, the operation of Hessian image thinning is that Hessian image is carried out to morphologic thinning operation, to obtain Hessian refined image.
Described third step is according to 3 reference mark
, adopting Bezier curve to build modelling and determine Bezier curve, its formula is as follows:
Described the 4th step further comprises:
Step 1041, simultaneously by 3 reference mark
,
,
,
on four direction, carry out integral translation,
,
, wherein k1, n are threshold parameter, k1 ∈ [4,6] and be integer, and n ∈ [2,4] and be integer, can build according to the new reference mark after integral translation the Bezier curve that 4n bar is new;
Step 1042, for every new Bezier curve, exists to the every bit on this Bezier curve respectively
the nearest Hessian point of search in scope,
and be integer,
and be integer, add up on this Bezier curve whole points and Hessian order recently distance with;
Step 1043, the distance of more every new Bezier curve statistics and size, selected distance and minimum 3 reference mark corresponding to Bezier curve
be 3 benchmark reference mark;
Step 1044, keeps
two benchmark reference mark are constant, respectively with
pixel in 6 pixel coverages is around interim reference mark, and according to this interim reference mark and
build Bezier curve, calculate this Bezier length of a curve, and the number of the available point of this Bezier curve in Hessian refined image, add up on this Bezier curve the number that point belongs to Hessian refined image foreground point, and calculate the number of this available point and the ratio of this Bezier length of a curve, and if this ratio is greater than k2, k2 ∈ [0.5,0.6], using this interim reference mark as benchmark reference mark
optimum controlling point
; With identical method, obtain respectively benchmark reference mark simultaneously
optimum controlling point
;
Step 1045, according to optimum controlling point
build Bezier curve, and the also output using this Bezier curve as detection curve.
According to another aspect of the present invention, a kind of Curves Recognition square law device based on the search of Bezier reference mark is provided, this device comprises:
Hessian refined image acquiring unit, for present image being carried out to Gaussian smoothing, Hessian calculating and the operation of Hessian image thinning, obtains Hessian refined image;
Demarcation unit, 3 reference mark according to actual curve position, is demarcated 3 reference mark for user on video image;
Bezier curve acquisition unit, for according to 3 reference mark, adopts Bezier curve to build modelling and obtains Bezier curve;
Detection curve obtains and output unit, for obtaining detection curve the output in Hessian refined image according to Bezier curve and 3 reference mark.
Wherein, in described Hessian refined image acquiring unit, Gaussian smoothing is to adopt Gaussian smoothing function to present image (wherein, the image that present image receives in the time of can being true-time operation, also can be one section of current frame image in video) carry out filtering processing, to obtain current smoothed image, specific as follows: establishing present image is
(
be point in present image
gray-scale value), the smoothed image obtaining after processing after filtering
(
be the interior point of smoothed image of present image
gray-scale value) be
Wherein,
the kernel function that represents Gaussian smoothing,
represent convolution algorithm.The kernel function of Gaussian smoothing
in
value relevant with the width of line, meet
, wherein
the pixel wide that represents line.
In described Hessian refined image acquiring unit, Hessian calculates and comprises:
Step a) is utilized every point in current smoothed image
the second order Grad of gray-scale value build Hessian matrix
, the eigenwert of calculating Hessian matrix
, wherein,
,
,
represent point
with the shade of gray difference of eight adjacent side points around, its computing formula is as follows:
Wherein,
represent pixel
gray-scale value;
If the eigenwert of certain any Hessian matrix in step b) smoothed image
, TH1 ∈ [4.2,4.9], thinks that this point is Hessian point, otherwise this point of filtering, thereby obtain Hessian image.
In described Hessian refined image acquiring unit, the operation of Hessian image thinning is that Hessian image is carried out to morphologic thinning operation, to obtain Hessian refined image.
In described Bezier curve acquisition unit according to 3 reference mark
, adopting Bezier curve to build modelling and determine Bezier curve, its formula is as follows:
Described detection curve obtains with output unit specifically for realizing following steps:
Step 1041, simultaneously by 3 reference mark
,
,
,
on four direction, carry out integral translation,
,
, wherein k1, n are threshold parameter, k1 ∈ [4,6] and be integer, and n ∈ [2,4] and be integer, can build according to the new reference mark after integral translation the Bezier curve that 4n bar is new;
Step 1042, for every new Bezier curve, exists to the every bit on this Bezier curve respectively
the nearest Hessian point of search in scope,
and be integer,
and be integer, add up on this Bezier curve whole points and Hessian order recently distance with;
Step 1043, the distance of more every new Bezier curve statistics and size, selected distance and minimum 3 reference mark corresponding to Bezier curve
be 3 benchmark reference mark;
Step 1044, keeps
two benchmark reference mark are constant, respectively with
pixel in 6 pixel coverages is around interim reference mark, and according to this interim reference mark and
build Bezier curve, calculate this Bezier length of a curve, and the number of the available point of this Bezier curve in Hessian refined image, add up on this Bezier curve the number that point belongs to Hessian refined image foreground point, and calculate the number of this available point and the ratio of this Bezier length of a curve, and if this ratio is greater than k2, k2 ∈ [0.5,0.6], using this interim reference mark as benchmark reference mark
optimum controlling point
; With identical method, obtain respectively benchmark reference mark simultaneously
optimum controlling point
;
Step 1045, according to optimum controlling point
build Bezier curve, and the also output using this Bezier curve as detection curve.
According to Curves Recognition method and the device based on the search of Bezier reference mark of the present invention, can identify simply, exactly the curve in video image.
Embodiment
For making the object, 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 according to the process flow diagram of the Curves Recognition method based on the search of Bezier reference mark of the present invention.As shown in Figure 1, according to the Curves Recognition method based on the search of Bezier reference mark of the present invention, comprise:
First step 101, carries out Gaussian smoothing, Hessian calculating and the operation of Hessian image thinning to present image, obtains Hessian refined image;
Second step 102, user, according to actual curve position, demarcates 3 reference mark on video image;
Third step 103, according to 3 reference mark, adopts Bezier curve to build modelling and obtains Bezier curve;
The 4th step 104, obtains detection curve the output in Hessian refined image according to Bezier curve and 3 reference mark.
first step:
Described Gaussian smoothing is to adopt Gaussian smoothing function to present image (wherein, the image that present image receives in the time of can being true-time operation, also can be one section of current frame image in video) carry out filtering processing, to obtain current smoothed image, specific as follows: establishing present image is
,
be point in present image
gray-scale value, the smoothed image obtaining after processing after filtering
(
be the interior point of smoothed image of present image
gray-scale value) be
Wherein,
the kernel function that represents Gaussian smoothing,
represent convolution algorithm.The kernel function of Gaussian smoothing
in
value relevant with the width of line, meet
, wherein
the pixel wide that represents line.
Hessian calculates and comprises:
Step a) is utilized every point in current smoothed image
the second order Grad of gray-scale value build Hessian matrix
, the eigenwert of calculating Hessian matrix
, wherein,
,
,
represent point
with the shade of gray difference of eight adjacent side points around, its computing formula is as follows:
Wherein,
represent pixel
gray-scale value;
If the eigenwert of certain any Hessian matrix in step b) smoothed image
, TH1 ∈ [4.2,4.9], thinks that this point is Hessian point, otherwise this point of filtering, thereby obtain Hessian image.
The operation of Hessian image thinning is that Hessian image is carried out to morphologic thinning operation, to obtain Hessian refined image.Wherein, morphologic thinning operation can be with reference to " Digital Image Processing, Paul Gonzales, Electronic Industry Press ".
third step:
Described third step is according to 3 reference mark
, adopting Bezier curve to build modelling and determine Bezier curve, its formula is as follows:
the 4th step:
Described the 4th step further comprises:
Step 1041, simultaneously by 3 reference mark
,
,
,
on four direction, carry out integral translation,
,
, wherein k1, n are threshold parameter, k1 ∈ [4,6] and be integer, and n ∈ [2,4] and be integer, can build according to the new reference mark after integral translation the Bezier curve that 4n bar is new;
Step 1042, for every new Bezier curve, exists to the every bit on this Bezier curve respectively
the nearest Hessian point of search in scope,
and be integer,
and be integer, add up on this Bezier curve whole points and Hessian order recently distance with;
Step 1043, the distance of more every new Bezier curve statistics and size, selected distance and
minimum 3 reference mark corresponding to Bezier curve
be 3 benchmark reference mark;
Step 1044, keeps
two benchmark reference mark are constant, respectively with
pixel in 6 pixel coverages is around interim reference mark, and according to this interim reference mark and
build Bezier curve, calculate this Bezier length of a curve, and the number of the available point of this Bezier curve in Hessian refined image, add up on this Bezier curve the number that point belongs to Hessian refined image foreground point, and calculate the number of this available point and the ratio of this Bezier length of a curve, and if this ratio is greater than k2, k2 ∈ [0.5,0.6], using this interim reference mark as benchmark reference mark
optimum controlling point
; With identical method, obtain respectively benchmark reference mark simultaneously
optimum controlling point
;
Step 1045, according to optimum controlling point
build Bezier curve, and the also output using this Bezier curve as detection curve.
Preferably, when power transmission line curve detection, can choose k1=4, n=3, k2=0.55.
Fig. 2 shows according to the frame diagram of the Curves Recognition device based on the search of Bezier reference mark of the present invention.As shown in Figure 2, according to the Curves Recognition device based on the search of Bezier reference mark of the present invention, comprise:
Hessian refined image acquiring unit 1, for present image being carried out to Gaussian smoothing, Hessian calculating and the operation of Hessian image thinning, obtains Hessian refined image;
Demarcation unit, 3 reference mark 2 according to actual curve position, is demarcated 3 reference mark for user on video image;
Bezier curve acquisition unit 3, for according to 3 reference mark, adopts Bezier curve to build modelling and obtains Bezier curve;
Detection curve obtains and output unit 4, for obtaining detection curve the output in Hessian refined image according to Bezier curve and 3 reference mark.
Wherein, in described Hessian refined image acquiring unit 1, Gaussian smoothing is to adopt Gaussian smoothing function to present image (wherein, the image that present image receives in the time of can being true-time operation, also can be one section of current frame image in video) carry out filtering processing, to obtain current smoothed image, specific as follows: establishing present image is
,
be point in present image
gray-scale value, the smoothed image obtaining after processing after filtering
(
be the interior point of smoothed image of present image
gray-scale value) be
Wherein,
the kernel function that represents Gaussian smoothing,
represent convolution algorithm.The kernel function of Gaussian smoothing
in
value relevant with the width of line, meet
, wherein
the pixel wide that represents line.
In described Hessian refined image acquiring unit 1, Hessian calculates and comprises:
Step a) is utilized every point in current smoothed image
the second order Grad of gray-scale value build Hessian matrix
, the eigenwert of calculating Hessian matrix
, wherein,
,
,
represent point
with the shade of gray difference of eight adjacent side points around, its computing formula is as follows:
Wherein,
represent pixel
gray-scale value;
If the eigenwert of certain any Hessian matrix in step b) smoothed image
, TH1 ∈ [4.2,4.9], thinks that this point is Hessian point, otherwise this point of filtering, thereby obtain Hessian image.
In described Hessian refined image acquiring unit 1, the operation of Hessian image thinning is that Hessian image is carried out to morphologic thinning operation, to obtain Hessian refined image.Wherein, morphologic thinning operation can be with reference to " Digital Image Processing, Paul Gonzales, Electronic Industry Press ".
In described Bezier
curve acquisition unit 3 according to 3 reference mark
, adopting Bezier curve to build modelling and determine Bezier curve, its formula is as follows:
Described detection curve obtains with output unit 4 specifically for realizing following steps:
Step 1041, simultaneously by 3 reference mark
,
,
,
on four direction, carry out integral translation,
,
, wherein k1, n are threshold parameter, k1 ∈ [4,6] and be integer, and n ∈ [2,4] and be integer, can build according to the new reference mark after integral translation the Bezier curve that 4n bar is new;
Step 1042, for every new Bezier curve, exists to the every bit on this Bezier curve respectively
the nearest Hessian point of search in scope,
and be integer,
and be integer, add up on this Bezier curve whole points and Hessian order recently distance with;
Step 1043, the distance of more every new Bezier curve statistics and size, selected distance and
minimum 3 reference mark corresponding to Bezier curve
be 3 benchmark reference mark;
Step 1044, keeps
two benchmark reference mark are constant, respectively with
pixel in 6 pixel coverages is around interim reference mark, and according to this interim reference mark and
build Bezier curve, calculate this Bezier length of a curve, and the number of the available point of this Bezier curve in Hessian refined image, add up on this Bezier curve the number that point belongs to Hessian refined image foreground point, and calculate the number of this available point and the ratio of this Bezier length of a curve, and if this ratio is greater than k2, k2 ∈ [0.5,0.6], using this interim reference mark as benchmark reference mark
optimum controlling point
; With identical method, obtain respectively benchmark reference mark simultaneously
optimum controlling point
;
Step 1045, according to optimum controlling point
build Bezier curve, and the also output using this Bezier curve as detection curve.
Preferably, when power transmission line curve detection, can choose k1=4, n=3, k2=0.55.
According to Curves Recognition method and the device based on the search of Bezier reference mark of the present invention, can identify simply, exactly the curve in video image.
The above; be only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention, be to be understood that; the present invention is not limited to implementation as described herein, and the object that these implementations are described is 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 is only subject to the restriction of content and the scope of the claims in the present invention, and its intention contains all alternatives and equivalents that are included in the spirit and scope of the invention being limited by claims.