Summary of the invention
In view of this, fundamental purpose of the present invention be to realize can be simple, the curve in the effective recognition actual scene.
For achieving the above object, according to first aspect of the present invention, a kind of Curves Recognition method based on the search of Bezier reference mark is provided, the method comprising the steps of:
First step carries out Gauss's smoothing processing, Hessian calculating and the operation of Hessian image thinning to present image, obtains the Hessian refined image;
Second step, the user demarcates 3 reference mark according to the actual curve position on video image;
Third step according to 3 reference mark, adopts the Bezier curve to make up modelling and obtains the Bezier curve;
The 4th step is obtained detection curve and output on the Hessian refined image according to Bezier curve and 3 reference mark.
Gauss's smoothing processing is to adopt Gauss's smooth function to present image (wherein in the wherein said first step; 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) carry out Filtering Processing; To obtain current smoothed image; Specific as follows: as to establish present image for
(
is the gray-scale value of point
in the present image), do through the smoothed image
(
is the gray-scale value of the interior point
of smoothed image of present image) that obtains after the Filtering Processing
Wherein, The level and smooth kernel function of
expression Gauss,
representes convolution algorithm.The value of
is relevant with the width of line in the level and smooth kernel function
of Gauss; Satisfy
, wherein the pixel wide of
expression line.
Hessian calculates and comprises in the said first step:
Step a) utilizes the second order Grad of the gray-scale value of every point in the current smoothed image
to make up Hessian matrix
; Calculate the eigenwert
of Hessian matrix; Wherein,
,
,
the expression point
and the shade of gray difference of eight adjacent side points on every side, its computing formula is following:
Wherein, the gray-scale value of
remarked pixel point
;
If step b) is the eigenwert
of certain any Hessian matrix in the smoothed image; TH1 ∈ [4.2; 4.9]; Think that then this point is the Hessian point, otherwise this point of filtering, thereby the Hessian image obtained.
The operation of Hessian image thinning is that the Hessian image is carried out the morphology Refinement operation in the said first step, to obtain the Hessian refined image.
Said third step is according to 3 reference mark
; Adopt the Bezier curve to make up modelling and confirm the Bezier curve, its formula is following:
Said the 4th step further comprises:
Step 1041; Simultaneously 3 reference mark
carried out integral translation on
,
,
,
four direction;
;
; Wherein k1, n are threshold parameter; K1 ∈ [4; 6] and be integer; N ∈ [2; 4] and be integer, can make up the new Bezier curve of 4n bar according to the new reference mark after the integral translation;
Step 1042; Respectively to every new Bezier curve; Every bit on this Bezier curve is searched for nearest Hessian point in
scope;
and be integer;
and be integer, add up on this Bezier curve distance that whole points and Hessian recently order and;
Step 1043; The distance of more every new Bezier curve statistics and size, selected distance is 3 benchmark reference mark with corresponding 3 reference mark
of minimum Bezier curve;
Step 1044, maintaining
two reference control points unchanged, respectively
6 pixels around the pixel is within the scope of the temporary control points, and according to the temporary control point and
build Bezier curves, Bezier curves to calculate the length, and the Bezier curve on the image at the Hessian refinement number of valid points, namely statistical point of the Bezier curve belongs to refine the image before the Hessian number of attractions and calculate the effective number of points with the Bezier curve length ratio, if the ratio is greater than k2, k2 ∈ [0.5,0.6], then the temporary control point as a reference control point
The best control points
; simultaneously with the same methods were used to obtain the reference control point
The best control points
;
Step 1045; Make up the Bezier curve according to optimum controlling point
, and this Bezier curve is also exported 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 is used for present image is carried out Gauss's smoothing processing, Hessian calculating and the operation of Hessian image thinning, obtains the Hessian refined image;
The unit is demarcated at 3 reference mark, is used for the user according to the actual curve position, on video image, demarcates 3 reference mark;
Bezier curve acquisition unit is used for according to 3 reference mark, adopts the Bezier curve to make up modelling and obtains the Bezier curve;
Detection curve obtains and output unit, is used for obtaining detection curve and output on the Hessian refined image according to Bezier curve and 3 reference mark.
Wherein, Gauss's smoothing processing is to adopt Gauss's smooth function to present image (wherein in the said Hessian refined image acquiring unit; 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) carry out Filtering Processing; To obtain current smoothed image; Specific as follows: as to establish present image for
(
is the gray-scale value of point
in the present image), do through the smoothed image
(
is the gray-scale value of the interior point
of smoothed image of present image) that obtains after the Filtering Processing
Wherein, The level and smooth kernel function of
expression Gauss,
representes convolution algorithm.The value of
is relevant with the width of line in the level and smooth kernel function
of Gauss; Satisfy
, wherein the pixel wide of
expression line.
Hessian calculates and comprises in the said Hessian refined image acquiring unit:
Step a) utilizes the second order Grad of the gray-scale value of every point in the current smoothed image
to make up Hessian matrix
; Calculate the eigenwert
of Hessian matrix; Wherein,
,
,
the expression point
and the shade of gray difference of eight adjacent side points on every side, its computing formula is following:
Wherein, the gray-scale value of
remarked pixel point
;
If step b) is the eigenwert
of certain any Hessian matrix in the smoothed image; TH1 ∈ [4.2; 4.9]; Think that then this point is the Hessian point, otherwise this point of filtering, thereby the Hessian image obtained.
The operation of Hessian image thinning is that the Hessian image is carried out the morphology Refinement operation in the said Hessian refined image acquiring unit, to obtain the Hessian refined image.
In the said Bezier curve acquisition unit according to 3 reference mark
; Adopt the Bezier curve to make up modelling and confirm the Bezier curve, its formula is following:
Said detection curve obtains with output unit and specifically is used to realize following steps:
Step 1041; Simultaneously 3 reference mark
carried out integral translation on
,
,
,
four direction;
;
; Wherein k1, n are threshold parameter; K1 ∈ [4; 6] and be integer; N ∈ [2; 4] and be integer, can make up the new Bezier curve of 4n bar according to the new reference mark after the integral translation;
Step 1042; Respectively to every new Bezier curve; Every bit on this Bezier curve is searched for nearest Hessian point in
scope;
and be integer;
and be integer, add up on this Bezier curve distance that whole points and Hessian recently order and;
Step 1043; The distance of more every new Bezier curve statistics and size, selected distance is 3 benchmark reference mark with corresponding 3 reference mark
of minimum Bezier curve;
Step 1044, maintaining
two reference control points unchanged, respectively
6 pixels around the pixel is within the scope of the temporary control points, and according to the temporary control point and
build Bezier curves, Bezier curves to calculate the length, and the Bezier curve on the image at the Hessian refinement number of valid points, namely statistical point of the Bezier curve belongs to refine the image before the Hessian number of attractions and calculate the effective number of points with the Bezier curve length ratio, if the ratio is greater than k2, k2 ∈ [0.5,0.6], then the temporary control point as a reference control point
The best control points
; simultaneously with the same methods were used to obtain the reference control point
The best control points
;
Step 1045; Make up the Bezier curve according to optimum controlling point
, and this Bezier curve is also exported as detection curve.
Can identify the curve in the video image simply, exactly according to Curves Recognition method and the device based on the search of Bezier reference mark of the present invention.
Embodiment
For making the object of the invention, technical scheme and advantage clearer, below in conjunction with embodiment and accompanying drawing, to further explain of the present invention.
Fig. 1 representes the process flow diagram according to the Curves Recognition method based on Bezier reference mark search of the present invention.As shown in Figure 1, comprise according to the Curves Recognition method based on the search of Bezier reference mark of the present invention:
First step 101 carries out Gauss's smoothing processing, Hessian calculating and the operation of Hessian image thinning to present image, obtains the Hessian refined image;
Second step 102, the user demarcates 3 reference mark according to the actual curve position on video image;
Third step 103 according to 3 reference mark, adopts the Bezier curve to make up modelling and obtains the Bezier curve;
The 4th step 104 is obtained detection curve and output on the Hessian refined image according to Bezier curve and 3 reference mark.
First step:
Said Gauss's smoothing processing is to adopt Gauss's smooth 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 current frame image in the video) carry out Filtering Processing; To obtain current smoothed image; Specific as follows: as to establish present image for
;
is the gray-scale value of point
in the present image, through the smoothed image
(
is the gray-scale value of the interior point
of smoothed image of present image) that obtains after the Filtering Processing does
Wherein, The level and smooth kernel function of
expression Gauss,
representes convolution algorithm.The value of
is relevant with the width of line in the level and smooth kernel function
of Gauss; Satisfy
, wherein the pixel wide of
expression line.
Hessian calculates and comprises:
Step a) utilizes the second order Grad of the gray-scale value of every point in the current smoothed image
to make up Hessian matrix
; Calculate the eigenwert
of Hessian matrix; Wherein,
,
,
the expression point
and the shade of gray difference of eight adjacent side points on every side, its computing formula is following:
Wherein, the gray-scale value of
remarked pixel point
;
If step b) is the eigenwert
of certain any Hessian matrix in the smoothed image; TH1 ∈ [4.2; 4.9]; Think that then this point is the Hessian point, otherwise this point of filtering, thereby the Hessian image obtained.
The operation of Hessian image thinning is that the Hessian image is carried out the morphology Refinement operation, to obtain the Hessian refined image.Wherein, the morphology Refinement operation can be with reference to " Digital Image Processing, Paul Gonzales, Electronic Industry Press ".
Third step:
Said third step is according to 3 reference mark
; Adopt the Bezier curve to make up modelling and confirm the Bezier curve, its formula is following:
The 4th step:
Said the 4th step further comprises:
Step 1041; Simultaneously 3 reference mark
carried out integral translation on
,
,
,
four direction;
;
; Wherein k1, n are threshold parameter; K1 ∈ [4; 6] and be integer; N ∈ [2; 4] and be integer, can make up the new Bezier curve of 4n bar according to the new reference mark after the integral translation;
Step 1042; Respectively to every new Bezier curve; Every bit on this Bezier curve is searched for nearest Hessian point in
scope;
and be integer;
and be integer, add up on this Bezier curve distance that whole points and Hessian recently order and;
Step 1043; The distance of more every new Bezier curve statistics and size, selected distance is 3 benchmark reference mark with corresponding 3 reference mark
of minimum Bezier curve;
Step 1044, maintaining
two reference control points unchanged, respectively
6 pixels around the pixel is within the scope of the temporary control points, and according to the temporary control point and
build Bezier curves, Bezier curves to calculate the length, and the Bezier curve on the image at the Hessian refinement number of valid points, namely statistical point of the Bezier curve belongs to refine the image before the Hessian number of attractions and calculate the effective number of points with the Bezier curve length ratio, if the ratio is greater than k2, k2 ∈ [0.5,0.6], then the temporary control point as a reference control point
The best control points
; simultaneously with the same methods were used to obtain the reference control point
The best control points
;
Step 1045; Make up the Bezier curve according to optimum controlling point
, and this Bezier curve is also exported as detection curve.
Preferably, when the power transmission line curve detection, can choose k1=4, n=3, k2=0.55.
Fig. 2 shows the frame diagram according to the Curves Recognition device based on Bezier reference mark search of the present invention.As shown in Figure 2, comprise according to the Curves Recognition device based on the search of Bezier reference mark of the present invention:
Hessian refined image acquiring unit 1 is used for present image is carried out Gauss's smoothing processing, Hessian calculating and the operation of Hessian image thinning, obtains the Hessian refined image;
Unit 2 is demarcated at 3 reference mark, is used for the user according to the actual curve position, on video image, demarcates 3 reference mark;
Bezier curve acquisition unit 3 is used for according to 3 reference mark, adopts the Bezier curve to make up modelling and obtains the Bezier curve;
Detection curve obtains and output unit 4, is used for obtaining detection curve and output on the Hessian refined image according to Bezier curve and 3 reference mark.
Wherein, Gauss's smoothing processing is to adopt Gauss's smooth function to present image (wherein in the said Hessian refined image acquiring unit 1; 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) carry out Filtering Processing; To obtain current smoothed image; Specific as follows: as to establish present image for
;
is the gray-scale value of point
in the present image, through the smoothed image
(
is the gray-scale value of the interior point
of smoothed image of present image) that obtains after the Filtering Processing does
Wherein, The level and smooth kernel function of
expression Gauss,
representes convolution algorithm.The value of
is relevant with the width of line in the level and smooth kernel function
of Gauss; Satisfy
, wherein the pixel wide of
expression line.
Hessian calculates and comprises in the said Hessian refined image acquiring unit 1:
Step a) utilizes the second order Grad of the gray-scale value of every point in the current smoothed image
to make up Hessian matrix
; Calculate the eigenwert
of Hessian matrix; Wherein,
,
,
the expression point
and the shade of gray difference of eight adjacent side points on every side, its computing formula is following:
Wherein, the gray-scale value of
remarked pixel point
;
If step b) is the eigenwert
of certain any Hessian matrix in the smoothed image; TH1 ∈ [4.2; 4.9]; Think that then this point is the Hessian point, otherwise this point of filtering, thereby the Hessian image obtained.
The operation of Hessian image thinning is that the Hessian image is carried out the morphology Refinement operation in the said Hessian refined image acquiring unit 1, to obtain the Hessian refined image.Wherein, the morphology Refinement operation can be with reference to " Digital Image Processing, Paul Gonzales, Electronic Industry Press ".
In the said Bezier
curve acquisition unit 3 according to 3 reference mark
; Adopt the Bezier curve to make up modelling and confirm the Bezier curve, its formula is following:
Said detection curve obtains with output unit 4 and specifically is used to realize following steps:
Step 1041; Simultaneously 3 reference mark
carried out integral translation on
,
,
,
four direction;
;
; Wherein k1, n are threshold parameter; K1 ∈ [4; 6] and be integer; N ∈ [2; 4] and be integer, can make up the new Bezier curve of 4n bar according to the new reference mark after the integral translation;
Step 1042; Respectively to every new Bezier curve; Every bit on this Bezier curve is searched for nearest Hessian point in
scope;
and be integer;
and be integer, add up on this Bezier curve distance that whole points and Hessian recently order and;
Step 1043; The distance of more every new Bezier curve statistics and size, selected distance is 3 benchmark reference mark with corresponding 3 reference mark
of minimum Bezier curve;
Step 1044, maintaining
two reference control points unchanged, respectively
6 pixels around the pixel is within the scope of the temporary control points, and according to the temporary control point and
build Bezier curves, Bezier curves to calculate the length, and the Bezier curve on the image at the Hessian refinement number of valid points, namely statistical point of the Bezier curve belongs to refine the image before the Hessian number of attractions and calculate the effective number of points with the Bezier curve length ratio, if the ratio is greater than k2, k2 ∈ [0.5,0.6], then the temporary control point as a reference control point
The best control points
; simultaneously with the same methods were used to obtain the reference control point
The best control points
;
Step 1045; Make up the Bezier curve according to optimum controlling point
, and this Bezier curve is also exported as detection curve.
Preferably, when the power transmission line curve detection, can choose k1=4, n=3, k2=0.55.
Can identify the curve in the video image simply, exactly according to Curves Recognition method and the device based on the search of Bezier reference mark of the present invention.
The above; Being merely preferred embodiment of the present invention, 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 described implementation here, 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 further improving without departing from the spirit and scope of the present invention and perfect; Therefore the present invention only receives 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 accompanying claims.