CN112200804A - Image detection method and device, computer readable storage medium and electronic equipment - Google Patents

Image detection method and device, computer readable storage medium and electronic equipment Download PDF

Info

Publication number
CN112200804A
CN112200804A CN202011237444.9A CN202011237444A CN112200804A CN 112200804 A CN112200804 A CN 112200804A CN 202011237444 A CN202011237444 A CN 202011237444A CN 112200804 A CN112200804 A CN 112200804A
Authority
CN
China
Prior art keywords
image
face
detected
image quality
determining
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
Application number
CN202011237444.9A
Other languages
Chinese (zh)
Inventor
谢佳锋
王国利
张骞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Horizon Information Technology Co Ltd
Original Assignee
Beijing Horizon Information Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Beijing Horizon Information Technology Co Ltd filed Critical Beijing Horizon Information Technology Co Ltd
Priority to CN202011237444.9A priority Critical patent/CN112200804A/en
Publication of CN112200804A publication Critical patent/CN112200804A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/0002Inspection of images, e.g. flaw detection
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Human Computer Interaction (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Analysis (AREA)

Abstract

The embodiment of the disclosure discloses an image detection method, an image detection device, a computer-readable storage medium and an electronic device, wherein the method comprises the following steps: acquiring a shot face image to be detected; if the face image to be detected is a qualified image, performing image quality detection on the face image to be detected to obtain an image quality score set, wherein each image quality score in the image quality score set corresponds to a preset image quality detection strategy; determining a comprehensive score for measuring the face image to be detected based on the image quality score set; and generating information for representing whether the facial image to be detected is a preferred image or not based on the comprehensive score. The embodiment of the disclosure realizes the integration of various image quality detection strategies, obtains the optimal image with the image quality meeting the requirements, and has richer image quality detection modes and higher detection accuracy.

Description

Image detection method and device, computer readable storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an image detection method and apparatus, a computer-readable storage medium, and an electronic device.
Background
At present, in some fields, quality detection needs to be performed on a face image, so that the quality of a shot face image meets a set requirement. For example, in the field of living body detection, it is necessary to identify a face image and verify whether a user is operating by a real living body. However, in order to deal with more possible attack means and improve the detection effect of the living body detection, a living body optimization method is needed to optimize the face image input into the living body detection model, so that the effect of the living body detection model is improved, a user is helped to discriminate fraudulent behaviors, and the legal benefit of the user is guaranteed.
Disclosure of Invention
The embodiment of the disclosure provides an image detection method and device, a computer-readable storage medium and an electronic device.
An embodiment of the present disclosure provides an image detection method, including: acquiring a shot face image to be detected; if the face image to be detected is a qualified image, performing image quality detection on the face image to be detected to obtain an image quality score set, wherein each image quality score in the image quality score set corresponds to a preset image quality detection strategy; determining a comprehensive score for measuring the face image to be detected based on the image quality score set; and generating information for representing whether the facial image to be detected is a preferred image or not based on the comprehensive score.
According to another aspect of the embodiments of the present disclosure, there is provided an image detection apparatus including: the acquisition module is used for acquiring a shot face image to be detected; the first detection module is used for detecting the image quality of the face image to be detected if the face image to be detected is a qualified image to obtain an image quality score set, wherein each image quality score in the image quality score set corresponds to a preset image quality detection strategy; the determining module is used for determining a comprehensive score for measuring the facial image to be detected based on the image quality score set; and the generating module is used for generating information for representing whether the face image to be detected is the preferred image or not based on the comprehensive score.
According to another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the image detection method described above.
According to another aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing processor-executable instructions; and the processor is used for reading the executable instructions from the memory and executing the instructions to realize the image detection method.
Based on the image detection method, the image detection device, the computer-readable storage medium and the electronic equipment provided by the embodiments of the present disclosure, by performing image quality detection on a face image to be detected in various measurements, a score corresponding to each image quality detection strategy is obtained, each score is fused to obtain a comprehensive score for measuring the face image to be detected, and finally, based on the comprehensive score, information for representing whether the face image to be detected is a preferred image is determined, so that various image quality detection strategies are integrated, a preferred image with satisfactory image quality is obtained, image quality detection modes are richer, and detection accuracy is higher.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a system diagram to which the present disclosure is applicable.
Fig. 2 is a schematic flowchart of an image detection method according to an exemplary embodiment of the present disclosure.
Fig. 3 is a flowchart illustrating an image detection method according to another exemplary embodiment of the present disclosure.
Fig. 4 is a flowchart illustrating an image detection method according to another exemplary embodiment of the present disclosure.
Fig. 5 is a flowchart illustrating an image detection method according to another exemplary embodiment of the present disclosure.
Fig. 6 is a schematic structural diagram of an image detection apparatus according to an exemplary embodiment of the present disclosure.
Fig. 7 is a schematic structural diagram of an image detection apparatus according to another exemplary embodiment of the present disclosure.
Fig. 8 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure.
Detailed Description
Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of the embodiments of the present disclosure and not all embodiments of the present disclosure, with the understanding that the present disclosure is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing an associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Summary of the application
The existing image quality detection method generally utilizes a certain single strategy to detect the quality of an image, which easily causes detection omission and has low detection accuracy. If these methods are applied to the field of biopsy, detection errors are easily caused by using an image with poor quality for biopsy.
Exemplary System
Fig. 1 illustrates an exemplary system architecture 100 of an image detection method or image detection apparatus to which embodiments of the present disclosure may be applied.
As shown in fig. 1, system architecture 100 may include terminal device 101, network 102, and server 103. Network 102 is the medium used to provide communication links between terminal devices 101 and server 103. Network 102 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
A user may use terminal device 101 to interact with server 103 over network 102 to receive or send messages and the like. Various communication client applications, such as a shooting application, an image processing application, a monitoring application, a web browser application, an instant messaging tool, etc., may be installed on the terminal device 101.
The terminal device 101 may be various electronic devices including, but not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle-mounted terminal (e.g., a car navigation terminal), etc., and a fixed terminal such as a digital TV, a desktop computer, etc.
The server 103 may be a server that provides various services, such as a background image detection server that performs quality detection on an image uploaded by the terminal apparatus 101. The background image detection server may process the received image to obtain a processing result (e.g., a comprehensive score representing image quality).
It should be noted that the image detection method provided by the embodiment of the present disclosure may be executed by the server 103 or the terminal device 101, and accordingly, the image detection apparatus may be disposed in the server 103 or the terminal device 101.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation. In the case where telecommunication is not required, the system architecture described above may not include a network, only terminal devices or servers.
Exemplary method
Fig. 2 is a schematic flowchart of an image detection method according to an exemplary embodiment of the present disclosure. The embodiment can be applied to an electronic device (such as the terminal device 101 or the server 103 shown in fig. 1), and as shown in fig. 2, the method includes the following steps:
step 201, acquiring a shot face image to be detected.
In this embodiment, the electronic device may obtain the image of the face to be detected, which is captured by the camera, from a remote location or from a local location. The camera may be a camera on the electronic device, or a camera connected to the electronic device in a wired or wireless manner. The face image to be detected may be an image obtained by photographing a face of a subject (which may be various subjects such as a person and an animal) located within a photographing range of the camera. The face image to be detected can be an image shot by a camera in real time or an image shot in advance.
Step 202, if the face image to be detected is a qualified image, performing image quality detection on the face image to be detected to obtain an image quality score set.
In this embodiment, the electronic device may determine that the facial image to be detected is a qualified image, and if the facial image to be detected is a qualified image, perform image quality detection on the facial image to be detected to obtain an image quality score set. And each image quality score in the image quality score set corresponds to a preset image quality detection strategy. For example, if the number of image quality detection strategies is three, three image quality scores can be obtained by using the three image quality detection strategies.
The image quality detection strategies may respectively correspond to different image quality detection algorithms, and each algorithm may obtain a score. For example, an image quality detection algorithm may obtain a score according to the degree of completeness (e.g., the ratio of the area of a face to the area of a complete face in an image is a score) for detecting whether a face image is complete.
In this embodiment, the electronic device may determine whether the face image to be detected is a qualified image according to a preset manner. For example, if the face image to be detected is a black-and-white image, it is not qualified. For another example, if the definition of the face image to be detected is smaller than the preset definition threshold, the face image is not qualified.
And step 203, determining a comprehensive score for measuring the facial image to be detected based on the image quality score set.
In this embodiment, the electronic device may determine a comprehensive score for measuring the facial image to be detected based on the set of image quality scores. The comprehensive score can be obtained by fusing the quality scores of all the images in a preset fusion mode. As an example, the respective image quality scores may be fused by way of addition, weighted summation, or the like. The comprehensive score is formed by fusing a plurality of image quality detection strategies, so the comprehensive score can fully reflect image quality characteristics in various aspects.
And step 204, generating information for representing whether the face image to be detected is a preferred image or not based on the comprehensive score.
In this embodiment, the electronic device may determine information for characterizing whether the facial image to be detected is a preferred image based on the composite score. In general, the composite score may be compared with a preset score threshold, and if the composite score is greater than or equal to the preset score threshold, information representing that the facial image to be detected is a preferred image may be generated. The information for representing whether the facial image to be detected is a preferred image may be various information, such as characters, numbers, symbols, images, and the like. For example, when it is determined that the face image to be detected is the preferred image, a label "1" is set for the face image to be detected, and when it is determined that the face image to be detected is not the preferred image, a label "0" is set for the face image to be detected. Since the higher the comprehensive score is, the better the quality of the face image to be detected, for example, the image of the comprehensive score manuscript has the characteristics of a large face area, no face occlusion, a face front facing the camera lens, and the like, an image of which the comprehensive score is greater than or equal to a preset score threshold value is called a preferred image, and the preferred image can be further used in scenes such as living body detection, identity recognition, and the like.
According to the method provided by the embodiment of the disclosure, the face image to be detected is subjected to multiple measured image quality detections, the score corresponding to each image quality detection strategy is obtained, the scores are fused to obtain the comprehensive score for measuring the face image to be detected, and finally, the information for representing whether the face image to be detected is the preferred image or not is determined based on the comprehensive score, so that multiple image quality detection strategies are integrated, the preferred image with the image quality meeting the requirements is obtained, the image quality detection mode is richer, and the detection accuracy is higher.
In some optional implementation manners, after step 204, if it is determined that the facial image to be detected is the preferred image, the electronic device may input the facial image to be detected into a pre-trained living body detection model, so as to obtain living body detection information for representing whether an object indicated by the facial image to be detected is a living body. The living body detection model is used for detecting whether an object indicated by the input image is a living body. As an example, the living body detection model may be trained by a machine learning method based on an existing algorithm such as an artificial neural network. Because the face image to be detected is determined as the preferred image after being detected through the steps, the risk of identification errors caused by factors such as face shielding, image unsharpness and the like can be reduced, and the accuracy of in vivo detection is improved.
In some alternative implementations, step 203 may be performed as follows:
and determining a comprehensive score based on a preset weight corresponding to each image quality score in the image quality score set and the image quality score set.
As an example, with three different image quality detection strategies, three image quality scores, G, Z, X respectively, may be obtained, corresponding to the preset weights a, b, c respectively. The composite score may be a G + b Z + c X. By setting the weights corresponding to different image quality detection strategies, the contribution of the different strategies to the image quality detection can be adjusted in a targeted manner, and the flexibility and pertinence of the quality detection are improved. For example, if the composite score requires a policy that emphasizes face integrity, the weight corresponding to the policy that characterizes face integrity may be increased.
In some alternative implementations, based on the above weights, step 203 may be performed as follows:
and determining a comprehensive score based on preset activation functions and weights corresponding to each image quality score in the image quality score set. The different image quality detection strategies correspond to different activation functions, and the activation functions are used for determining whether the face image to be detected meets the requirements of the corresponding image quality detection strategies. Generally, when the policy requirement is satisfied, the function value of the activation function corresponding to the policy is 1, otherwise, the function value is 0.
As an example, the function of determining the composite score S is as follows:
S=T(G)T(Z)T(X)(a*G+b*Z+c*X)
wherein, t (g), t (z), t (x) are activation functions, respectively corresponding to different image quality detection strategies. For example, when no face key point is detected in the face image to be detected, t (g) is 0, and when there is a face key point, t (g) is 1. When the face attitude angle of the face image to be detected does not meet the set attitude angle range, T (Z) is 0, and when the face attitude angle meets the attitude angle range, T (Z) is 1. When the size of the effective face area in the face image to be detected is detected to be smaller than the preset size, T (X) is 0, and when the size is larger than or equal to the preset size, T (X) is 1.
The realization mode can set conditions for the calculation of the comprehensive score by setting the activation function corresponding to the image quality detection strategy, and can enlarge the difference between the scores of the high-quality image and the low-quality image, thereby being beneficial to leading the obtained comprehensive score to more accurately represent the quality of the image.
In some optional implementations, in step 202, the method of deriving an image quality score may include at least one of:
the method comprises the steps of determining the non-occlusion degree value of a face indicated by a face image to be detected, and determining an image quality score based on the non-occlusion degree value.
And the non-shielding degree value is used for representing the face exposure degree in the face image to be detected. In general, the larger the non-occlusion degree value is, the smaller the degree to which the face is occluded, that is, the larger the face exposure degree is. The non-occlusion degree value can be obtained in various ways, for example, the exposed area S1 of the face in the face image to be detected can be determined and the exposed area S2 of the complete face can be predicted by using the existing face detection method, and the non-occlusion degree value is S1/S2.
The image quality score corresponding to the method may be the non-occlusion degree value itself, or may be obtained by performing conversion (for example, normalization, or conversion to a tenth system, a percentile system, or the like) in a preset manner on the non-occlusion degree value.
And determining the face attitude angle of the face image to be detected, and if the face attitude angle meets the preset condition, determining the image quality score based on the face attitude angle.
The face posture angle generally includes pitch (pitch angle), yaw (yaw angle), roll (roll angle). The preset condition may define a range of facial pose angles. In general, the higher the face pose angle indicates that the forward direction of the face is off the optical axis of the camera, the smaller the image quality score. As an example, the image quality score may be determined according to a table, a formula, or the like that characterizes the correspondence of the face pose angle to the image quality score.
And determining the size of the face region in the face image to be detected, and determining the image quality score based on the size.
Specifically, the size of the face region may be determined according to an existing face recognition method (e.g., an artificial neural network-based face recognition model). In general, the face area may be a rectangular area, and the length and width of the rectangular area are the size of the face area. As an example, the above-mentioned face region size may be compared with a preset ideal size, and the correspondence between the face region size and the image quality score may be set according to a rule that the closer the actual size is to the ideal size, the higher the image quality analysis is, thereby determining the image quality score from the size of the detected face region.
The implementation mode can carry out quality detection on the face image to be detected according to different angles by providing the three methods for determining the image quality scores, so that the three strategies are combined, and the obtained combined scores can more accurately represent the image quality.
In some alternative implementations, as shown in fig. 3, the electronic device may determine the unobstructed degree value of the face indicated by the face image to be detected according to the following steps:
step 301, inputting a face image to be detected into a pre-trained face key point detection model to obtain a face key point set.
The key point detection model is used for determining face key points from an input face image to be detected, wherein the face key points are points with certain characteristics of the face, such as points representing the canthus, the tip of the nose, the chin, the corner of the mouth and the like. The face key points may be represented by coordinates in the face image to be detected. The key point detection model can be a model obtained by training by using a machine learning method based on an artificial neural network. The key point detection model is a commonly used prior art at present, and is not described herein again.
Step 302, determining a non-occlusion degree value of the face indicated by the face image to be detected based on the number of face key points in the face key point set.
As an example, a ratio of the number of face key points in the above face key point set to the number of face key points without occlusion may be determined as the occlusion free degree value.
The face key points detected by the implementation mode can accurately represent the face area in the image, and the number of the detected key points can represent the exposure degree of the face, so that the non-shielding degree value is more accurate, and the accuracy of determining the image quality score is improved.
In some alternative implementations, as shown in fig. 4, the step 302 may include the following steps:
step 3021, determining a keypoint score representing the probability of the position of the face keypoint in the face, wherein the keypoint score corresponds to each face keypoint in the face keypoint set.
In general, in the detection of key points, the position of each key is obtained to correspond to a probability value representing the probability that the point is a certain part of the face. The keypoint score may be the probability value itself, or may be a value obtained by converting the probability value.
Step 3022, summing the scores of the key points corresponding to each face key point in the face key point set to obtain a sum.
And step 3023, determining the non-occlusion degree value of the face indicated by the face image to be detected based on the sum value and the numerical value representing the non-occlusion of the face.
The above numerical value representing that the face is not blocked may be the sum of probabilities corresponding to all the detected key points in an ideal state (i.e., a state where the face is not blocked and the face image is clear). In an ideal state, the probability value corresponding to each face key point can be 1, so that the sum of scores of the key points in the ideal state can be obtained as a numerical value representing that the face is not shielded. As an example, the above-mentioned sum may be divided by the above-mentioned numerical value representing that the face is not occluded, to obtain an unoccluded degree value.
According to the implementation mode, the non-shielding degree value is determined based on the probability corresponding to the face key points, so that the non-shielding degree value is closer to the reality, and the accuracy of determining the image quality score is further improved.
In some alternative implementations, as shown in fig. 5, the electronic device may determine the image quality score in the second implementation as follows:
step 501, inputting a face image to be detected into a pre-trained face attitude angle detection model to obtain a face attitude angle and a forward degree value used for representing the degree of the face facing the shooting front.
The face attitude angle detection model is used for representing the corresponding relation between the face image to be detected and the face attitude angle. The face attitude angle detection model can be obtained by training by a machine learning method based on the existing artificial neural network.
The face pose angle may be used to characterize the degree of deflection of the face in a frontal direction relative to a camera that captures the face. The face posture angle may include a pitch angle (pitch), a yaw angle (yaw), and a roll angle (roll), which respectively represent an angle of turning up and down, turning left and right, and rotation in a plane.
The forward-range value may be calculated based on the face pose angle. In general, a higher positive level value indicates that the face is oriented closer to the optical axis of the camera, i.e., the face is deflected less relative to the camera.
As an example, assuming that the value boundaries of yaw and pitch are ± 40 ° and ± 30 °, respectively, the forward direction degree value can be obtained based on the following formula:
pos_frontal=2000-(yaw*yaw/16+pitch*pitch/9)*10
as can be seen from this equation, pos _ front is 0 when yaw is. + -. 40 ℃ and pitch is. + -. 30 ℃; when yaw is 0 ° and pitch is also 0 °, pos _ front is 2000, and the face is facing the optical axis of the camera. pos _ front has a value in the range [0,2000 ].
Step 502, if the face pose angle satisfies a preset condition, determining an image quality score based on the forward degree value and a preset forward degree threshold.
The preset condition may be a valid range of the set face posture angle (e.g., yaw is equal to or less than 40 °, pitch, roll is equal to or less than 30 °).
Continuing with the above example, the image quality score may be obtained using the following normalization formula:
Z=(pos_frontal-frontal_thr)/(2000-frontal_thr)
wherein, front _ thr is a forward degree threshold, and since the value range of Z is [0,1], if front _ thr is 0, the value range of pos _ front is [0,2000 ]. If it is desired to limit the range of facial pose angles to a smaller range, a larger front _ thr, for example 1000, may be set, at which point the value range of pos _ front is limited to [1000,2000 ].
According to the implementation mode, the forward degree value is determined based on the face attitude angle, the image quality score is determined based on the forward degree value and the forward degree threshold value, and the higher image quality score can be determined when the face approaches to the forward facing direction of the camera, so that the face image to be detected with the face attitude angle in a certain range can be efficiently and accurately determined to be the high-quality image, and the pertinence of extracting the optimal image is improved.
In some alternative implementations, the electronic device may determine the image quality score in the third mode as follows:
determining an image quality score based on the size and a preset first size threshold and a preset second size threshold.
Wherein the first size threshold may be set greater than the second size threshold. As an example, if the first size threshold is L1, the second size threshold is L2, and the size of the actual face image is L, L, L1, and L2 may be the length or width of the rectangular region, then the normalized value may be determined according to the following formula:
S=(L-L2)/(L1-L2)
usually, before the calculation using this formula, a constraint may be set, that is, if L ≧ L1, S ═ 1; if L is less than or equal to L2, S is 0.
Since L, L1 and L2 may be the length or width of the rectangular region, two S may be calculated, and assuming S1 and S2, S1 or S2 may be used as the image quality score, or the average of S1 and S2 may be used as the image quality score.
This implementation mode can restrict the size of the facial image to be detected to a certain range during image quality detection through the judgment of the size of the facial image region, filters out the facial image with smaller size, and makes the quality of the optimal image obtained finally better.
Exemplary devices
Fig. 6 is a schematic structural diagram of an image detection apparatus according to an exemplary embodiment of the present disclosure. The present embodiment can be applied to an electronic device, as shown in fig. 6, the image detection apparatus includes: an obtaining module 601, configured to obtain a shot face image to be detected; the first detection module 602 is configured to, if the face image to be detected is a qualified image, perform image quality detection on the face image to be detected to obtain an image quality score set, where each image quality score in the image quality score set corresponds to a preset image quality detection policy; a determining module 603, configured to determine, based on the image quality score set, a comprehensive score for measuring the facial image to be detected; a generating module 604, configured to generate information used for characterizing whether the facial image to be detected is a preferred image based on the comprehensive score.
In this embodiment, the obtaining module 601 may obtain the image of the face to be detected, which is captured by the camera, from a remote location or from a local location. The camera can be a camera on the device, and also can be a camera connected with the device in a wired connection or wireless connection mode. The face image to be detected may be an image obtained by photographing a face of a subject (which may be various subjects such as a person and an animal) located within a photographing range of the camera. The face image to be detected can be an image shot by a camera in real time or an image shot in advance.
In this embodiment, the first detection module 602 may determine that the facial image to be detected is a qualified image, and if the facial image to be detected is a qualified image, perform image quality detection on the facial image to be detected to obtain an image quality score set. And each image quality score in the image quality score set corresponds to a preset image quality detection strategy. For example, if the number of image quality detection strategies is three, three image quality scores can be obtained by using the three image quality detection strategies.
The image quality detection strategies may respectively correspond to different image quality detection algorithms, and each algorithm may obtain a score. For example, an image quality detection algorithm may obtain a score according to the degree of completeness (e.g., the ratio of the area of a face to the area of a complete face in an image is a score) for detecting whether a face image is complete.
In this embodiment, the first detection module 602 may determine whether the facial image to be detected is a qualified image in various ways. For example, if the face image to be detected is a black-and-white image, it is not qualified. For another example, if the definition of the face image to be detected is smaller than the preset definition threshold, the face image is not qualified.
In this embodiment, the determining module 603 may determine a comprehensive score for measuring the face image to be detected based on the image quality score set. The comprehensive score can be obtained by fusing the quality scores of all the images in a preset fusion mode. As an example, the respective image quality scores may be fused by way of addition, weighted summation, or the like. The comprehensive score is formed by fusing a plurality of image quality detection strategies, so the comprehensive score can fully reflect image quality characteristics in various aspects.
In this embodiment, the generating module 604 may determine information for characterizing whether the facial image to be detected is a preferred image based on the composite score. In general, the composite score may be compared with a preset score threshold, and if the composite score is greater than or equal to the preset score threshold, information representing that the facial image to be detected is a preferred image may be generated. The information for representing whether the facial image to be detected is a preferred image may be various information, such as characters, numbers, symbols, images, and the like. For example, when it is determined that the face image to be detected is the preferred image, a label "1" is set for the face image to be detected, and when it is determined that the face image to be detected is not the preferred image, a label "0" is set for the face image to be detected.
Referring to fig. 7, fig. 7 is a schematic structural diagram of an image detection apparatus according to another exemplary embodiment of the present disclosure.
In some optional implementations, the first detection module 602 includes at least one of: a first determining unit 6021, configured to determine a non-occlusion degree value of the face indicated by the face image to be detected, and determine an image quality score based on the non-occlusion degree value; a second determining unit 6022, configured to determine a face pose angle of the face image to be detected, and determine an image quality score based on the face pose angle if the face pose angle satisfies a preset condition; a third determining unit 6023 configured to determine a size of the face region in the face image to be detected, and determine the image quality score based on the size.
In some optional implementations, the first determining unit 6021 includes: the first detecting subunit 60211 is configured to input the facial image to be detected into a pre-trained facial key point detection model, so as to obtain a facial key point set; a first determining subunit 60212, configured to determine, based on the number of face keypoints in the set of face keypoints, a non-occlusion degree value of a face indicated by the face image to be detected.
In some optional implementations, the first determining subunit 60212 is further to: determining a key point score which represents the probability of the face key point at the position of the face and corresponds to each face key point in the face key point set; summing the scores of the key points corresponding to each face key point in the face key point set to obtain a sum value; and determining the non-occlusion degree value of the face indicated by the face image to be detected based on the sum value and the numerical value representing the non-occlusion of the face.
In some optional implementations, the second determining unit 6022 includes: a second detection subunit 60221, configured to input the face image to be detected into a pre-trained face pose angle detection model, so as to obtain a face pose angle and a forward direction degree value used for representing a degree of the face facing the shooting front; a second determining subunit 60222, configured to determine an image quality score based on the forward direction degree value and a preset forward direction degree threshold if the face pose angle satisfies a preset condition.
In some optional implementations, the third determining unit 6023 is further configured to: determining an image quality score based on the size and a preset first size threshold and a preset second size threshold.
In some optional implementations, the determining module 603 is further configured to: and determining a comprehensive score based on a preset weight corresponding to each image quality score in the image quality score set and the image quality score set.
In some optional implementations, the determining module 603 is further configured to: and determining a comprehensive score based on preset activation functions and weights corresponding to each image quality score in the image quality score set.
In some optional implementations, the apparatus further comprises: the second detecting module 605 is configured to, if it is determined that the face image to be detected is the preferred image, input the face image to be detected into a pre-trained living body detection model, and obtain living body detection information for representing whether an object indicated by the face image to be detected is a living body.
The image detection device provided by the above embodiment of the present disclosure performs multiple measured image quality detections on a face image to be detected, obtains a score corresponding to each image quality detection strategy, fuses the scores to obtain a comprehensive score for measuring the face image to be detected, and finally determines information for representing whether the face image to be detected is a preferred image or not based on the comprehensive score, thereby implementing multiple image quality detection strategies, obtaining a preferred image with satisfactory image quality, and having richer image quality detection modes and higher detection accuracy.
Exemplary electronic device
Next, an electronic apparatus according to an embodiment of the present disclosure is described with reference to fig. 8. The electronic device may be either or both of the terminal device 101 and the server 103 as shown in fig. 1, or a stand-alone device separate from them, which may communicate with the terminal device 101 and the server 103 to receive the collected input signals therefrom.
FIG. 8 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure.
As shown in fig. 8, an electronic device 800 includes one or more processors 801 and memory 802.
The processor 801 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 800 to perform desired functions.
Memory 802 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. Volatile memory can include, for example, Random Access Memory (RAM), cache memory (or the like). The non-volatile memory may include, for example, Read Only Memory (ROM), a hard disk, flash memory, and the like. One or more computer program instructions may be stored on a computer readable storage medium and executed by the processor 801 to implement the image detection methods of the various embodiments of the present disclosure above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 800 may further include: an input device 803 and an output device 804, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
For example, when the electronic device is the terminal device 101 or the server 103, the input device 803 may be a camera, a mouse, a keyboard, or the like, for inputting the image of the face to be detected. When the electronic device is a stand-alone device, the input device 803 may be a communication network connector for receiving the input face image to be detected from the terminal device 101 and the server 103.
The output device 804 may output various information including the composite score and the like to the outside. The output devices 804 may include, for example, a display, speakers, a printer, and a communication network and its connected remote output devices, among others.
Of course, for simplicity, only some of the components of the electronic device 800 relevant to the present disclosure are shown in fig. 8, omitting components such as buses, input/output interfaces, and the like. In addition, electronic device 800 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the image detection method according to various embodiments of the present disclosure described in the "exemplary methods" section above of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the image detection method according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable 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 disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. An image detection method, comprising:
acquiring a shot face image to be detected;
if the facial image to be detected is a qualified image, performing image quality detection on the facial image to be detected to obtain an image quality score set, wherein each image quality score in the image quality score set corresponds to a preset image quality detection strategy;
determining a comprehensive score for measuring the facial image to be detected based on the image quality score set;
and generating information for representing whether the facial image to be detected is a preferred image or not based on the comprehensive score.
2. The method according to claim 1, wherein the image quality detection of the facial image to be detected, resulting in an image quality score set, comprises at least one of:
determining a non-occlusion degree value of the face indicated by the face image to be detected, and determining an image quality score based on the non-occlusion degree value;
determining a face attitude angle of the to-be-detected face image, and if the face attitude angle meets a preset condition, determining an image quality score based on the face attitude angle;
determining the size of the face area in the face image to be detected, and determining an image quality score based on the size.
3. The method according to claim 2, wherein the determining of the unobstructed extent value of the face indicated by the facial image to be detected comprises:
inputting the face image to be detected into a pre-trained face key point detection model to obtain a face key point set;
and determining the non-occlusion degree value of the face indicated by the face image to be detected based on the number of the face key points in the face key point set.
4. The method according to claim 3, wherein the determining an unobstructed extent value of the face indicated by the facial image to be detected based on the number of facial keypoints in the set of facial keypoints comprises:
determining a key point score which represents the probability of the face key point at the position of the face and corresponds to each face key point in the face key point set;
summing the scores of the key points corresponding to each face key point in the face key point set to obtain a sum value;
and determining the non-occlusion degree value of the face indicated by the face image to be detected based on the sum value and the numerical value representing the non-occlusion of the face.
5. The method according to claim 2, wherein the determining a face pose angle of the facial image to be detected, and if the face pose angle satisfies a preset condition, determining an image quality score based on the face pose angle comprises:
inputting the face image to be detected into a pre-trained face attitude angle detection model to obtain a face attitude angle and a forward degree value used for representing the degree of the face facing the shooting front;
and if the face attitude angle meets the preset condition, determining an image quality score based on the forward degree value and a preset forward degree threshold value.
6. The method of claim 2, wherein the determining an image quality score based on the size comprises:
determining an image quality score based on the size and a preset first size threshold and a preset second size threshold.
7. The method according to one of claims 1 to 6, wherein the determining a composite score for measuring the facial image to be detected based on the set of image quality scores comprises:
determining a composite score based on a preset weight corresponding to each image quality score in the set of image quality scores and the set of image quality scores.
8. An image detection apparatus comprising:
the acquisition module is used for acquiring a shot face image to be detected;
the first detection module is used for carrying out image quality detection on the facial image to be detected if the facial image to be detected is a qualified image to obtain an image quality score set, wherein each image quality score in the image quality score set corresponds to a preset image quality detection strategy;
the determining module is used for determining a comprehensive score for measuring the facial image to be detected based on the image quality score set;
and the generating module is used for generating information for representing whether the facial image to be detected is the preferred image or not based on the comprehensive score.
9. A computer-readable storage medium, the storage medium storing a computer program for performing the method of any of the preceding claims 1-7.
10. An electronic device, the electronic device comprising:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method of any one of claims 1 to 7.
CN202011237444.9A 2020-11-09 2020-11-09 Image detection method and device, computer readable storage medium and electronic equipment Pending CN112200804A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011237444.9A CN112200804A (en) 2020-11-09 2020-11-09 Image detection method and device, computer readable storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011237444.9A CN112200804A (en) 2020-11-09 2020-11-09 Image detection method and device, computer readable storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN112200804A true CN112200804A (en) 2021-01-08

Family

ID=74033096

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011237444.9A Pending CN112200804A (en) 2020-11-09 2020-11-09 Image detection method and device, computer readable storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN112200804A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112836656A (en) * 2021-02-07 2021-05-25 北京迈格威科技有限公司 Equipment control method and device and image acquisition system
CN113792661A (en) * 2021-09-15 2021-12-14 北京市商汤科技开发有限公司 Image detection method, image detection device, electronic equipment and storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107679490A (en) * 2017-09-29 2018-02-09 百度在线网络技术(北京)有限公司 Method and apparatus for detection image quality
CN108230293A (en) * 2017-05-31 2018-06-29 深圳市商汤科技有限公司 Determine method and apparatus, electronic equipment and the computer storage media of quality of human face image
CN108875452A (en) * 2017-05-11 2018-11-23 北京旷视科技有限公司 Face identification method, device, system and computer-readable medium
CN109146856A (en) * 2018-08-02 2019-01-04 深圳市华付信息技术有限公司 Picture quality assessment method, device, computer equipment and storage medium
CN110197146A (en) * 2019-05-23 2019-09-03 招商局金融科技有限公司 Facial image analysis method, electronic device and storage medium based on deep learning
CN110826402A (en) * 2019-09-27 2020-02-21 深圳市华付信息技术有限公司 Multi-task-based face quality estimation method

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108875452A (en) * 2017-05-11 2018-11-23 北京旷视科技有限公司 Face identification method, device, system and computer-readable medium
CN108230293A (en) * 2017-05-31 2018-06-29 深圳市商汤科技有限公司 Determine method and apparatus, electronic equipment and the computer storage media of quality of human face image
CN107679490A (en) * 2017-09-29 2018-02-09 百度在线网络技术(北京)有限公司 Method and apparatus for detection image quality
CN109146856A (en) * 2018-08-02 2019-01-04 深圳市华付信息技术有限公司 Picture quality assessment method, device, computer equipment and storage medium
CN110197146A (en) * 2019-05-23 2019-09-03 招商局金融科技有限公司 Facial image analysis method, electronic device and storage medium based on deep learning
CN110826402A (en) * 2019-09-27 2020-02-21 深圳市华付信息技术有限公司 Multi-task-based face quality estimation method

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
潘岑蕙: "基于深度学习的人脸图像质量评价", 《中国优秀硕士学位论文全文数据库 信息科技辑》, pages 2 - 4 *

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112836656A (en) * 2021-02-07 2021-05-25 北京迈格威科技有限公司 Equipment control method and device and image acquisition system
CN113792661A (en) * 2021-09-15 2021-12-14 北京市商汤科技开发有限公司 Image detection method, image detection device, electronic equipment and storage medium
WO2023040314A1 (en) * 2021-09-15 2023-03-23 上海商汤智能科技有限公司 Image test method and apparatus, electronic device, and storage medium
CN113792661B (en) * 2021-09-15 2024-06-11 北京市商汤科技开发有限公司 Image detection method, device, electronic equipment and storage medium

Similar Documents

Publication Publication Date Title
US11182592B2 (en) Target object recognition method and apparatus, storage medium, and electronic device
US20210133468A1 (en) Action Recognition Method, Electronic Device, and Storage Medium
CN113366487A (en) Operation determination method and device based on expression group and electronic equipment
CN112084856A (en) Face posture detection method and device, terminal equipment and storage medium
CN111489290B (en) Face image super-resolution reconstruction method and device and terminal equipment
CN110321845B (en) Method and device for extracting emotion packets from video and electronic equipment
CN110210196B (en) Identity authentication method and device
CN111612842A (en) Method and device for generating pose estimation model
CN111626219A (en) Trajectory prediction model generation method and device, readable storage medium and electronic equipment
CN108509994B (en) Method and device for clustering character images
CN108229375B (en) Method and device for detecting face image
CN112200804A (en) Image detection method and device, computer readable storage medium and electronic equipment
CN110795714A (en) Identity authentication method and device, computer equipment and storage medium
CN112446352A (en) Behavior recognition method, behavior recognition device, behavior recognition medium, and electronic device
CN112069887A (en) Face recognition method, face recognition device, terminal equipment and storage medium
CN113989156A (en) Method, apparatus, medium, device, and program for reliability verification of desensitization method
JP2022003526A (en) Information processor, detection system, method for processing information, and program
CN112766023B (en) Method, device, medium and equipment for determining gesture of target object
WO2021049234A1 (en) Image analysis device, control method, and program
CN112200109A (en) Face attribute recognition method, electronic device, and computer-readable storage medium
CN113506328A (en) Method and device for generating sight line estimation model and method and device for estimating sight line
CN111898529B (en) Face detection method and device, electronic equipment and computer readable medium
CN115862597A (en) Method and device for determining character type, electronic equipment and storage medium
CN112329624A (en) Living body detection method and apparatus, storage medium, and electronic device
CN112541425A (en) Emotion detection method, device, medium and electronic equipment

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