Summary of the invention
In view of this, it is an object of the invention to overcome the deficiencies of the prior art and provide a kind of face pattern recognition methods,
Device, equipment and storage medium.
In order to achieve the above object, the present invention adopts the following technical scheme:
According to the application in a first aspect, providing a kind of face pattern recognition methods, comprising:
Obtain picture to be detected;
The picture input foreground model to be detected is tentatively judged into the picture to be detected by the foreground model
On whether have face pattern, obtain the first judging result of yes/no;
If first judging result be it is yes, the picture to be detected is inputted into Face Detection model, passes through the skin
Color detection model continues to judge whether have face pattern on the picture to be detected, obtains the second judging result of yes/no;
If second judging result be it is yes, based on the Face Detection model export face patterning regions.
Optionally, the mode for obtaining the picture to be detected includes: to obtain picture to be detected by monitoring device.
It is optionally, described to obtain picture to be detected, comprising:
Obtain monitor video;Wherein, the monitor video is made of at least two frame pictures;
Determine the frame number of every frame picture in the monitor video;
By the frame number divided by m, remainder is obtained;Wherein, m is positive integer.
The frame number that remainder is a to picture be picture to be detected;Wherein, a is the nonnegative integer less than m.
Optionally, described that the picture to be detected is inputted into foreground model, by the foreground model, described in preliminary judgement
Whether there is face pattern on picture to be detected, comprising:
The picture to be detected is handled, foreground picture is obtained;
Judge whether the size of the foreground picture is less than preset threshold;
Do not have face pattern on picture to be detected if so, determining;
Otherwise, it determines having face pattern on picture to be detected.
Optionally, the processing picture to be detected, obtains foreground picture, comprising:
Using picture to be detected described in opencv technical treatment, foreground picture is obtained.
Optionally, described to continue to judge whether there is face pattern on the picture to be detected, obtain the second of yes/no
Judging result;Include:
By using edge detection algorithm, face patterning regions are extracted in the picture to be detected;
Obtain the extraction result;
Judge whether the extraction result is sky, obtains the second judging result of yes/no.
Optionally, further includes:
According to the picture to be detected and the face patterning regions, determine unselected for mapping to be checked in the video
Face patterning regions on the picture of piece.
According to the application second aspect, a kind of face pattern identification device is provided, comprising:
Module is obtained, for obtaining picture to be detected;
First judgment module, for tentatively sentencing the picture input foreground model to be detected by the foreground model
Whether have face pattern, obtain the first judging result of yes/no if breaking on the picture to be detected;;
Second judgment module, if first judging result be it is yes, the picture to be detected is inputted into Face Detection mould
Type continues to judge whether have face pattern on the picture to be detected, obtains yes/no by the Face Detection model
Second judging result;
Output module, if for second judging result be it is yes, face pattern is exported based on the Face Detection model
Region.
According to the application third aspect, a kind of face pattern identification equipment is provided, comprising:
Processor, and the memory being connected with the processor;
For storing computer program, the computer program is at least used to execute the application first aspect the memory
The face pattern recognition methods;
The processor is for calling and executing the computer program in the memory.
According to the application fourth aspect, a kind of storage medium is provided, the storage medium is stored with computer program, described
When computer program is executed by processor, each step in the face pattern recognition methods as described in the application first aspect is realized
Suddenly.
The invention adopts the above technical scheme, and after obtaining picture to be detected, the picture to be detected is first inputted prospect mould
Type tentatively judges whether there is face pattern on the picture to be detected by the foreground model;Come with this to the detection
Whether there is face pattern to carry out preliminary judgement on picture.If first judging result be it is yes, by the mapping to be checked
Piece inputs Face Detection model, by the Face Detection model, further judges whether there is people on the picture to be detected
Face pattern;If the result tentatively judged does not have face pattern, which is not judged further, reduced to picture
The amount of operation in identification process improves the speed of identification.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, technical solution of the present invention will be carried out below
Detailed description.Obviously, described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base
Embodiment in the present invention, those of ordinary skill in the art are obtained all without making creative work
Other embodiment belongs to the range that the present invention is protected.
Fig. 1 is the method for detecting human face that the embodiment of the present invention one provides.Referring to Fig.1, Face datection side provided by the present application
Method includes:
S101 obtains picture to be detected;
Wherein, the mode for obtaining video can be to be obtained by monitoring device.Monitoring device can be photographic device.
Further, obtaining video can be persistently to obtain video.That is: it while carrying out Face datection, constantly obtains
New video.
Picture to be detected input foreground model is tentatively judged whether have on picture to be detected by foreground model by S102
There is face pattern, obtains the first judging result of yes/no;
S103, if the first judging result be it is yes, by picture to be detected input Face Detection model, pass through Face Detection mould
Type continues to judge whether have face pattern on picture to be detected, obtains the second judging result of yes/no;
S104, if the second judging result be it is yes, based on Face Detection model export face patterning regions.
The invention adopts the above technical scheme, and after obtaining picture to be detected, picture to be detected is first inputted foreground model, is led to
Foreground model is crossed, tentatively judges whether there is face pattern on picture to be detected;Come whether there is people on detection picture with this
Face pattern carries out preliminary judgement.If the first judging result be it is yes, by picture to be detected input Face Detection model, pass through skin
Color detection model continues to judge whether have face pattern on picture to be detected;If the first judging result be it is no, not to the figure
Piece carries out continuing to judge, reduces the amount to the operation during picture recognition, improve the speed of identification.
In practical application, referring to Fig. 2, step S102, picture to be detected is inputted into foreground model, by foreground model, just
Step judges whether there is face pattern on picture to be detected, comprising:
S201 handles picture to be detected, obtains foreground picture;
S202, judges whether the size of foreground picture is less than preset threshold;
S203 does not have face pattern if so, determining on picture to be detected;
S204, otherwise, it determines having face pattern on picture to be detected.
Specifically handle the mode of picture to be detected are as follows:
Under normal circumstances, when foreground picture is smaller, it is believed that do not include face pattern in picture to be detected.By upper
The picture that a part does not have face pattern can quickly be excluded by stating step, reduce the amount of operation in identification process.
In practical application, referring to Fig. 3, step S103, picture to be detected is inputted into Face Detection model, passes through Face Detection
Model further judges whether there is face pattern on picture to be detected, comprising:
S301 extracts face patterning regions by using edge detection algorithm in picture to be detected;
S302 is obtained and is extracted result;
S303 judges to extract whether result is sky, obtains the second judging result of yes/no.
Wherein, by Face Detection model, human face region is extracted using edge detection algorithm, is produced compared to using P-Net
The step of technical solution of raw target frame, operation, is less, and the amount of operation is less, operation it is more efficient.
Wherein, edge detecting technology can be sobel edge detection.
In practical application, step 101, picture to be detected is obtained, comprising: obtain monitor video;Wherein, monitor video be by
At least two frame pictures are constituted;Obtain the frame number of every frame picture in monitor video;By frame number divided by m, remainder is obtained;Wherein, m is
Positive integer.The frame number that remainder is a to picture be picture to be detected;Wherein, a is the nonnegative integer less than m.
Correspondingly, face pattern recognition methods further include: according to the face patterning regions that Face Detection model exports, estimation
It is not the face patterning regions in the picture of picture to be detected in video.Wherein it is possible to using the optical flow tracking of FAST angle point
It is not the face patterning regions in the picture of picture to be detected that method, which is estimated in video,.
In this way, the extraction for picture can be completed while constantly obtaining video information.The value model of further m
Enclosing can be 2-4.The value of specific m can be 2.The value of further a can be 0.Such as: when m value is taking for 2, n
When value is 0, the effect of extraction is to extract the picture of even frame.
Using the optical flow tracking of FAST angle point, the mode of " a few frame detections, the tracking of a few frames ".Such as: the 2nd frame, the 4th has been determined
Face pattern on frame and the 6th frame.Then the 1st frame, the 3rd frame can be judged according to the face pattern on the 2nd frame, the 4th frame and the 6th frame
With the face pattern on the 5th frame.
Reduce the quantity for needing to carry out the picture of Face datection through the above way, improves the speed of detection.
As shown in figure 4, present invention also provides a kind of face pattern identification devices.Referring to Fig. 4, face provided by the present application
Pattern identification device, comprising:
Module 401 is obtained, for obtaining picture to be detected;
First judgment module 402, for picture to be detected to be inputted foreground model, by foreground model, tentatively judge to
Whether have face pattern, obtain the first judging result of yes/no if detecting on picture;
Second judgment module 403, if the first judging result be it is yes, by picture to be detected input Face Detection model, lead to
Face Detection model is crossed, continues to judge whether there is face pattern on picture to be detected, obtains the second judging result of yes/no;
Output module 404, if for the second judging result be it is yes, face patterning regions are exported based on Face Detection model.
The invention adopts the above technical scheme, and after obtaining picture to be detected, picture to be detected is first inputted foreground model, is led to
Foreground model is crossed, tentatively judges whether there is face pattern on picture to be detected;Come whether there is people on detection picture with this
Face pattern carries out preliminary judgement.If the first judging result be it is yes, by picture to be detected input Face Detection model, pass through skin
Color detection model continues to judge whether have face pattern on picture to be detected;If the first judging result be it is no, not to the figure
Piece carries out continuing to judge, reduces the amount to the operation during picture recognition, improve the speed of identification.
As shown in figure 5, present invention also provides a kind of face patterns to identify equipment.Referring to Fig. 5, face provided by the present application
Pattern identifies equipment, comprising:
Processor 502, and the memory 501 being connected with processor;
Memory 501 is at least used to execute above-mentioned face pattern identification for storing computer program, computer program
Method;
Processor is for calling and executing the computer program in memory.
Present invention also provides a kind of storage medium, storage medium is stored with computer program, and computer program is processed
When device executes, realize such as each step in above-mentioned face pattern recognition methods.
About the device and equipment in above-described embodiment, wherein modules and component have executed the concrete mode of operation
It is described in detail in the embodiment of the method, no detailed explanation will be given here.It is understood that above-mentioned
Same or similar part can mutually refer in each embodiment, and unspecified content may refer to it in some embodiments
The same or similar content in his embodiment.
It is understood that same or similar part can mutually refer in the various embodiments described above, in some embodiments
Unspecified content may refer to the same or similar content in other embodiments.
It should be noted that in the description of the present invention, term " first ", " second " etc. are used for description purposes only, without
It can be interpreted as indication or suggestion relative importance.In addition, in the description of the present invention, unless otherwise indicated, the meaning of " multiple "
Refer at least two.
Any process described otherwise above or method description are construed as in flow chart or herein, and expression includes
It is one or more for realizing specific logical function or process the step of executable instruction code module, segment or portion
Point, and the range of the preferred embodiment of the present invention includes other realization, wherein can not press shown or discussed suitable
Sequence, including according to related function by it is basic simultaneously in the way of or in the opposite order, to execute function, this should be of the invention
Embodiment person of ordinary skill in the field understood.
It should be appreciated that each section of the invention can be realized with hardware, software, firmware or their combination.Above-mentioned
In embodiment, software that multiple steps or method can be executed in memory and by suitable instruction executing method with storage
Or firmware is realized.It, and in another embodiment, can be under well known in the art for example, if realized with hardware
Any one of column technology or their combination are realized: having a logic gates for realizing logic function to data-signal
Discrete logic, with suitable combinational logic gate circuit specific integrated circuit, programmable gate array (PGA), scene
Programmable gate array (FPGA) etc..
Those skilled in the art are understood that realize all or part of step that above-described embodiment method carries
It suddenly is that relevant hardware can be instructed to complete by program, the program can store in a kind of computer-readable storage medium
In matter, which when being executed, includes the steps that one or a combination set of embodiment of the method.
It, can also be in addition, each functional unit in each embodiment of the present invention can integrate in a processing module
It is that each unit physically exists alone, can also be integrated in two or more units in a module.Above-mentioned integrated mould
Block both can take the form of hardware realization, can also be realized in the form of software function module.The integrated module is such as
Fruit is realized and when sold or used as an independent product in the form of software function module, also can store in a computer
In read/write memory medium.
Storage medium mentioned above can be read-only memory, disk or CD etc..
In the description of this specification, reference term " one embodiment ", " some embodiments ", " example ", " specifically show
The description of example " or " some examples " etc. means specific features, structure, material or spy described in conjunction with this embodiment or example
Point is included at least one embodiment or example of the invention.In the present specification, schematic expression of the above terms are not
Centainly refer to identical embodiment or example.Moreover, particular features, structures, materials, or characteristics described can be any
One or more embodiment or examples in can be combined in any suitable manner.
Although the embodiments of the present invention has been shown and described above, it is to be understood that above-described embodiment is example
Property, it is not considered as limiting the invention, those skilled in the art within the scope of the invention can be to above-mentioned
Embodiment is changed, modifies, replacement and variant.