Method for detecting human face and device
Technical field
The present invention relates to image technique field, particularly relate to a kind of method for detecting human face and device.
Background technology
Recognition of face (Face Recognition) refers in particular to utilize com-parison and analysis face visual signature information to carry out identity mirror
Other computer technology, is the emphasis of current artificial intelligence and pattern recognition, is widely used in national security, military peace
The fields such as the monitoring of entirely, identification, bank and customs, gate control system, video conference.
Face datection (Face Detection) is the key link in recognition of face, and Face datection refers to for any one
Secondary given image, uses certain strategy to scan for determining whether containing face to it, if it is returns people
The position of face, size and attitude.
According to the difference of the face knowledge utilized, method for detecting human face can be divided into: the method for detecting human face of feature based
With method for detecting human face based on study.The method for detecting human face of feature based includes: low-level image feature analyzes method, group feature
Method and deforming template method, low-level image feature is analyzed method and is included again method for detecting human face based on the colour of skin.People based on study
Face detecting method can be divided into according to the difference of learning method: method based on bayesian criterion, based on artificial neural network
Method (ANN, artificial neural network), method (SVM, the support vector of support vector machine
Machine), method based on Adaboost etc..
According to the colouring information of pixel, method for detecting human face based on the colour of skin mainly detects whether pixel belongs to skin
Color, carries out skin color segmentation from substantial amounts of scenery, and looks for by skin pixel point in image is carried out cluster analysis image
To possible human face region.It does not relies on the minutia of face, for rotating, the expression situation such as change have relative steady
Qualitative, and can distinguish with the color of most of background objects.But method for detecting human face based on the colour of skin is solid owing to depending on
Fixed priori pattern, therefore adapts to ability poor, when image is by illumination effect, for environment or the colour cast face of colour cast
Verification and measurement ratio is low, and Detection results is poor, and the most even inspection does not measures face.Additionally, method for detecting human face based on the colour of skin is also easily subject to
Noise and the various impact blocked, and then affect final Detection results.
Method for detecting human face based on Adaboost, its basic thought is that same training set is used different features,
Train different Weak Classifiers, one strong classifier of the composition that then combined by these Weak Classifiers.This method is not easily susceptible to
The impact of color, but false drop rate is high.In order to reduction false drop rate, it usually needs gather substantial amounts of training sample, carry out tight
The training of lattice, extracts more rectangular characteristic parameter, and then adds the complexity of calculating.For mini-plant, such as: hands
Holding equipment, due to the restriction of equipment own resource so that this method is less useful on mini-plant the face in detection image, right
For the handheld device of low side, this method even cannot be used for detecting in low side devices the face in image.
Therefore it provides the lowest method for detecting human face of a kind of complexity, false drop rate and loss becomes the most urgently to be resolved hurrily
One of problem.
Other about the correlation technique of Face datection referring also to Publication No. US2006072811A1, invention entitled
The U.S. Patent application of Face datection (Face detection).
Summary of the invention
The problem that the present invention solves is to provide the lowest method for detecting human face of a kind of complexity, false drop rate and loss and dress
Put.
In order to solve the problems referred to above, the present invention provides a kind of method for detecting human face, including:
Face datection algorithm is utilized to obtain the multiple regional frames in image;
The plurality of regional frame is carried out cluster analysis, to obtain at least one cluster areas;
Add up the number of regional frame in each cluster areas, determine the number cluster areas more than first threshold of regional frame
For human face region.
Optionally, described method for detecting human face, also include:
Number based on regional frame determines people less than first threshold and more than the features of skin colors of the cluster areas of Second Threshold
Face region.
Optionally, described number based on regional frame is less than first threshold and the colour of skin of the cluster areas more than Second Threshold
Feature determines that human face region includes:
Skin color detection algorithm is utilized to detect the skin pixel point of described cluster areas;
When in the number of described skin pixel point is than described cluster areas, the value of the number of pixel is more than three threshold values,
Determine that described cluster areas is human face region.
Optionally, described number based on regional frame is less than first threshold and the colour of skin of the cluster areas more than Second Threshold
Feature determines that human face region includes:
Skin color detection algorithm is utilized to detect the skin pixel point of any region frame in described cluster areas;
In the number of described skin pixel point is than described any region frame, the value of the number of pixel is more than the 4th threshold value
Time, determine that described cluster areas is human face region.
Optionally, described number based on regional frame is less than first threshold and the colour of skin of the cluster areas more than Second Threshold
Feature determines that human face region includes:
Skin color detection algorithm is utilized to detect the skin pixel point of the predeterminable area of any region frame in described cluster areas;
Number at described skin pixel point is more than the 5th threshold value than the value of the number of the pixel in described predeterminable area
Time, determine that described cluster areas is human face region.
Optionally, described regional frame is rectangle frame, and described predeterminable area is determined by following manner:
Width ∈ 0.25W~1W, height ∈ 0.25H~1H;
Wherein, width is the width of described predeterminable area, and height is the height of described predeterminable area, and W is described rectangle frame
Width, H is the height of described rectangle frame.
Optionally, described method for detecting human face, also comprise determining that the number cluster areas less than Second Threshold of regional frame
For non-face region.
Optionally, described first threshold is the integer between [10,40].
Optionally, described Second Threshold is the integer between [5,8].
Optionally, the span of described 3rd threshold value is [0.3~0.8].
Optionally, described skin color detection algorithm is the skin color detection algorithm based on Gauss model or Bayesian model.
Optionally, described method for detecting human face, also include: before the number of the regional frame in adding up each cluster areas, go
Except described cluster areas meets pre-conditioned regional frame.
Optionally, described pre-conditioned it is: the distance ratio at the center at the center of described regional frame to cluster areas is described
The value of the width of regional frame is less than distance threshold.
Optionally, described regional frame is rectangle frame, and described distance threshold is in the range of [0.5W, W], and wherein W is described square
The width of shape frame.
Optionally, described Face datection algorithm and skin color detection algorithm are carried out at different color spaces.
Optionally, described Face datection algorithm is adaboost algorithm.
For solving the problems referred to above, the present invention also provides for a kind of human face detection device, including:
Acquiring unit, for utilizing Face datection algorithm to obtain the multiple regional frames in image;
Cluster analysis unit, for carrying out cluster analysis to the plurality of regional frame, to obtain at least one cluster areas;
Statistic unit, for adding up the number of the regional frame in each cluster areas;
First determines unit, is human face region for determining that the number of regional frame is more than the cluster areas of first threshold.
Compared with prior art, technical scheme has the advantage that
The multiple regional frames obtained by Face datection algorithm are carried out cluster analysis, adds up regional frame in each cluster areas
Number, detect human face region with this, for method for detecting human face based on the colour of skin, due to it by illumination effect relatively
Little, therefore loss is low;For method for detecting human face based on Adaboost, due to nothing during the training of detector
Substantial amounts of sample need to be gathered, therefore reduce the complexity of Face datection;Further, after using Face datection algorithm to obtain regional frame,
First carry out cluster analysis, then the regional frame number in cluster areas is added up, also reduce the false drop rate of Face datection.
When number at the regional frame of cluster areas is less than first threshold and is more than Second Threshold, based on described cluster areas
Features of skin colors determine human face region, calculate compared to method for detecting human face based on the colour of skin and Face datection based on Adaboost
Method, is added up by the regional frame number combining cluster areas and skin color detection algorithm carries out Face datection, reduce further people
The loss of face detection and false drop rate.
Accompanying drawing explanation
Fig. 1 is the schematic flow sheet of the method for detecting human face of the embodiment of the present invention one;
Fig. 2 is the distribution signal being probably human face region that the employing Adaboost algorithm of the embodiment of the present invention one detects
Figure;
Fig. 3 is the relation schematic diagram between picture number and the rectangle frame of the embodiment of the present invention one;
Fig. 4 is the structural representation of the human face detection device of the embodiment of the present invention one;
Fig. 5 is the schematic flow sheet of the method for detecting human face of the embodiment of the present invention two;
Fig. 6 be the predeterminable area of the embodiment of the present invention two choose schematic diagram;
Fig. 7 is the structural representation of the human face detection device of the embodiment of the present invention two.
Detailed description of the invention
Understandable, below in conjunction with the accompanying drawings to the present invention for enabling the above-mentioned purpose of the present invention, feature and advantage to become apparent from
Detailed description of the invention be described in detail.
Elaborate detail in the following description so that fully understanding the present invention.But the present invention can with multiple not
Being same as alternate manner described here to implement, those skilled in the art can do class in the case of intension of the present invention
Like promoting.Therefore the present invention is not limited by following public detailed description of the invention.
Existing Face datection algorithm based on the colour of skin is easily subject to illumination effect, therefore relatively low to the verification and measurement ratio of face,
And although method for detecting human face based on Adaboost can obtain the strong classifier of cascade with accurately by strict training
Ground detection face, but during training strong classifier, computation complexity is higher, is not suitable for examining the image in mini-plant
Survey.
Inventor considers whether can accurately completely examine face on the premise of not increasing computation complexity
Surveying, inventor finds through long-term research, when using Face datection algorithm detection image, will detect that multiple regional frame,
After multiple regional frames are carried out cluster analysis, different cluster areas can be obtained, and the number of regional frame in each cluster areas
Detection with human face region has close relationship.
Therefore, inventor proposes, by the judgement of the number of the regional frame of cluster areas is detected human face region.
Embodiment one
Fig. 1 is the schematic flow sheet of the method for detecting human face of the embodiment of the present invention one, as it is shown in figure 1, described Face datection
Method includes:
Step S11: utilize Face datection algorithm to obtain the multiple regional frames in image;
Step S12: the plurality of regional frame is carried out cluster analysis, to obtain at least one cluster areas;
Step S13: add up the number of regional frame in each cluster areas, determines that the number of regional frame is more than first threshold
Cluster areas is human face region.
Perform step S11, this step can be applied existing human face detection tech obtain the multiple regional frames in image,
As: can use algorithm based on bayesian criterion, algorithm based on artificial neural network, the algorithm of support vector machine or
Image is detected by Adaboost algorithm, obtains the multiple regional frames in image.In the present embodiment, to use Adaboost
Algorithm illustrates as a example by detecting image.
Image is detected actual referring to and forms strong classification by Adaboost algorithm by described employing Adaboost algorithm
Device, utilizes described strong classifier to detect image.In general, can include that face is just by collection is a number of
Sample and do not include the negative sample of face, forms sample training collection.For different sample training collection training Weak Classifiers, then
The weak classifier set that these are obtained in different training sets, constitutes a strong classifier.Described different sample instruction
Practicing collection is the weight realization corresponding by adjusting each sample.
During initially starting training, the weight that each sample (including positive sample and negative sample) is corresponding is identical, at this sample
One's duty plants and trains a Weak Classifier h1(x).For h1X sample that () is wrong point, then increase the weight of its correspondence;And for
h1X the sample of () correctly classification, then reduce its weight.The sample making wrong point highlights, and obtains new sample distribution.With
Time, give h according to the situation that mistake is divided1X () weight, represents the significance level of this Weak Classifier, mistake gets the fewest weight more
Greatly.Under new sample distribution, again to Weak Classifier h1X () is trained, obtain Weak Classifier h2(x) and weight thereof.Successively
Analogize, through T circulation, just obtained T Weak Classifier, and the weight that T Weak Classifier is corresponding.Finally weak this T
Grader adds up by its corresponding weight and has just obtained strong classifier.Form strong classifier and be referred to prior art
Adaboost algorithm is utilized to form the detailed process of strong classifier.
In this step, when using Adaboost algorithm training strong classifier, in order to reduce computation complexity, during training
The quantity of training sample, the extraction of training parameter can be carried out suitable choosing.Obtain strong by Adaboost algorithm training
After grader, utilize described strong classifier that image is detected.
In addition, it is necessary to explanation, when using Adaboost algorithm that face is detected, it is to carry out at gray space
, therefore, if image to be detected is coloured image, before obtaining the regional frame in image to be detected by Adaboost algorithm,
First image to be detected should be changed to gray space.
For using the strong classifier that Adaboost algorithm is formed, during detection, strong classifier (detector) is usually square
Shape window, detector is to detect according to pixel level line slip in image to be detected.Therefore, can detect in the place having face
Go out multiple rectangle frame (rectangle frame size is indefinite).
Fig. 2 is the distribution signal being probably human face region that the employing Adaboost algorithm of the embodiment of the present invention one detects
Figure, for convenience of description, only gives the regional frame corresponding to a face in Fig. 2.For the multiple faces in piece image
For, situation similar to that shown in Fig. 2 all should occur at each face.
As in figure 2 it is shown, the actually corresponding face of multiple rectangle frames of detecting of detector, it may also be said to these are multiple
What rectangle frame was actually corresponding is the same area.Therefore, need to carry out cluster analysis merging to this situation.To the square detected
Shape frame is merged by clustering algorithm, to obtain corresponding cluster areas.Such as: can by the rectangle frame that detects by
Merging according to its center, namely the rectangle frame that center is assembled is merged into a rectangular area, described rectangular area is
The cluster areas obtained after carrying out cluster analysis, the length of described cluster areas and width can be taken at respectively and merge rectangle frame
During, the maximum of rectangle frame length and the maximum of rectangle frame width, the center of described rectangular area is cluster areas
Center.In actual applications, specifically use which kind of clustering algorithm that multiple rectangle frames carry out cluster analysis and merge to be formed poly-
Class region, depending on actual demand.
Perform step S12, the multiple rectangle frames obtained are carried out cluster analysis, it is thus achieved that N number of cluster areas (N in step S11
, namely N number of candidate face region >=1).And for N number of cluster areas, it is all to be clustered by least one rectangle frame
Analyze and merge acquisition, for each cluster areas, all contain at least one rectangle frame in other words.
In the present embodiment, in order to prevent from cluster process occurs deviation, also include the square having carried out cluster analysis
Shape frame detects, and detects the rectangle frame in cluster areas in other words, to remove ineligible rectangle frame.Specifically
Ground, it is simply that the center of calculating rectangle frame, to distance d (seeing Fig. 2) of the center c of cluster areas, is unsatisfactory for following public affairs at described d
During formula, this rectangle frame is picked out cluster areas.
Wherein, WiFor the width of i-th rectangle frame in cluster areas, rec_ratio is distance threshold.In the present embodiment
Rec_ratio takes 0.5Wi~WiBetween.
Perform step S13, the rectangle frame in the N number of cluster areas (candidate face region) obtained in step S12 is carried out
Statistics, detects human face region by the number of the rectangle frame of statistics.Inventor has carried out substantial amounts of experiment, acquires substantial amounts of
Image also performs step S11 and S12 respectively, finds when the cluster areas obtained is human face region, the rectangle of this cluster areas
The number of frame meets some requirements, it is thus achieved that detect the confidence district of face according to the number of the rectangle frame in Statistical Clustering Analysis region
Between.Specifically, it is simply that the number of the rectangle frame of cluster areas more than first threshold time, it is thus achieved that cluster areas be human face region.
Described first threshold is associated with the target detection rate of Face datection algorithm, and described target detection rate includes: target detection correct
Rate, the loss of target detection and the false drop rate of target detection.
Fig. 3 is the relation schematic diagram between picture number and the rectangle frame of the embodiment of the present invention one.As it is shown on figure 3, in figure
Abscissa represents the number of the rectangle frame of cluster areas, and vertical coordinate represents the number of the image of collection.As it is shown on figure 3, this
In embodiment, in the image collected, when human face region being detected, the number of rectangle frame is all higher than 1.In other words at the present embodiment
In, do not appear in the situation of human face region only one of which rectangle frame.When cluster areas is human face region, rectangle in cluster areas
The number of frame is that the image of 2 has 139 width;When cluster areas is human face region, in cluster areas, the number of rectangle frame is 4
Image has 78 width;When cluster areas is human face region, in cluster areas, the number of rectangle frame is that the image of 15 has 162
Width;......;When cluster areas is human face region, in cluster areas, the number of rectangle frame is that the image of 20 has 173
Width;......;When cluster areas is human face region, in cluster areas, the number of rectangle frame is that the image of 25 has 186 width;Cluster
When region is human face region, in cluster areas, the number of rectangle frame is that the image of 30 has 151 width;......;When collect
The number of the rectangle frame of the cluster areas in image is when the high confidence interval shown in Fig. 3, and described cluster areas is human face region.
Described first threshold is the integer between [10,40], and in the present embodiment, described first threshold takes 10.By to cluster areas
The number of rectangle frame is added up, and can detect the position of face soon.
Corresponding to above-mentioned method for detecting human face, the present embodiment also provides for a kind of human face detection device, and Fig. 4 is that the present invention is real
Executing the structural representation of the human face detection device of example one, as shown in Figure 4, described human face detection device includes:
Acquiring unit 101, for utilizing Face datection algorithm to obtain the multiple regional frames in image.
Cluster analysis unit 102, is connected with described acquiring unit 101, for the plurality of regional frame carries out cluster point
Analysis, to obtain at least one cluster areas.
Statistic unit 103, is connected with described cluster analysis unit 102, for adding up regional frame in each cluster areas
Number.
First determines unit 104, is connected with described statistic unit 103, for determining that the number of regional frame is more than the first threshold
The cluster areas of value is human face region.
In the present embodiment, described Face datection algorithm can be Adaboost algorithm, and described first threshold is [10~40]
Between integer.
In the present embodiment, described human face detection device also includes: removal unit (not shown), in described statistics
Before unit 103 adds up the number of the regional frame in each cluster areas, remove and described cluster areas meets pre-conditioned region
Frame.Described pre-conditioned it is: the distance at center at the center of described regional frame to cluster areas is than the width of described regional frame
Value less than distance threshold.Regional frame described in the present embodiment is rectangle frame, described distance threshold in the range of [0.5W, W], its
Middle W is the width of described rectangle frame.
In the present embodiment, the work process of described human face detection device may refer to above-mentioned method for detecting human face and carries out,
Here is omitted.
Embodiment two
In embodiment one, give when the number of the regional frame of cluster areas is more than first threshold, determine this cluster district
Territory is human face region.During actual detection, it is also possible to occur that the number of the regional frame of cluster areas is unsatisfactory for more than the
The situation of one threshold value, when the present embodiment is unsatisfactory for the situation in embodiment one to the number of the regional frame of cluster areas, the most really
Determine whether cluster areas is that human face region illustrates.
Fig. 5 is the schematic flow sheet of the method for detecting human face of the embodiment of the present invention two, as it is shown in figure 5, described Face datection
Method includes:
Step S 11: utilize Face datection algorithm to obtain the multiple regional frames in image;
Step S12: the plurality of regional frame is carried out cluster analysis, to obtain at least one cluster areas;
Step S13: add up the number of regional frame in each cluster areas, determines that the number of regional frame is more than first threshold
Cluster areas is human face region;
Step S14: number based on regional frame is less than first threshold and the colour of skin spy of the cluster areas more than Second Threshold
Levy and determine human face region;
Step S15: determining that the number of regional frame is less than the cluster areas of Second Threshold is non-face region.
In the present embodiment, step S11~S13 are similar with embodiment one, so place is no longer described in detail.
Continuing with seeing Fig. 3, the transition shown in Fig. 3 is interval, is the number of regional frame in the cluster areas detected
Less than first threshold and more than the situation of Second Threshold, described Second Threshold is associated with the target detection rate of Face datection algorithm,
Described Second Threshold is the integer between [5~8], and in the present embodiment, described Second Threshold takes 5.Rectangle for cluster areas
For the number of frame is in the cluster areas that transition is interval, utilize the features of skin colors of this cluster areas to determine human face region.
Specifically, step S14 includes:
Step S141: utilize skin color detection algorithm to detect the colour of skin of the predeterminable area of any region frame in described cluster areas
Pixel;
Step S142: the number at described skin pixel point is more than than the value of the number of the pixel in described predeterminable area
During five threshold values, determine that described cluster areas is human face region.
Perform step S141, due at least one rectangle frame corresponding of the cluster areas after cluster analysis, therefore, profit
The skin pixel point of the predeterminable area of arbitrary rectangle frame in described cluster areas is detected with skin color detection algorithm.
Fig. 6 is the schematic diagram of choosing of the predeterminable area of the embodiment of the present invention two, and described predeterminable area is rectangle, described default
The wide width in region is between 0.25W~1W, and W is the width (unit is pixel) of rectangle frame, the height of described predeterminable area
Height is between 0.25H~1H, and H is the height (unit is pixel) of rectangle frame.
In general, for the human face region structure of rectangle, vertically it equally spaced can be divided into three
Individual region, wherein eyes and eyebrow are usually located at 1/3 region that rectangular area is top;Face is usually located at rectangular area on the lower
1/3 region, nose is then positioned at remaining 1/3 region being in centre.Owing to the present embodiment being detect based on features of skin colors
Human face region, and the features of skin colors of eyes, eyebrow and face region is inconspicuous, therefore, for human face region to be detected
For (rectangular area), described predeterminable area choose the impact that should as far as possible avoid eyes eyebrow and face, choose described rectangle
The zone line (containing nosed region) in region.In the present embodiment, described predeterminable area choose as shown in Figure 6, described
Predeterminable area is centrally located at the center of rectangle frame, the width of described predeterminable area
The height of described predeterminable area
After selected predeterminable area, the skin pixel of predeterminable area described in existing Face Detection technology for detection can be applied
Point: the skin pixel point of predeterminable area as described in skin color detection algorithm based on Gauss model detection can be used, it is also possible to adopt
Detect the skin pixel point of described predeterminable area with skin color detection algorithm based on Bayesian model, and use skin color detection algorithm
During detection skin pixel point, the space at image place can be other color spaces such as YCbCr space, yuv space, YIQ space
In any one.The concrete skin pixel point using skin color detection algorithm based on which kind of model to detect described predeterminable area,
Depending on practical situation.
Performing step S142, the number of statistics skin pixel point, the number ratio at the skin pixel point of predeterminable area is preset
When the value of the number of all pixels in region is more than five threshold values, determine that described cluster areas is human face region.That is:
Wherein, count is the number of the skin pixel point of predeterminable area, and weight × height is the picture in predeterminable area
The number of vegetarian refreshments, limit_ratio is the 5th threshold value.
Depending on described 5th threshold value is by testing, the 5th threshold value described in the present embodiment in the range of [0.5~1), e.g., described
5th threshold value can take 0.5,0.6,0.7 etc..
In another embodiment, number of based on regional frame is less than first threshold and more than the cluster areas of Second Threshold
Features of skin colors determines that human face region is the skin pixel point by detecting cluster areas, and by the skin pixel point in cluster areas
It is compared to carry out with the pixel in whole cluster areas, specifically, including:
Skin color detection algorithm is utilized to detect the skin pixel point of described cluster areas;
When in the number of described skin pixel point is than described cluster areas, the value of the number of pixel is more than three threshold values,
Determine that described cluster areas is human face region.
Depending on described 3rd threshold value is by testing, in the present embodiment, the span of described 3rd threshold value is [0.3,0.8].
As, described 3rd threshold value can take 0.3,0.4,0.5 etc..
In another embodiment, number of based on regional frame is less than first threshold and more than the cluster areas of Second Threshold
Features of skin colors determines that human face region is the skin pixel point number by detecting any region frame in described cluster areas, and will
Described skin pixel point number is compared to carry out with the pixel number in this regional frame, specifically, and including:
Skin color detection algorithm is utilized to detect the skin pixel point of any region frame in described cluster areas;
In the number of described skin pixel point is than described any region frame, the value of the number of pixel is more than the 4th threshold value
Time, determine that described cluster areas is human face region.
Depending on described 4th threshold value is by testing, in the present embodiment, the span of described 4th threshold value be [0.5~1),
As, described 4th threshold value can take 0.5,0.6,0.7,0.8 etc..
When the number of regional frame in the cluster areas detected is less than Second Threshold, i.e. square shown in Fig. 3
When the number of shape frame is positioned at low confidence interval, determine that this cluster areas is non-face region.
It should be noted that in the present embodiment, it is the number of rectangle frame by Statistical Clustering Analysis region, and to rectangle frame
Number carries out classification and obtains some confidence intervals.But Fig. 3 simply show a kind of dividing mode of confidence interval, i.e. according to square
The number of shape frame marks off three confidence intervals, when the number of the rectangle frame adding up a certain cluster areas belongs to high confidence interval
Time, it is determined that this cluster areas is human face region.When the number of the rectangle frame adding up a certain cluster areas belongs to low confidence interval
Time, it is determined that this cluster areas is non-face region.When the number of the rectangle frame adding up a certain cluster areas belongs to transition interval
Time, then to determine whether this cluster areas is human face region further combined with skin color detection algorithm.When practice, confidence
Interval division is not limited solely to shown in Fig. 3, and e.g., confidence interval can be divided into 2,4,5 etc., the most how to divide
Depending on reasonably confidence interval can be by testing the data sample collected.Therefore, the division of confidence interval should not
As the restriction to technical solution of the present invention.
Corresponding to above-mentioned method for detecting human face, the embodiment of the present invention also provides for a kind of human face detection device, and Fig. 7 is this
The structural representation of the human face detection device of bright embodiment two, as it is shown in fig. 7, described human face detection device includes:
Acquiring unit 101, for utilizing Face datection algorithm to obtain the multiple regional frames in image.
Cluster analysis unit 102, is connected with described acquiring unit 101, for the plurality of regional frame carries out cluster point
Analysis, to obtain at least one cluster areas.
Statistic unit 103, is connected with described cluster analysis unit 102, for adding up regional frame in each cluster areas
Number.
First determines unit 104, is connected with described statistic unit 103, for determining that the number of regional frame is more than the first threshold
The cluster areas of value is human face region.
Second determines unit 105, is connected with described statistic unit 103, for number based on regional frame less than the first threshold
Value and determine human face region more than the features of skin colors of cluster areas of Second Threshold.
3rd determines unit 106, is connected with described statistic unit 103, for determining that the number of regional frame is less than the second threshold
The cluster areas of value is non-face region.
Second Threshold described in the present embodiment is the integer between [5~8], and described second determines that unit 105 includes:
3rd detector unit (not shown), is used for utilizing skin color detection algorithm to detect arbitrary district in described cluster areas
The skin pixel point of the predeterminable area of territory frame.
3rd determines subelement (not shown), at the number ratio of described skin pixel point in described predeterminable area
Pixel number value more than five threshold values time, determine that described cluster areas is human face region.
Described skin color detection algorithm is the skin color detection algorithm based on Gauss model or Bayesian model.Described 5th threshold value
By test depending on, the span of the 5th threshold value described in the present embodiment be [0.5~1), e.g., described 5th threshold value can take
0.5,0.6,0.7 etc..
In another embodiment, described second determines that unit includes:
First detector unit, utilizes skin color detection algorithm to detect the skin pixel point of described cluster areas;
First determines subelement, for the number of pixel in the number of described skin pixel point is than described cluster areas
Value more than three threshold values time, determine that described cluster areas is human face region.
Depending on described 3rd threshold value is by testing, in the present embodiment, the span of described 3rd threshold value is [0.3,0.8].
As, described 3rd threshold value can take 0.3,0.4,0.5 etc..
In another embodiment, described second determines that unit includes:
Second detector unit, utilizes skin color detection algorithm to detect the skin pixel of any region frame in described cluster areas
Point;
Second determines subelement, for pixel in the number of described skin pixel point is than described any region frame
When the value of number is more than four threshold values, determine that described cluster areas is human face region.
Depending on described 4th threshold value is by testing, in the present embodiment, the span of described 4th threshold value be [0.5~1),
As, described 4th threshold value can take 0.5,0.6,0.7,0.8 etc..
The work process of human face detection device described in the present embodiment, may refer to above-mentioned method for detecting human face and carries out,
The most reinflated concrete detailed description.
In sum, technical scheme at least has the advantages that
The multiple regional frames obtained by Face datection algorithm are carried out cluster analysis, adds up regional frame in each cluster areas
Number, detect human face region with this, for method for detecting human face based on the colour of skin, due to it by illumination effect relatively
Little, therefore loss is low;For method for detecting human face based on Adaboost, due to nothing during the training of detector
Substantial amounts of sample need to be gathered, therefore reduce the complexity of Face datection;Further, after using Face datection algorithm to obtain regional frame,
First carry out cluster analysis, then the regional frame number in cluster areas is added up, also reduce the false drop rate of Face datection.
When number at the regional frame of cluster areas is less than first threshold and is more than Second Threshold, based on described cluster areas
Features of skin colors determine human face region, calculate compared to method for detecting human face based on the colour of skin and Face datection based on Adaboost
Method, is added up by the regional frame number combining cluster areas and skin color detection algorithm carries out Face datection, reduce further people
The loss of face detection and false drop rate.
During detection skin pixel point, the skin pixel point of described cluster areas can be detected, it is also possible to detect described cluster
The skin pixel point of any region frame in region, it is also possible to detect the skin of the predeterminable area of any region frame in described cluster areas
Colour vegetarian refreshments, and then utilize skin pixel point to determine human face region, therefore there is the biggest motility.
Although the present invention is open as above with preferred embodiment, but it is not for limiting the present invention, any this area
Technical staff without departing from the spirit and scope of the present invention, may be by the method for the disclosure above and technology contents to this
Bright technical scheme makes possible variation and amendment, therefore, every content without departing from technical solution of the present invention, according to the present invention
Technical spirit any simple modification, equivalent variations and modification that above example is made, belong to technical solution of the present invention
Protection domain.