CN113989881A - Face detection method, device and terminal - Google Patents
Face detection method, device and terminal Download PDFInfo
- Publication number
- CN113989881A CN113989881A CN202111211767.5A CN202111211767A CN113989881A CN 113989881 A CN113989881 A CN 113989881A CN 202111211767 A CN202111211767 A CN 202111211767A CN 113989881 A CN113989881 A CN 113989881A
- Authority
- CN
- China
- Prior art keywords
- image
- face
- detection
- head
- shoulder
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
The embodiment of the application discloses a face detection method, a face detection device and a face detection terminal, which are applied to the field of image processing and comprise the following steps: acquiring an image to be identified, inputting the image to be detected into a head and shoulder detection model to acquire head and shoulder characteristics, and determining a head and shoulder detection frame based on the head and shoulder characteristics; determining a detection frame image corresponding to the image to be identified according to the position of the head and shoulder detection frame; and inputting the detection frame image into a face detection model, and carrying out face detection on the detection frame image through the face detection model. By the method provided by the embodiment of the application, on one hand, the size of the face target in the image to be recognized can be increased, and on the other hand, the data volume of the image to be recognized can be reduced, so that the difficulty of face detection is reduced, the speed of follow-up face detection is increased, and the efficiency of face detection is improved.
Description
Technical Field
The embodiment of the application relates to the field of image processing, in particular to a face detection method, a face detection device and a face detection terminal.
Background
Face recognition refers to that for any given image, a certain strategy is adopted to search the image to determine whether the image contains a face, and if so, the position and size of the face in the image and the face information are output. Face detection is a key link in automatic face recognition systems.
Early face recognition research mainly aims at face images with strong constraint conditions (such as images without background), and usually assumes that face positions are always or easily obtained, so the face detection problem is not considered. With the development of applications such as electronic commerce and the like, face recognition becomes the most potential biological identity authentication means, and the application background requires that an automatic face recognition system has a certain recognition capability on a general image, so a series of problems faced by the face recognition system are paid attention to by researchers as an independent topic. At present, the application background of face detection is far beyond the scope of a face recognition system, and the face detection system has important application value in the aspects of content-based retrieval, digital video processing, video detection and the like.
However, because the proportion of the face size to the image is generally small, the existing face detection technology is generally deficient in real-time performance, and particularly on low-computational-effort equipment, it is difficult to simultaneously ensure speed and precision.
Disclosure of Invention
The embodiment of the application provides a face detection method, a face detection device and a face detection terminal, wherein a region frame containing a face image is determined by utilizing head and shoulder features in an image to be recognized, then the image to be recognized is cut according to the position of the region frame to obtain an image corresponding to the region frame, then face detection is carried out on the image corresponding to the region frame, further input data of a face detection model is reduced, the processing speed and the detection precision of the face detection model are improved, and the face recognition speed and precision are subsequently improved.
A first aspect of an embodiment of the present application provides a face detection method, including:
acquiring an image to be recognized, inputting the image to be recognized into a head and shoulder detection model to acquire head and shoulder characteristics, and determining the position of a head and shoulder detection frame based on the head and shoulder characteristics;
determining a detection frame image corresponding to the image to be identified according to the position of the head and shoulder detection frame;
and inputting the detection frame image into a preset face detection model, and carrying out face detection on the detection frame image through the face detection model.
In an optional embodiment, before inputting the image to be recognized into the head-shoulder detection model, the method further comprises:
zooming an image to be recognized to a first preset size;
inputting an image to be recognized into a head and shoulder detection model, comprising:
and inputting the zoomed image to be recognized into the head and shoulder detection model.
In an alternative embodiment, before inputting the detection frame image into the face detection model, the method further comprises:
processing the detection frame image according to a second preset size;
inputting the detection frame image into a face detection model, comprising:
and inputting the processed detection frame image into a human face detection model.
In an alternative embodiment, the face detection of the detection frame image by the face detection model includes:
at least one face image included in the detection frame image is determined through a face detection model.
And determining a target face image which is successfully matched with the detection frame image in at least one face image.
And determining a face detection result according to the target face image, and outputting the face detection result.
In an optional implementation manner, determining, as a face detection result, a target face image in the face image that is successfully matched with the detection frame image includes:
and respectively determining the intersection and parallel ratio of the face image and the detection frame image.
And determining a target face image in the face image according to the intersection ratio of the face image and the detection frame image.
In an alternative embodiment, determining a target face image in the face image according to the intersection ratio of the face image and the detection frame image includes:
determining a target face image with the largest intersection ratio with the detection frame image in the face images as a face detection result; or the like, or, alternatively,
and determining a preset number of target face images with high priority in the face images according to the intersection ratio of the face images and the detection frame images.
In an alternative embodiment, determining the target face image as a face detection result includes:
and screening the preset number of target face images according to a non-maximum value inhibition algorithm.
And determining a face detection result according to the screening result.
A second aspect of the embodiments of the present application provides a face detection apparatus, including:
the head and shoulder detection module is used for acquiring head and shoulder characteristics of the image to be identified and determining a head and shoulder detection frame based on the head and shoulder characteristics so as to acquire a detection frame image corresponding to the image to be identified;
the face detection module is used for receiving the detection frame image to perform face detection;
wherein, head and shoulder detection module includes first input unit, obtains unit and confirms the unit:
the first input unit is used for acquiring an image to be identified and transmitting the image to the acquisition unit;
the acquisition unit is used for acquiring a head and shoulder detection frame of an image to be identified;
the determining unit is used for determining a detection frame image corresponding to the image to be identified according to the position of the head and shoulder detection frame;
the face detection module comprises a second input unit and a processing unit:
a second input unit for inputting the detection frame image to the processing unit;
and the processing unit is used for carrying out face detection on the detection frame image through a preset face detection model.
In an optional embodiment, the processing unit is further configured to scale the image to be recognized to a first preset size;
and the first input unit is specifically used for inputting the zoomed image to be recognized into the acquisition unit.
In an optional embodiment, the processing unit is further configured to process the detection frame image according to a second preset size.
And the second input unit is specifically used for inputting the processed detection frame image into the determination unit.
In an optional implementation manner, the processing unit is specifically configured to determine at least one face image included in the detection frame image by the determining unit, determine a target face image successfully matched with the detection frame image in the at least one face image, determine a face detection result according to the target face image, and output the face detection result.
In an optional implementation manner, the processing unit is specifically configured to determine an intersection ratio between the face image and the detection frame image, and determine a target face image in the face image according to the intersection ratio between the face image and the detection frame image.
In an optional implementation manner, the processing unit is specifically configured to determine, as a face detection result, a target face image in the face image, which has a largest intersection ratio with the detection frame image; or, determining a preset number of target face images with high priority in the face images according to the intersection ratio of the face images and the detection frame images.
In an optional implementation manner, the processing unit is further configured to filter a preset number of target face images according to a non-maximum suppression algorithm; and determining a face detection result according to the screening result.
A third aspect of the embodiments of the present application provides a terminal, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements any one of the methods described above when executing the computer program.
In an optional implementation manner, the terminal further includes an image acquisition device, and the image acquisition device is configured to acquire the image to be identified according to any one of the above descriptions.
A fourth aspect of embodiments of the present application provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, performs the method according to any one of the embodiments of the present application from the first aspect to the first aspect.
In the embodiment of the application, head and shoulder detection is performed on an image to be recognized through a head and shoulder detection model to obtain head and shoulder characteristics, the position of a head and shoulder detection frame is determined based on the head and shoulder characteristics, then a detection frame image corresponding to the image to be recognized is determined according to the position of the head and shoulder detection frame, then the detection frame image is input into a preset face detection model, and face detection is performed on the detection frame image through the face detection model. Generally, the image to be recognized includes a head-shoulder image that is larger than the face image, it is easier to detect the head-shoulder image in the image to be recognized, and the head-shoulder image is generally close to the face image. Therefore, according to the embodiment of the application, the head and shoulder images are firstly identified, and then the detection frame images corresponding to the images to be identified are determined by using the positions of the head and shoulder images (head and shoulder detection frames), so that the data volume of the images to be identified can be reduced under the condition of ensuring that the face image information is not lost, and thus, when the face detection is carried out on the detection frame images corresponding to the images to be identified, on one hand, the size proportion of the face target in the images to be identified can be increased, on the other hand, the data volume of the images to be identified can be reduced, so that the difficulty of face detection is reduced, the speed of face detection is increased, and the efficiency of face detection is improved.
Drawings
Fig. 1 is a schematic flowchart of a method for detecting a face according to an embodiment of the present application;
fig. 2 is a schematic flowchart of another method for detecting a face according to an embodiment of the present disclosure;
fig. 3 is a schematic structural diagram of a face detection apparatus according to an embodiment of the present application;
fig. 4 is a schematic structural diagram of another face detection apparatus according to an embodiment of the present application.
Detailed Description
The embodiment of the application provides a face detection device and related equipment, wherein a region frame containing a face image is determined by utilizing head and shoulder characteristics in an image to be recognized, then the image to be recognized is cut according to the position of the region frame to obtain an image corresponding to the region frame, and then face detection is carried out on the image corresponding to the region frame so as to reduce input data of a face detection model and improve the processing speed and recognition accuracy of the face detection model.
Technical terms used in the embodiments of the present invention are only used for illustrating specific embodiments and are not intended to limit the present invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Further, the use of "including" and/or "comprising" in the specification is intended to specify the presence of stated features, integers, steps, operations, elements, and/or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and/or components.
The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below, if any, are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed.
The face recognition technology is a biological recognition technology for identifying the identity based on the face feature information of a person. The method is a series of related technologies, generally called portrait recognition and facial recognition, for acquiring an image or video stream containing a human face by using a camera or a camera, detecting and tracking the human face in the image, and further performing facial recognition on the detected human face. The face recognition system integrates various professional technologies such as artificial intelligence, machine recognition, machine learning, model theory, expert system and video image processing, is the latest application of biological feature recognition, realizes the core technology of the face recognition system, and shows the conversion from weak artificial intelligence to strong artificial intelligence.
The face recognition system mainly comprises four parts, namely: the method comprises the steps of face image acquisition and detection, face image preprocessing, face image feature extraction and face matching and recognition. The human face image acquisition and detection comprises two steps of acquisition and detection. In the process of acquiring the face image, different face images can be acquired through the camera lens, such as static images, dynamic images, images at different positions, images with different expressions and the like. When the user is in the shooting range of the acquisition equipment, the acquisition equipment can automatically search and shoot the face image of the user. The face detection is mainly used for preprocessing of face recognition, namely, the position and the size of a face are accurately calibrated in the collected image to be recognized. The image to be recognized includes various features, such as histogram features, color features, template features, structural features, and the like. The face detection is to extract the useful information and to use the features to realize the face detection.
The face image preprocessing refers to a process of processing an image and finally serving for feature extraction based on a face detection result. The original image acquired by the system is limited by various conditions and random interference, so that the original image cannot be directly used, and the original image needs to be subjected to image preprocessing such as gray scale correction, noise filtering and the like in the early stage of image processing. For the face image, the preprocessing process mainly includes light compensation, gray level transformation, histogram equalization, normalization, geometric correction, filtering, sharpening, and the like of the face image.
The face image feature extraction refers to an extraction process of available features by a face recognition system, and the available features generally comprise visual features, pixel statistical features, face image transformation coefficient features, face image algebraic features and the like. The face feature extraction is performed aiming at certain features of the face, and is a process for performing feature modeling on the face. The methods for extracting human face features are classified into two main categories: one is a knowledge-based characterization method; the other is a characterization method based on algebraic features or statistical learning.
The matching and identification of the face image is the last process of the face identification, and the matching result is obtained by searching and matching the extracted feature data of the face image with the feature template stored in the database. A threshold value is usually set, and when the similarity exceeds the threshold value, it is output as a recognition result. The face recognition is to compare the face features to be recognized with the obtained face feature template, and judge the identity information of the face according to the similarity degree. This process is divided into two categories: one is confirmation, which is a process of performing one-to-one image comparison, and the other is recognition, which is a process of performing one-to-many image matching comparison.
Through the description of the face recognition system, it can be seen that the face detection plays an important role in the face recognition process. Through the face detection technology, the specific position and size of the face in the image to be recognized can be determined, and thus a basis is provided for subsequent feature extraction and matching recognition. It can be understood that the face detection can preprocess the image to be recognized, screen out the image containing the face, and remove the image not containing the face, so that the recognition efficiency of the face recognition can be greatly improved, and meanwhile, the success probability of the face recognition is also enhanced. The face detection is the basis of upper-layer application, and plays an important role in subsequent face quality, attribute, living body and feature extraction.
In the existing face detection process, because in the image to be recognized, the face target is usually small, so the detection difficulty is large, and meanwhile, besides the face target, there are too many background images in the image to be recognized, which will bring great interference to face detection, and at the same time, the input data amount of the whole face recognition process will be increased, resulting in the problems of low face precision, slow speed and the like, and the situations of false detection and inaccurate recognition will often occur, so how to improve the face detection precision and the detection speed to improve the face recognition precision and the recognition speed becomes a problem to be solved urgently.
Based on the above problem, the embodiment of the present application provides a method for face detection, before face recognition is performed, a head and shoulder recognition model (head and shoulder detection model) is first used to perform head and shoulder detection on an image to be recognized, so as to obtain a head and shoulder detection frame in the image to be recognized, then the image to be recognized is cut and processed based on the position of the head and shoulder detection frame, and finally face detection is performed on the processed image to be recognized. Therefore, the data volume of the image to be recognized can be reduced under the condition of ensuring that the face image information is not lost, on one hand, the size of a face target in the image to be recognized is increased, on the other hand, the data volume of the image to be recognized is reduced, the difficulty of face detection is reduced, the speed of face detection is increased, and the efficiency of face detection is improved.
Fig. 1 is a schematic flow chart of a method for detecting a face according to an embodiment of the present application, and as shown in fig. 1, the method includes:
101. and acquiring an image to be recognized, inputting the image to be recognized into the head and shoulder detection model to acquire head and shoulder characteristics, and determining the position of the head and shoulder detection frame based on the head and shoulder characteristics.
In the process of face detection, the image to be recognized contains a face target. Generally, the proportion of the human face target relative to the image to be recognized is small, and the human face target is difficult to recognize and detect. Therefore, the head and shoulder detection model can be utilized to perform head and shoulder identification on the image to be identified first. The head and shoulder images are larger than the face images, and the head and shoulder images comprise the face images. Therefore, the approximate position of the face image can be locked by performing the head and shoulder recognition first, and the range for determining the face image is further reduced.
The function of the head and shoulder detection model is to extract the head and shoulder features of an input image to be recognized to obtain a head and shoulder frame in the image to be recognized, namely, to select the head and shoulder image part in the image to be detected, and to determine the position of the head and shoulder detection frame based on the head and shoulder features. It can be understood that, in the embodiment of the application, the trained head and shoulder detection model can be directly called to perform the first-step detection on the image to be recognized, and if the head and shoulder detection model recognizes the head and shoulder image in the image to be recognized, the range of the face image can be reduced. If the head and shoulder detection model does not identify the head and shoulder images in the image to be identified, the image to be identified does not contain the face image, and the next detection step is not needed. The head and shoulder detection model can preliminarily screen a large number of images to be identified, and the efficiency of the whole detection process is improved.
102. And determining a detection frame image corresponding to the image to be identified according to the position of the head and shoulder detection frame.
And the head and shoulder detection model is used for detecting the head and shoulder of the image to be recognized to acquire head and shoulder characteristics, and then a head and shoulder detection frame of the image to be recognized is further obtained. Specifically, the head and shoulder detection model can output coordinate information of the head and shoulder detection frame in the image to be recognized, and further can lock the head and shoulder image in the image to be recognized according to the coordinate information, so that the range of the face image is reduced.
Then, after coordinate information of the head and shoulder detection frame in the image to be recognized is acquired through the head and shoulder detection model, the detection frame can be mapped to the image to be recognized according to the coordinate information, then the corresponding detection frame image in the image to be recognized is intercepted according to the head and shoulder detection frame, background features in the image to be recognized are removed, and image features used for face detection are reduced. Meanwhile, the size of the head and shoulder image in the detection frame image is larger, and the difficulty of face detection is reduced.
For example, the mapping method may be that, assuming that the original image is image _ raw, the size of the original image is (img _ w0, img _ h0), the size of the input image of the head-shoulder detection model is (img _ w1, img _ h1), and the obtained head-shoulder region frame is (x1, y1, w, h), the coordinates on the original image _ raw may be obtained through coordinate transformation:
(x1*img_w0/img_w1,y1*img_h0/img_h1,w*img_w0/img_w1,h*img_h0/img_h1)
further, the head-shoulder area Image _ a can be cut out from the original Image based on the coordinates. It should be noted that the specific values of the aforementioned img _ w1 and img _ w0 and the aforementioned img _ h1 and img _ h0 are not limited herein.
103. And inputting the detection frame image into a preset face detection model, and carrying out face detection on the detection frame image through the face detection model.
After the detection frame image is obtained, the detection frame image is input into a face detection model, and the face detection model can detect the detection frame image based on the face features. The face detection means determining the position, size, contour and the like of a face so as to perform feature comparison on a face detection result generated by face detection during subsequent face recognition to obtain identity information and the like corresponding to the face image.
It is to be understood that the head-shoulder detection model may determine a plurality of detection frame images, and the face detection model may also detect a plurality of faces included in the detection frame images.
Optionally, the process of performing face detection by the face detection model is as follows: the method comprises the steps of firstly carrying out face detection on a detection frame image, cutting out a main face area after detecting a face and positioning key feature points of the face, and feeding the cut main face area into a rear-end recognition algorithm after preprocessing. And the recognition algorithm extracts the face features and compares the extracted face features with the stored known faces to finish the final classification. Specifically, the face detection model is used for acquiring a facial image of a user, and the subsequent face recognition algorithm is used for calculating and analyzing the position, the face shape and the angle of the facial features of the user, comparing the facial features with an existing template in a database of the user, and then judging the real identity of the user. Further, the face recognition can comprehensively use a plurality of technologies such as digital image/video processing, pattern recognition, computer vision and the like, and the existing face recognition algorithm mainly comprises 4 types: an identification algorithm based on human face characteristic points, an identification algorithm based on the whole human face image, an identification algorithm based on a template, and an algorithm for identification by using a neural network.
In the embodiment of the application, head and shoulder detection is performed on an image to be recognized through a head and shoulder detection model to obtain head and shoulder characteristics, the position of a head and shoulder detection frame is determined based on the head and shoulder characteristics, then a detection frame image corresponding to the image to be recognized is determined according to the position of the head and shoulder detection frame, then the detection frame image is input into a preset face detection model, and face detection is performed on the detection frame image through the face detection model. Generally, the image to be recognized includes a head-shoulder image that is larger than the face image, it is easier to detect the head-shoulder image in the image to be recognized, and the head-shoulder image is generally close to the face image. Therefore, according to the embodiment of the application, the head and shoulder images are firstly identified, and then the detection frame images corresponding to the images to be identified are determined by using the positions of the head and shoulder images (head and shoulder detection frames), so that the data volume of the images to be identified can be reduced under the condition of ensuring that the face image information is not lost, and thus, when the face detection is carried out on the detection frame images corresponding to the images to be identified, on one hand, the size proportion of the face target in the images to be identified can be increased, on the other hand, the data volume of the images to be identified can be reduced, so that the difficulty of face detection is reduced, the speed of face detection is increased, and the efficiency of face detection is improved.
Fig. 2 is a schematic flow chart of another method for detecting a face according to an embodiment of the present application, and as shown in fig. 2, the method includes:
201. and zooming the image to be recognized to a first preset size.
Before the image to be recognized is input to the head and shoulder detection model, the image to be recognized may be preprocessed, and specifically, the image to be recognized may be scaled according to a fixed size (a first preset size). It can be understood that, in this step, in order to unify the input amount of the head and shoulder detection model, it is ensured that the sizes of the input images of the head and shoulder detection model are consistent, and it is also ensured that the images with smaller sizes can also be used for head and shoulder detection.
202. And inputting the zoomed image to be recognized into the head and shoulder detection model to obtain the head and shoulder characteristics, and determining the position of the head and shoulder detection frame based on the head and shoulder characteristics.
Step 202 is similar to step 101 in the embodiment shown in fig. 1, and is not described herein again.
203. And determining a detection frame image corresponding to the image to be identified according to the position of the head and shoulder detection frame.
Step 203 is similar to step 102 in the embodiment shown in fig. 1, and is not described herein again.
204. And processing the detection frame image according to the second preset size.
After the detection frame image is obtained, the detection frame image is processed according to a second preset size, and the size of the processed detection frame image is the second preset size so as to unify the size of the input image of the face detection model. Specifically, the detection frame image may be scaled down and enlarged in equal proportion, so that the size of the detection frame image is fixed to the second preset size. In a preferred example, when the size of the original detection frame image is larger than the second preset size, the original detection frame image may be cropped, that is, the background in the original detection frame image is cropped, so as to further reduce the input data amount of the face detection model.
205. And inputting the processed detection frame image into a face detection model, and carrying out face detection on the detection frame image through the face detection model.
Step 205 is similar to step 103 in the embodiment shown in fig. 1, and is not described herein again.
206. At least one face image included in the detection frame image is determined through a face detection model.
It is understood that a plurality of faces may be included in the detection frame image, and the face detection model may determine a plurality of face images in the detection frame image. When the face detection model outputs a plurality of face images, the face images can be further analyzed and processed, and compared with a head and shoulder detection frame detected in the detection frame image, and a final face detection result is obtained.
207. And determining a target face image which is successfully matched with the detection frame image in at least one face image.
After the face detection model identifies a plurality of face images in the detection frame images, each face image can be respectively matched with the detection frame images to obtain a target face image which is successfully matched.
For example, the target face image may be determined according to the intersection ratio of the face image and the detection frame image. The intersection ratio of the face image and the detection frame image reflects the coincidence degree of the face image and the head and shoulder image. Since the human face is specifically located on the head of the person, the higher the intersection ratio is, that is, the higher the coincidence degree of the human face image and the head-shoulder image is, the more accurate the identified human face image is. That is, the face image with the largest intersection ratio with the detection frame image among all the face images may be determined as the target face image, and determined as the face detection result. Meanwhile, a plurality of face images can also be sorted according to the intersection ratio of the face images and the detection frame images, and finally, a preset number of face images with high priority are selected as target face images according to the sorting result.
208. And screening the target face image according to a non-maximum suppression algorithm.
After the target face image is determined, the target face image can be screened by using a non-maximum suppression (NMS) algorithm. The non-maximum suppression algorithm, as the name implies, suppresses the maximum and can be understood as a local optimum. By using the method, the acquired face image can be screened, and the limit value is deleted to obtain the optimal target face image.
209. And determining a face detection result according to the screening result, and outputting the face detection result.
When the target face image is screened, the final face detection result can be determined according to the screening result.
In the embodiment of the application, head and shoulder detection is performed on an image to be recognized through a head and shoulder detection model to obtain a head and shoulder detection frame in the image to be recognized, then the image to be recognized is cut and processed according to the position of the head and shoulder detection frame to obtain a detection frame image corresponding to the image to be recognized, and then face detection is performed on the detection frame image through a face detection model to obtain a face detection result. Generally, the image to be recognized includes a head-shoulder image that is larger than the face image, it is easier to detect the head-shoulder image in the image to be recognized, and the head-shoulder image is generally close to the face image. Therefore, according to the embodiment of the application, the head and shoulder images are firstly identified, and then the images to be identified are cut by utilizing the positions of the head and shoulder images (the head and shoulder detection frames), so that the data volume of the images to be identified can be reduced under the condition of ensuring that the face image information is not lost, and therefore, when the face detection is carried out on the cut images to be identified, on one hand, the size proportion of the face target in the images to be identified can be increased, on the other hand, the data volume of the images to be identified can be reduced, the difficulty of the face detection is reduced, the speed of the face detection is increased, and the efficiency of the face detection is improved.
Fig. 3 is a face detection apparatus provided in an embodiment of the present application, including:
the head and shoulder detection module is used for acquiring head and shoulder characteristics of the image to be identified and determining a head and shoulder detection frame based on the head and shoulder characteristics so as to acquire a detection frame image corresponding to the image to be identified;
the face detection module is used for receiving the detection frame image to perform face detection;
the head and shoulder detection module includes a first input unit 301, an obtaining unit 302, and a determining unit 303:
the first input unit 301 is used for acquiring an image to be recognized and transmitting the image to the acquisition unit 302.
An obtaining unit 302, configured to obtain a head and shoulder detection frame of an image to be identified;
the determining unit 303 is configured to determine a detection frame image corresponding to the image to be recognized according to the position of the head and shoulder detection frame.
The face detection module includes a second input unit 304 and a processing unit 305:
the second input unit 304 is further configured to input the detection frame image to the processing unit 305.
A processing unit 305, configured to perform face detection on the detected frame image.
In an alternative embodiment, the processing unit 305 is further configured to scale the image to be recognized to a first preset size.
The first input unit 301 is specifically configured to input the scaled image to be recognized into the acquisition unit 302.
In an optional embodiment, the processing unit 304 is further configured to process the detection frame image according to a second preset size, where the size of the processed detection frame image is the second preset size and includes only a human face.
The second input unit 304 is specifically configured to input the processed detection frame image to the processing unit 305.
In an alternative embodiment, the processing unit 305 is specifically configured to determine at least one face image included in the detection frame image, determine a target face image successfully matched with the detection frame image in the at least one face image, determine a face detection result according to the target face image, and output the face detection result.
In an alternative embodiment, the processing unit 305 is specifically configured to determine an intersection ratio between the face image and the detection frame image, and determine a target face image in the face image according to the intersection ratio between the face image and the detection frame image.
In an alternative embodiment, the processing unit 305 is specifically configured to determine, as a face detection result, a target face image with a largest intersection ratio with the detection frame image in the face image; or, determining a preset number of target face images with high priority in the face images according to the intersection ratio of the face images and the detection frame images.
In an optional implementation, the processing unit 305 is further configured to filter a preset number of target face images according to a non-maximum suppression algorithm; and determining a face detection result according to the screening result.
Referring to fig. 4, a schematic structural diagram of another face detection terminal according to an embodiment of the present application is shown, where the terminal 400 includes: a processor 401, a memory 402 and a computer program 403 stored in said memory and executable on said processor, wherein said computer program when executed by the processor implements the above-mentioned face detection method.
The processor 401 and the memory 402 may be interconnected by a bus; the bus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc.
The processor 401 may be a Central Processing Unit (CPU), a Network Processor (NP), or a combination of a CPU and an NP. The processor 801 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a Programmable Logic Device (PLD), or a combination thereof. The PLD may be a Complex Programmable Logic Device (CPLD), a field-programmable gate array (FPGA), a General Array Logic (GAL), or any combination thereof.
In one embodiment, the terminal 400 further comprises a communication interface for communicating with peripheral devices, which may be a wired communication interface, such as an ethernet interface, a wireless communication interface, or a combination thereof. The ethernet interface may be an optical interface, an electrical interface, or a combination thereof. The wireless communication interface may be a WLAN interface, a cellular network communication interface, a combination thereof, or the like.
Optionally, the memory 402 may also be configured to store program instructions, and the processor 401 invokes the program instructions stored in the memory 402, may execute steps in the method embodiment shown in fig. 1 or fig. 2, or implement optional embodiments thereof, so that the face detection apparatus implements the steps in the method, which is not described herein again.
In some embodiments of the present application, the terminal may further include an image capturing device, and the image capturing device may be configured to capture the image to be recognized.
In some specific embodiments of the present application, the image capturing device may be any one or more combination of a color camera, a black and white camera, a grayscale camera, an infrared camera, a depth camera, and the like, which is not limited herein.
The present application further provides a chip or a chip system, where the chip or the chip system includes at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor executes instructions or a computer program to perform one or more steps in the method embodiments shown in fig. 1 or fig. 2.
The communication interface in the chip may be an input/output interface, a pin, a circuit, or the like.
In a possible implementation, the chip or chip system described above further comprises at least one memory, in which instructions are stored. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or may be a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
The embodiment of the present application further provides a computer storage medium, where computer program instructions for implementing the face detection method provided by the embodiment of the present application are stored in the computer storage medium.
An embodiment of the present application further provides a computer program product, where the computer program product includes computer software instructions, and the computer software instructions may be loaded by a processor to implement the flow in the face detection method shown in fig. 1 or fig. 2.
Technical terms used in the embodiments of the present invention are only used for illustrating specific embodiments and are not intended to limit the present invention. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. Further, the use of "including" and/or "comprising" in the specification is intended to specify the presence of stated features, integers, steps, operations, elements, and/or components, but does not preclude the presence or addition of one or more other features, integers, steps, operations, elements, and/or components.
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules to perform all or part of the above-mentioned functions. Each functional unit and module in the embodiments may be integrated in one processing unit, or each unit may exist alone physically, or two or more units are integrated in one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used for limiting the protection scope of the present application. The specific working processes of the units and modules in the system may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/terminal and method may be implemented in other ways. For example, the above-described apparatus/terminal embodiments are merely illustrative, and for example, the division of the modules or units is only one logical division, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The corresponding structures, materials, acts, and equivalents of all means or step plus function elements in the claims below, if any, are intended to include any structure, material, or act for performing the function in combination with other claimed elements as specifically claimed. The description of the present invention has been presented for purposes of illustration and description, but is not intended to be exhaustive or limited to the invention in the form disclosed.
Claims (11)
1. A face detection method, comprising:
acquiring an image to be recognized, inputting the image to be recognized into a head and shoulder detection model to acquire head and shoulder characteristics, and determining the position of a head and shoulder detection frame based on the head and shoulder characteristics;
determining a detection frame image corresponding to the image to be identified according to the position of the head and shoulder detection frame;
and inputting the detection frame image into a preset face detection model, and carrying out face detection on the detection frame image through the face detection model.
2. The method of claim 1, wherein prior to entering the image to be recognized into the head-shoulder detection model, the method further comprises:
zooming the image to be recognized to a first preset size;
the step of inputting the image to be recognized into the head and shoulder detection model comprises the following steps:
and inputting the zoomed image to be recognized into the head and shoulder detection model.
3. The method of any of claims 1-2, wherein prior to inputting the detection frame image into a face detection model, the method further comprises:
processing the detection frame image according to a second preset size;
the inputting the detection frame image into the face detection model comprises:
and inputting the processed detection frame image into the human face detection model.
4. The method according to claim 3, wherein the performing face detection on the detection frame image by the face detection model comprises:
determining at least one face image included in the detection frame image through the face detection model;
determining a target face image which is successfully matched with the detection frame image in the at least one face image;
and determining a face detection result according to the target face image, and outputting the face detection result.
5. The method of claim 4, wherein the determining the target face image of the face images that is successfully matched with the detection frame image comprises:
respectively determining the intersection ratio of the face image and the detection frame image;
and determining the target face image in the face image according to the intersection ratio of the face image and the detection frame image.
6. The method according to claim 5, wherein the determining the target face image in the face images according to the intersection ratio of the face image and the detection frame image comprises:
determining the target face image with the largest intersection ratio with the detection frame image in the face images as the face detection result; or the like, or, alternatively,
and determining a preset number of target face images with high priority in the face images according to the intersection ratio of the face images and the detection frame images.
7. The method of claim 6, wherein determining a face detection result from the target face image comprises:
screening the preset number of target face images according to a non-maximum suppression algorithm;
and determining the face detection result according to the screening result.
8. A face detection apparatus, comprising:
the head and shoulder detection module is used for acquiring head and shoulder characteristics of the image to be identified and determining a head and shoulder detection frame based on the head and shoulder characteristics so as to acquire a detection frame image corresponding to the image to be identified;
the face detection module is used for receiving the detection frame image to carry out face detection;
the head and shoulder detection module comprises a first input unit, an acquisition unit and a determination unit:
the first input unit is used for acquiring the image to be identified and transmitting the image to the acquisition unit;
the acquisition unit is used for acquiring a head and shoulder detection frame of the image to be identified;
the determining unit is used for determining a detection frame image corresponding to the image to be identified according to the position of the head and shoulder detection frame;
the face detection module comprises a second input unit and a processing unit:
the second input unit is used for inputting the detection frame image to the processing unit;
and the processing unit is used for carrying out face detection on the detection frame image through a preset face detection model.
9. A terminal comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the method according to any of claims 1 to 7 when executing the computer program.
10. The terminal according to claim 9, characterized in that the terminal further comprises an image capturing device for capturing the image to be recognized according to any one of claims 1 to 7.
11. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1 to 7.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111211767.5A CN113989881A (en) | 2021-10-18 | 2021-10-18 | Face detection method, device and terminal |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111211767.5A CN113989881A (en) | 2021-10-18 | 2021-10-18 | Face detection method, device and terminal |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| CN113989881A true CN113989881A (en) | 2022-01-28 |
Family
ID=79739204
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN202111211767.5A Pending CN113989881A (en) | 2021-10-18 | 2021-10-18 | Face detection method, device and terminal |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN113989881A (en) |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114943858A (en) * | 2022-04-22 | 2022-08-26 | 阿里巴巴(中国)有限公司 | Data center inspection system, battery abnormity identification method, equipment and storage medium |
| CN116665024A (en) * | 2023-06-07 | 2023-08-29 | 浙江久婵物联科技有限公司 | Image processing system and method in face recognition |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2019114036A1 (en) * | 2017-12-12 | 2019-06-20 | 深圳云天励飞技术有限公司 | Face detection method and device, computer device, and computer readable storage medium |
| CN111062306A (en) * | 2019-12-12 | 2020-04-24 | 广东美的白色家电技术创新中心有限公司 | Control method and control device for household appliance, household appliance and storage device |
| CN111353473A (en) * | 2020-03-30 | 2020-06-30 | 浙江大华技术股份有限公司 | Face detection method and device, electronic equipment and storage medium |
| CN111414887A (en) * | 2020-03-30 | 2020-07-14 | 上海高重信息科技有限公司 | Face recognition method of secondary detection mask based on YOLOV3 algorithm |
-
2021
- 2021-10-18 CN CN202111211767.5A patent/CN113989881A/en active Pending
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| WO2019114036A1 (en) * | 2017-12-12 | 2019-06-20 | 深圳云天励飞技术有限公司 | Face detection method and device, computer device, and computer readable storage medium |
| CN111062306A (en) * | 2019-12-12 | 2020-04-24 | 广东美的白色家电技术创新中心有限公司 | Control method and control device for household appliance, household appliance and storage device |
| CN111353473A (en) * | 2020-03-30 | 2020-06-30 | 浙江大华技术股份有限公司 | Face detection method and device, electronic equipment and storage medium |
| CN111414887A (en) * | 2020-03-30 | 2020-07-14 | 上海高重信息科技有限公司 | Face recognition method of secondary detection mask based on YOLOV3 algorithm |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN114943858A (en) * | 2022-04-22 | 2022-08-26 | 阿里巴巴(中国)有限公司 | Data center inspection system, battery abnormity identification method, equipment and storage medium |
| CN116665024A (en) * | 2023-06-07 | 2023-08-29 | 浙江久婵物联科技有限公司 | Image processing system and method in face recognition |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN111951237B (en) | Visual appearance detection method | |
| CN111292305B (en) | An improved YOLO-V3 metal processing surface defect detection method | |
| CN112381075B (en) | Method and system for carrying out face recognition under specific scene of machine room | |
| WO2019080203A1 (en) | Gesture recognition method and system for robot, and robot | |
| Qing et al. | Automated detection and identification of white-backed planthoppers in paddy fields using image processing | |
| CN111951238A (en) | Product defect detection method | |
| CN108664840A (en) | Image-recognizing method and device | |
| CN105678213B (en) | Dual-mode mask person event automatic detection method based on video feature statistics | |
| CN109815823B (en) | Data processing method and related product | |
| CN112784712B (en) | Missing child early warning implementation method and device based on real-time monitoring | |
| CN110348289B (en) | Finger vein identification method based on binary image | |
| CN113989881A (en) | Face detection method, device and terminal | |
| US20220405527A1 (en) | Target Detection Methods, Apparatuses, Electronic Devices and Computer-Readable Storage Media | |
| CN113076860B (en) | Bird detection system under field scene | |
| CN118644733A (en) | An intelligent ore identification system based on three-dimensional mineral data | |
| CN112132151A (en) | Image character recognition system and method based on recurrent neural network recognition algorithm | |
| Chumuang et al. | Eggs Separation Process by Image Processing | |
| CN108563997B (en) | Method and device for establishing face detection model and face recognition | |
| CN110619273A (en) | Efficient iris recognition method and device | |
| CN107341456B (en) | Weather sunny and cloudy classification method based on single outdoor color image | |
| CN114359641A (en) | Target object detection method, related device and equipment | |
| CN113887314A (en) | Vehicle driving direction identification method and device, computer equipment and storage medium | |
| CN118865370A (en) | A system and method for intelligent detection and analysis of quality of finished Chinese medicine pieces | |
| CN114638785B (en) | Method, system, medium, device and terminal for detecting strong light area in image | |
| CN110866500A (en) | Face detection alignment system, method, device, platform, mobile terminal and storage medium |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| PB01 | Publication | ||
| PB01 | Publication | ||
| SE01 | Entry into force of request for substantive examination | ||
| SE01 | Entry into force of request for substantive examination |