Summary of the invention
Embodiment of the invention technical matters to be solved is, a kind of method of people's face detection and the device that a kind of people's face detects are provided, and makes people's face detect and have higher detection rate and less false drop rate to have detection speed faster simultaneously.
In order to solve the problems of the technologies described above, the method that the embodiment of the invention provides a kind of people's face to detect comprises:
Image to obtaining carries out the LBP feature calculation, obtains the LBP characteristic pattern;
Utilization is differentiated said LBP characteristic pattern based on the good AdaBoost sorter of LBP features training, obtains the first face area data;
Said the first face area data is asked for the Haar characteristic, obtain the Haar characteristic pattern, utilize and said Haar characteristic pattern is differentiated, obtain the second human face region data based on the good AdaBoost sorter of Haar features training;
The said second human face region data are carried out cluster, overlapping human face region is merged, obtain four-player face area data;
Export the human face region in the said image.
Wherein, obtain also comprising after the second human face region data:
The said second human face region data are carried out multiple dimensioned LBP feature calculation, obtain multiple dimensioned LBP characteristic pattern;
Utilization is differentiated said multiple dimensioned LBP characteristic pattern based on the good AdaBoost sorter of multiple dimensioned LBP features training, obtains third party's face area data;
Said the said second human face region data are carried out cluster; Overlapping human face region is merged; The step that obtains four-player face area data is specially: said third party's face area data is carried out cluster, overlapping human face region is merged, obtain four-player face area data.
Wherein, said the image that obtains is carried out the LBP feature calculation, obtain the LBP characteristic pattern; Utilize the AdaBoost sorter that said LBP characteristic pattern is differentiated, the step that obtains the first face area data comprises:
Zoom factor according to preset carries out convergent-divergent to the image that obtains;
Judge that whether scaled images is less than preset pixel window port area;
When judged result for not the time; Scaled images is carried out the LBP feature calculation; With said pixel window port area the LBP characteristic pattern that obtains is scanned then; And the pixel window that each scans used based on the good AdaBoost sorter of LBP features training differentiate, preserve the first face area data that obtains; Continue the convergent-divergent present image according to said zoom factor, repeat said step of scaled images being carried out the LBP feature calculation.
Wherein, the said Haar of utilization characteristic is differentiated said the first face area data, and the step that obtains the second human face region data comprises:
Calculate the integrogram and square integrogram of the said image that obtains;
From said the first face area data, take out the candidate face zone successively;
Yardstick according to said candidate face zone is adjusted the yardstick based on the good sorter of Haar features training, differentiates whether the said candidate face zone of taking out is human face region;
The human face region that preservation is differentiated out obtains the second human face region data.
Wherein, said the said second human face region data are carried out multiple dimensioned LBP feature calculation, the step that obtains multiple dimensioned LBP characteristic pattern comprises:
Image is carried out in candidate face zone in the said second human face region data dwindle, shorten the size of training sample into;
Multiple dimensioned LBP feature calculation is carried out in candidate face zone to shortening the training sample size into; The current central pixel point of said multiple dimensioned LBP characteristic is replaced by the central area of preset yardstick, and the single pixel of said central pixel point eight neighborhoods is replaced by eight adjacent areas of said central area; Utilize the mean value of said central area pixel value and the mean value of each adjacent area pixel value to participate in said multiple dimensioned LBP feature calculation.
Wherein, said four-player face area data people's face testing result data that are current frame image; After obtaining four-player face area data, also comprise:
According to people's face testing result data of current frame image and people's face testing result data of previous frame image, the area that overlaps of current frame image human face region and previous frame image human face region relatively;
When said coincidence area reaches preset threshold value, then carry out current frame image human face region and previous frame image human face region related, as the face tracking result of present frame;
When previous frame image human face region exist can't be corresponding with the current frame image human face region human face region the time, then this human face region to previous frame carries out the detection of people's face again;
When there be not the human face region corresponding with previous frame image human face region in the human face region of current frame image, then with people's face testing result of current frame image as new face tracking result.
Correspondingly, the embodiment of the invention also discloses the device that a kind of people's face detects, comprising:
LBP feature calculation module is used for the image that obtains is carried out the LBP feature calculation, obtains the LBP characteristic pattern;
First discrimination module is used to utilize based on the good AdaBoost sorter of LBP features training said LBP characteristic pattern is differentiated, and obtains the first face area data;
Second discrimination module is used for said the first face area data is asked for the Haar characteristic, obtains the Haar characteristic pattern, utilizes and based on the good AdaBoost sorter of Haar features training said Haar characteristic pattern is differentiated, and obtains the second human face region data;
Cluster merges module, is used for the said second human face region data are carried out cluster, and overlapping human face region is merged, and obtains four-player face area data;
Output module is used for exporting the human face region of said image.
Wherein, the device of said people's face detection also comprises:
Multiple dimensioned LBP feature calculation module is used for the said second human face region data are carried out multiple dimensioned LBP feature calculation, obtains multiple dimensioned LBP characteristic pattern;
The 3rd discrimination module is used to utilize based on the good AdaBoost sorter of multiple dimensioned LBP features training said multiple dimensioned LBP characteristic pattern is differentiated, and obtains third party's face area data;
Said cluster merges module and specifically is used for said third party's face area data is carried out cluster, and overlapping human face region is merged, and obtains four-player face area data.
Wherein, said LBP feature calculation module comprises:
The image zoom unit is used for according to preset zoom factor the image that obtains being carried out convergent-divergent;
Judging unit is used to judge that whether scaled images is less than preset pixel window port area;
The judgment processing unit, be used for when the judged result of said judging unit for not the time, then scaled images is carried out the LBP feature calculation, trigger said first discrimination module then to differentiate; Continue the convergent-divergent present image according to said zoom factor then, trigger said judging unit and repeat and saidly judge that scaled images is whether less than the step of preset pixel window port area;
Said first discrimination module specifically is used for said pixel window port area the LBP characteristic pattern that obtains being scanned; And the pixel window that each scans used based on the good AdaBoost sorter of LBP features training differentiate, preserve the first face area data that obtains.
Wherein, said second discrimination module comprises:
Computing unit is used to calculate the integrogram and square integrogram of the said image that obtains;
The zone retrieval unit is used for taking out the candidate face zone successively from said the first face area data,
The adjustment judgement unit is used for adjusting the yardstick based on the good sorter of Haar features training according to the yardstick in said candidate face zone, differentiates whether the said candidate face zone of taking out is human face region;
Preserve the unit, be used to preserve and differentiate the human face region of coming out, obtain the second human face region data.
Wherein, said multiple dimensioned LBP feature calculation module comprises:
Image dwindles the unit, is used for that image is carried out in the candidate face zone of the said second human face region data and dwindles, and shortens the size of training sample into;
Feature calculation unit is used for multiple dimensioned LBP feature calculation is carried out in the candidate face zone that shortens the training sample size into; The current central pixel point of said multiple dimensioned LBP characteristic is replaced by the central area of preset yardstick, and the single pixel of said central pixel point eight neighborhoods is replaced by eight adjacent areas of said central area; Utilize the mean value of said central area pixel value and the mean value of each adjacent area pixel value to participate in said multiple dimensioned LBP feature calculation.
Wherein, the device that said people's face detects also comprises the face tracking module, and said face tracking module comprises:
Comparing unit is used for according to people's face testing result data of current frame image and people's face testing result data of previous frame image, relatively the area that overlaps of current frame image human face region and previous frame image human face region;
The comparison process unit is used for when said coincidence area reaches preset threshold value, then carry out current frame image human face region and previous frame image human face region related, as the face tracking result of present frame; When previous frame image human face region exist can't be corresponding with the current frame image human face region human face region the time, then this human face region to previous frame carries out the detection of people's face again; When there be not the human face region corresponding with previous frame image human face region in the human face region of current frame image, then with people's face testing result of current frame image as new face tracking result.
Embodiment of the present invention embodiment has following beneficial effect:
The user can be according to self-demand, detects to people's face detection of the detection of people's face, video or the camera data of single image and quick real-time people's face of video or camera data respectively, and three kinds of different application models are carried out people's face and detected; And the image to obtaining carries out the LBP feature calculation, utilizes and based on the good AdaBoost sorter of LBP features training said LBP characteristic pattern is differentiated, and said the first face area data is asked for the Haar characteristic; Obtain the Haar characteristic pattern; Utilization is differentiated said Haar characteristic pattern based on the good AdaBoost sorter of Haar features training, then can also carry out multiple dimensioned LBP feature calculation to the said second human face region data, obtains multiple dimensioned LBP characteristic pattern; Utilization is differentiated said multiple dimensioned LBP characteristic pattern based on the good AdaBoost sorter of multiple dimensioned LBP features training; Obtain third party's face area data, then the human face region data are carried out cluster, overlapping human face region is merged; Final output human face region; Improve the verification and measurement ratio of people's face detection greatly and reduced false drop rate, and had very fast detection speed, and can add interframe face tracking step; Further improve detection speed, satisfied the demand of user's high detection rate and high detection speed.
Embodiment
To combine the accompanying drawing in the embodiment of the invention below, the technical scheme in the embodiment of the invention is carried out clear, intactly description, obviously, described embodiment only is the present invention's part embodiment, rather than whole embodiment.Based on the embodiment among the present invention, those of ordinary skills are not making the every other embodiment that is obtained under the creative work prerequisite, all belong to the scope of the present invention's protection.
The schematic flow sheet of first embodiment of inventor's face detecting method as shown in Figure 1 comprises:
Step S101: the image to obtaining carries out the LBP feature calculation, obtains the LBP characteristic pattern;
Particularly; LBP is a kind of image local texture description method of effective imparametrization; Calculate simple, as to catch trace in image minutia; Thereby extract the local field relation schema that is more conducive to classify, it successfully has been applied in many Machine Vision Recognition tasks, comprises recognition of face.
Step S102: utilize and said LBP characteristic pattern is differentiated, obtain the first face area data based on the good AdaBoost sorter of LBP features training;
Particularly, Adaboost is a kind of iterative algorithm, and its core concept is to the different sorter (Weak Classifier) of same training set training, gathers these Weak Classifiers then, constitutes a stronger sorter (strong classifier).A plurality of strong classifier one-level one-levels are constituted the sorter of a cascade (Cascade) structure.When doing AdaBoost sorter human face discriminating; Human face region to be checked is differentiated earlier,, otherwise continued differentiation with next strong classifier if be found to be non-facely just with its eliminating with each strong classifier; Differentiate through all sorters up to rectangle frame to be detected, then it is decided to be human face region.
Wherein, treating the step that surveyed area differentiates with a strong classifier comprises:
A), take out a Weak Classifier successively according to Weak Classifier number in the strong classifier;
B) according to the eigenwert of the feature calculation present image in the Weak Classifier; Use the threshold value (a plurality of threshold values and a plurality of interval are arranged) of eigenwert and sorter to compare then, in respective bins, taking out current Weak Classifier differentiation is the probability of people's face (be Weak Classifier and differentiate the result).
C) differentiate results to all Weak Classifiers and carry out addition, be the strong classifier result, compare with it and strong classifier threshold value then, if more than or equal to threshold value then differentiate the face for the people, otherwise differentiation is non-face.
Step S103: said the first face area data is asked for the Haar characteristic, obtain the Haar characteristic pattern, utilize and said Haar characteristic pattern is differentiated, obtain the second human face region data based on the good AdaBoost sorter of Haar features training;
Particularly; In order to detect the human face region in the image more exactly, after obtaining said the first face area data, utilize the Haar characteristic that said the first face area data is differentiated; Further get rid of non-face zone, obtain the second human face region data.
Step S104: the said second human face region data are carried out cluster, overlapping human face region is merged, obtain four-player face area data;
Particularly, the differentiation through above-mentioned steps obtains a series of human face regions, but owing to someone's face in the image may be detected by the detection block of different scale, therefore in the end also need carry out union operation to these zones, to export unified people's face frame; The method of union operation mainly comprises following two steps:
A) elder generation carries out cluster according to the central point and the wide height of people's face detection block to human face region, and cluster feature is exactly the distance according to central point between each frame;
B) to through steps A) human face region that cluster is good, merge processing according to the overlapping region again, when two frame overlapping regions are too much, just carry out union operation.
Step S105: export the human face region in the said image.
Particularly, through above-mentioned steps, people's face of having accomplished based on image detects, and can obtain the size and the position of people's face in the input picture.
Further, the schematic flow sheet of the LBP pretreatment stage of method for detecting human face in the embodiment of the invention as shown in Figure 2 has specified that step S101 and step S102 can comprise in the foregoing description:
Step S201: the zoom factor according to preset carries out convergent-divergent to the image that obtains;
Particularly, said zoom factor can be for greater than 1.1 decimal.
Step S202: judge that whether scaled images is less than preset pixel window port area;
Particularly, said preset pixel window port area includes but not limited to the window area of 20*20 (pixel), when judging scaled images greater than this preset pixel window port area, promptly judged result for not the time, execution in step S203 then; Otherwise execution in step S204.
Step S203: scaled images is carried out the LBP feature calculation; With said pixel window port area (like the window of 20*20) the LBP characteristic pattern that obtains is scanned then; And the pixel window that each scans used based on the good AdaBoost sorter of LBP features training differentiate, preserve the first face area data that obtains; Continue the convergent-divergent present image according to said zoom factor; Repeated execution of steps S202;
Particularly; Each pixel window that scans used based on the good AdaBoost sorter of LBP features training differentiate; When determining current window is human face region; Then multiply by this zoom factor to the summit of current window image and wide height, be transformed on the original image, these pixels are preserved; When determining current window is not human face region, then gets rid of the pixel of current window.
Step S204: the first face area data that output is preserved.
Particularly, less than preset pixel window port area, then end process is exported the first face area data of preserving as if scaled images.
Processing through step S101 and step S102 (being that step S201 is to step S204) can exclude a large amount of non-face zones the human face region that reserve judgement goes out apace.
Again further, the Harr characteristic of method for detecting human face is differentiated the schematic flow sheet in stage in the embodiment of the invention as shown in Figure 3, has specified that step S103 can comprise in the foregoing description:
Step S301: the integrogram and square integrogram that calculate the said image that obtains;
Particularly, promptly the image to original input calculates, and draws integrogram and square integrogram, so that calculate the Haar characteristic of any rectangle fast.
Step S302: from said the first face area data, take out the candidate face zone successively;
Step S303: the yardstick according to said candidate face zone is adjusted the yardstick based on the good sorter of Haar features training, differentiates whether the said candidate face zone of taking out is human face region;
Particularly, from the human face region that step S102 preserves, take out human face region successively and differentiate, the method that adopts detecting device to amplify when differentiating in this stage is just preserved for people's face if differentiate, otherwise just this zone eliminating.The detecting device amplification procedure can comprise:
A) detecting device is amplified, only change characteristic frame and corresponding weight in the detecting device;
B) according to working as forefathers' face frame and training of human face sample size; Calculate amplification factor factor; Then each the characteristic frame in the Weak Classifier is amplified (summit of characteristic frame and wide height are amplified get final product) and the corresponding weight of characteristic frame is adjusted (divided by the area of working as forefathers' face frame, carrying out the sorter area normalization with original weight).
Step S304: preserve the human face region of differentiating out, obtain the second human face region data.
Again further, more accurate for people's face is detected, remove the flase drop in some non-face zones, the schematic flow sheet of second embodiment of inventor's face detecting method as shown in Figure 4 comprises:
Step S401: the image to obtaining carries out the LBP feature calculation, obtains the LBP characteristic pattern;
Step S402: utilize and said LBP characteristic pattern is differentiated, obtain the first face area data based on the good AdaBoost sorter of LBP features training;
Step S403: said the first face area data is asked for the Haar characteristic, obtain the Haar characteristic pattern, utilize and said Haar characteristic pattern is differentiated, obtain the second human face region data based on the good AdaBoost sorter of Haar features training;
Particularly, step S401 can repeat no more with reference to the step S101 in the foregoing description to step S103 to step S403 here.
Step S404: the said second human face region data are carried out multiple dimensioned LBP feature calculation, obtain multiple dimensioned LBP characteristic pattern;
Particularly, image is carried out in the candidate face zone in the said second human face region data dwindle, shorten the size (such as the window area of 20*20 (pixel)) of training sample into;
Multiple dimensioned LBP feature calculation is carried out in candidate face zone to shortening the training sample size into; The current central pixel point of said multiple dimensioned LBP characteristic is replaced by the central area of preset yardstick, and the single pixel of said central pixel point eight neighborhoods is replaced by eight adjacent areas of said central area; Utilize the mean value of said central area pixel value and the mean value of each adjacent area pixel value to participate in said multiple dimensioned LBP feature calculation.
Step S405: utilize and said multiple dimensioned LBP characteristic pattern is differentiated, obtain third party's face area data based on the good AdaBoost sorter of multiple dimensioned LBP features training;
Particularly, utilize based on the good AdaBoost sorter of multiple dimensioned LBP features training, get rid of the zone that does not belong to people's face carrying out identification and classification through the eigenwert of the good multiple dimensioned LBP feature calculation of training in advance.
Step S406: said third party's face area data is carried out cluster, overlapping human face region is merged, obtain four-player face area data;
Step S407: export the human face region in the said image.
Again further; The image that obtains in the method that people's face of the embodiment of the invention detects can be that single image, video or camera are taken each frame video image of accomplishing; And video or real-time each frame video image taken of camera; Promptly; The method that people's face of the embodiment of the invention detects can provide 3 kinds of different people's faces to detect application model to the user; The user can be according to self-demand, selects people's face of the detection of people's face, video or the camera data of single image to detect respectively or quick real-time people's face of video or camera data detects, and the foregoing description is told about is that people's face of single image detects; The image that obtains is a single image, combines Fig. 5 and Fig. 6 to specify below respectively video or camera are taken the method for detecting human face of the video data of accomplishing and the quick real-time method for detecting human face of data that video or camera are taken in real time.
The schematic flow sheet of the 3rd embodiment of inventor's face detecting method as shown in Figure 5 specifies the quick real-time method for detecting human face to video or the real-time data of taking of camera, comprising:
Step S50 1: the image to obtaining carries out the LBP feature calculation, obtains the LBP characteristic pattern;
Step S50 2: utilize and based on the good AdaBoost sorter of LBP features training said LBP characteristic pattern is differentiated, obtain the first face area data;
Step S50 3: said the first face area data is asked for the Haar characteristic, obtain the Haar characteristic pattern, utilize and based on the good AdaBoost sorter of Haar features training said Haar characteristic pattern is differentiated, obtain the second human face region data;
Step S50 4: the said second human face region data are carried out cluster, overlapping human face region is merged, obtain four-player face area data;
Particularly, step S501 to step S504 with reference to the foregoing description step S101 to step S104, repeat no more here.
Step S50 5: according to people's face testing result data of current frame image and people's face testing result data of previous frame image, and the area that overlaps of current frame image human face region and previous frame image human face region relatively;
Particularly, this step is an interframe face tracking step, carries out people's face according to the coincidence area and follows, specifically according to the corresponding execution in step S506 of result relatively, S507 or S508.
Step S50 6: when said coincidence area reaches preset threshold value, then carry out current frame image human face region and previous frame image human face region related, as the face tracking result of present frame;
Step S507: when previous frame image human face region exist can't be corresponding with the current frame image human face region human face region the time, then this human face region to previous frame carries out the detection of people's face again;
Particularly, it is consistent with people's face detection step in the foregoing description that said human face region is carried out step that people's face detects again, repeats no more here.
Step S50 8: when there be not the human face region corresponding with previous frame image human face region in the human face region of current frame image, then with people's face testing result of current frame image as new face tracking result;
Step S509: export the human face region in the said image.
The schematic flow sheet of the 4th embodiment of inventor's face detecting method as shown in Figure 6 specifies the method for detecting human face to video or camera data, comprising:
Step S60 1: the image to obtaining carries out the LBP feature calculation, obtains the LBP characteristic pattern;
Step S60 2: utilize and based on the good AdaBoost sorter of LBP features training said LBP characteristic pattern is differentiated, obtain the first face area data;
Step S60 3: said the first face area data is asked for the Haar characteristic, obtain the Haar characteristic pattern, utilize and based on the good AdaBoost sorter of Haar features training said Haar characteristic pattern is differentiated, obtain the second human face region data;
Particularly, step S601 to step S603 with reference to the foregoing description step S101 to step S103, repeat no more here.
Step S60 4: the said second human face region data are carried out multiple dimensioned LBP feature calculation, obtain multiple dimensioned LBP characteristic pattern;
Particularly, image is carried out in the candidate face zone in the said second human face region data dwindle, shorten the size (such as the window area of 20*20 (pixel)) of training sample into;
Human face region to shortening the training sample size into adopts the good multiple dimensioned LBP feature calculation of training in advance; The current central pixel point of said multiple dimensioned LBP characteristic is replaced by the central area of preset yardstick, and the single pixel of said central pixel point eight neighborhoods is replaced by eight adjacent areas of said central area; Utilize the mean value of said central area pixel value and the mean value of each adjacent area pixel value to participate in said multiple dimensioned LBP feature calculation.
Step S605: utilize and said multiple dimensioned LBP characteristic pattern is differentiated, obtain third party's face area data based on the good AdaBoost sorter of multiple dimensioned LBP features training;
Particularly, utilize based on the good AdaBoost sorter of multiple dimensioned LBP features training, get rid of the zone that does not belong to people's face carrying out identification and classification through the eigenwert of the good multiple dimensioned LBP feature calculation of training in advance.
Step S606: said third party's face area data is carried out cluster, overlapping human face region is merged, obtain four-player face area data;
Step S607: according to people's face testing result data of current frame image and people's face testing result data of previous frame image, the area that overlaps of current frame image human face region and previous frame image human face region relatively;
Particularly, this step is an interframe face tracking step, carries out people's face according to the coincidence area and follows, specifically according to the corresponding execution in step S608 of result relatively, S609 or S610.
Step S608: when said coincidence area reaches preset threshold value, then carry out current frame image human face region and previous frame image human face region related, as the face tracking result of present frame;
Step S609: when previous frame image human face region exist can't be corresponding with the current frame image human face region human face region the time, then this human face region to previous frame carries out the detection of people's face again;
Step S610: when there be not the human face region corresponding with previous frame image human face region in the human face region of current frame image, then with people's face testing result of current frame image as new face tracking result;
Step S611: export the human face region in the said image.
Detect tracking step through people's face, the time that can improve people's face verification and measurement ratio greatly and reduce algorithm detections needs, satisfied the demand of user's high detection rate and high detection speed.
Embodiment of the present invention embodiment, user can be according to self-demands, detect to people's face detection of the detection of people's face, video or the camera data of single image and quick real-time people's face of video or camera data respectively; Three kinds of different application models are carried out people's face and are detected, and the image that obtains is carried out the LBP feature calculation, utilize and based on the good AdaBoost sorter of LBP features training said LBP characteristic pattern are differentiated; And said the first face area data asked for the Haar characteristic, and obtain the Haar characteristic pattern, utilize and said Haar characteristic pattern is differentiated based on the good AdaBoost sorter of Haar features training; Then can also carry out multiple dimensioned LBP feature calculation to the said second human face region data; Obtain multiple dimensioned LBP characteristic pattern, utilize and said multiple dimensioned LBP characteristic pattern is differentiated, obtain third party's face area data based on the good AdaBoost sorter of multiple dimensioned LBP features training; Then the human face region data are carried out cluster; Overlapping human face region is merged, finally export human face region, improved the verification and measurement ratio of people's face detection greatly and reduced false drop rate; And has very fast detection speed; And can add interframe face tracking step, and further improve detection speed, satisfied the demand of user's high detection rate and high detection speed.
Specify the method for people's face detection of the embodiment of the invention above, below accordingly, specified the device of people's face detection of the embodiment of the invention.
The structural representation of first embodiment of the device that inventor's face as shown in Figure 7 detects; The device 7 that people's face detects comprises: LBP feature calculation module 71, first discrimination module 72, second discrimination module 73, cluster merge module 74 and output module 75, wherein
LBP feature calculation module 71 is used for the image that obtains is carried out the LBP feature calculation, obtains the LBP characteristic pattern;
First discrimination module 72 is used to utilize based on the good AdaBoost sorter of LBP features training to be differentiated said LBP characteristic pattern, obtains the first face area data;
Second discrimination module 73 is used for said the first face area data is asked for the Haar characteristic, obtains the Haar characteristic pattern, utilizes and based on the good AdaBoost sorter of Haar features training said Haar characteristic pattern is differentiated, and obtains the second human face region data;
Cluster merges module 74 and is used for the said second human face region data are carried out cluster, and overlapping human face region is merged, and obtains four-player face area data;
Output module 75 is used for exporting the human face region of said image.
Further, the structural representation of the LBP feature calculation module of the embodiment of the invention as shown in Figure 8, LBP feature calculation module 71 comprises: image zoom unit 711, judging unit 712 and judgment processing unit 713, wherein
Image zoom unit 711 is used for according to preset zoom factor the image that obtains being carried out convergent-divergent;
Judging unit 712 is used to judge that whether scaled images is less than preset pixel window port area;
Judgment processing unit 713 be used for when the judged result of judging unit 712 for not the time, then scaled images is carried out the LBP feature calculation, trigger first discrimination module 72 then to differentiate; Continue the convergent-divergent present image according to said zoom factor then, trigger judging unit 712 and repeat and saidly judge that scaled images is whether less than the step of preset pixel window port area;
First discrimination module 712 specifically is used for said pixel window port area (like the window of 20*20) the LBP characteristic pattern that obtains being scanned; And the pixel window that each scans used based on the good AdaBoost sorter of LBP features training differentiate, preserve the first face area data that obtains.
Again further, the structural representation of second discrimination module of the embodiment of the invention as shown in Figure 9, second discrimination module 73 comprises: computing unit 731, regional retrieval unit 732, adjustment judgement unit 733 and preservation unit 734, wherein
Computing unit 731 is used to calculate the integrogram and square integrogram of the said image that obtains; Particularly, promptly the image to original input calculates, and draws integrogram and square integrogram, so that calculate the Haar characteristic of any rectangle fast.
Zone retrieval unit 732 is used for according to said integrogram and square integrogram, from said the first face area data, takes out the candidate face zone successively,
Adjustment judgement unit 733 is used for adjusting the yardstick based on the good sorter of Haar features training according to the yardstick in candidate face zone, differentiates whether the candidate face zone of taking out is human face region;
Preserve unit 734 and be used to preserve the human face region that differentiation is come out, obtain the second human face region data.
Again further; It is more accurate for people's face is detected; Remove the flase drop in some non-face zones, the structural representation of second embodiment of the device that inventor's face as shown in Figure 10 detects, the device 7 that people's face detects comprise that LBP feature calculation module 71, first discrimination module 72, second discrimination module 73, cluster merge outside module 74 and the output module 75; Also comprise: multiple dimensioned LBP feature calculation module 76 and the 3rd discrimination module 77, wherein
Multiple dimensioned LBP feature calculation module 76 is used for the said second human face region data are carried out multiple dimensioned LBP feature calculation, obtains multiple dimensioned LBP characteristic pattern;
The 3rd discrimination module 77 is used to utilize based on the good AdaBoost sorter of multiple dimensioned LBP features training to be differentiated said multiple dimensioned LBP characteristic pattern, obtains third party's face area data;
Cluster merges module 74 and specifically is used for said third party's face area data is carried out cluster, and overlapping human face region is merged, and obtains four-player face area data.
Particularly, the structural representation of the multiple dimensioned LBP feature calculation module of the embodiment of the invention as shown in Figure 11, multiple dimensioned LBP feature calculation module 76 comprises: image dwindles unit 761 and feature calculation unit 762, wherein
Image dwindles unit 761 and is used for human face region with the said second human face region data and carries out image and dwindle, and shortens the size of training sample into;
Feature calculation unit 762 is used for multiple dimensioned LBP feature calculation is carried out in the candidate face zone that shortens the training sample size into; The current central pixel point of said multiple dimensioned LBP characteristic is replaced by the central area of preset yardstick, and the single pixel of said central pixel point eight neighborhoods is replaced by eight adjacent areas of said central area; Utilize the mean value of said central area pixel value and the mean value of each adjacent area pixel value to participate in said multiple dimensioned LBP feature calculation.
The image that obtains in the device 7 that people's face of the embodiment of the invention detects can be that single image, video or camera are taken each frame video image of accomplishing; And video or real-time each frame video image taken of camera; Promptly; The device 7 that people's face of the embodiment of the invention detects can provide 3 kinds of different people's faces to detect application model to the user; The user can be according to self-demand; Select people's face of the detection of people's face, video or the camera data of single image to detect respectively or quick real-time people's face of video or camera data detects; The foregoing description is told about is that people's face of single image detects, and the image that obtains is a single image, combines Figure 12 and Figure 13 to specify method for detecting human face that 7 pairs of videos of device that people's face detects or camera take the video data of accomplishing below respectively and to video or the camera quick real-time method for detecting human face of the data of shooting in real time.
The structural representation of the 3rd embodiment of the device that inventor's face as shown in Figure 12 detects; Specify the 7 pairs of videos of device of people's face detection or the quick real-time method for detecting human face of the data that camera is taken in real time; The device 7 that people's face detects comprises: LBP feature calculation module 71, first discrimination module 72, second discrimination module 73, cluster merge outside module 74 and the output module 75; Can also comprise face tracking module 78; Face tracking module 78 comprises: comparing unit 781 and comparison process unit 782, particularly:
Comparing unit 781 is used for the people's face testing result data according to people's face testing result data of current frame image and previous frame image, relatively the area that overlaps of current frame image human face region and previous frame image human face region;
Comparison process unit 782 is used for when said coincidence area reaches preset threshold value, then carry out current frame image human face region and previous frame image human face region related, as the face tracking result of present frame; When previous frame image human face region exist can't be corresponding with the current frame image human face region human face region the time, then this human face region to previous frame carries out the detection of people's face again; When there be not the human face region corresponding with previous frame image human face region in the human face region of current frame image, then with people's face testing result of current frame image as new face tracking result.
The structural representation of the 4th embodiment of the device that inventor's face as shown in Figure 13 detects; Specify 7 pairs of videos of device of people's face detection or the method for detecting human face that camera is taken the video data of accomplishing; The device 7 that people's face detects comprises: LBP feature calculation module 71, first discrimination module 72, second discrimination module 73, cluster merge outside module 74, output module 75, multiple dimensioned LBP feature calculation module 76 and the 3rd discrimination module 77; Can also comprise face tracking module 78; Face tracking module 78 comprises: comparing unit 781 and comparison process unit 782, particularly:
Comparing unit 781 is used for the people's face testing result data according to people's face testing result data of current frame image and previous frame image, relatively the area that overlaps of current frame image human face region and previous frame image human face region;
Comparison process unit 782 is used for when said coincidence area reaches preset threshold value, then carry out current frame image human face region and previous frame image human face region related, as the face tracking result of present frame; When previous frame image human face region exist can't be corresponding with the current frame image human face region human face region the time, then this human face region to previous frame carries out the detection of people's face again; When there be not the human face region corresponding with previous frame image human face region in the human face region of current frame image, then with people's face testing result of current frame image as new face tracking result.
The people's face that carries out through the face tracking module in the embodiment of the invention 78 detects to be followed the tracks of, and the time that can improve people's face verification and measurement ratio greatly and reduce algorithm detections needs, has satisfied the demand of user's high detection rate and high detection speed.
In sum, through embodiment of the present invention embodiment, the user can be according to self-demand; Detect to people's face detection of the detection of people's face, video or the camera data of single image and quick real-time people's face of video or camera data respectively, three kinds of different application models are carried out people's face and are detected, and the image that obtains is carried out the LBP feature calculation; Utilization is differentiated said LBP characteristic pattern based on the good AdaBoost sorter of LBP features training, and said the first face area data is asked for the Haar characteristic, obtains the Haar characteristic pattern; Utilization is differentiated said Haar characteristic pattern based on the good AdaBoost sorter of Haar features training, then can also carry out multiple dimensioned LBP feature calculation to the said second human face region data, obtains multiple dimensioned LBP characteristic pattern; Utilization is differentiated said multiple dimensioned LBP characteristic pattern based on the good AdaBoost sorter of multiple dimensioned LBP features training; Obtain third party's face area data, then the human face region data are carried out cluster, overlapping human face region is merged; Final output human face region; Improve the verification and measurement ratio of people's face detection greatly and reduced false drop rate, and had very fast detection speed, and can add interframe face tracking step; Further improve detection speed, satisfied the demand of user's high detection rate and high detection speed.
One of ordinary skill in the art will appreciate that all or part of flow process that realizes in the foregoing description method; Be to instruct relevant hardware to accomplish through computer program; Described program can be stored in the computer read/write memory medium; This program can comprise the flow process like the embodiment of above-mentioned each side method when carrying out.Wherein, described storage medium can be magnetic disc, CD, read-only storage memory body (Read-Only Memory, ROM) or at random store memory body (Random Access Memory, RAM) etc.
Above disclosedly be merely a kind of preferred embodiment of the present invention, can not limit the present invention's interest field certainly with this, the equivalent variations of therefore doing according to claim of the present invention still belongs to the scope that the present invention is contained.