Content of the invention
Based on this it is necessary to provide a kind of video monitoring various visual angles vehicle checking method and device, it is possible to increase from various visual angles
The accuracy rate of vehicle detection, improves the efficiency processing.
A kind of video monitoring various visual angles vehicle checking method, methods described includes:
Gradient channel feature based on image pattern and luv channel characteristics, are trained by adaboost training algorithm,
Obtain multiple detection corresponding tree-shaped cascade adaboost graders of yardstick, described tree-shaped cascade adaboost grader includes many
Individual cascade classifier branch, each cascade classifier branch is used for the vehicle target in default angular field of view in detection image;
Input video image to be detected;
Gradient channel feature according to video image to be detected and luv channel characteristics, with the plurality of detection yardstick pair
The tree-shaped cascade adaboost grader answered is identified to the described video image of input, obtains each detection yardstick corresponding
Vehicle target testing result in video image;
Merge the vehicle target testing result of multiple detection corresponding tree-shaped cascade adaboost graders of yardstick.
Wherein in an embodiment, the described gradient channel feature based on image pattern and luv channel characteristics, pass through
The step that adaboost training algorithm is trained includes:
Input comprises the image pattern of the vehicle target in default angular field of view;
Extract gradient channel feature and the luv channel characteristics of described image sample;
Based on described gradient channel feature and described luv channel characteristics, it is trained using adaboost training algorithm, obtains
To the cascade classifier branch corresponding to described default angular field of view.
Wherein in an embodiment, the luv of the described gradient channel feature extracting image pattern and extraction image pattern
The step of channel characteristics includes executing the following step in the rgb space of image and luv space respectively:
Image is smoothed;
The derivative dx in picture traverse direction for the image value of pixel (x, y) in calculating image, and pixel in image
In the derivative dy in picture altitude direction, for pixel in picture traverse direction coordinate, y is pixel to wherein x to the image value of (x, y)
Picture altitude direction coordinate;
With formulaCalculate corresponding gradient-norm m of pixel (x, y) in image, by each pixel
Gradient-norm m is worth to gradient-norm image m (x, y) as image;
- 90 are spent and is divided into 6 directions to the gradient direction of 90 degree of scopes, 30 degree of each direction, the corresponding ladder in each direction
Degree directional imageWith formulaCalculate pixel (x, y) corresponding gradient direction θ in image, if
θ is located at j-th direction, then the corresponding gradient direction image in j-th directionWith formulaCalculate
Image value, wherein 1≤j≤6, are integer;
Calculate gradient-norm image m (x, y), gradient direction imageCorresponding passage integral image ii(x, y), leads to
Trace integral image ii(x, y) image value at (x, y) place is passage integral image ii(x, y) corresponding gradient-norm image m (x, y)
Or gradient direction imageIt is located at the cumulative of all image values in (x, y) place upper left corner, wherein 1≤j≤6,1≤i≤7, be
Integer;
Passage integral image i is calculated with formula f (i, x, y, w, h)=a+d-b-ci(x, y) corresponding gradient channel feature f
(i, x, y, w, h), wherein a=ii(x, y), b=ii(x+w, y), c=ii(x, y+h), d=ii(x+w, y+h), 1≤i≤7, w
Value is 1 to default detection width, and h value is 1 to default detection height.
Wherein in an embodiment, described tree-shaped cascade adaboost grader includes n level grader, and n is more than 1, is
Integer;
First order grader is used for detection and is differed the vehicle target in 45 degree of angulars field of view with vehicle axis;
As n >=more than or equal to 2, described tree-shaped cascade adaboost grader include the first cascade classifier branch, the
Two cascade classifier branches and third level connection grader branch, described first cascade classifier branch is used for detection and vehicle axis
Line differs the vehicle target in 15 degree of angulars field of view, and described second cascade classifier branch is used for detection and is differed with vehicle axis
Vehicle target in 15 to 30 degree angulars field of view, described third level connection grader branch is used for detection and differs 30 with vehicle axis
Vehicle target to 45 degree of angulars field of view.
Wherein in an embodiment, merge multiple detection corresponding tree-shaped cascade adaboost graders of yardstick described
The step of vehicle target testing result after, also include carrying out non-maximum suppression to described vehicle target testing result.
A kind of video monitoring various visual angles vehicle detection apparatus, described device includes:
Input module, for input picture sample and video image to be detected;
Training module, for the gradient channel feature based on image pattern and luv channel characteristics, is trained by adaboost
Algorithm is trained, and obtains multiple detection corresponding tree-shaped cascade adaboost graders of yardstick, described tree-shaped cascade
Adaboost grader includes multiple cascade classifier branches, and each cascade classifier branch is used for default visual angle in detection image
In the range of vehicle target;
Detection module, for the gradient channel feature according to video image to be detected and luv channel characteristics, with described many
The individual detection corresponding tree-shaped cascade adaboost grader of yardstick is identified to the described video image of input, obtains each inspection
Survey the vehicle target testing result in the corresponding video image of yardstick;
Result output module, for merging the vehicle mesh of multiple detection corresponding tree-shaped cascade adaboost graders of yardstick
Mark testing result.
In one embodiment, described training module is used for the vehicle target comprising in default angular field of view of receives input
Image pattern;And extract gradient channel feature and the luv channel characteristics of described image sample;And led to based on described gradient
Road feature and described luv channel characteristics, are trained using adaboost training algorithm, obtain corresponding to described default visual angle model
The cascade classifier branch enclosing.
In one embodiment, described training module is used for respectively in rgb space and the luv space of image, to image
Smoothed;And in calculating image pixel (x, y) the derivative dx in picture traverse direction for the image value, and picture in image
In the derivative dy in picture altitude direction, for pixel in picture traverse direction coordinate, y is picture to wherein x to the image value of vegetarian refreshments (x, y)
Vegetarian refreshments picture altitude direction coordinate;And with formulaCalculate the corresponding ladder of pixel (x, y) in image
Degree mould m, is worth to gradient-norm image m (x, y) by gradient-norm m of each pixel as image;And spend -90 to 90 degree of scopes
Gradient direction be divided into 6 directions, 30 degree of each direction, each direction correspond to a gradient direction imageWith formulaCalculate pixel (x, y) corresponding gradient direction θ in image, if θ is located at j-th direction, j-th side
To corresponding gradient direction imageWith formulaCalculate image value, wherein 1≤j≤6, are whole
Number;And calculate gradient-norm image m (x, y), gradient direction imageCorresponding passage integral image ii(x, y), passage
Integral image ii(x, y) image value at (x, y) place is passage integral image ii(x, y) corresponding gradient-norm image m (x, y) or
Gradient direction imageIt is located at the cumulative of all image values in (x, y) place upper left corner, wherein 1≤j≤6,1≤i≤7, are whole
Number;And passage integral image i is calculated with formula f (i, x, y, w, h)=a+d-b-ci(x, y) corresponding gradient channel feature f
(i, x, y, w, h), wherein a=ii(x, y), b=ii(x+w, y), c=ii(x, y+h), d=ii(x+w, y+h), 1≤i≤7, w
Value is 1 to default detection width, and h value is 1 to default detection height.
In one embodiment, described tree-shaped cascade adaboost grader includes n level grader, and n is more than 1, is integer;
First order grader is used for detection and is differed the vehicle target in 45 degree of angulars field of view with vehicle axis;
As n >=more than or equal to 2, described tree-shaped cascade adaboost grader include the first cascade classifier branch, the
Two cascade classifier branches and third level connection grader branch, described first cascade classifier branch is used for detection and vehicle axis
Line differs the vehicle target in 15 degree of angulars field of view, and described second cascade classifier branch is used for detection and is differed with vehicle axis
Vehicle target in 15 to 30 degree angulars field of view, described third level connection grader branch is used for detection and differs 30 with vehicle axis
Vehicle target to 45 degree of angulars field of view.
In one embodiment, described result output module is used for described vehicle target testing result is carried out with non-maximum suppression
System.
Above-mentioned video monitoring various visual angles vehicle checking method and device, in training, are simultaneously based on the gradient of image pattern
Channel characteristics and luv channel characteristics, are trained obtaining multiple detection yardsticks using adaboost training algorithm corresponding tree-shaped
Cascade adaboost grader, detection when, using tree-shaped cascade adaboost to input video image to be detected, according to
The gradient channel feature of image and luv channel characteristics are detected, efficiently utilize the colouring information in image, improve inspection
The accuracy surveyed, and in training with regard to training in advance the tree-shaped cascade adaboost grader of multiple yardsticks, in detection no
Conventionally image need to repeatedly be scaled, be improve the efficiency of object detection process.
Specific embodiment
In order that the objects, technical solutions and advantages of the present invention become more apparent, below in conjunction with drawings and Examples, right
The present invention is further elaborated.It should be appreciated that specific embodiment described herein is only in order to explain the present invention, and
It is not used in the restriction present invention.
Referring to Fig. 1, in one embodiment, there is provided a kind of video monitoring various visual angles vehicle checking method.Its flow process bag
Include:
Step 102, the gradient channel feature based on image pattern and luv channel characteristics, by adaboost training algorithm
It is trained, obtain multiple detection corresponding tree-shaped cascade adaboost graders of yardstick.
Wherein, tree-shaped cascade adaboost grader includes multiple cascade classifier branches, each cascade classifier branch
For the vehicle target in angular field of view default in detection image, thus by the multiple visual angle of multiple cascade classifier branch detection
Vehicle target.In a step 102, multiple detection yardsticks can empirically be worth to set, and each detection yardstick corresponds to one
The size of individual detector detection window, in the present embodiment, detection yardstick maximum could be arranged to the size of image, remaining inspection
Survey yardstick to be reduced according to an experience ratio value.
In the present embodiment, step 102 is gradient channel feature based on image pattern and luv channel characteristics are trained
The tree-shaped cascade adaboost grader of multiple detection yardsticks, detects the corresponding tree-shaped cascade of yardstick training each
During adaboost grader, can follow these steps to be trained:
Step 102a, input comprises the image pattern of the vehicle target in default angular field of view.
Step 102b, extracts gradient channel feature and the luv channel characteristics of image pattern.
In the present embodiment, during execution step 102b, the gradient channel feature of extraction image pattern is the rgb color in image
Color space is carried out;The luv channel characteristics extracting image pattern are to carry out in the luv color space of image, only need to be by image in rgb
The image value in space switchs to the image value of luv color space.
The step extracting the gradient channel feature of image pattern includes:
(1) image is smoothed, for example, can be, but not limited to be using Gaussian smoothing algorithm, image to be smoothed.
(2) the derivative dx in picture traverse direction for the image value of pixel (x, y) in calculating image, and pixel in image
In the derivative dy in picture altitude direction, for pixel in picture traverse direction coordinate, y is pixel to wherein x to the image value of point (x, y)
Dot image short transverse coordinate.
(3) with formulaCalculate corresponding gradient-norm m of pixel (x, y) in image, by each pixel
Gradient-norm m of point is worth to gradient-norm image m (x, y) as image.
(4) gradient direction spent -90 to 90 degree of scopes is divided into 6 directions, 30 degree of each direction, each direction corresponding
Gradient direction imageWith formulaCalculate pixel (x, y) corresponding gradient direction θ in image,
If θ is located at j-th direction, the corresponding gradient direction image in j-th directionWith formulaMeter
Nomogram picture value, wherein 1≤j≤6, are integer.
(5) gradient-norm image m (x, y), gradient direction image are calculatedCorresponding passage integral image ii(x, y),
Passage integral image ii(x, y) image value at (x, y) place is passage integral image ii(x, y) corresponding gradient-norm image m (x,
Or gradient direction image y)Cumulative positioned at all image values in (x, y) place upper left corner, wherein 1≤j≤6,1≤i≤7,
For integer.
(6) passage integral image i is calculated with formula f (i, x, y, w, h)=a+d-b-ci(x, y) corresponding gradient channel is special
Levy f (i, x, y, w, h), wherein a=ii(x, y), b=ii(x+w, y), c=ii(x, y+h), d=ii(x+w, y+h), 1≤i≤
7, w values are 1 to default detection width, and h value is 1 to default detection height.
The luv channel characteristics extracting image pattern are to carry out in the luv color space of image, and its extraction process is carried with above-mentioned
The process taking gradient channel feature is similar to, and will not be described here.
Step 102c, based on gradient channel feature and luv channel characteristics, is trained using adaboost training algorithm,
Obtain the cascade classifier branch corresponding to default angular field of view.
According to the gradient channel feature extracted and luv channel characteristics, instructed using traditional adaboost training algorithm
Practice, obtain the cascade classifier branch corresponding to this angular field of view.The angular field of view being provided is more, can examine during subsequent detection
The angular field of view surveyed is wider.For example in traffic video monitoring, monitor vehicle axis (including as viewed from after Herba Plantaginis and car)
Target in 45 degree of angulars field of view of difference has been able to satisfaction and is actually needed.In training, can be, but not limited to mesh in sample
Mark is trained every 15 degree of angular field of view input picture samples, obtains the corresponding cascade detecting within 15 degree of angulars field of view and divides
Cascade classifier in class device, the cascade classifier of detection 15 to 30 degree angular field of view, and detection 30 to 45 degree angular field of view.
In hands-on, angular divisions can also reset as needed.Obtain after training corresponding to default angular field of view
Cascade classifier, with the increase of series, its detection false alarm rate is more and more lower, the accuracy also more and more higher thus detecting.
Step 104, inputs video image to be detected.
Step 106, the gradient channel feature according to video image to be detected and luv channel characteristics, use the plurality of inspection
Survey the corresponding tree-shaped cascade adaboost grader of yardstick the described video image of input is identified, obtain each detection ruler
Spend the vehicle target testing result in corresponding video image.
In the present embodiment, it is gradient channel feature based on the video image being inputted and luv channel characteristics to target
It is identified, the gradient channel feature of video image and the extracting mode of luv channel characteristics, lead to the gradient of above-mentioned image pattern
Road feature is identical with the extraction process of luv channel characteristics, will not be described here.
In the present embodiment, referring to Fig. 2, trained for various visual angles detection tree-shaped cascade adaboost grader bag
Include n level grader, n is more than 1, is integer.First order grader 201 is used for detection and is differed 45 degree of angulars field of view with vehicle axis
Interior vehicle target.As n >=more than or equal to 2, tree-shaped cascade adaboost grader include the first cascade classifier branch, the
Two cascade classifier branches and third level connection grader branch, the first cascade classifier branch is used for detection and vehicle axis phase
Differ from the vehicle target in 15 degree of angulars field of view, first order cascade classifier branch includes second level grader 2022, the third level is divided
Class device 2032 etc..Second cascade classifier branch is used for detection and is differed the vehicle in 15 to 30 degree angulars field of view with vehicle axis
Target, the second cascade classifier branch includes second level grader 2024, third level grader 2034 etc..The third level joins grader
Branch is used for the vehicle target that detection differs in 30 to 45 degree angulars field of view with vehicle axis, third level connection grader branch bag
Include second level grader 2026, third level grader 2036 etc..In the present embodiment, if altimetric image to be checked is classified by the first order
The detection of device, and the inspection of grader branch is joined by the first cascade classifier branch or the second cascade classifier branch or the third level
Survey, then sentencing this fixed altimetric image to be checked is vehicle target, is not otherwise vehicle target.
Step 108, merges the vehicle target detection knot of multiple detection corresponding tree-shaped cascade adaboost graders of yardstick
Really.
In the present embodiment, after merging testing result, non-maximum suppression can also be carried out to testing result, optionally side
The corresponding close rectangle frame having overlap of method vehicle target as detected by merge.In other embodiments, can also adopt
Mean shift algorithm.
Referring to Fig. 3, in one embodiment, there is provided a kind of video monitoring various visual angles vehicle detection apparatus, comprising:
Input module 302, for input picture sample and video image to be detected.
Training module 304, for the gradient channel feature based on image pattern and luv channel characteristics, by adaboost
Training algorithm is trained, and obtains multiple detection corresponding tree-shaped cascade adaboost graders of yardstick, tree-shaped cascade
Adaboost grader includes multiple cascade classifier branches, and each cascade classifier branch is used for default visual angle in detection image
In the range of vehicle target.
Detection module 306, for the gradient channel feature according to video image to be detected and luv channel characteristics, with many
The individual detection corresponding tree-shaped cascade adaboost grader of yardstick is identified to the video image of input, obtains each detection ruler
Spend the vehicle target testing result in corresponding video image.
Result output module 308, for merging the car of multiple detection corresponding tree-shaped cascade adaboost graders of yardstick
Object detection results.
In one embodiment, training module 304 is used for the vehicle target comprising in default angular field of view of receives input
Image pattern;And extract gradient channel feature and the luv channel characteristics of described image sample;And led to based on described gradient
Road feature and described luv channel characteristics, are trained using adaboost training algorithm, obtain corresponding to default angular field of view
Cascade classifier branch.The tree-shaped cascade adaboost grader obtaining is trained to include n level grader, n is more than 1, is integer;
First order grader is used for detection and is differed the vehicle target in 45 degree of angulars field of view with vehicle axis;When n >=be more than or equal to 2
When, tree-shaped cascade adaboost grader includes the first cascade classifier branch, the second cascade classifier branch and third level connection
Grader branch, the first cascade classifier branch is used for detection and is differed the vehicle mesh in 15 degree of angulars field of view with vehicle axis
Mark, the second cascade classifier branch is used for the vehicle target that detection differs in 15 to 30 degree angulars field of view with vehicle axis, the
Three cascade classifier branches are used for detection and are differed the vehicle target in 30 to 45 degree angulars field of view with vehicle axis.
In one embodiment, training module 304 is used for respectively in rgb space and the luv space of image, and image is entered
Row is smooth;And in calculating image pixel (x, y) the derivative dx in picture traverse direction for the image value, and pixel in image
In the derivative dy in picture altitude direction, for pixel in picture traverse direction coordinate, y is pixel to wherein x to the image value of point (x, y)
Dot image short transverse coordinate;And with formulaCalculate the corresponding gradient of pixel (x, y) in image
Mould m, is worth to gradient-norm image m (x, y) by gradient-norm m of each pixel as image;And spend -90 to 90 degree of scopes
Gradient direction is divided into 6 directions, 30 degree of each direction, and each direction corresponds to a gradient direction imageWith formulaCalculate pixel (x, y) corresponding gradient direction θ in image, if θ is located at j-th direction, j-th side
To corresponding gradient direction imageWith formulaCalculate image value, wherein 1≤j≤6, are whole
Number;And calculate gradient-norm image m (x, y), gradient direction imageCorresponding passage integral image ii(x, y), passage
Integral image ii(x, y) image value at (x, y) place is passage integral image ii(x, y) corresponding gradient-norm image m (x, y) or
Gradient direction imageIt is located at the cumulative of all image values in (x, y) place upper left corner, wherein 1≤j≤6,1≤i≤7, are whole
Number;And passage integral image i is calculated with formula f (i, x, y, w, h)=a+d-b-ci(x, y) corresponding gradient channel feature f
(i, x, y, w, h), wherein a=ii(x, y), b=ii(x+w, y), c=ii(x, y+h), d=ii(x+w, y+h), 1≤i≤7, w
Value is 1 to default detection width, and h value is 1 to default detection height.
In one embodiment, result output module 308 is used for carrying out non-maximum suppression to vehicle target testing result.
Embodiment described above only have expressed the several embodiments of the present invention, and its description is more concrete and detailed, but simultaneously
Therefore the restriction to the scope of the claims of the present invention can not be interpreted as.It should be pointed out that for those of ordinary skill in the art
For, without departing from the inventive concept of the premise, some deformation can also be made and improve, these broadly fall into the guarantor of the present invention
Shield scope.Therefore, the protection domain of patent of the present invention should be defined by claims.