Target face image detection method and device, storage medium, and electronic device
By calculating the differences in brightness statistics in the left and right areas in the face of the face of the face, the problem of low and accurate accuracy of yin and yang face sample data mining data in existing technologies has been solved, and high -efficiency and accurate target face image detection is achieved.
Patent Information
- Application Number
- CN202010130175.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-02-28
- Publication Date
- 2025-01-28
- Estimated Expiration
- 2040-02-28
AI Technical Summary
The prior art is inefficient and prone to errors when digging Yin-Yang face sample data through artificial means.
By obtaining the original image, determine the corresponding face cover image of the person, and calculate the difference in pixel brightness statistics in the left and right areas in the image of the images. If the difference meets the specified conditions, the original image contains the target face image.
It improves the detection efficiency of the target face image, reduces the investment of manpower and material resources, and enhances the accuracy of the test results.
Smart Images

Figure CN113326718B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of face recognition technology, and in particular to a target face image detection method, a target face image detection device, an electronic device, and a computer-readable storage medium. Background Art
[0002] With the rapid development of artificial intelligence technology, image recognition technology has attracted more and more attention. As a branch of image recognition, face recognition has been widely used in many fields. For example, face recognition technology can be applied to access control systems, payment systems, traffic safety systems, etc. Among them, sample data plays a vital role in the accuracy and recognition efficiency of face recognition technology.
[0003] At present, when mining facial sample data with special attributes such as "yin-yang face", we can only rely on manual methods to screen "yin-yang face" samples by judging the differences in light distribution in facial images. However, this method not only wastes a lot of manpower and material resources, but also has low recognition efficiency and is prone to errors.
[0004] It should be noted that the information disclosed in the above background technology section is only used to enhance the understanding of the background of the present disclosure, and therefore may include information that does not constitute the prior art known to ordinary technicians in the field. Summary of the invention
[0005] The purpose of the present disclosure is to provide a target face image detection method, a target face image detection device, an electronic device and a computer-readable storage medium, thereby overcoming to a certain extent the problems of low efficiency and easy errors in manually mining yin-yang face sample data due to the limitations and defects of related technologies.
[0006] According to a first aspect of the present disclosure, a target face image detection method is provided, comprising:
[0007] Acquire an original image, and determine a face mask image corresponding to the original image, wherein the face mask image includes a first mask area and a second mask area;
[0008] Calculating first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the second mask area;
[0009] When the difference between the first brightness statistical data and the second brightness statistical data meets a specified condition, it is determined that the original image contains a target face image.
[0010] In an exemplary embodiment of the present disclosure, obtaining an original image includes:
[0011] Obtain sample video data from a preset database;
[0012] Image frames are extracted from the sample video data to obtain original images corresponding to the sample video data.
[0013] In an exemplary embodiment of the present disclosure, determining the face mask image corresponding to the original image includes:
[0014] The original image is subjected to face registration processing by a preset face registration tool to determine a face mask image corresponding to the original image.
[0015] In an exemplary embodiment of the present disclosure, before performing face registration processing on the original image by using a preset face registration tool, the method further includes:
[0016] Performing face detection processing on the original image by using a preset face detection tool to determine at least two face frames in the original image; wherein at least two face frames correspond to at least two face images;
[0017] The face image corresponding to the largest face frame is used as the face image to be detected corresponding to the original image.
[0018] In an exemplary embodiment of the present disclosure, determining the face mask image corresponding to the original image includes:
[0019] Performing face registration processing on the face image to be detected corresponding to the original image by using the face registration tool to determine a plurality of contour feature points of the face image to be detected;
[0020] A face mask image corresponding to the original image is determined according to the contour feature points.
[0021] In an exemplary embodiment of the present disclosure, determining a face mask image corresponding to the original image according to the contour feature points includes:
[0022] Based on the contour feature points, a mask image construction process is performed on the face image to be detected to determine a face mask image corresponding to the original image.
[0023] In an exemplary embodiment of the present disclosure, based on the contour feature points, performing mask image construction processing on the face image to be detected to determine the face mask image corresponding to the original image includes:
[0024] Based on a preset mask image constructor, determining a mask polygon corresponding to the face image to be detected according to the contour feature points;
[0025] A face mask image corresponding to the original image is determined according to the mask polygon and the face image to be detected.
[0026] In an exemplary embodiment of the present disclosure, determining a mask image corresponding to the original image according to the mask polygon and the original image includes:
[0027] The face image to be detected is cropped according to the mask polygon to determine a face mask image corresponding to the original image.
[0028] In an exemplary embodiment of the present disclosure, before calculating first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the right face mask image area, the method further includes:
[0029] The original color channels corresponding to the pixels of the face mask image are converted into target color channels to calculate brightness statistics of the pixels of the face mask image according to the channel values corresponding to the target color channels.
[0030] In an exemplary embodiment of the present disclosure, the target color channel includes a brightness channel, and the calculating first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the right face mask image area includes:
[0031] Obtaining a first channel value corresponding to a brightness channel of the first mask area and obtaining a second channel value corresponding to a brightness channel of the second mask area;
[0032] First brightness statistics data corresponding to the first mask area and second brightness statistics data corresponding to the second mask area are calculated according to the first channel value and the second channel value.
[0033] In an exemplary embodiment of the present disclosure, calculating first brightness statistics corresponding to the first mask area and second brightness statistics corresponding to the second mask area according to the first channel value and the second channel value includes:
[0034] Determine first area data of the mask polygon corresponding to the first mask area and determine second area data of the mask polygon corresponding to the second mask area;
[0035] Calculate first brightness statistical data corresponding to the first mask area according to the first channel value and the first area data;
[0036] Second brightness statistical data corresponding to the second mask area is calculated according to the second channel value and the second area data.
[0037] In an exemplary embodiment of the present disclosure, when the difference between the first brightness statistical data and the second brightness statistical data satisfies a specified condition, determining that the original image includes a target face image includes:
[0038] Calculating a difference between the first brightness statistical data and the second brightness statistical data;
[0039] Determine whether a difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to a preset difference threshold;
[0040] If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to the difference threshold, it is determined that the original image contains a target face image;
[0041] If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is less than the difference threshold, it is determined that the original image does not contain the target face image, and the original image is deleted.
[0042] According to a second aspect of the present disclosure, a target face image detection device is provided, comprising:
[0043] A face mask image determination module, used to obtain an original image and determine a face mask image corresponding to the original image, wherein the face mask image includes a first mask area and a second mask area;
[0044] a brightness statistics calculation module, configured to calculate first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the second mask area;
[0045] The target face image detection module is used to determine that the original image contains a target face image when the difference between the first brightness statistical data and the second brightness statistical data meets a specified condition.
[0046] In an exemplary embodiment of the present disclosure, the face mask image determination module further includes an original image acquisition unit, and the original image acquisition unit is configured to:
[0047] Obtain sample video data from a preset database;
[0048] Image frames are extracted from the sample video data to obtain original images corresponding to the sample video data.
[0049] In an exemplary embodiment of the present disclosure, the face mask image determination module further includes a face registration unit, and the face registration unit is configured to:
[0050] The original image is subjected to face registration processing by a preset face registration tool to determine a face mask image corresponding to the original image.
[0051] In an exemplary embodiment of the present disclosure, the target face image detection device further includes a face image monitoring unit to be detected, and the face image monitoring unit to be detected is configured as follows:
[0052] Performing face detection processing on the original image by using a preset face detection tool to determine at least two face frames in the original image; wherein at least two face frames correspond to at least two face images;
[0053] The face image corresponding to the largest face frame is used as the face image to be detected corresponding to the original image.
[0054] In an exemplary embodiment of the present disclosure, the face mask image determination module further includes:
[0055] A contour feature point detection unit, used to perform face registration processing on the face image to be detected corresponding to the original image through the face registration tool, and determine a plurality of contour feature points of the face image to be detected;
[0056] A face mask image determining unit is used to determine the face mask image corresponding to the original image according to the contour feature points.
[0057] In an exemplary embodiment of the present disclosure, the face mask image determining unit is further configured to:
[0058] Based on the contour feature points, a mask image construction process is performed on the face image to be detected to determine a face mask image corresponding to the original image.
[0059] In an exemplary embodiment of the present disclosure, the face mask image determining unit is further configured to:
[0060] Based on a preset mask image constructor, determining a mask polygon corresponding to the face image to be detected according to the contour feature points;
[0061] A face mask image corresponding to the original image is determined according to the mask polygon and the face image to be detected.
[0062] In an exemplary embodiment of the present disclosure, the face mask image determining unit is further configured to:
[0063] The face image to be detected is cropped according to the mask polygon to determine a face mask image corresponding to the original image.
[0064] In an exemplary embodiment of the present disclosure, the target face image detection device further includes a channel conversion unit, and the channel conversion unit is configured as follows:
[0065] The original color channels corresponding to the pixels of the face mask image are converted into target color channels to calculate brightness statistics of the pixels of the face mask image according to the channel values corresponding to the target color channels.
[0066] In an exemplary embodiment of the present disclosure, the brightness statistical data calculation module further includes:
[0067] A channel value acquisition unit, configured to acquire a first channel value corresponding to a brightness channel of the first mask area and to acquire a second channel value corresponding to a brightness channel of the second mask area;
[0068] The brightness statistical data calculation unit is used to calculate first brightness statistical data corresponding to the first mask area and second brightness statistical data corresponding to the second mask area according to the first channel value and the second channel value.
[0069] In an exemplary embodiment of the present disclosure, the brightness statistical data calculation unit is further configured to:
[0070] Determine first area data of the mask polygon corresponding to the first mask area and determine second area data of the mask polygon corresponding to the second mask area;
[0071] Calculate first brightness statistical data corresponding to the first mask area according to the first channel value and the first area data;
[0072] Second brightness statistical data corresponding to the second mask area is calculated according to the second channel value and the second area data.
[0073] In an exemplary embodiment of the present disclosure, the target face image detection module is further configured to:
[0074] Calculating a difference between the first brightness statistical data and the second brightness statistical data;
[0075] Determine whether a difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to a preset difference threshold;
[0076] If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to the difference threshold, it is determined that the original image contains a target face image;
[0077] If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is less than the difference threshold, it is determined that the original image does not contain the target face image, and the original image is deleted.
[0078] According to a third aspect of the present disclosure, an electronic device is provided, comprising: a processor; and a memory for storing executable instructions of the processor; wherein the processor is configured to execute any one of the above-mentioned methods by executing the executable instructions.
[0079] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, any one of the methods described above is implemented.
[0080] The exemplary embodiments of the present disclosure may have some or all of the following beneficial effects:
[0081] In a target facial image detection method provided in an example embodiment of the present disclosure, a facial mask image corresponding to an acquired original image is determined, and first brightness statistics data corresponding to pixels of a first mask area in the facial mask image and second brightness statistics data corresponding to pixels of a second mask area are calculated. When the difference between the first brightness statistics data and the second brightness statistics data meets a specified condition, it is determined that the original image contains the target facial image. On the one hand, when detecting a target face image, i.e., an image containing a yin-yang face, from an original image, the target face image is mined by calculating the difference in brightness statistical data between the left and right regions in a face mask image, which not only saves a lot of manpower and material resources, but also all the mining processes can be realized by a computer, effectively improving the detection efficiency of the target face image; on the other hand, by determining the face mask image corresponding to the original image, and then judging whether the original image contains the target face image based on the face mask image, not only can the interference factors in the original image be eliminated to make the detection result more accurate, but also the number of pixels involved in the system calculation can be reduced, further improving the detection efficiency; on the other hand, by setting specified conditions, when the difference between the first brightness statistical data and the second brightness statistical data meets the specified conditions, it is determined that the original image contains the target face image, further ensuring the accuracy of the target face image detection.
[0082] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0083] The accompanying drawings herein are incorporated into the specification and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the specification are used to explain the principles of the present disclosure. Obviously, the accompanying drawings described below are only some embodiments of the present disclosure, and for ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without creative work.
[0084] Figure 1 A schematic diagram showing an exemplary system architecture of a target face image detection method and device to which the embodiments of the present disclosure can be applied;
[0085] Figure 2 A schematic diagram showing the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown;
[0086] Figure 3 The following is a schematic diagram showing a process flow of a target face image detection method according to an embodiment of the present disclosure;
[0087] Figure 4 The following schematically shows a flow chart of performing face detection on an original image according to an embodiment of the present disclosure;
[0088] Figure 5 The following schematically shows a flow chart of performing face registration on an original image according to an embodiment of the present disclosure;
[0089] Figure 6 The following schematically shows a flow chart of determining a face mask image by using a mask polygon according to an embodiment of the present disclosure;
[0090] Figure 7 A schematic diagram of a process of calculating brightness statistical data according to an embodiment of the present disclosure is shown;
[0091] Figure 8 A schematic diagram of a process of calculating brightness statistics using mask polygons and pixel channel values according to an embodiment of the present disclosure is shown;
[0092] Fig. 9 The following schematically shows a process flow diagram of detecting a target face image according to an embodiment of the present disclosure;
[0093] Fig.10 The following schematically shows a flow chart of detecting whether an original image contains a target face image according to an embodiment of the present disclosure;
[0094] Fig.11 The following schematically shows an application diagram of performing face detection on an original image according to an embodiment of the present disclosure;
[0095] Fig.12 The following schematically shows an application diagram of constructing a face mask image according to an embodiment of the present disclosure;
[0096] Fig.13 A schematic block diagram of a target face image detection device according to an embodiment of the present disclosure is schematically shown. DETAILED DESCRIPTION
[0097] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as being limited to the examples set forth herein; on the contrary, these embodiments are provided so that the present disclosure will be more comprehensive and complete, and the concepts of the example embodiments are fully conveyed to those skilled in the art. The described features, structures, or characteristics may be combined in one or more embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the embodiments of the present disclosure. However, those skilled in the art will appreciate that the technical solutions of the present disclosure may be practiced while omitting one or more of the specific details, or other methods, components, devices, steps, etc. may be adopted. In other cases, known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.
[0098] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and their repeated description will be omitted. Some of the block diagrams shown in the accompanying drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or implemented in one or more hardware modules or integrated circuits, or implemented in different networks and / or processor devices and / or microcontroller devices.
[0099] Figure 1 A schematic diagram showing a system architecture of an exemplary application environment in which a target face image detection method and device according to an embodiment of the present disclosure can be applied.
[0100] like Figure 1 As shown, the system architecture 100 may include one or more of terminal devices 101, 102, 103, a network 104, and a server 105. The network 104 is used to provide a medium for communication links between the terminal devices 101, 102, 103 and the server 105. The network 104 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc. The terminal devices 101, 102, 103 may be various electronic devices with display screens, including but not limited to desktop computers, portable computers, smart phones, tablet computers, etc. It should be understood that Figure 1The number of terminal devices, networks and servers in the embodiment is only for illustration. According to the implementation requirements, there may be any number of terminal devices, networks and servers. For example, the server 105 may be a server cluster composed of multiple servers.
[0101] The target face image detection method provided in the embodiment of the present disclosure is generally executed by the server 105, and accordingly, the target face image detection device is generally set in the server 105. However, it is easy for those skilled in the art to understand that the target face image detection method provided in the embodiment of the present disclosure can also be executed by the terminal devices 101, 102, and 103, and accordingly, the target face image detection device can also be set in the terminal devices 101, 102, and 103, and this is not particularly limited in the present exemplary embodiment. For example, in an exemplary embodiment, the user can upload the original image to the server 105 through the terminal devices 101, 102, and 103, and the server transmits the original image containing the target face image to the terminal devices 101, 102, and 103 through the target face image detection method provided in the embodiment of the present disclosure.
[0102] Figure 2 A schematic diagram of the structure of a computer system suitable for implementing an electronic device of an embodiment of the present disclosure is shown.
[0103] It should be noted that Figure 2 The computer system 200 of the electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0104] like Figure 2 As shown, the computer system 200 includes a central processing unit (CPU) 201, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 202 or a program loaded from a storage part 208 into a random access memory (RAM) 203. Various programs and data required for system operation are also stored in the RAM 203. The CPU 201, the ROM 202, and the RAM 203 are connected to each other via a bus 204. An input / output (I / O) interface 205 is also connected to the bus 204.
[0105] The following components are connected to the I / O interface 205: an input section 206 including a keyboard, a mouse, etc.; an output section 207 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 208 including a hard disk, etc.; and a communication section 209 including a network interface card such as a LAN card, a modem, etc. The communication section 209 performs communication processing via a network such as the Internet. A drive 210 is also connected to the I / O interface 205 as needed. A removable medium 211, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 210 as needed, so that a computer program read therefrom is installed into the storage section 208 as needed.
[0106] In particular, according to an embodiment of the present disclosure, the process described below with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program contains a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 209, and / or installed from the removable medium 211. When the computer program is executed by the central processing unit (CPU) 201, the various functions defined in the method and apparatus of the present application are executed. In some embodiments, the computer system 200 may also include an AI (Artificial Intelligence) processor, which is used to process computing operations related to machine learning.
[0107] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0108] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0109] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0110] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being installed in the electronic device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method described in the following embodiment. For example, the electronic device may implement the following method. Figure 3 to Figure 9 The various steps shown, etc.
[0111] The technical solution of the embodiment of the present disclosure is described in detail below:
[0112] Computer vision technology (CV) is a science that studies how to make machines "see". To put it more specifically, it refers to the use of cameras and computers to replace human eyes to identify, track and measure targets, and further perform image processing to make computer processing into images that are more suitable for human observation or transmission to instruments for detection. As a scientific discipline, computer vision studies related theories and technologies, and attempts to establish an artificial intelligence system that can obtain information from images or multi-dimensional data. Computer vision technology usually includes image processing, image recognition, image semantic understanding, image retrieval, OCR, video processing, video semantic understanding, video content / behavior recognition, three-dimensional object reconstruction, 3D technology, virtual reality, augmented reality, simultaneous positioning and map construction, and other technologies, as well as common biometric recognition technologies such as face recognition and fingerprint recognition.
[0113] Artificial Intelligence (AI) is the theory, method, technology and application system that uses digital computers or machines controlled by digital computers to simulate, extend and expand human intelligence, perceive the environment, acquire knowledge and use knowledge to obtain the best results. In other words, artificial intelligence is a comprehensive technology in computer science that attempts to understand the essence of intelligence and produce a new intelligent machine that can respond in a similar way to human intelligence. Artificial intelligence is to study the design principles and implementation methods of various intelligent machines so that machines have the functions of perception, reasoning and decision-making.
[0114] Artificial intelligence technology is a comprehensive discipline that covers a wide range of fields, including both hardware-level and software-level technologies. The basic technologies of artificial intelligence generally include sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technology, operation / interaction systems, mechatronics and other technologies. Artificial intelligence software technology mainly includes computer vision technology, speech processing technology, natural language processing technology, and machine learning / deep learning.
[0115] The inventors have found that while face recognition algorithms have been widely used, their performance and accuracy are still affected by factors such as lighting, viewing angle, and occlusion. Lighting changes are a key factor affecting face recognition performance because the three-dimensional structure of the face and the shadows cast by the light will strengthen or weaken the original facial features. Among them, a partially shadowed facial image (i.e., a "yin-yang face") refers to an image containing non-illuminated surfaces and illuminated surfaces, where different areas of the face are affected by uneven light distribution or external factors such as hair, arms, and clothes under the illumination of a strong light source or a unilateral light source, resulting in large differences in color and brightness in different areas of the face. At present, there is no technical solution for mining sample images with special attributes such as partially shadowed facial images (hereinafter referred to as "yin-yang faces" for ease of description) from massive original images. Moreover, at present, if we want to mine sample images with special attributes such as "yin-yang faces" from massive original images, we can only manually judge and mark the images that may contain "yin-yang faces" in massive original images. This solution not only consumes a lot of manpower and material resources, but also has very low detection efficiency. The sample images obtained contain many erroneous samples and inconsistent standards, resulting in poor face recognition effect when the machine learning model related to face recognition technology is trained with the sample images obtained manually.
[0116] Based on one or more of the above problems, this exemplary embodiment provides a target face image detection method. The target face image detection method can be applied to the above server 105, and can also be applied to one or more of the above terminal devices 101, 102, 103, which is not particularly limited in this exemplary embodiment. The following is an example of a server executing the method. Figure 3 As shown, the target face image detection method may include the following steps S310 to S330:
[0117] Step S310: Acquire an original image, and determine a face mask image corresponding to the original image, wherein the face mask image includes a first mask area and a second mask area.
[0118] Step S320: Calculate first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the second mask area.
[0119] Step S330: When the difference between the first brightness statistical data and the second brightness statistical data meets a specified condition, determine that the original image contains a target face image.
[0120] In the target face image detection method provided in the present example implementation, on the one hand, when detecting the target face image, i.e., the image containing the yin-yang face, from the original image, the target face image is mined by calculating the difference in brightness statistical data between the left and right regions in the face mask image, which not only saves a lot of manpower and material resources, but also all the mining processes can be realized by a computer, effectively improving the detection efficiency of the target face image; on the other hand, by determining the face mask image corresponding to the original image, and then judging whether the original image contains the target face image based on the face mask image, not only can the interference factors in the original image be eliminated to make the detection result more accurate, but also the number of pixels involved in the system calculation can be reduced, further improving the detection efficiency; on the other hand, by setting specified conditions, when the difference between the first brightness statistical data and the second brightness statistical data meets the specified conditions, it is determined that the original image contains the target face image, further ensuring the accuracy of the target face image detection.
[0121] Next, the above steps of this exemplary embodiment are described in more detail.
[0122] In step S310, an original image is acquired, and a face mask image corresponding to the original image is determined, wherein the face mask image includes a first mask area and a second mask area.
[0123] In an example embodiment of the present disclosure, the original image may refer to a set of images containing human faces to be detected (to be mined) obtained through various means. For example, the original image may be a set of face images obtained by intercepting video frames from multiple video data, or a set of face images captured from the Internet by a web crawler tool (Web crawler). Of course, it may also be a set of face images randomly generated by a generative adversarial network (GAN), and this example embodiment does not specifically limit this.
[0124] Image masking can refer to the use of selected images, graphics or objects to block the image to be processed (all or part) to control the area or process of image processing. The specific image or object used for covering is called a mask or template. A face mask image can refer to an image of facial features of a face in an original image captured by a mask polygon. It can also be considered that a face mask image can be an image obtained by removing parts of the original image that are not related to facial features of the face (such as hair and other interfering factors that may affect the brightness of the image) through a mask polygon. This example implementation does not make any special restrictions on this.
[0125] Preferably, in this exemplary embodiment, the face mask image can be divided into a first mask area and a second mask area according to the position of the area to be detected. For example, the first mask area can be the left face mask area, and the second mask area can be the right face mask area. Of course, the first mask area can also be the upper mask area, and the second mask area can also be the lower mask area. In actual application, the determined face mask image can also be divided into a mask area containing at least two areas according to the position of the area to be detected. This exemplary embodiment does not specifically limit this.
[0126] Specifically, when the first mask area is a left face mask area, the first mask area may refer to an area corresponding to the facial features of the left face of the face image in the original image; when the second mask area is a right face mask area, the second mask area may refer to an area corresponding to the facial features of the right face of the face image in the original image; other situations are similar and will not be elaborated here.
[0127] It should be noted that the "first" and "second" here are only used to distinguish the illuminated surface (area with higher brightness) and the non-illuminated surface (area with lower brightness) in the face mask image, and should not impose any special limitations on this example embodiment.
[0128] In step S320, first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the second mask area are calculated.
[0129] In an example embodiment of the present disclosure, the first brightness statistical data may refer to data that can characterize the brightness of pixels in the first mask area, and the second brightness statistical data may refer to data that can characterize the brightness of pixels in the second mask area. Specifically, the brightness statistical data may be data calculated from the channel values of the color channels corresponding to the pixels in the first mask area or the second mask area, or may be regional average brightness data calculated from the channel values of the color channels corresponding to the pixels in the first mask area or the second mask area and the regional area. Of course, it may also be other data that can characterize the brightness of pixels in the first mask area or the second mask area. For example, the brightness statistical data may also be a pixel brightness distribution histogram or a pixel brightness distribution table, and this example embodiment does not specifically limit this.
[0130] It should be noted that the “first” and “second” here are only used to distinguish the difference in brightness statistical data corresponding to the first mask area or the second mask area, and have no special meaning in this example embodiment and should not cause any special limitation to this example embodiment.
[0131] In step S330, when the difference between the first brightness statistical data and the second brightness statistical data meets a specified condition, it is determined that the original image contains a target face image.
[0132] In an example embodiment of the present disclosure, the specified condition may refer to data determined based on prior knowledge data and used to determine whether the difference between the first mask area or the second mask area meets the standard of a "yin-yang face" image. For example, the specified condition may be that the difference between the first brightness statistical data and the second brightness statistical data is greater than a difference threshold, or that the distribution difference of the pixel brightness distribution histogram between the first brightness statistical data and the second brightness statistical data is greater than a preset value. Of course, the specified condition may be customized according to the needs of the actual application scenario, and this example embodiment does not specifically limit this. The target facial image may represent an image containing a "yin-yang face". When the difference between the first brightness statistical data of the first mask area and the second brightness statistical data of the second mask area corresponding to the original image meets the specified condition, the original image may be considered to be a "yin-yang face" image, that is, it is determined that the target facial image is detected to be contained in the original image.
[0133] Preferably, in this exemplary embodiment, the original image can be obtained by the following steps: obtaining sample video data from a preset database; performing image frame extraction on the sample video data to obtain the original image corresponding to the sample video data.
[0134] Among them, the preset database may refer to a database server that is pre-set and used to store multimedia data that may contain the target face image. For example, the preset database may store video data or image data that may contain the target face image, or may store video data or image data obtained from the network by a web crawler tool. Of course, it may also store image data that may contain the target face image generated by a pre-trained generative adversarial network. This example embodiment does not specifically limit this. Sample video data may refer to video data to be detected and stored in the preset database. Image frame extraction of sample video data may refer to a process of determining a set of original images from sample video data. For example, key frames may be extracted from sample video data at a fixed frequency to obtain the original image, or key frames may be randomly extracted from sample video data as the original image by a random algorithm. Of course, image frames with a high probability of containing the target face image may also be obtained from sample video data according to an edge detection algorithm (which may refer to an algorithm for identifying points with obvious brightness changes in a digital image) as the original image. This example embodiment does not specifically limit this.
[0135] In this exemplary embodiment, a face registration process is performed on the original image using a preset face registration tool to determine a face mask image corresponding to the original image.
[0136] Among them, the face registration tool may refer to a tool that detects and determines the facial feature contours corresponding to the face image in the original image. For example, the face registration tool may be a face registration SDK (Software Development Kit, which is a collection of development tools for building application software for a specific software package, software framework, hardware platform, operating system, etc.). The face registration tool may also be a tool built by an edge detection algorithm. Of course, the face registration tool may also be other tools that can detect and determine the facial feature contours corresponding to the face image in the original image. This example embodiment does not specifically limit this. The face registration process may refer to a process of detecting the original image through the face registration tool and generating contour features in the face image area of the original image. Through the face registration process, the contour features of the face image in the original image can be identified to ensure the accuracy of the subsequent process of processing the face image.
[0137] In this exemplary embodiment, before the original image is processed for face registration by a preset face registration tool, Figure 4 The steps in denoise the original image:
[0138] Figure 4 The figure schematically shows a flow chart of performing face detection on an original image according to an embodiment of the present disclosure.
[0139] refer to Figure 4 As shown, in step S410, face detection processing is performed on the original image by using a preset face detection tool to determine at least two face frames in the original image; wherein the at least two face frames correspond to at least two face images.
[0140] In this example embodiment, the face detection tool may refer to a tool that selects the part of the image containing the face image by a preset geometric figure (generally a rectangle). For example, the face detection tool may be a face detection SDK, or a pre-trained face recognition model (such as a face recognition model may be a neural network model, or a machine learning model such as a support vector machine, which is not specifically limited in this example embodiment). Of course, the face detection tool may also be other tools that can identify the part of the original image containing the face image, which is not specifically limited in this example embodiment. The face frame may refer to the preset geometric figure that the face detection tool detects and identifies the face part in the original image. Of course, the face frame may also be understood as the minimum bounding box containing the complete face area in the original image, which is not limited in this example embodiment. Generally, an original image may contain one or more parts containing a face. After the face detection tool performs face detection processing, multiple face frames containing face parts may be obtained. Each face frame may contain a face image. Therefore, an original image may contain multiple face images.
[0141] Step S420: taking the face image corresponding to the largest face frame as the face image to be detected corresponding to the original image.
[0142] In this example embodiment, the face image to be detected may refer to the face image selected from the original image that needs to be further detected. Of course, the face image to be detected can also be considered as the clearest face image in the original image, and this example embodiment is not limited to this. Since the original image may contain multiple face images, but generally smaller face images cannot be further detected and processed due to too few pixels, they need to be filtered. Preferably, in this example embodiment, the face image corresponding to the largest face frame (which can also be understood as the clearest face image in the original image) can be selected as the face image to be detected corresponding to the original image. Only the clearest and effective face image to be detected in the original image needs to be detected, which can not only exclude the face images with poor quality in the original image, effectively improve the detection efficiency of the target face image, but also filter out more interference factors to ensure the accuracy of the detection result.
[0143] In this example embodiment, the Figure 5 The steps in determine the face mask image corresponding to the original image:
[0144] Figure 5The figure schematically shows a flow chart of performing face registration on an original image according to an embodiment of the present disclosure.
[0145] refer to Figure 5 As shown, in step S510, face registration processing is performed on the face image to be detected corresponding to the original image by using the face registration tool to determine multiple contour feature points of the face image to be detected.
[0146] In this example embodiment, the contour feature points may refer to the feature points corresponding to the facial contour of the face obtained by performing face registration processing on the determined face image to be detected. For example, taking the left face in the face image to be detected as an example, the contour feature points corresponding to the face image to be detected may include the left contour points (11 points can be set), the inner corner of the left eye (1 point can be set), the center of the nose (1 point can be set), the left corner of the mouth (1 point can be set), etc. Of course, the number of contour feature points can be customized according to actual needs, and this example embodiment does not make special restrictions on this. Correspondingly, the corresponding contour feature points can also be identified on the right face in the face image to be detected. Generally, some contour feature points are distributed on the central axis corresponding to the left face and the right face, and do not need to be set repeatedly.
[0147] Step S520: determining a face mask image corresponding to the original image according to the contour feature points.
[0148] In this example embodiment, the approximate position of the facial features of the face in the face image to be detected is determined based on the contour feature points on the face image to be detected, and then the face mask image corresponding to the face image to be detected is determined through the contour feature points (which can be simply understood as cutting out the area corresponding to the facial features of the face in the face image to be detected, and removing interference factors such as the area containing hair that may affect the detection result). By determining the facial mask image corresponding to the face image to be detected and performing the subsequent detection process, the accuracy of the detection result can be further guaranteed, and the detection efficiency can be further guaranteed because of the reduction in pixels.
[0149] Specifically, after determining the contour feature points corresponding to the face image to be detected, based on the determined contour feature points, a mask image construction process is performed on the face image to be detected to determine the face mask image corresponding to the original image. The mask image construction process may refer to a process of determining the face mask image of the face image to be detected based on the contour feature points. For example, the mask image construction process may refer to a process of constructing a face mask image corresponding to the face image to be detected according to the FillPoly function (which may refer to a function for drawing and filling a polygon) of Opencv (Open Source Computer Vision Library), or it may be a process of constructing a face mask image for the face image to be detected according to a preset mask image. This exemplary embodiment does not specifically limit this.
[0150] Preferably, it can be done by Figure 6 The steps in construct the face mask image corresponding to the face image to be detected:
[0151] Figure 6 The figure schematically shows a flow chart of determining a face mask image by using a mask polygon according to an embodiment of the present disclosure.
[0152] refer to Figure 6 As shown, in step S610, based on a preset mask image constructor, a mask polygon corresponding to the face image to be detected is determined according to the contour feature points.
[0153] In this example embodiment, the mask image constructor may be a function in a preset programming language that constructs a mask polygon corresponding to the face image to be detected. For example, the mask image constructor may include but is not limited to the FillPoly function of Opencv. The mask polygon may refer to a polygon generated by inputting contour feature points into the FillPoly function, which is the shape corresponding to the face mask image corresponding to the face image to be detected. It can also be understood as "deducting" the face mask image from the face image to be detected through the mask polygon.
[0154] Step S620: determining a face mask image corresponding to the original image according to the mask polygon and the face image to be detected.
[0155] In this example embodiment, the face image to be detected is partially occluded by the mask polygon to generate a face mask image corresponding to the face image to be detected. Since the mask polygon is constructed based on the contour feature points corresponding to the face image to be detected, the obtained face mask image can accurately represent the core facial features of the face and filter out interference factors (such as factors that may affect the distribution of image brightness and darkness, such as the area corresponding to the hair), further ensuring the accuracy of detection.
[0156] Specifically, the face image to be detected can be cropped according to the mask polygon to determine the face mask image corresponding to the original image. The cropping process can refer to the process of shielding the non-core facial features in the face image to be detected corresponding to the original image by the mask polygon, shielding the unnecessary non-core facial feature area, and the remaining part can be considered as the face mask image corresponding to the face image to be detected.
[0157] In this example embodiment, before performing target face image detection on the face image to be detected, the original color channel corresponding to the pixel of the face mask image is first converted into the target color channel. The original color channel may refer to the RGB channel corresponding to the pixel of the face mask image (RGB may refer to the colors representing the three channels of red, green and blue, which is a color standard in the industry, and various colors are obtained by changing the three color channels of red R, green G and blue B and superimposing them on each other), and the target color channel may refer to the HSV channel corresponding to the pixel of the face mask image (i.e., hue, saturation Saturation, brightness Value, which may refer to a color space created according to the intuitive characteristics of color, also known as the Hexcone Model). The specific conversion process can be shown as expressions (1), (2) and (3):
[0158]
[0159]
[0160] V=C max (3)
[0161] Among them, R can represent the R channel value corresponding to the original color channel, G can represent the G channel value corresponding to the original color channel, B can represent the B channel value corresponding to the original color channel, R'=R / 255, G'=G / 255, B'=B / 255, C max =max(R',G',B'),C min =min(R',G',B'),Δ=C max -C min .
[0162] In this example embodiment, the target color channel may include a brightness channel V, which may be specifically Figure 7 The steps in Calculate the brightness statistics of the mask image:
[0163] Figure 7 The flowchart of a brightness statistics data calculation method according to an embodiment of the present disclosure is schematically shown.
[0164] refer to Figure 7 As shown, step S710, obtaining a first channel value corresponding to the brightness channel of the first mask area and obtaining a second channel value corresponding to the brightness channel of the second mask area;
[0165] Step S720: Calculate first brightness statistics corresponding to the first mask area and second brightness statistics corresponding to the second mask area according to the first channel value and the second channel value.
[0166] The first channel value may refer to the V channel value corresponding to the brightness channel of all pixels in the first mask area, and similarly, the first channel value may refer to the V channel value corresponding to the brightness channel of all pixels in the second mask area. Then, the first brightness statistics corresponding to the first mask area and the second brightness statistics corresponding to the second mask area are calculated by determining the first channel value and the second channel value.
[0167] Since the V channel value can describe the brightness of the image pixels more intuitively, in this example embodiment, the distribution difference of the left and right facial areas under the V channel is used to determine whether the light source in the face image to be detected is unevenly distributed, and then to determine whether the original image contains the target face image (i.e., the "yin-yang face" image). This can not only reduce the amount of calculation of the system, improve the system's work efficiency, and ensure detection efficiency, but also, by comparing the distribution differences under the V channel, the detection results obtained have a high accuracy rate.
[0168] Specifically, you can Figure 8 The steps in calculate first brightness statistics corresponding to the first mask area and second brightness statistics corresponding to the second mask area based on the channel values:
[0169] Figure 8 The flowchart of calculating brightness statistics by using mask polygons and pixel channel values according to an embodiment of the present disclosure is schematically shown.
[0170] refer to Figure 8 As shown, step S810, determining first area data of the mask polygon corresponding to the first mask area and determining second area data of the mask polygon corresponding to the second mask area;
[0171] Step S820, calculating first brightness statistical data corresponding to the first mask area according to the first channel value and the first area data;
[0172] Step S830: Calculate second brightness statistical data corresponding to the second mask area according to the second channel value and the second area data.
[0173] Among them, the first area data may refer to the area of the mask polygon corresponding to the first mask area. For example, the first area data may be the area calculated by the standard area calculation formula of the mask polygon corresponding to the first mask area (the mask polygon may be divided into standard geometric figures such as triangles or rectangles, and then calculated by the standard area calculation formula), or the area corresponding to the mask polygon calculated by the calculus formula. This example embodiment does not make any special restrictions on this. The second area data may refer to the area of the mask polygon corresponding to the second mask area. For example, the second area data may be the area calculated by the standard area calculation formula of the mask polygon corresponding to the second mask area (the mask polygon may be divided into standard geometric figures such as triangles or rectangles, and then calculated by the standard area calculation formula), or the area corresponding to the mask polygon calculated by the calculus formula. This example embodiment does not make any special restrictions on this.
[0174] Preferably, the first brightness statistical data can be obtained by performing a product calculation on the first channel value and the first area data. In this case, the first brightness statistical data can be considered as data that can characterize the average brightness of the first mask area; similarly, the second brightness statistical data can be obtained by performing a product calculation on the second channel value and the second area data. In this case, the second brightness statistical data can be considered as data that can characterize the average brightness of the second mask area. Of course, it is also possible to draw a pixel brightness distribution histogram of the first mask area using the first channel value and the first area data, and use the pixel brightness distribution histogram as the first brightness statistical data; and to draw a pixel brightness distribution histogram of the first mask area using the second channel value and the second area data, and use the pixel brightness distribution histogram as the second brightness statistical data. The difference between the first mask area and the second mask area is determined by comparing and analyzing the pixel brightness distribution histograms corresponding to the first brightness statistical data and the second brightness statistical data. This example embodiment does not specifically limit this.
[0175] In this exemplary embodiment, it is preferred to Fig. 9 The steps in detect whether the original image contains the target face image:
[0176] Fig. 9 The following schematically shows a flow chart of detecting a target facial image according to an embodiment of the present disclosure.
[0177] refer to Fig. 9 As shown, step S910, calculating the difference between the first brightness statistical data and the second brightness statistical data;
[0178] Step S920, determining whether a difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to a preset difference threshold;
[0179] Step S930: If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to the difference threshold, it is determined that the original image contains a target face image;
[0180] Step S940: If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is less than the difference threshold, it is determined that the original image does not contain the target face image, and the original image is deleted.
[0181] The difference between the first brightness statistical data and the second brightness statistical data is calculated, specifically, the first brightness statistical data is subtracted from the second brightness statistical data, or the second brightness statistical data is subtracted from the first brightness statistical data, and the absolute value of the difference is obtained to obtain the difference between the first brightness statistical data and the second brightness statistical data. The difference threshold value may refer to pre-set data for judging whether the difference between the first brightness statistical data and the second brightness statistical data reaches the target face image ("yin-yang face" image) standard. For example, assuming that the difference threshold value may be 10, the first brightness statistical data may be 30, and the second brightness statistical data may be 63, the difference between the first brightness statistical data and the second brightness statistical data is 33, which is greater than the difference threshold value 10. Therefore, at this time, it can be determined that the face image to be detected corresponding to the first brightness statistical data and the second brightness statistical data is the target face image. Of course, the difference threshold value may be customized according to the actual situation. This is only a schematic example and should not impose any special limitations on this exemplary embodiment.
[0182] When it is judged that the difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to the difference threshold, it is considered that the facial image to be detected corresponding to the first brightness statistical data and the second brightness statistical data meets the standard of the target facial image ("yin-yang face" image), so the detection result is to determine that the original image corresponding to the facial image to be detected contains the target facial image.
[0183] When it is determined that the difference between the first brightness statistical data and the second brightness statistical data is less than the difference threshold, it is considered that the facial image to be detected corresponding to the first brightness statistical data and the second brightness statistical data does not meet the standard of the target facial image ("yin-yang face" image). Therefore, the detection result is to determine that the original image corresponding to the facial image to be detected does not contain the target facial image, and the original image is deleted to save system resources.
[0184] Fig.10 The flowchart of detecting whether an original image contains a target face image according to an embodiment of the present disclosure is schematically shown.
[0185] refer to Fig.10 As shown, step S1010, obtaining the original image;
[0186] Step S1020, performing face detection on the original image using a face detection tool, determining the largest face frame, and obtaining a corresponding face image to be detected;
[0187] Step S1030, determining the contour feature points of the face image to be detected by using a face registration tool, and drawing a mask polygon corresponding to the face image to be detected according to the contour feature points;
[0188] Step S1040, determining a face mask image according to the face image to be detected and the mask polygon;
[0189] Step S1050, determining first brightness statistical data corresponding to the left face mask image and second brightness statistical data corresponding to the right face mask image in the face mask image;
[0190] Step S1060, determining whether the difference between the first brightness statistical data and the second brightness statistical data satisfies a specified condition, and executing step S1070 when it is determined that the difference between the first brightness statistical data and the second brightness statistical data satisfies the specified condition, otherwise executing step S1080;
[0191] Step S1070, determining whether the original image corresponding to the face mask image contains the target face image;
[0192] Step S1080, determining that the original image corresponding to the face mask image does not contain the target face image;
[0193] Step S1090, deleting the original image.
[0194] Fig.11 The following is a schematic diagram of an application of performing face detection on an original image according to an embodiment of the present disclosure.
[0195] refer to Fig.11 As shown, an original image 1101 is obtained. The original image 1101 may include face image 1102, face image 1103, face image 1104, and face image 1105. A face detection tool is used to detect and identify multiple face images in the original image 1101, and they are marked by face frame 1106, face frame 1107, face frame 1108, and face frame 1109. Finally, face image 1102 corresponding to the largest face frame 1106 is used as the face image to be detected corresponding to the original image 1101.
[0196] Fig.12 The application diagram of constructing a face mask image according to an embodiment of the present disclosure is schematically shown.
[0197] refer to Fig.12As shown, the left face part corresponding to the face image to be detected is used as an example for explanation, the face image to be detected 1201 determined by the face detection tool is further subjected to face registration processing by the face registration tool to determine a plurality of contour feature points 1202 corresponding to the face image to be detected 1201, and the contour feature points 1202 may include left contour points, left eye inner corner, nose center, left mouth corner, etc. Of course, the contour feature points 1202 may be customized according to actual conditions, and are not specifically limited here. Further, the mask polygon 1203 corresponding to the face image to be detected is determined by the preset mask polygon constructor and the contour feature points 1202, and then the face mask image (i.e., the image filled inside the mask polygon 1203) is determined by the mask polygon 1203 and the face image to be detected 1201.
[0198] It should be noted that although the steps of the method in the present disclosure are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0199] Furthermore, in this exemplary embodiment, a target face image detection device is also provided. The target face image detection device can be applied to a server or a terminal device. Fig.13 As shown, the target facial image detection device 1300 may include a facial mask image determination module 1310 , a brightness statistics data calculation module 1320 and a target facial image detection module 1330 .
[0200] in:
[0201] The face mask image determination module 1310 is used to obtain an original image and determine a face mask image corresponding to the original image, wherein the face mask image includes a first mask area and a second mask area;
[0202] The brightness statistics calculation module 1320 is used to calculate first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the second mask area;
[0203] The target face image detection module 1330 is used to determine that the original image contains a target face image when the difference between the first brightness statistical data and the second brightness statistical data meets a specified condition.
[0204] In an exemplary embodiment of the present disclosure, the face mask image determination module 1310 further includes an original image acquisition unit, and the original image acquisition unit is configured to:
[0205] Obtain sample video data from a preset database;
[0206] Image frames are extracted from the sample video data to obtain original images corresponding to the sample video data.
[0207] In an exemplary embodiment of the present disclosure, the face mask image determination module 1310 further includes a face registration unit, and the face registration unit is configured to:
[0208] The original image is subjected to face registration processing by a preset face registration tool to determine a face mask image corresponding to the original image.
[0209] In an exemplary embodiment of the present disclosure, the target facial image detection device 1300 further includes a facial image monitoring unit to be detected, and the facial image monitoring unit to be detected is configured as follows:
[0210] Performing face detection processing on the original image by using a preset face detection tool to determine at least two face frames in the original image; wherein at least two face frames correspond to at least two face images;
[0211] The face image corresponding to the largest face frame is used as the face image to be detected corresponding to the original image.
[0212] In an exemplary embodiment of the present disclosure, the face mask image determination module 1310 further includes:
[0213] A contour feature point detection unit, configured to perform face registration processing on the face image to be detected corresponding to the original image by using the face registration tool, and determine a plurality of contour feature points of the face image to be detected;
[0214] A face mask image determining unit is used to determine the face mask image corresponding to the original image according to the contour feature points.
[0215] In an exemplary embodiment of the present disclosure, the face mask image determining unit is further configured to:
[0216] Based on the contour feature points, a mask image construction process is performed on the face image to be detected to determine a face mask image corresponding to the original image.
[0217] In an exemplary embodiment of the present disclosure, the face mask image determining unit is further configured to:
[0218] Based on a preset mask image constructor, determining a mask polygon corresponding to the face image to be detected according to the contour feature points;
[0219] A face mask image corresponding to the original image is determined according to the mask polygon and the face image to be detected.
[0220] In an exemplary embodiment of the present disclosure, the face mask image determining unit is further configured to:
[0221] The face image to be detected is cropped according to the mask polygon to determine a face mask image corresponding to the original image.
[0222] In an exemplary embodiment of the present disclosure, the target face image detection device 1300 further includes a channel conversion unit, and the channel conversion unit is configured as follows:
[0223] The original color channels corresponding to the pixels of the face mask image are converted into target color channels.
[0224] In an exemplary embodiment of the present disclosure, the brightness statistics data calculation module 1320 further includes:
[0225] A channel value acquisition unit, configured to acquire a first channel value corresponding to a brightness channel of the first mask area and to acquire a second channel value corresponding to a brightness channel of the second mask area;
[0226] The brightness statistical data calculation unit is used to calculate first brightness statistical data corresponding to the first mask area and second brightness statistical data corresponding to the second mask area according to the first channel value and the second channel value.
[0227] In an exemplary embodiment of the present disclosure, the brightness statistical data calculation unit is further configured to:
[0228] Determine first area data of the mask polygon corresponding to the first mask area and determine second area data of the mask polygon corresponding to the second mask area;
[0229] Calculate first brightness statistical data corresponding to the first mask area according to the first channel value and the first area data;
[0230] Second brightness statistical data corresponding to the second mask area is calculated according to the second channel value and the second area data.
[0231] In an exemplary embodiment of the present disclosure, the target face image detection module 1330 is further configured to:
[0232] Calculating a difference between the first brightness statistical data and the second brightness statistical data;
[0233] Determine whether a difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to a preset difference threshold;
[0234] If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to the difference threshold, it is determined that the original image contains a target face image;
[0235] If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is less than the difference threshold, it is determined that the original image does not contain the target face image, and the original image is deleted.
[0236] The specific details of each module or unit in the above-mentioned target face image detection device have been described in detail in the corresponding target face image detection method, so they will not be repeated here.
[0237] It should be noted that, although several modules or units of the device for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into multiple modules or units to be embodied.
[0238] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0239] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.
Claims
1. A target face image detection method, characterized in that: include: Acquire an original image, and determine a face mask image corresponding to the original image, wherein the face mask image includes a first mask area and a second mask area; Converting original color channels corresponding to pixels of the face mask image into brightness channels to calculate brightness statistics of pixels of the face mask image according to channel values corresponding to the brightness channels; Obtaining a first channel value corresponding to a brightness channel of the first mask area and obtaining a second channel value corresponding to a brightness channel of the second mask area; Determining first area data of a mask polygon corresponding to the first mask area and determining second area data of a mask polygon corresponding to the second mask area; Calculate first brightness statistical data corresponding to the first mask area according to the first channel value and the first area data; Calculate second brightness statistical data corresponding to the second mask area according to the second channel value and the second area data; When the difference between the first brightness statistical data and the second brightness statistical data meets a specified condition, it is determined that the original image contains a target face image.
2. The target face image detection method according to claim 1, characterized in that: Get the original image, including: Obtain sample video data from a preset database; Image frames are extracted from the sample video data to obtain original images corresponding to the sample video data.
3. The target face image detection method according to claim 1, characterized in that: The determining the face mask image corresponding to the original image comprises: The original image is subjected to face registration processing by a preset face registration tool to determine a face mask image corresponding to the original image.
4. The target face image detection method according to claim 3, characterized in that: Before performing face registration processing on the original image by using a preset face registration tool, the method further includes: Performing face detection processing on the original image by using a preset face detection tool to determine at least two face frames in the original image; wherein at least two face frames correspond to at least two face images; The face image corresponding to the largest face frame is used as the face image to be detected corresponding to the original image.
5. The target face image detection method according to claim 4, characterized in that: The determining the face mask image corresponding to the original image comprises: Performing face registration processing on the face image to be detected corresponding to the original image by using the face registration tool to determine a plurality of contour feature points of the face image to be detected; A face mask image corresponding to the original image is determined according to the contour feature points.
6. The target face image detection method according to claim 5, characterized in that: Determining a face mask image corresponding to the original image according to the contour feature points includes: Based on the contour feature points, a mask image construction process is performed on the face image to be detected to determine a face mask image corresponding to the original image.
7. The target face image detection method according to claim 6, characterized in that: Based on the contour feature points, performing mask image construction processing on the face image to be detected to determine the face mask image corresponding to the original image, including: Based on a preset mask image constructor, determining a mask polygon corresponding to the face image to be detected according to the contour feature points; A face mask image corresponding to the original image is determined according to the mask polygon and the face image to be detected.
8. The target face image detection method according to claim 7, characterized in that: Determining a mask image corresponding to the original image according to the mask polygon and the original image includes: The face image to be detected is cropped according to the mask polygon to determine a face mask image corresponding to the original image.
9. The target face image detection method according to claim 1, characterized in that: When the difference between the first brightness statistical data and the second brightness statistical data satisfies a specified condition, determining that the original image includes a target face image comprises: Calculating a difference between the first brightness statistical data and the second brightness statistical data; Determine whether a difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to a preset difference threshold; If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is greater than or equal to the difference threshold, it is determined that the original image contains a target face image; If it is determined that the difference between the first brightness statistical data and the second brightness statistical data is less than the difference threshold, it is determined that the original image does not contain the target face image, and the original image is deleted.
10. A target face image detection device, characterized in that: include: A face mask image determination module, used to obtain an original image and determine a face mask image corresponding to the original image, wherein the face mask image includes a first mask area and a second mask area; A channel conversion unit is configured to: convert the original color channel corresponding to the pixel of the face mask image into a brightness channel to calculate the brightness statistics of the pixel of the face mask image according to the channel value corresponding to the brightness channel; a brightness statistics calculation module, configured to calculate first brightness statistics of pixels in the first mask area and second brightness statistics of pixels in the second mask area; a target face image detection module, configured to determine that the original image contains a target face image when a difference between the first brightness statistical data and the second brightness statistical data satisfies a specified condition; Wherein, the brightness statistical data calculation module includes: A channel value acquisition unit, configured to acquire a first channel value corresponding to a brightness channel of the first mask area and to acquire a second channel value corresponding to a brightness channel of the second mask area; Brightness statistics calculation unit, configured as follows: Determining first area data of a mask polygon corresponding to the first mask area and determining second area data of a mask polygon corresponding to the second mask area; Calculate first brightness statistical data corresponding to the first mask area according to the first channel value and the first area data; Second brightness statistical data corresponding to the second mask area is calculated according to the second channel value and the second area data.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 9 is implemented.
12. An electronic device, characterized in that: include: processor; as well as A memory, configured to store executable instructions of the processor; The processor is configured to perform the method of any one of claims 1 to 9 by executing the executable instructions.
Citation Information
Patent Citations
Photo acquisition method and device
CN106503614A
Face image detection method and device
CN110210393A