CN107025458B - People's vehicle classification method and device - Google Patents
People's vehicle classification method and device Download PDFInfo
- Publication number
- CN107025458B CN107025458B CN201610066022.7A CN201610066022A CN107025458B CN 107025458 B CN107025458 B CN 107025458B CN 201610066022 A CN201610066022 A CN 201610066022A CN 107025458 B CN107025458 B CN 107025458B
- Authority
- CN
- China
- Prior art keywords
- image
- histogram
- gradient
- gradient direction
- movement destination
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000000034 method Methods 0.000 title claims abstract description 34
- 239000013598 vector Substances 0.000 claims abstract description 67
- 238000012706 support-vector machine Methods 0.000 claims abstract description 22
- 238000001514 detection method Methods 0.000 claims abstract description 11
- 239000000203 mixture Substances 0.000 claims description 7
- 239000000284 extract Substances 0.000 claims description 6
- 238000012544 monitoring process Methods 0.000 abstract description 5
- 238000010586 diagram Methods 0.000 description 7
- 238000004458 analytical method Methods 0.000 description 5
- 238000013527 convolutional neural network Methods 0.000 description 5
- 238000005286 illumination Methods 0.000 description 4
- 230000000007 visual effect Effects 0.000 description 3
- 206010039203 Road traffic accident Diseases 0.000 description 2
- 230000002411 adverse Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 239000012634 fragment Substances 0.000 description 2
- XLYOFNOQVPJJNP-UHFFFAOYSA-N water Substances O XLYOFNOQVPJJNP-UHFFFAOYSA-N 0.000 description 2
- 230000018109 developmental process Effects 0.000 description 1
- 238000003709 image segmentation Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 230000011218 segmentation Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/241—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
- G06F18/2411—Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on the proximity to a decision surface, e.g. support vector machines
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V10/00—Arrangements for image or video recognition or understanding
- G06V10/40—Extraction of image or video features
- G06V10/50—Extraction of image or video features by performing operations within image blocks; by using histograms, e.g. histogram of oriented gradients [HoG]; by summing image-intensity values; Projection analysis
- G06V10/507—Summing image-intensity values; Histogram projection analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06V—IMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
- G06V2201/00—Indexing scheme relating to image or video recognition or understanding
- G06V2201/08—Detecting or categorising vehicles
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Artificial Intelligence (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Engineering & Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Multimedia (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a kind of people's vehicle classification method and devices, the described method comprises the following steps: the moving target in detection video obtains movement destination image;Calculate the gradient orientation histogram of the movement destination image;Feature vector is extracted from the gradient orientation histogram, is classified using support vector machines to the movement destination image using described eigenvector as input vector, First Kind Graph picture and the second class image are obtained, the First Kind Graph picture is motor vehicle image.Since the present invention does not need that image is normalized, it is only necessary to the calculating of gradient direction figure is carried out, and gradient direction figure is a kind of simple operation that adjacent pixel subtracts each other, computational complexity very little, the requirement to hardware is lower, therefore reduces hardware cost;And it can be transplanted in some embedded devices, therefore expand application range;Operational efficiency is very high simultaneously, therefore improves classification speed, can give full play to the real-time of monitoring.
Description
Technical field
The present invention relates to technical field of video monitoring, more particularly, to a kind of people's vehicle classification method and device.
Background technique
With the development of urbanization, urban population quantity is increasing, and urban transportation is also more and more crowded, traffic accident
Increase therewith.Usually pedestrian in traffic accident in one side of weak tendency, therefore, people and vehicle classification are in traffic state analysis
In play a very important role.
The Chinese patent application of Publication No. CN104463194A describes a kind of people's vehicle classification method and device, counts first
Otherness value and class inherited value in the class of training sample set are calculated, the ratio of otherness value and class inherited value in class is remembered
Otherness ratio is done, is made comparisons according to otherness ratio and threshold value, sets the convolution of convolutional neural networks according to the result of the comparison
The number of plies;Convolutional neural networks are followed by initialized, the convolutional neural networks of initialization are instructed using the convolution number of plies of front
Practice, obtains convolutional neural networks model;Finally, inputting image to be detected, people's vehicle point is carried out using convolutional neural networks model
Class.Such method needs to collect a large amount of training sample, relatively high to the hardware requirement of training pattern, improves hardware cost.
The Chinese patent application of Publication No. CN104519323A describes a kind of people's vehicle non-target classification system and method, first
Video is first subjected to physical segmentation by setting amount of bytes, obtains multiple video blocks, these video blocks are stored in different sons and are saved
Point;Secondly fragment is carried out to video according to the key frame in each video block, parsing fragment obtains key value pair, according to key-value pair pair
Video slicing carries out the classification of people's vehicle.Such method for illumination, background variation people's vehicle image it is more sensitive, classification accuracy compared with
It is low.
In conclusion people's vehicle classification method of the prior art, some hardware costs are higher, and some accuracys rate are lower, therefore
It needs to propose a kind of low hardware cost, accuracy rate and high people's vehicle classification method.
Summary of the invention
The main purpose of the present invention is to provide a kind of people's vehicle classification method and devices, it is intended to reduce hardware cost, improve
Accuracy rate.
To achieve these objectives, the present invention proposes a kind of people's vehicle classification method, comprising the following steps:
The moving target in video is detected, movement destination image is obtained;
Calculate the gradient orientation histogram of the movement destination image;
Feature vector is extracted from the gradient orientation histogram, utilizes branch for described eigenvector as input vector
It holds vector machine to classify to the movement destination image, obtains First Kind Graph picture and the second class image, the First Kind Graph picture
For motor vehicle image.
Preferably, the acquisition First Kind Graph picture and the step of the second class image after further include:
The second class image is divided into the part n and the part n+1 respectively from top to bottom, calculates separately out the ladder of each section
Direction histogram is spent, wherein n takes the integer more than or equal to 2;
Extract feature vector from the gradient orientation histogram of described each section, using described eigenvector as input to
Amount classifies to the second class image using support vector machines, obtains pedestrian image and non-motor vehicle image.
Preferably, described to extract feature vector from the gradient orientation histogram and include:
Five be made of f1 [0], f1 [1], f1 [2], f1 [3] and f1 [4] are extracted from the gradient orientation histogram
Dimension group is as feature vector, in which:
F1 [0] is the width of the movement destination image and the ratio of height, and f1 [1] is hanging down for the movement destination image
Straight the sum of gradient direction number of pixels and horizontal gradient direction number of pixels with it is other in addition to vertically and horizontally gradient direction
The ratio of the sum of gradient direction number of pixels, f1 [2] are the array index of the minimum value in the gradient orientation histogram, f1
It [3] is the array index of the maximum value in the gradient orientation histogram, f1 [4] is the top half of the movement destination image
The ratio of the sum of gray value and the sum of lower half portion gray value.
Preferably, described that the second class image is divided into the part n and the part n+1 respectively from top to bottom, it calculates separately
The gradient orientation histogram of each section out, comprising:
The second class image is divided into first part, second part and Part III from top to bottom and is total to three parts, point
The gradient orientation histogram of each section is not calculated;The second class image is divided into first part, second from top to bottom
Partially, Part III and Part IV totally four part, calculates separately out the gradient orientation histogram of each section.
Preferably, extracting feature vector from the gradient orientation histogram of described each section includes:
The four-dimensional array being made of f2 [0], f2 [1], f2 [2] and f2 [3] is extracted from the gradient orientation histogram
As feature vector, in which:
Vertical gradient direction histogram in second part and Part III when f2 [0] is the second class image described in trisection
Accounting, when f2 [1] is the second class image described in trisection in second part horizontal gradient direction histogram accounting, f2 [2] is
The sum of horizontal gradient direction histogram of Part III and Part IV and vertical gradient side when the second class image described in the quartering
To the ratio of the sum of histogram, the horizontal gradient direction histogram of Part IV when f2 [3] is the second class image described in the quartering
With the ratio of the sum of the histogram of other gradient directions in addition to horizontal and vertical gradient direction.
The present invention proposes a kind of people's vehicle sorter simultaneously, comprising:
Moving object detection module obtains movement destination image for detecting the moving target in video;
First computing module, for calculating the gradient orientation histogram of the movement destination image;
First categorization module, for extracting feature vector from the gradient orientation histogram, by described eigenvector
Classified using support vector machines to the movement destination image as input vector, obtains First Kind Graph picture and the second class figure
Picture, the First Kind Graph picture are motor vehicle image.
Preferably, further includes:
Second computing module, for the second class image to be divided into the part n and the part n+1 respectively from top to bottom, point
The gradient orientation histogram of each section is not calculated, and wherein n takes the integer more than or equal to 2;
Second categorization module will be described for extracting feature vector from the gradient orientation histogram of described each section
Feature vector classifies to the second class image using support vector machines as input vector, obtains pedestrian image and non-machine
Motor-car image.
Preferably, first categorization module is used for: is extracted from the gradient orientation histogram by f1 [0], f1
[1], five dimension groups of f1 [2], f1 [3] and f1 [4] composition are as feature vector, in which:
F1 [0] is the width of the movement destination image and the ratio of height, and f1 [1] is hanging down for the movement destination image
Straight the sum of gradient direction number of pixels and horizontal gradient direction number of pixels with it is other in addition to vertically and horizontally gradient direction
The ratio of the sum of gradient direction number of pixels, f1 [2] are the array index of the minimum value in the gradient orientation histogram, f1
It [3] is the array index of the maximum value in the gradient orientation histogram, f1 [4] is the top half of the movement destination image
The ratio of the sum of gray value and the sum of lower half portion gray value.
Preferably, second computing module is used for: the second class image is divided into first part, from top to bottom
Two parts and Part III are total to three parts, calculate separately out the gradient orientation histogram of each section;By the second class image
It is divided into first part, second part, Part III and Part IV totally four part from top to bottom, calculates separately out each section
Gradient orientation histogram.
Preferably, second categorization module is used for: is extracted from the gradient orientation histogram by f2 [0], f2
[1], the four-dimensional array of f2 [2] and f2 [3] composition is as feature vector, in which:
Vertical gradient direction histogram in second part and Part III when f2 [0] is the second class image described in trisection
Accounting, when f2 [1] is the second class image described in trisection in second part horizontal gradient direction histogram accounting, f2 [2] is
The sum of horizontal gradient direction histogram of Part III and Part IV and vertical gradient side when the second class image described in the quartering
To the ratio of the sum of histogram, the horizontal gradient direction histogram of Part IV when f2 [3] is the second class image described in the quartering
With the ratio of the sum of the histogram of other gradient directions in addition to horizontal and vertical gradient direction.
A kind of people's vehicle classification method provided by the present invention, does not need that image is normalized, it is only necessary to carry out
The calculating of gradient orientation histogram extracts feature vector from gradient orientation histogram and is input to support vector machines, can lead to
It crosses support vector machines and realizes the classification of pedestrian's vehicle.Since gradient direction figure is a kind of simple operation that adjacent pixel subtracts each other, operation is multiple
Miscellaneous degree very little, the requirement to hardware is lower, therefore reduces hardware cost;And it can be transplanted in some embedded devices,
Therefore application range is expanded;Operational efficiency is very high simultaneously, therefore improves classification speed, can give full play to the real-time of monitoring
Property.Moreover, the scenes such as illumination, visual angle, resolution ratio can be overcome to the unfavorable shadow of people's vehicle image using technical solution of the present invention
It rings, improves nicety of grading and classification speed.
Detailed description of the invention
Fig. 1 is the flow chart of people's vehicle classification method first embodiment of the invention;
Fig. 2 is the flow chart that the gradient orientation histogram of movement destination image is calculated in the embodiment of the present invention;
Fig. 3 is the schematic diagram of pedestrian in the embodiment of the present invention, non-motor vehicle and motor vehicle;
Fig. 4 is the flow chart of people's vehicle classification method second embodiment of the invention;
Fig. 5 is the schematic diagram of trisection pedestrian image and non-motor vehicle image in the embodiment of the present invention;
Fig. 6 is the schematic diagram of quartering pedestrian image and non-motor vehicle image in the embodiment of the present invention;
Fig. 7 is the module diagram of people's vehicle sorter first embodiment of the invention;
Fig. 8 is the module diagram of people's vehicle sorter second embodiment of the invention.
The embodiments will be further described with reference to the accompanying drawings for the realization, the function and the advantages of the object of the present invention.
Specific embodiment
It should be appreciated that the specific embodiments described herein are merely illustrative of the present invention, it is not intended to limit the present invention.
Referring to Fig. 1, proposes people's vehicle classification method first embodiment of the invention, the described method comprises the following steps:
Moving target in S11, detection video, obtains movement destination image.
Specifically, obtain the video data that acquires in real time or obtain video data from the video for recorded completion, to obtaining
The video data taken carries out moving object detection, obtains multiple movement destination images.For example, the back based on Pixel-level can be used
Scape modeling, foreground detection ViBe algorithm carry out moving object detection, obtain the movement destination image of extraneous rectangle frame.Certainly,
Moving object detection can be carried out to video using other way in the prior art or algorithm, details are not described herein.
S12, the gradient orientation histogram for calculating movement destination image.
Specifically, carrying out gradient direction calculating to each movement destination image, the ladder of each movement destination image is obtained
Spend direction histogram.As shown in Fig. 2, the gradient orientation histogram for calculating movement destination image mainly comprises the steps that
S121, the gradient direction figure for calculating movement destination image.
For example, can calculate gradient direction figure using sobel operator, which includes horizontal gradient dx and vertical gradient
dy.Wherein, horizontal gradient dx is that the value that the right one arranges subtracts the difference that the value of the column of the left side one obtains, and vertical gradient dy is following one
Capable value subtracts the difference that the value of top a line obtains, and the edge of image does not calculate gradient, is set to 0.
It is of course also possible to use other way in the prior art or algorithm calculate gradient orientation histogram, herein not
It repeats again.
S122, statistics with histogram is carried out to the gradient direction figure calculated, obtains gradient orientation histogram.
After obtaining the horizontal gradient directional diagram and vertical gradient directional diagram of image, so that it may calculate each picture in image
The gradient magnitude and gradient direction of vegetarian refreshments, wherein gradient magnitude isGradient direction is arctan (dy/
Dx), value range is
Since gradient direction is directional, it is not concerned with directionality in the present invention, therefore take absolute value to gradient direction |
Arctan (dy/dx) |, value range isSuch as a pedestrian, vertical body edge is larger, i.e., dx is larger, water
Pingbian edge is smaller, i.e. dy is close to 0, then gradient direction | arctan (dy/dx) | it is 0.Preferably, the present invention is by gradient direction4 regions are divided into, i.e., WithCalculate each pixel
Gradient direction value, counted according to the affiliated area of its gradient direction, finally count the gradient direction histogram of the image
Figure.
Gradient orientation histogram can use a four-dimensional array hist1 [4] to indicate, hist1 [4] by hist1 [0],
Hist1 [1], hist1 [2] and hist1 [3] composition, in which: hist1 [3] represents movement destination imageGradient side
To (horizontal gradient direction) number of pixels, hist1 [2] represents movement destination imageGradient direction number of pixels,
Hist1 [1] represents movement destination imageGradient direction number of pixels, hist1 [0] represent movement destination image
'sGradient direction (vertical gradient direction) number of pixels.
S13, feature vector is extracted from gradient orientation histogram.
Specifically, being extracted from the gradient orientation histogram of each movement destination image by f1 [0], f1 [1], f1 [2], f1
[3] and feature vector f1 [5] of the five dimension groups as each movement destination image of f1 [4] composition, in which:
F1 [0] is the width (Width) of movement destination image and the ratio of height (Height), it may be assumed that f1 [0]=Width/
Height;
F1 [1] be movement destination image vertical gradient direction number of pixels and the sum of horizontal gradient direction number of pixels with
The ratio of the sum of other gradient direction number of pixels in addition to vertically and horizontally gradient direction, it may be assumed that f1 [1]=(hist1 [0]+
Hist1 [3])/(hist1 [1]+hist1 [2]), wherein hist1 [0] is vertical gradient direction number of pixels, and hist1 [3] is water
Flat gradient direction number of pixels;
F1 [2] is the array index of the minimum value in gradient orientation histogram hist1 [4].For example, hist1 [4] includes
Hist1 [0], hist1 [1], hist1 [2] and hist1 [3], if the minimum value in hist1 [4] is [1] hist1, f1 [2]
=1;
F1 [3] is the array index of the maximum value in gradient orientation histogram hist1 [4].For example, hist1 [4] includes
Hist1 [0], hist1 [1], hist1 [2], hist1 [3], if the maximum value in hist1 [4] is [3] hist1, f1 [3]
=3;
F1 [4] is ratio of the sum of the top half gray value of movement destination image with the sum of lower half portion gray value.
S14, classified using support vector machines to movement destination image using feature vector as input vector, obtain the
A kind of image and the second class image, wherein First Kind Graph picture is motor vehicle image.
First Kind Graph picture is motor vehicle image, and the second class image is the movement destination image other than motor vehicle, mainly includes
Pedestrian and non motorized vehicle image, in certain embodiments can be directly by the second class image as pedestrian image.
As shown in figure 3, being from left to right respectively pedestrian image, non-motor vehicle image and motor vehicle image.
Since the ratio of width to height of pedestrian and non motorized vehicle image is less than 1, and the ratio of width to height of motor vehicle image is greater than or equal to 1,
Therefore it can use the classification of f1 [0] Lai Jinhang pedestrian and non motorized vehicle image and motor vehicle image in feature vector.
Due to pedestrian and non motorized vehicle image except vertically and horizontally gradient direction with for other gradient directions histogram
It is abundanter than motor vehicle image, therefore can use the f1 in feature vector [1] Lai Jinhang pedestrian and non motorized vehicle image and machine
The classification of motor-car image.
Since the vertical edge of pedestrian and non motorized vehicle image is abundanter than horizontal edge, and the horizontal edge of motor vehicle image
It is similar with vertical edge, therefore can use the f1 in feature vector [2] and f1 [3] Lai Jinhang pedestrian and non motorized vehicle image
With the classification of motor vehicle image.
Since motor vehicle image is usually a kind of color, the ratio of the sum of gray value of upper and lower two halves part is approximately 1,
Therefore it can use the classification of f1 [4] Lai Jinhang pedestrian and non motorized vehicle image and motor vehicle image in feature vector.
In the present embodiment, the feature vector f1 for five dimensions that will be made of f1 [0], f1 [1], f1 [2], f1 [3] and f1 [4]
[5] it is input to support vector machines as input vector, utilizes (the training and study of support vector machines of trained support vector machines
Process is similar) comprehensive analysis is carried out to [4] five feature vectors of f1 [0]-f1 according to input vector, it is right based on the analysis results
Movement destination image is classified, and multiple movement destination images are classified as First Kind Graph picture and the second class image.
In certain embodiments, feature vector can also only include any one in f1 [0]-f1 [4] or any two
A, three or four combinations.
People's vehicle classification method of the embodiment of the present invention, does not need that image is normalized, it is only necessary to carry out gradient
The calculating of direction histogram extracts feature vector from gradient orientation histogram and is input to support vector machines, can pass through branch
Hold the classification that vector machine realizes pedestrian (including non-motor vehicle) and motor vehicle.Since gradient direction figure is that a kind of adjacent pixel subtracts each other
Simple operation, computational complexity very little, the requirement to hardware is lower, therefore reduces hardware cost;And it can be transplanted to
In some embedded devices, therefore expand application range;Operational efficiency is very high simultaneously, therefore improves classification speed, can fill
The real-time of monitoring is waved in distribution.Moreover, the scenes pair such as illumination, visual angle, resolution ratio can be overcome using technical solution of the present invention
The adverse effect of people's vehicle image, improves nicety of grading and classification speed.
Referring to fig. 4, people's vehicle classification method second embodiment of the invention is proposed, people's vehicle classification process of the present embodiment is divided into
Two parts, first part are to classify using pedestrian and non motorized vehicle as one kind with motor vehicle;Second part is by pedestrian and non-machine
Motor-car classification.The method specifically includes the following steps:
Moving target in S21, detection video, obtains movement destination image.
S22, the gradient orientation histogram for calculating movement destination image.
S23, feature vector is extracted from gradient orientation histogram.
S24, classified using support vector machines to movement destination image using feature vector as input vector, obtain the
A kind of image and the second class image, wherein First Kind Graph picture is motor vehicle image.
In the present embodiment, step S21-S24 is identical as the step S11-S14 in first embodiment respectively, no longer superfluous herein
It states.
S25, the second class image is divided into the part n and the part n+1 respectively from top to bottom, calculates separately out the ladder of each section
Spend direction histogram.
Since pedestrian image and non-motor vehicle image top half are almost the same in the second class image, but there is difference in lower half portion
It is different, therefore can be partially and by way of the part n+1 the difference of lower half portion being utilized to extract at n the second class image segmentation
Feature vector out distinguishes pedestrian image and non-motor vehicle image, reaches and classifies to pedestrian image and non-motor vehicle image
Purpose.
Wherein, n takes the integer more than or equal to 2.In segmented image, equal part preferably is carried out to image, that is, by the second class
Image is averagely divided into multiple portions from top to bottom.
In the present embodiment, n takes 3, it may be assumed that the second class image is divided into first part, second part and third from top to bottom
Part be total to three parts, calculate separately out each section gradient orientation histogram be hist3 [0] [4], hist3 [1] [4] and
Hist3 [2] [4] (as shown in Figure 5);By the second class image be divided into from top to bottom first part, second part, Part III and
Part IV totally four part, the gradient orientation histogram for calculating separately out each section is hist4 [0] [4], hist4 [1] [4],
Hist4 [2] [4] and hist4 [3] [4] (as shown in Figure 6).
Gradient side in step S12 in the specific calculation Yu first embodiment of gradient orientation histogram in this step S25
Calculation to histogram is similar, and details are not described herein.Wherein:
Hist3 [0] [4] is made of hist3 [0] [0], hist3 [0] [1], hist3 [0] [2] and hist3 [0] [3];
Hist3 [1] [4] is made of hist3 [1] [0], hist3 [1] [1], hist3 [1] [2] and hist3 [1] [3];
Hist3 [2] [4] is made of hist3 [2] [0], hist3 [2] [1], hist3 [2] [2] and hist3 [2] [3];
Hist4 [0] [4] is made of hist4 [0] [0], hist4 [0] [1], hist4 [0] [2] and hist4 [0] [3];
Hist4 [1] [4] is made of hist4 [1] [0], hist4 [1] [1], hist4 [1] [2] and hist4 [1] [3];
Hist4 [2] [4] is made of hist4 [2] [0], hist4 [2] [1], hist4 [2] [2] and hist4 [2] [3];
Hist4 [3] [4] is made of hist4 [3] [0], hist4 [3] [1], hist4 [3] [2] and hist4 [3] [3].
S26, feature vector is extracted from the gradient orientation histogram of second class image each section.
For each the second class image, extracted from the gradient orientation histogram of its each section by f2 [0], f2 [1],
The four-dimensional array of f2 [2] and f2 [3] composition is as feature vector, in which:
Vertical gradient direction histogram accounts in second part and Part III when f2 [0] is the second class of trisection image
Than, it may be assumed that f2 [0]=(hist3 [1] [0]+hist3 [2] [0])/(tmp1+tmp2), wherein hist3 [1] [0] is second part
Vertical gradient direction histogram, hist3 [2] [0] be Part III vertical gradient direction histogram, tmp1=hist3 [1]
[0]+hist3 [1] [1]+hist3 [1] [2]+hist3 [1] [3], represents the histogram of all gradient directions of second part, tmp2
=hist3 [2] [0]+hist3 [2] [1]+hist3 [2] [2]+hist3 [2] [3], represents all gradient directions of Part III
Histogram;
F2 [1] be the second class of trisection image when second part in horizontal gradient direction histogram accounting, it may be assumed that f2 [1]
=hist3 [1] [3]/tmp1, wherein hist3 [1] [3] is the horizontal gradient direction histogram of second part, and tmp1 is second
Divide the histogram of all gradient directions;
When f2 [2] is the second class of quartering image the sum of horizontal gradient direction histogram of Part III and Part IV with
The ratio of the sum of vertical gradient direction histogram, it may be assumed that f2 [2]=(hist4 [2] [3]+hist4 [3] [3])/(hist4 [2] [0]
+ hist4 [3] [0]), wherein hist4 [2] [3] is the horizontal gradient direction histogram of Part III, and hist4 [3] [3] is the 4th
Partial horizontal gradient direction histogram, hist4 [2] [0] are the vertical gradient direction histogram of Part III, hist4 [3]
It [0] is the vertical gradient direction histogram of Part IV;
F2 [3] be the second class of the quartering image when Part IV horizontal gradient direction histogram with remove horizontal and vertical ladder
Spend the ratio of the sum of histogram of other gradient directions other than direction, it may be assumed that hist4 [3] [3]/(hist4 [3] [2]+hist4
[3] [1]), wherein hist4 [3] [3] is the horizontal gradient direction histogram of Part IV.
S27, classified using support vector machines to the second class image using feature vector as input vector, obtain pedestrian
Image and non-motor vehicle image.
Since f2 [0], f2 [1], f2 [2] and f2 [3] embody the difference of pedestrian image and non-motor vehicle image lower half portion
Different, therefore, the four-dimensional feature vector f2 [4] that the present embodiment will be made of f2 [0], f2 [1], f2 [2] and f2 [3] is as defeated
Incoming vector is input to support vector machines, using trained support vector machines according to input vector to [3] four spies of f2 [0]-f2
It levies vector and carries out comprehensive analysis, classify based on the analysis results to the second class image, be row by multiple second class image classifications
People's image and non-motor vehicle image.
In certain embodiments, feature vector can also only include any one in f2 [0]-f2 [3] or any two
A or three combinations.
The present embodiment further classifies to the second class image, sorts out pedestrian image and non-machine from the second class image
Motor-car image finally realizes the classification of pedestrian, non-motor vehicle and motor vehicle, and classification results are finer, improve classification
Precision simultaneously further improves the accuracy rate of classification.
Referring to Fig. 7, people's vehicle sorter first embodiment of the invention is proposed, described device includes moving object detection mould
Block 10, the first computing module 20 and the first categorization module 30, in which:
Moving object detection module 10: for detecting the moving target in video, movement destination image is obtained.
First computing module 20: for calculating the gradient orientation histogram of movement destination image.
First categorization module 30: for extracting feature vector from gradient orientation histogram, using feature vector as defeated
Incoming vector classifies to movement destination image using support vector machines, obtains First Kind Graph picture and the second class image.Wherein,
A kind of image is motor vehicle image.Second class image is the movement destination image other than motor vehicle, mainly includes pedestrian and non-machine
Motor-car image, in certain embodiments can be directly by the second class image as pedestrian image.
Specifically, the first categorization module 30 is extracted from gradient orientation histogram by f1 [0], f1 [1], f1 [2], f1
[3] and five dimension groups of f1 [4] composition are as feature vector, in which: f1 [0] is the width of movement destination image and the ratio of height
Value, f1 [1] be movement destination image vertical gradient direction number of pixels and the sum of horizontal gradient direction number of pixels with except hanging down
The ratio of the sum of other gradient direction number of pixels other than straight and horizontal gradient direction, f1 [2] are in gradient orientation histogram
Minimum value array index, f1 [3] be gradient orientation histogram in maximum value array index, f1 [4] be moving target
The ratio of the sum of top half gray value of image and the sum of lower half portion gray value.
People's vehicle sorter of the embodiment of the present invention, does not need that image is normalized, it is only necessary to carry out gradient
The calculating of direction histogram extracts feature vector from gradient orientation histogram and is input to support vector machines, can pass through branch
Hold the classification that vector machine realizes pedestrian (including non-motor vehicle) and motor vehicle.Since gradient direction figure is that a kind of adjacent pixel subtracts each other
Simple operation, computational complexity very little, the requirement to hardware is lower, therefore reduces hardware cost;And it can be transplanted to
In some embedded devices, therefore expand application range;Operational efficiency is very high simultaneously, therefore improves classification speed, can fill
The real-time of monitoring is waved in distribution.Moreover, the scenes pair such as illumination, visual angle, resolution ratio can be overcome using technical solution of the present invention
The adverse effect of people's vehicle image, improves nicety of grading and classification speed.
Referring to Fig. 8, people's vehicle sorter second embodiment of the invention is proposed, the present embodiment is on the basis of first embodiment
On increase the second computing module 40 and the second categorization module 50, in which:
Second computing module 40: for the second class image to be divided into the part n and the part n+1 respectively from top to bottom, respectively
The gradient orientation histogram of each section is calculated, wherein n takes the integer more than or equal to 2.
Preferably, n takes 3, and the second class image is divided into first part, second part by the second computing module 40 from top to bottom
Three parts are total to Part III, calculate separately out the gradient orientation histogram of each section;From top to bottom by the second class image etc.
It is divided into first part, second part, Part III and Part IV totally four part, calculates separately out the gradient direction of each section
Histogram.
Second categorization module 50: for from second classification image each section gradient orientation histogram in extract feature to
Amount, classifies to the second class image using support vector machines using feature vector as input vector, acquisition pedestrian image and non-
Motor vehicle image.
Preferably, the second categorization module 50 is extracted from gradient orientation histogram by f2 [0], f2 [1], f2 [2] and f2
[3] the four-dimensional array formed is as feature vector, in which: second part and third portion when f2 [0] is the second class of trisection image
The accounting of vertical gradient direction histogram in point, horizontal gradient direction in second part when f2 [1] is the second class of trisection image
The accounting of histogram, the horizontal gradient direction histogram of Part III and Part IV when f2 [2] is the second class of quartering image
The sum of ratio with the sum of vertical gradient direction histogram, the horizontal ladder of Part IV when f2 [3] is the second class of quartering image
Spend the ratio of the sum of direction histogram and the histogram of other gradient directions in addition to horizontal and vertical gradient direction.
The present embodiment further classifies to the second class image, sorts out pedestrian image and non-machine from the second class image
Motor-car image finally realizes the classification of pedestrian, non-motor vehicle and motor vehicle, and classification results are finer, improve classification
Precision simultaneously further improves the accuracy rate of classification.
It should be appreciated that people's vehicle sorter provided by the above embodiment and people's vehicle classification method embodiment belong to same structure
Think, specific implementation process is detailed in embodiment of the method, and the technical characteristic in embodiment of the method is corresponding in Installation practice
It is applicable in, which is not described herein again.
Through the above description of the embodiments, those skilled in the art can be understood that above-described embodiment side
Method can be realized by means of software and necessary general hardware platform, naturally it is also possible to by hardware, but in many cases
The former is more preferably embodiment.Based on this understanding, technical solution of the present invention substantially in other words does the prior art
The part contributed out can be embodied in the form of software products, which is stored in a storage medium
In (such as ROM/RAM, magnetic disk, CD), including some instructions are used so that a terminal device (can be mobile phone, computer, clothes
Business device or the network equipment etc.) execute method described in each embodiment of the present invention.
It should be understood that the above is only a preferred embodiment of the present invention, the scope of the patents of the invention cannot be therefore limited,
It is all to utilize equivalent structure or equivalent flow shift made by description of the invention and accompanying drawing content, it is applied directly or indirectly in
Other related technical areas are included within the scope of the present invention.
Claims (8)
1. a kind of people's vehicle classification method, which comprises the following steps:
The moving target in video is detected, movement destination image is obtained;
Calculate the gradient orientation histogram of the movement destination image;
Five dimensions being made of f1 [0], f1 [1], f1 [2], f1 [3] and f1 [4] are extracted from the gradient orientation histogram
Group is used as feature vector, is carried out using support vector machines to the movement destination image using described eigenvector as input vector
Classification, obtains First Kind Graph picture and the second class image, and the First Kind Graph picture is motor vehicle figure;
Wherein, f1 [0] is the width of the movement destination image and the ratio of height, and f1 [1] is the movement destination image
The sum of vertical gradient direction number of pixels and horizontal gradient direction number of pixels and its in addition to vertically and horizontally gradient direction
The ratio of the sum of its gradient direction number of pixels, f1 [2] are the array index of the minimum value in the gradient orientation histogram, f1
It [3] is the array index of the maximum value in the gradient orientation histogram, f1 [4] is the top half of the movement destination image
The ratio of the sum of gray value and the sum of lower half portion gray value.
2. people's vehicle classification method according to claim 1, which is characterized in that the acquisition First Kind Graph picture and the second class figure
After the step of picture further include:
The second class image is divided into the part n and the part n+1 respectively from top to bottom, calculates separately out the gradient side of each section
To histogram, wherein n takes the integer more than or equal to 2;
Feature vector is extracted from the gradient orientation histogram of described each section, using described eigenvector as input vector benefit
Classified with support vector machines to the second class image, obtains pedestrian image and non-motor vehicle image.
3. people's vehicle classification method according to claim 2, which is characterized in that it is described by the second class image from top to bottom
It is divided into the part n and the part n+1 respectively, calculates separately out the gradient orientation histogram of each section, comprising:
The second class image is divided into first part, second part and Part III from top to bottom and is total to three parts, is counted respectively
Calculate the gradient orientation histogram of each section;By the second class image be divided into from top to bottom first part, second part,
Part III and Part IV totally four part, calculate separately out the gradient orientation histogram of each section.
4. people's vehicle classification method according to claim 3, which is characterized in that from the gradient orientation histogram of described each section
In extract feature vector and include:
The four-dimensional array conduct being made of f2 [0], f2 [1], f2 [2] and f2 [3] is extracted from the gradient orientation histogram
Feature vector, in which:
Vertical gradient direction histogram accounts in second part and Part III when f2 [0] is the second class image described in trisection
When than, f2 [1] being the second class image described in trisection in second part horizontal gradient direction histogram accounting, f2 [2] is four
The sum of horizontal gradient direction histogram of Part III and Part IV and vertical gradient direction when the second class image described in equal part
The ratio of the sum of histogram, f2 [3] be the quartering described in the second class image when Part IV horizontal gradient direction histogram with
The ratio of the sum of the histogram of other gradient directions in addition to horizontal and vertical gradient direction.
5. a kind of people's vehicle sorter characterized by comprising
Moving object detection module obtains movement destination image for detecting the moving target in video;
First computing module, for calculating the gradient orientation histogram of the movement destination image;
First categorization module, for extracted from the gradient orientation histogram by f1 [0], f1 [1], f1 [2], f1 [3] and
Five dimension groups of f1 [4] composition utilize support vector machines to institute as feature vector, using described eigenvector as input vector
It states movement destination image to classify, obtains First Kind Graph picture and the second class image, the First Kind Graph picture is motor vehicle image;
Wherein, f1 [0] is the width of the movement destination image and the ratio of height, and f1 [1] is the movement destination image
The sum of vertical gradient direction number of pixels and horizontal gradient direction number of pixels and its in addition to vertically and horizontally gradient direction
The ratio of the sum of its gradient direction number of pixels, f1 [2] are the array index of the minimum value in the gradient orientation histogram, f1
It [3] is the array index of the maximum value in the gradient orientation histogram, f1 [4] is the top half of the movement destination image
The ratio of the sum of gray value and the sum of lower half portion gray value.
6. people's vehicle sorter according to claim 5, which is characterized in that further include:
Second computing module is counted respectively for the second class image to be divided into the part n and the part n+1 respectively from top to bottom
The gradient orientation histogram of each section is calculated, wherein n takes the integer more than or equal to 2;
Second categorization module, for extracting feature vector from the gradient orientation histogram of described each section, by the feature
Vector classifies to the second class image using support vector machines as input vector, obtains pedestrian image and non-motor vehicle
Image.
7. people's vehicle sorter according to claim 6, which is characterized in that second computing module is used for: will be described
Second class image is divided into first part, second part and Part III from top to bottom and is total to three parts, calculates separately out each portion
The gradient orientation histogram divided;By the second class image be divided into from top to bottom first part, second part, Part III and
Part IV totally four part, calculates separately out the gradient orientation histogram of each section.
8. people's vehicle sorter according to claim 6, which is characterized in that second categorization module is used for: from described
The four-dimensional array that is made of f2 [0], f2 [1], f2 [2] and f2 [3] is extracted in gradient orientation histogram as feature vector,
In:
Vertical gradient direction histogram accounts in second part and Part III when f2 [0] is the second class image described in trisection
When than, f2 [1] being the second class image described in trisection in second part horizontal gradient direction histogram accounting, f2 [2] is four
The sum of horizontal gradient direction histogram of Part III and Part IV and vertical gradient direction when the second class image described in equal part
The ratio of the sum of histogram, f2 [3] be the quartering described in the second class image when Part IV horizontal gradient direction histogram with
The ratio of the sum of the histogram of other gradient directions in addition to horizontal and vertical gradient direction.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610066022.7A CN107025458B (en) | 2016-01-29 | 2016-01-29 | People's vehicle classification method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610066022.7A CN107025458B (en) | 2016-01-29 | 2016-01-29 | People's vehicle classification method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107025458A CN107025458A (en) | 2017-08-08 |
CN107025458B true CN107025458B (en) | 2019-08-30 |
Family
ID=59524878
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610066022.7A Expired - Fee Related CN107025458B (en) | 2016-01-29 | 2016-01-29 | People's vehicle classification method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107025458B (en) |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103400157A (en) * | 2013-07-23 | 2013-11-20 | 青岛海信网络科技股份有限公司 | Road pedestrian and non-motor vehicle detection method based on video analysis |
CN103413330A (en) * | 2013-08-30 | 2013-11-27 | 中国科学院自动化研究所 | Method for reliably generating video abstraction in complex scene |
US8908921B2 (en) * | 2010-11-29 | 2014-12-09 | Kyushu Institute Of Technology | Object detection method and object detector using the method |
CN104239852A (en) * | 2014-08-25 | 2014-12-24 | 中国人民解放军第二炮兵工程大学 | Infrared pedestrian detecting method based on motion platform |
-
2016
- 2016-01-29 CN CN201610066022.7A patent/CN107025458B/en not_active Expired - Fee Related
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8908921B2 (en) * | 2010-11-29 | 2014-12-09 | Kyushu Institute Of Technology | Object detection method and object detector using the method |
CN103400157A (en) * | 2013-07-23 | 2013-11-20 | 青岛海信网络科技股份有限公司 | Road pedestrian and non-motor vehicle detection method based on video analysis |
CN103413330A (en) * | 2013-08-30 | 2013-11-27 | 中国科学院自动化研究所 | Method for reliably generating video abstraction in complex scene |
CN104239852A (en) * | 2014-08-25 | 2014-12-24 | 中国人民解放军第二炮兵工程大学 | Infrared pedestrian detecting method based on motion platform |
Non-Patent Citations (1)
Title |
---|
一种基于计算机视觉的行人流量统计方法;肖 江 等;《信息技术》;20150825;22-25页 |
Also Published As
Publication number | Publication date |
---|---|
CN107025458A (en) | 2017-08-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Bautista et al. | Convolutional neural network for vehicle detection in low resolution traffic videos | |
CN105844234B (en) | Method and equipment for counting people based on head and shoulder detection | |
Mithun et al. | Detection and classification of vehicles from video using multiple time-spatial images | |
CN104978567B (en) | Vehicle checking method based on scene classification | |
CN107330390B (en) | People counting method based on image analysis and deep learning | |
CN109918971B (en) | Method and device for detecting number of people in monitoring video | |
CN107491720A (en) | A kind of model recognizing method based on modified convolutional neural networks | |
CN106886778B (en) | License plate character segmentation and recognition method in monitoring scene | |
CN107886507B (en) | A kind of salient region detecting method based on image background and spatial position | |
CN105069816B (en) | A kind of method and system of inlet and outlet people flow rate statistical | |
CN111915583B (en) | Vehicle and pedestrian detection method based on vehicle-mounted thermal infrared imager in complex scene | |
Saran et al. | Traffic video surveillance: Vehicle detection and classification | |
CN113516853B (en) | Multi-lane traffic flow detection method for complex monitoring scene | |
CN110163822A (en) | The netted analyte detection and minimizing technology and system cut based on super-pixel segmentation and figure | |
CN112580447B (en) | Edge second-order statistics and fusion-based power line detection method | |
Rabiu | Vehicle detection and classification for cluttered urban intersection | |
CN105809716A (en) | Superpixel and three-dimensional self-organizing background subtraction algorithm-combined foreground extraction method | |
CN109063630B (en) | Rapid vehicle detection method based on separable convolution technology and frame difference compensation strategy | |
Su et al. | A new local-main-gradient-orientation HOG and contour differences based algorithm for object classification | |
CN104299007A (en) | Classifier training method for behavior recognition | |
CN104239908A (en) | Intelligent ridership automatic statistical method based on self-adaptive threshold value | |
CN107301421A (en) | The recognition methods of vehicle color and device | |
CN104200455B (en) | A kind of key poses extracting method based on movement statistics signature analysis | |
CN106446832B (en) | Video-based pedestrian real-time detection method | |
KR20080079443A (en) | Method and apparatus for extracting object from image |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
CB02 | Change of applicant information | ||
CB02 | Change of applicant information |
Address after: 518000 4th Floor of Building W1A, No. 034 High-tech Industrial Village, Nanshan District, Shenzhen City, Guangdong Province Applicant after: SHENZHEN ZNV TECHNOLOGY Co.,Ltd. Address before: 518000 4th Floor of Building W1A, No. 034 High-tech Industrial Village, Nanshan District, Shenzhen City, Guangdong Province Applicant before: SHENZHEN ZNV TECHNOLOGY Co.,Ltd. |
|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20190830 |