WO2022062379A1 - Image detection method and related apparatus, device, storage medium, and computer program - Google Patents

Image detection method and related apparatus, device, storage medium, and computer program Download PDF

Info

Publication number
WO2022062379A1
WO2022062379A1 PCT/CN2021/088718 CN2021088718W WO2022062379A1 WO 2022062379 A1 WO2022062379 A1 WO 2022062379A1 CN 2021088718 W CN2021088718 W CN 2021088718W WO 2022062379 A1 WO2022062379 A1 WO 2022062379A1
Authority
WO
WIPO (PCT)
Prior art keywords
detected
image
preset
feature
target
Prior art date
Application number
PCT/CN2021/088718
Other languages
French (fr)
Chinese (zh)
Inventor
时占
闫研
Original Assignee
北京市商汤科技开发有限公司
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 北京市商汤科技开发有限公司 filed Critical 北京市商汤科技开发有限公司
Priority to JP2021564951A priority Critical patent/JP2022552754A/en
Priority to KR1020217035770A priority patent/KR20220042301A/en
Publication of WO2022062379A1 publication Critical patent/WO2022062379A1/en

Links

Images

Classifications

    • 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
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/10Terrestrial scenes
    • 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/107Static hand or arm
    • GPHYSICS
    • G08SIGNALLING
    • G08BSIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
    • G08B21/00Alarms responsive to a single specified undesired or abnormal condition and not otherwise provided for
    • G08B21/18Status alarms

Definitions

  • the present application relates to the technical field of image processing, and in particular, to an image detection method and related apparatus, equipment, storage medium, and computer program.
  • image processing especially the detection and recognition of objects in images
  • a camera device is used to collect an image or video stream containing a human face, and the human face is automatically detected in the image, and then face recognition is performed on the detected human face, and corresponding processing is performed based on the recognition result.
  • the embodiments of the present application provide at least one image detection method and related apparatus, equipment, storage medium, and computer program.
  • An embodiment of the present application provides an image detection method, including: acquiring a first image containing a target to be detected; detecting the first image to obtain a detection result of the first image, wherein the detection result includes the target to be detected in the first image Detect whether the target is occluded by a preset object; perform a preset operation that matches the detection result.
  • the detection result is obtained by using a neural network to detect the first image.
  • the detection is performed by a neural network trained in advance, so that the detection result is more accurate and the detection speed is faster.
  • performing a preset operation matching the detection result includes: when the target to be detected is not blocked by a preset object, issuing a first reminder; wherein, the first reminder is used to prompt using a preset object to treat Detect the target for occlusion.
  • the situation that the object to be detected is not blocked by the preset object is timely reminded, and the person being reminded can also take corresponding measures in time.
  • the detection result further includes whether the occlusion mode in which the target to be detected is occluded by a preset object is a preset occlusion mode; performing a preset operation matching the detection result includes: when the target to be detected is occluded by a preset object and When the occlusion mode does not belong to the preset occlusion mode, a second reminder is issued; wherein, the second reminder is used to prompt to adjust the occlusion mode of the preset object.
  • performing a preset operation matching the detection result includes: when the object to be detected is occluded by a preset object, extracting at least a first feature of an unoccluded portion of the object to be detected from the first image , as the to-be-identified feature of the target to be detected; using the to-be-identified feature to identify the target to be detected, and obtain the recognition result.
  • the features of the unoccluded part are extracted for identification, which realizes the recognition based on the local features of the target to be detected, and since the local features are not occluded, it can represent the features to be detected. target, to a certain extent to ensure the accuracy of recognition.
  • extracting at least a first feature of an unoccluded part of the object to be detected from the first image as the feature to be identified of the object to be detected includes: extracting an unoccluded part of the object to be detected from the first image Part of the first feature, and obtains the second feature of the occluded part of the object to be detected; the first feature and the second feature are used as the feature to be identified of the object to be detected.
  • the feature of the occluded portion is also combined, thereby improving the feature richness of the object to be detected.
  • acquiring the second feature of the occluded portion of the object to be detected includes: extracting the feature of the occluded portion from the first image as the second feature; or, acquiring a preset feature of the occluded portion as the second feature features, wherein the preset features include features obtained based on at least one reference feature, and each reference feature is obtained by extracting an area corresponding to the occluded part in a reference target that does not have an occluded part.
  • the features of the occluded part can be directly extracted. Since the features of the occluded part can be different to a certain extent with different targets to be detected, this method can improve the accuracy of recognition; It is also possible to obtain a preset feature as the feature of the occluded part. This method does not need to perform feature extraction on the occluded part, which can reduce the consumption of processing resources and improve the processing efficiency.
  • using the feature to be identified to identify the target to be detected, and obtaining a recognition result includes at least one of the following: in the case that the preset target includes one, obtaining the difference between the feature to be identified and the pre-stored feature of the preset target If the first similarity satisfies the first preset condition, it is determined that the identification result includes the target to be detected passing the identity authentication; in the case of multiple preset targets, the features to be identified are obtained respectively The second similarity with the pre-stored features of each preset target, and determining the recognition result includes determining the identity of the target to be detected as the identity of the preset target corresponding to the second similarity that satisfies the second preset condition.
  • a preset target is compared or compared with a preset target in a database.
  • the method includes at least one of the following: the first preset condition includes that the first similarity is greater than a first similarity threshold; the second preset condition includes that the second similarity is greater than a second similarity threshold.
  • the method includes at least one of the following: a first similarity threshold when the feature to be identified includes a second feature of an occluded portion of the object to be detected is smaller than a threshold value when the feature to be identified does not include the second feature
  • the feature to be identified contains the second feature
  • the second feature may be different from the real feature of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the recognition accuracy.
  • the method before acquiring the first similarity between the feature to be identified and the pre-stored feature of the preset target, the method further includes: in response to an account registration request, registering an account for the user; In the frame of the second image, a second image that meets the preset quality requirements is determined, and the features of the user's preset part are extracted from the determined second image; the features of the preset part are associated with the account, and the preset part is The feature of the saves the pre-stored feature as the preset target.
  • the features of the preset part are extracted by first determining the second image that meets the quality requirements, so that the extracted features are more accurate.
  • the method when the object to be detected is occluded by a preset object, before extracting at least the first feature of the unoccluded portion of the object to be detected from the first image, the method further includes at least one of the following steps: from Among the multiple frames of first images containing the target to be detected, determine the first image that meets the preset quality requirements as the first image for subsequent feature extraction; preprocess the first image for subsequent feature extraction; perform subsequent feature extraction Perform living body detection on the first image of the to-be-detected object, and when the living-body detection result is that the target to be detected is a living body, it is determined to extract at least the first feature of the unoccluded part of the target to be detected from the first image and its subsequent steps.
  • preprocessing is performed before feature extraction, so that the extracted features are more accurate.
  • determining a first image that meets a preset quality requirement as the first image for subsequent feature extraction includes: based on a quality factor of each frame of the first image , correspondingly obtain the quality score of the first image of each frame, wherein the quality factor of the first image includes at least one of the following: pose information of the target to be detected relative to the photographing device, a value used to reflect the size of the target to be detected in the first image parameter information and brightness information of the first image; based on the quality score, determine the first image that meets the preset quality requirements as the first image for subsequent feature extraction, wherein the quality score of the selected first image is higher than that of other first images quality score.
  • feature extraction is performed by determining images whose quality scores meet the requirements, so that the extracted features can better represent the target to be detected.
  • preprocessing the first image for subsequent feature extraction includes: in the case that the first image includes multiple objects to be detected, determining the location of the objects to be detected in the first image that meet the preset extraction requirements target area, and remove the image portion other than the target area in the first image; and/or, detect that the inclination angle of the object to be detected in the first image is greater than a preset angle, and rotate the first image to the inclination of the object to be detected The angle is less than or equal to the preset angle.
  • the preset extraction requirements include that the area of the area corresponding to the target to be detected is larger than the area of the area corresponding to other targets to be detected, and the other targets to be detected include targets other than the target to be detected.
  • the result to be detected is more accurate.
  • the target to be detected includes a human face
  • the preset object includes a mask
  • a corresponding reminder can be issued so that the user can adjust in time; if the face wears a mask, face recognition, etc.
  • An embodiment of the present application provides an image detection device, comprising: an image acquisition module configured to acquire a first image containing a target to be detected; a target detection module configured to detect the first image to obtain a detection result of the first image , wherein the detection result includes whether the target to be detected in the first image is blocked by a preset object; the operation execution module is configured to execute a preset operation matching the detection result.
  • An embodiment of the present application provides an electronic device, including a memory and a processor, where the processor is configured to execute program instructions stored in the memory, so as to implement the above image detection method.
  • An embodiment of the present application provides a computer-readable storage medium, on which program instructions are stored, and the above-mentioned image detection method is implemented when the program instructions are executed by a processor.
  • An embodiment of the present application provides a computer program, including computer-readable code, when the computer-readable code is executed in an electronic device, the processor in the electronic device executes the image detection method described above.
  • the embodiments of the present application provide an image detection method and related devices, equipment, storage media, and computer programs. By detecting a first image containing a target to be detected, it is possible to obtain whether the target to be detected is blocked, and then execute an image detection method that matches the detection result.
  • the preset operation can determine whether the object to be detected is occluded, so that a subsequent preset operation matching the detection result can be performed, and flexible processing can be performed based on the occlusion state of the object to be detected in the image.
  • FIG. 1 is a schematic flowchart of an embodiment of an image detection method according to an embodiment of the present application
  • FIG. 2 is a schematic diagram of a first image in an embodiment of an image detection method according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a preprocessed first image in an embodiment of an image detection method according to an embodiment of the present application
  • FIG. 4 is a schematic structural diagram of an embodiment of an image detection apparatus according to an embodiment of the present application.
  • FIG. 5 is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present application.
  • FIG. 6 is a schematic structural diagram of an embodiment of a computer-readable storage medium according to an embodiment of the present application.
  • the image detection method in the embodiment of the present application can be applied to a device with image processing capability.
  • the device may have an image capture or video capture function, for example, the device may include components such as a camera for capturing images or videos. Or the device can obtain the required video stream or image from other devices by performing data transmission or data interaction with other devices, or access the required video streams from the storage resources of other devices or are images etc.
  • other devices have image capture or video capture functions, and have a communication connection with the device, for example, the device can perform data transmission or data interaction with other devices through Bluetooth, wireless network, etc., this application
  • the embodiment does not limit the communication mode between the two, which may include but not limited to the above-mentioned cases.
  • the device may include a mobile phone, a tablet computer, an interactive screen, etc., which is not limited herein.
  • FIG. 1 is a schematic flowchart of an embodiment of an image detection method according to an embodiment of the present application.
  • the image detection method is performed by an electronic device, and the method may include the following steps:
  • Step S11 Acquire a first image containing the target to be detected.
  • the first image containing the target to be detected may be the initial image containing the target object collected by directly calling the camera of the device, of course, it may be an image obtained from other devices, or it may be selected after frame selection, brightness adjustment, resolution, etc.
  • the targets to be detected can also include human faces, faces or limbs of other animals, and so on. Therefore, the manner of acquiring the first image containing the target to be detected is not limited.
  • other devices refer to devices that can only be operated by using different central processing units.
  • Step S12 Detect the first image to obtain a detection result of the first image, where the detection result includes whether the target to be detected in the first image is blocked by a preset object.
  • the preset object refers to any object that can block the target to be detected, such as masks, scarves, glasses, or visible objects such as arms and paper.
  • the first image is detected. During the detection process, it is necessary to detect whether the first image contains an image to be detected. If there is a target to be detected, it is determined whether the target to be detected is blocked by a preset object.
  • the way of judging whether the target to be detected is occluded by a preset object may be to train an occlusion detection model before detecting the first image, and input the first image into the occlusion detection model (for example, it may be a neural network with occlusion detection function). network), it can be known whether the target to be detected in the first image is blocked by a preset object.
  • the way of judging whether the target to be detected is blocked by a preset object may also be judging whether the preset detection position in the target to be detected is blocked, and whether the object blocked by the preset detection position satisfies the preset object conditions of.
  • the features of the occluded object and the preset occluded object can be extracted, and the similarity can be judged to obtain a detection result including whether the object to be detected is occluded.
  • Step S13 Execute a preset operation matching the detection result.
  • the detection result may be that the target to be detected is occluded but not by the preset object, the target to be detected is occluded by the preset object but the occlusion method is not the preset method, the target to be detected is occluded by the preset object and the occlusion method is the same as the preset method.
  • the setting method is the same or the target to be detected is not blocked at all. In the embodiment of the present application, it is considered whether the target to be detected in the first image is blocked by a preset object.
  • the preset object may be set to any object, that is, an occlusion detection model is used, and as long as it is determined that the object to be detected is occluded, a corresponding preset operation is performed.
  • the preset operation can be any operation related to object detection, such as recognition, etc.
  • the detection result is obtained by using a neural network to detect the first image.
  • a preset object occlusion model is trained first, so that the trained preset object occlusion model can detect whether the target to be detected in the first image is occluded by the preset object.
  • the preset object may be one or more, such as two or three different objects. When there are multiple preset objects, it indicates that a preset object occlusion model can determine whether the target to be detected is preset When the object is occluded, it can also detect which preset object is occluded by the target to be detected.
  • the target to be detected may be a face, and the preset object may be a mask.
  • the preset object occlusion model is a mask detection model.
  • the mask detection model can detect whether the target to be detected wears a mask. Of course, in some embodiments, it can also simultaneously detect whether the target to be detected is wearing a mask in the correct way.
  • the detection is performed by a neural network trained in advance, which makes the detection result more accurate and the detection speed faster.
  • a first reminder is issued, wherein the first reminder is used to prompt the use of a preset object to block the target to be detected.
  • the first reminder can have various reminder methods, including the method of frame selection by a face frame. If it is detected that the target to be detected is not blocked by a preset object, the face area will be framed in the form of a face frame. , the face frame at this time can have a warning color, such as red or yellow.
  • the first reminder can also be a combination of the face frame and the prompt text.
  • the prompt text such as you are not wearing a mask, please wear a mask, of course , it can also be in the form of voice reminder, or in the form of flashing indicator lights.
  • voice reminder or in the form of flashing indicator lights.
  • these forms can be used in combination or alone, which is not specified here.
  • a first reminder is issued to remind the face to wear a mask to cover the mouth and nose of the face.
  • the detection result further includes whether the occlusion mode in which the target to be detected is occluded by the preset object is a preset occlusion mode.
  • the preset occlusion mode can be marked in the training sample, wherein the preset occlusion mode can be the correct occlusion mode, so that the preset object occlusion model is trained so that the trained pre- It is assumed that the object occlusion model can determine whether the occlusion mode of the preset object is the preset occlusion mode when it is detected that the target to be detected is occluded by the preset object.
  • a second reminder is issued.
  • the second reminder is used to prompt to adjust the occlusion mode of the preset object.
  • the preset object is a mask
  • the preset occlusion method is the correct way of wearing a mask.
  • the preset occlusion mode may be various occlusion modes, such as the correct occlusion mode, the first wrong occlusion mode, the second wrong occlusion mode, etc.
  • the occlusion mode of object occlusion is the first wrong occlusion mode
  • a reminder corresponding to the first erroneous occlusion mode is issued, and when it is detected that the occlusion mode in which the target to be detected is occluded by the preset object is the second wrong occlusion mode, Then, a reminder corresponding to the second wrong occlusion mode is issued to prompt the target to be detected to adjust the occlusion mode to the correct occlusion mode.
  • the correct occlusion method is that the mask covers the nose and mouth at the same time
  • the first wrong occlusion method is that the mask covers the nose but does not cover the mouth.
  • the reminder corresponding to the first wrong occlusion method is to remind the face to cover the mouth at the same time.
  • the second wrong occlusion method is that the mask covers the mouth but not the nose.
  • the reminder corresponding to the second wrong occlusion method is: Prompt the face to cover the nose at the same time.
  • the method of the second reminder is similar to that of the first reminder, and can also be in the form of a face frame and a text reminder, and a face frame and a voice reminder or a separate text reminder or a separate voice reminder or a warning light flashing, etc.
  • the text reminder or voice should be set accordingly.
  • the preset blocking method is the first wrong blocking method
  • the text reminder corresponds to the first wrong blocking method. .
  • the target to be detected when the target to be detected is blocked by a preset object, the target to be detected is identified. In other business scenarios, if the target to be detected is not blocked by a preset object, the target to be detected will not be identified. If it is detected that the face does not wear a mask, the face recognition will not be performed, and the face without a mask will not be able to enter the station through face recognition. Of course, according to the needs of the business scenario, even if it is detected that the target to be detected is not blocked by a preset object, the target to be detected can still be identified.
  • the first image that meets the preset quality requirements can be determined from the multi-frame first images containing the target to be detected as the follow-up feature extraction.
  • the manner of determining the first image that meets the preset quality requirements as the first image for subsequent feature extraction may be based on the quality factor of each frame of the first image, correspondingly obtaining the quality score of each frame of the first image, wherein the first image
  • the quality factor of the image includes at least one of the following: pose information of the target to be detected relative to the photographing device, parameter information used to reflect the size of the target to be detected in the first image, and brightness information of the first image.
  • the pose information of the target to be detected relative to the photographing device may be angle information of the target to be detected relative to the photographing device.
  • the angle information of the target to be detected relative to the photographing device here may be the angle information of the target to be detected relative to the lens during shooting. For example, taking the lens as the origin, establish a three-dimensional coordinate system, in which the line connecting the lens and the center of the earth is the X axis, the line extending directly in front of the lens and perpendicular to the X axis is the Y axis, and the line perpendicular to the X axis and the Y axis is the Y axis. for the Z axis.
  • the three-dimensional coordinate system is only used to represent the angle between the target to be detected and the photographing device.
  • the selection of the origin of the three-dimensional coordinate system or the selection of three directions may be different from the embodiments of the present application.
  • the angle can be divided into angles relative to the XYZ direction of the lens. For example, if the target to be detected faces the lens, the angles along the XYZ direction are all 0° (degrees), and the front side of the target to be detected faces the first image acquisition component. Then the angle of the target to be detected relative to the first image acquisition component in the X direction is 90°, the angle along the Y direction is 0°, and the angle along the Z direction is also 0°.
  • the parameter information used to reflect the size of the object to be detected in the first image includes the size of the area of the first image occupied by the object to be detected, where the area size can be represented by the size of the area of the first image occupied by the object to be detected.
  • the premise is that the target to be detected is completely contained in the first image.
  • the quality factor score of the size of the target to be detected in the first image of this frame is equal to relatively low.
  • the brightness information of the first image is not as high as possible, but as the brightness of natural light at the current moment is better, and the score of this quality factor is relatively higher.
  • the weights occupied by the above three quality factors are set according to the influence degree relationship of the above three quality factors on the image quality. For example, the weight of the angle is set to 0.4, and the other two are set to 0.3 respectively. Of course, this is only an example.
  • the weights between the various quality factors can be set according to the needs.
  • the extracted features can better represent the target to be detected.
  • the setting of the weight can take into account the actual image detection accuracy requirements, the processing capability of the image detection device, and the resource occupancy.
  • the processing capability of the image detection device is high and the resource occupancy is small, multiple quality factors may be considered to calculate the quality score, and if the processing capability of the image detection device is too low, appropriate use of Several quality factors are used to calculate the quality score, for example, an appropriate quality factor is selected according to the time required to calculate each quality factor or the memory space occupied. Therefore, the choice of how many quality factors to use or which quality factors to use can be made flexibly.
  • a lower quality score threshold may also be determined. If the quality score of the first image is lower than the quality score threshold, it will be excluded, and the first image with the quality score greater than the quality score threshold will be retained. .
  • the first image for subsequent feature extraction may also be preprocessed.
  • the preprocessing method may be: in the case that the first image includes multiple targets to be detected, determine the target area of the target to be detected in the first image that meets the preset extraction requirements, and remove the target area in the first image. part of the image outside the area.
  • the target area here may be an area containing a target to be detected. That is to say, when the first image contains multiple targets to be detected, the identification is not performed on the complete first image, but only on the target area of the target to be detected that meets the preset extraction requirements.
  • the preset extraction requirement may be that the area of the area corresponding to the target to be detected is larger than the area of the area corresponding to other targets to be detected, wherein the other targets to be detected include targets other than the target to be detected. If there are multiple objects to be detected in the first image, the areas occupied by the multiple objects to be detected may be inconsistent, and the objects to be detected with larger areas have a relatively higher recognition rate during the recognition process. Detection target for identification.
  • the object to be detected whose center is closer to the center of the first image may be identified, or in other embodiments, the corresponding objects of all objects to be detected may be obtained separately.
  • all the objects to be detected in the latter refer to the objects to be detected whose areas are tied first or whose areas are larger than a preset area extraction threshold.
  • the preprocessing of the first image for subsequent feature extraction may also be that it is detected that the inclination angle of the object to be detected in the first image is greater than a preset angle, and rotate the first image until the inclination angle of the object to be detected is less than or equal to the preset angle.
  • the rotation method in addition to rotating the entire first image, may only rotate the target to be detected, or the target area including the target to be detected. Therefore, the method of aligning the target to be detected is not limited here. .
  • the preset angle may be within 0° to 180° clockwise or counterclockwise. In this embodiment of the present application, the preset angle is selected to be set to 0°.
  • the preset angle may also be 30°, 35°, and the like.
  • the way of judging whether the object to be detected is inclined by a preset angle may be to obtain the included angle between a line connecting a preset first key point and a preset second key point in the object to be detected and a vertical line, Whether the angle is greater than the preset angle, if it is greater, rotate the first image so that the included angle is less than or equal to the preset angle, and the preset first key point after rotation is located above the preset second key, which is relative to The bottom edge of the first image is determined.
  • the inclination angle may also be the inclination angle of the object to be detected relative to a certain position of the first image, for example, the inclination angle of the object to be detected relative to the center of the first image.
  • the preset angle here can be set according to the requirements of different scenarios, for example, it can be determined according to the area of the first image where the area where the target to be detected is located. For example, when the area of the area where the target to be detected is located is larger than the first area preset value, the preset angle can be set to be greater than 30°, and when the area of the area where the target to be detected is located is smaller than the second area preset value, the preset angle can be set. Set the angle to be less than 30°.
  • FIG. 2 is a schematic diagram of a first image in an embodiment of an image detection method according to an embodiment of the present application
  • FIG. 3 is a schematic diagram of a preprocessed first image in an embodiment of the image detection method according to an embodiment of the present application. . As shown in FIG.
  • the lower half of the object to be detected 21 in the first image 20 is blocked by a preset object 22 , and the object to be detected 21 is obviously inclined to the left, that is, the upper left corner of the object to be detected 21 (the first preset
  • the angle between the connection line between the key point) and the lower left corner point (the second preset key point) and a vertical line is 30°, that is, the inclination angle of the target 21 to be detected is 30° greater than the preset angle of 0°, then the
  • the first image 20 is rotated to the right, that is, rotated 30° clockwise.
  • the rotated first image is shown in FIG. 3 .
  • FIG. 3 In FIG.
  • FIG. 3 the upper left corner point (the first preset key point) and the lower left corner point of the target 21 to be detected are shown in FIG. 3 .
  • the included angle between the connection line (the second preset key point) and a vertical line is 0°, which is equal to the preset angle of 0°.
  • the target to be detected in the first image When the inclination angle of the target to be detected in the first image is greater than the preset angle, the target to be detected is straightened, so that the subsequent process of performing live detection or target recognition on the target to be detected is reduced because the target to be detected is inclined due to the inclination of the target. the impact caused.
  • a liveness detection may also be performed on the subsequent feature extraction first image, and when the liveness detection result is that the target to be detected is a living body, it is determined to execute the At least the first feature of the unoccluded part of the object to be detected is extracted from the first image and the subsequent steps thereof.
  • the object to be detected with the largest area is selected for living body detection.
  • the in vivo detection can be performed by inputting the target area corresponding to the target to be detected into the in vivo detection model, wherein the in vivo detection model is obtained by training a number of images containing the target to be detected occluded by the preset object.
  • the first feature of the unoccluded part of the object to be detected is first extracted from the first image as the feature to be identified of the object to be detected.
  • the first feature refers to the feature of the key point that is not occluded in the target to be detected.
  • the first feature of the unoccluded part of the object to be detected can be extracted from the first image, and the second feature of the occluded part of the object to be detected can be obtained, and the first feature and the second feature are used as the object to be detected. Identify features.
  • the second feature here is the feature of the key points of the occluded part of the target to be detected.
  • the second feature of the occluded portion There are two ways to obtain the second feature of the occluded portion.
  • One is to extract the feature of the occluded portion from the first image as the second feature. That is to say, although this part is occluded by the preset object, the second feature of the occluded part is extracted according to the method of extracting the first feature that is not occluded, that is, the same processing mechanism is adopted regardless of whether the target to be detected is occluded by the preset object. , that is, whether it is occluded by a preset object does not affect the feature extraction process.
  • this method can still be used to extract key point features in the target to be detected.
  • the method of extracting the second feature is to treat the face as not being blocked by the mask, and extract the features of each key point on the face, that is to say, for the face wearing a mask
  • the same processing mechanism is used as the face without a mask, that is, wearing a mask will not affect the process of feature extraction.
  • Another way is to obtain a preset feature of the occluded part as the second feature, wherein the preset feature may be a feature obtained based on at least one reference feature, and each reference feature is the difference between the reference target without the occluded part and the reference target. The area corresponding to the occluded part is extracted.
  • the reference features of the key points of the occluded part are preset, that is, the features of the occluded part are complemented.
  • a number of detection results are pre-extracted for the features corresponding to preset parts in the target to be detected that do not have an occluded part, and then the average value of the extracted several features is supplemented as the reference feature of the part occluded by the object, wherein, It may be to pre-extract the features of the corresponding preset parts in the target to be detected whose detection results are not occluded by the preset object, and then fill in the average value of the extracted features as the reference feature of the part occluded by the preset object.
  • pre-extract the features of the corresponding preset parts in several faces without masks that is, the features of the mask-wearing parts, such as nose, mouth, etc., and make up the average value of the extracted features as the mask covered by the mask. part of the preset reference feature.
  • the features of the occluded parts can be directly extracted. Since the features of the occluded parts can be different to a certain extent with the different objects to be detected, this method can improve the accuracy of recognition;
  • the preset feature can be obtained as the feature of the occluded part, and this method does not need to perform feature extraction on the occluded part, which can reduce the consumption of processing resources and improve the processing efficiency.
  • the to-be-identified feature is used to identify the to-be-detected object.
  • the recognized scenes can be divided into 1:1 scenes and 1:N scenes, where 1:1 refers to the comparison between two features, and 1:N refers to one feature and multiple features comparison between.
  • 1:1 scenario that is, when the preset target includes one, the first similarity between the feature to be identified and the pre-stored feature of the preset target is obtained, and when the first similarity satisfies the first prediction
  • it is determined that the identification result includes that the target to be detected has passed the identity authentication.
  • the first preset condition may be that the first similarity is greater than the first similarity threshold.
  • the first similarity threshold when the feature to be identified includes the second feature of the occluded portion of the target to be detected is smaller than the first similarity threshold when the feature to be identified does not include the second feature. If the feature to be identified contains a second feature, the second feature may be different from the real feature of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the accuracy of identification sex.
  • the selection of the first similarity threshold may be determined according to the ratio of the number of occluded key points to the total number of key points of the target to be detected.
  • the first similarity threshold may be determined to be one-third of the similarity threshold of the unobstructed target to be detected.
  • the first similarity threshold can be set to be 0.1 smaller than the first similarity threshold in the case where the feature to be identified does not include the second feature, or a smaller value, which is not done here. Regulation.
  • the similarity threshold for identifying the unoccluded target to be detected may be between 0.6 and 1. Of course, this is only an example.
  • the first similarity threshold in the case where the feature to be identified includes the second feature of the occluded part of the target to be detected may also be equal to the value of the feature to be identified that does not include the second feature.
  • the first similarity threshold value in this case, if the feature to be identified includes the second feature can also be determined according to the above method and can be determined according to the actual situation.
  • an association between the user account and the pre-stored feature of the preset target is established first.
  • the implementation is as follows: in response to an account registration request, register an account for the user.
  • the account here can be some electronic payment accounts, as long as the application program that can perform target recognition can respond to the account registration request and register the account for the user.
  • the user can register through the mobile phone number in the corresponding application. After the registration is successful, the user obtains the user name, password and other information.
  • a second image that meets the preset quality requirements is determined, and the feature of the preset part of the user is extracted from the determined second image.
  • the preset part here is the same as the preset part of the target to be detected.
  • the step of selecting the second image that meets the preset quality requirement is the same as the above-mentioned step of selecting the first image that meets the preset quality requirement.
  • the feature of the preset part is associated with the account, and the feature of the preset part is saved as the pre-stored feature of the preset target. That is, the preset part of the user is the preset target.
  • the second similarity between the features to be identified and the pre-stored features of each preset target is obtained respectively, and it is determined that the recognition results include
  • the identity of the target to be detected is determined as the identity of the preset target corresponding to the second degree of similarity satisfying the second preset condition.
  • the second preset condition may be that the second similarity is greater than the second similarity threshold.
  • satisfying the second preset condition referred to here is not only greater than the second similarity threshold, but is often a parameter that takes the maximum value among all the second similarity. That is, the preset target identity corresponding to the largest second similarity is selected as the identity of the target to be detected.
  • the second similarity threshold when the feature to be identified includes the second feature is smaller than the second similarity threshold when the feature to be identified does not include the second feature. If the feature to be identified contains a second feature, the second feature may be different from the real feature of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the accuracy of identification sex.
  • the method for determining the second similarity threshold is the same as the method for determining the first similarity threshold.
  • 1:N can be in a scenario involving many faces.
  • an office building or a company has installed face recognition gates at the entrance and exit.
  • the camera on the gate detects and captures the face, and compares the captured face with the face database.
  • the comparison is successful, open the gate, when an unregistered person appears at the gate, the comparison should be unsuccessful and the gate does not respond.
  • the preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
  • the embodiments of the present application further provide an image detection method, the method utilizes the model detection capability based on the deep learning algorithm, and starts from the face verification scene, and realizes the 1:1 and 1:N scenes At the same time, it provides a method for checking whether a mask is worn, as well as the realization method of face comparison and face retrieval in the process of wearing a mask.
  • the face verification scenarios mainly include 1:1 and 1:N scenarios.
  • 1:1 in the payment scenario refers to the 1:1 verification between the face photo captured in real time and the bottom library image bound by the member. If it is confirmed that they are the same user, the authentication is passed.
  • the 1:N scenario is more related to face retrieval. For example, an office building or a company has installed face recognition gates at the entrance and exit. Users register and form a face database. When the user appears in front of the gate, the camera on the gate detects and captures the face, and compares the captured face image with the pictures in the face database. When the comparison is successful, the gate is opened, and the comparison When unsuccessful, the gate will not respond, that is, the gate will remain closed.
  • dummies such as photos (including photos obtained by taking pictures of people, electronically synthesized photos, etc.), masks, etc.
  • the user has an account, such as an account for electronic payment.
  • the user registers through the mobile phone number in the application system corresponding to the electronic payment account. After the registration is successful, the user obtains information such as user name and password, that is, an electronic payment account.
  • the application system guides the user to perform the operation of binding the face through some activities.
  • the user passes the living body authentication, the face recognition is performed, and when the quality of the face in the video meets the face collection requirements, the user's face is collected. image.
  • a frame with the highest quality in the shooting process can be selected, and the evaluation criteria of the quality include one or more of the dimensions such as the angle of the human face, the intensity of the illumination, and the size of the human face.
  • the collected face image of the user can be associated with the account, specifically the identification of the account, as a comparison picture of the face base library.
  • the order is confirmed and the payment link is entered.
  • the user if it has bound the face image and chooses face payment, it will enter the face capture link.
  • face detection check the wearing of masks (that is, face attribute detection). If you wear a mask, continue the subsequent process. If you do not wear a mask, you can remind the user to wear a mask by playing voice or displaying text.
  • the facial feature value including the mask part.
  • the feature value of the face without a mask in the image of the face base library is A.
  • extract the feature of the face wearing a mask extract the feature value A1
  • compare the feature vector of the feature value A1 with the mask and the feature value A without the mask is A without the mask.
  • the second is to extract the facial feature values of the visible part above the mask. Assuming that all faces have 128 key points and 64 key points above the mask, then extract the eigenvalues from the 64 key points of the visible part above the mask, Compare with the eigenvalues extracted from the corresponding 64 key points in the picture of the face base library.
  • the generated feature value is compared with the feature value of the picture in the user's described face base library, and when the comparison threshold is exceeded (for example, the comparison threshold is set to 0.8, and the similarity exceeds 0.8, it is considered to be the same user), the comparison is passed, and the face verification process ends.
  • the comparison threshold for example, the comparison threshold is set to 0.8, and the similarity exceeds 0.8, it is considered to be the same user
  • the picture in the face base library are bound and associated with the face recognition device of the gate, so that the face recognition equipment of the gate can read the pictures in the face base library.
  • the face recognition device on the gate detects the face information, and then enters the face capture state (at this time, the camera module on the face recognition device can be turned on all the time to perform face tracking, The face frame always moves with the movement of the face).
  • the facial feature value in the 1:N scene there are also two ways to extract and retrieve the facial feature value in the 1:N scene.
  • the first is to extract the facial feature value including the mask part. It is assumed that there are A and B in the comparison picture of the face base library. , C, D, and E of the five face eigenvalues without masks, the same way is used to extract the features of the faces wearing masks, and the five eigenvalues A1, B1, C1, D1 and E1 are extracted.
  • the eigenvalue A1 of wearing a mask if the distance between the eigenvalue A1 and the eigenvector of the eigenvalue A is the shortest, the corresponding eigenvalue A is retrieved.
  • the second is to extract the facial feature value of the visible part above the mask, in which the generation part of the feature value is the same as the method in the above 1:1 scenario, please refer to the above description.
  • the generated eigenvalues are then used for facial feature retrieval (1:N search) in the pictures of the face base database of all users in the entire building.
  • the retrieval is considered successful. If the retrieval is successful, the face recognition device transmits an opening signal, the gate opens, and the face verification process ends.
  • the execution subject of the image detection method may be an image detection apparatus, for example, the image detection method may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (User Equipment, UE), a mobile device, a terminal , cellular phones, cordless phones, personal digital assistants (Personal Digital Assistant, PDA), handheld devices, computing devices, in-vehicle devices, wearable devices, etc.
  • the image detection method may be implemented by the processor calling computer-readable instructions stored in the memory.
  • FIG. 4 is a schematic structural diagram of an embodiment of an image detection apparatus according to an embodiment of the present application.
  • the image detection device 40 includes an image acquisition module 41 , a target detection module 42 and an operation execution module 43 .
  • the image acquisition module 41 is configured to acquire a first image containing the target to be detected;
  • the target detection module 42 is configured to detect the first image to obtain a detection result of the first image, wherein the detection result includes the target to be detected in the first image Whether it is blocked by a preset object;
  • the operation execution module 43 is configured to execute a preset operation matching the detection result.
  • the preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
  • the detection result is obtained by detecting the first image by the target detection module 42 using a neural network.
  • detection is performed by a neural network trained in advance, so that the detection result is more accurate and the detection speed is faster.
  • the operation execution module 43 performs a preset operation matching the detection result, including: when the target to be detected is not blocked by a preset object, issuing a first reminder; wherein the first reminder is used to remind the user to use The preset object occludes the target to be detected.
  • the detection result further includes whether the occlusion mode in which the target to be detected is occluded by a preset object is a preset occlusion mode; the operation execution module 43 performs a preset operation matching the detection result, including: In the case where the object is blocked and the blocking method does not belong to the preset blocking method, a second reminder is issued; wherein, the second reminder is used to prompt to adjust the blocking method of the preset object.
  • the operation execution module 43 performs a preset operation matching the detection result, including: when the object to be detected is occluded by a preset object, extracting at least the unoccluded part of the object to be detected from the first image
  • the first feature of the object is used as the feature to be identified of the target to be detected; the feature to be identified is used to identify the target to be detected, and the identification result is obtained.
  • the features of the unoccluded part are extracted for identification, which realizes the recognition based on the local features of the target to be detected, and since the local features are not occluded, it can represent the target to be detected. Detect the target to ensure the accuracy of recognition to a certain extent.
  • the operation execution module 43 extracts at least the first feature of the unoccluded part of the object to be detected from the first image as the feature to be identified of the object to be detected, including: extracting the object to be detected from the first image The first feature of the unoccluded part is obtained, and the second feature of the occluded part of the object to be detected is obtained; the first feature and the second feature are used as the feature to be identified of the object to be detected.
  • the feature of the occluded part is also combined, thereby improving the feature richness of the object to be detected.
  • the operation execution module 43 obtains the second feature of the occluded portion of the object to be detected, including: extracting the feature of the occluded portion from the first image as the second feature; or, obtaining a preset of the occluded portion
  • the feature is used as the second feature, wherein the preset feature includes a feature obtained based on at least one reference feature, and each reference feature is obtained by extracting an area corresponding to the occluded part in the reference target without the occluded part.
  • the features of the occluded part can be directly extracted. Since the features of the occluded part can be different to a certain extent with different targets to be detected, this method can improve the accuracy of recognition. It is also possible to obtain a preset feature as the feature of the occluded part. This method does not need to perform feature extraction on the occluded part, which can reduce the consumption of processing resources and improve the processing efficiency.
  • the operation execution module 43 uses the feature to be identified to identify the target to be detected, and obtains the recognition result including at least one of the following: in the case that the preset target includes one, obtain the difference between the feature to be identified and the preset target. The first similarity between the pre-stored features, and in the case that the first similarity satisfies the first preset condition, it is determined that the identification result includes that the target to be detected has passed the identity authentication; in the case of multiple preset targets, respectively obtain The second similarity between the feature to be identified and the pre-stored feature of each preset target, and determining the recognition result includes determining the identity of the target to be detected as the preset target corresponding to the second similarity that satisfies the second preset condition. identity.
  • the above scheme by calculating the first similarity with the pre-stored features of a specific preset target, or calculating the similarity with the pre-stored features of multiple preset targets, so that the target to be detected can be compared with the actual scene requirements.
  • a specific preset target is compared or compared with a preset target in a database.
  • the first preset condition includes that the first similarity is greater than a first similarity threshold; the second preset condition includes that the second similarity is greater than a second similarity threshold.
  • the first similarity threshold when the feature to be identified includes the second feature of the occluded portion of the object to be detected is smaller than the first similarity threshold when the feature to be identified does not include the second feature Threshold; the second similarity threshold when the feature to be identified includes the second feature is smaller than the second similarity threshold when the feature to be identified does not include the second feature.
  • the feature to be identified contains a second feature
  • the second feature may be different from the real features of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the recognition accuracy.
  • the image detection apparatus 40 further includes a pre-stored module (not shown).
  • the pre-store module is configured to: in response to the account registration request, register an account for the user; In the second image, a second image that meets the preset quality requirements is determined, and the features of the user's preset part are extracted from the determined second image; the features of the preset part are associated with the account, and the features of the preset part are Features saves pre-existing features that are preset targets.
  • the features of the preset part are extracted by first determining the second image that meets the quality requirements, so that the extracted features are more accurate.
  • the operation execution module 43 is further configured to perform the following At least one step: from multiple frames of first images containing the target to be detected, determining a first image that meets preset quality requirements as the first image for subsequent feature extraction; preprocessing the first image for subsequent feature extraction; Perform in vivo detection on the first image for subsequent feature extraction, and when the result of the in vivo detection is that the target to be detected is a living body, determine to extract at least the first feature of the unoccluded part of the target to be detected from the first image and its next steps.
  • preprocessing is performed before feature extraction, so that the extracted features are more accurate, and the target to be detected is identified only when the target to be detected is a living body, thereby enhancing the security of identification, and can be used in Prevent prosthetic attack to some extent.
  • the operation execution module 43 determines, from the multiple frames of first images containing the target to be detected, the first image that meets the preset quality requirements as the first image for subsequent feature extraction, including: based on the first image of each frame The quality factor of the image corresponds to the quality score of the first image of each frame, wherein the quality factor of the first image includes at least one of the following: pose information of the target to be detected relative to the photographing device, used to reflect the information to be detected in the first image Detect the parameter information of the target size and the brightness information of the first image; based on the quality score, determine the first image that meets the preset quality requirements as the first image for subsequent feature extraction, wherein the quality score of the selected first image is higher than Quality scores for other first images.
  • feature extraction is performed by determining images whose quality scores meet the requirements, so that the extracted features can better represent the target to be detected.
  • the operation execution module 43 preprocesses the first image for subsequent feature extraction, including: when the first image includes multiple objects to be detected, determining that the objects to be detected that meet the preset extraction requirements are in the first image. a target area in an image, and remove the image portion other than the target area in the first image; and/or, detect that the inclination angle of the object to be detected in the first image is greater than a preset angle, and rotate the first image to the target area to be detected The inclination angle of the detection target is smaller than the preset angle.
  • the preset extraction requirements include that the area of the area corresponding to the target to be detected is larger than the area of the area corresponding to other targets to be detected, and the other targets to be detected include targets other than the target to be detected.
  • the target to be detected includes a human face
  • the preset object includes a mask
  • the preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
  • FIG. 5 is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present application.
  • the electronic device 50 includes a memory 51 and a processor 52, and the processor 52 is configured to execute program instructions stored in the memory 51, so as to implement the steps in any of the above image detection method embodiments.
  • the electronic device 50 may include, but is not limited to, a microcomputer and a server.
  • the electronic device 50 may also include mobile devices such as a notebook computer and a tablet computer, which are not limited herein.
  • the processor 52 is configured to control itself and the memory 51 to implement the steps in any of the image detection method embodiments described above.
  • the processor 52 may also be referred to as a central processing unit (Central Processing Unit, CPU).
  • the processor 52 may be an integrated circuit chip with signal processing capability.
  • the processor 52 may also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
  • a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
  • the processor 52 may be jointly implemented by an integrated circuit chip.
  • the preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
  • FIG. 6 is a schematic structural diagram of an embodiment of a computer-readable storage medium according to an embodiment of the present application.
  • the computer-readable storage medium 60 stores program instructions 61 that can be executed by the processor, and the program instructions 61 are used to implement the steps in any of the above image detection method embodiments.
  • the preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
  • the embodiments of the present application provide a computer program, including computer-readable codes, when the computer-readable codes are executed in an electronic device, a processor in the electronic device executes the above method.
  • the functions or modules included in the apparatus provided in the embodiments of the present application may be used to execute the methods described in the above method embodiments, and for implementation, reference may be made to the above method embodiments for brevity.
  • the disclosed method and apparatus may be implemented in other manners.
  • the device implementations described above are only illustrative.
  • the division of modules or units is only a logical function division. In actual implementation, there may be other divisions.
  • units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented.
  • the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
  • each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit.
  • the above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units.
  • the integrated unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium.
  • the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage
  • the medium includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (Processor) to execute all or part of the steps of the methods in the various implementation manners of the embodiments of this application.
  • the aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
  • Embodiments of the present application provide an image detection method and related devices, equipment, storage media, and computer programs.
  • the method includes: acquiring a first image containing an object to be detected; detecting the first image to obtain the The detection result of the first image, wherein the detection result includes whether the target to be detected in the first image is blocked by a preset object; and a preset operation matching the detection result is performed.
  • the image detection method provided by the embodiment of the present application, it is possible to determine whether the object to be detected is occluded, so as to perform a subsequent preset operation matching the detection result, and realize flexible processing based on the occlusion state of the object to be detected in the image.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • General Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Business, Economics & Management (AREA)
  • Emergency Management (AREA)
  • Image Analysis (AREA)
  • Collating Specific Patterns (AREA)

Abstract

An image detection method and a related apparatus, a device, and a storage medium. The image detection method comprises: acquiring a first image containing a target to be detected (S11); performing detection on the first image, and obtaining a detection result of the first image, the detection result comprising whether said target in the first image is blocked by a preset object (S12); and executing a preset operation matching the detection result (S13).

Description

图像检测方法和相关装置、设备、存储介质、计算机程序Image detection method and related apparatus, equipment, storage medium, computer program
相关申请的交叉引用CROSS-REFERENCE TO RELATED APPLICATIONS
本申请基于申请号为202011002322.1、申请日为2020年09月22日、申请名称为“图像检测方法和相关装置、设备、存储介质”的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此以全文引用的方式引入本申请。This application is based on the Chinese patent application with the application number 202011002322.1, the application date is September 22, 2020, and the application name is "image detection method and related devices, equipment, storage medium", and claims the priority of the Chinese patent application, The entire content of this Chinese patent application is hereby incorporated by reference in its entirety.
技术领域technical field
本申请涉及图像处理技术领域,特别是涉及一种图像检测方法和相关装置、设备、存储介质、计算机程序。The present application relates to the technical field of image processing, and in particular, to an image detection method and related apparatus, equipment, storage medium, and computer program.
背景技术Background technique
目前,图像处理,特别是对图像中的目标进行检测与识别,已被广泛运用到各个使用场景中。以人脸为例,对图像中的人脸检测与识别,已广泛应用于金融、边检、政府、航天、电力、工厂、教育、医疗等领域。现有技术中会采用摄像设备采集含有人脸的图像或视频流,并自动在图像中检测人脸,进而对检测到的人脸进行脸部识别,并基于识别结果进行相应处理。At present, image processing, especially the detection and recognition of objects in images, has been widely used in various usage scenarios. Taking faces as an example, the detection and recognition of faces in images has been widely used in finance, border inspection, government, aerospace, electric power, factories, education, medical care and other fields. In the prior art, a camera device is used to collect an image or video stream containing a human face, and the human face is automatically detected in the image, and then face recognition is performed on the detected human face, and corresponding processing is performed based on the recognition result.
发明内容SUMMARY OF THE INVENTION
本申请实施例至少提供一种图像检测方法和相关装置、设备、存储介质、计算机程序。The embodiments of the present application provide at least one image detection method and related apparatus, equipment, storage medium, and computer program.
本申请实施例提供了一种图像检测方法,包括:获取包含待检测目标的第一图像;对第一图像进行检测,得到第一图像的检测结果,其中,检测结果包括第一图像中的待检测目标是否被预设物体遮挡;执行与检测结果匹配的预设操作。An embodiment of the present application provides an image detection method, including: acquiring a first image containing a target to be detected; detecting the first image to obtain a detection result of the first image, wherein the detection result includes the target to be detected in the first image Detect whether the target is occluded by a preset object; perform a preset operation that matches the detection result.
因此,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡的检测结果,然后执行与检测结果匹配的预设操作,能够实现判断待检测目标是否被遮挡,从而进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。Therefore, by detecting the first image containing the object to be detected to obtain a detection result of whether the object to be detected is blocked, and then performing a preset operation matching the detection result, it is possible to determine whether the object to be detected is blocked, so as to carry out subsequent The preset operation matching the detection result realizes flexible processing based on the occlusion state of the target to be detected in the image.
在一些实施例中,检测结果是利用神经网络对第一图像进行检测得到的。In some embodiments, the detection result is obtained by using a neural network to detect the first image.
因此,通过提前训练好的神经网络来进行检测,使得检测结果更准确且检测速度更快。Therefore, the detection is performed by a neural network trained in advance, so that the detection result is more accurate and the detection speed is faster.
在一些实施例中,执行与检测结果匹配的预设操作,包括:在待检测目标未被预设物体遮挡的情况下,发出第一提醒;其中,第一提醒用于提示使用预设物体对待检测目标进行遮挡。In some embodiments, performing a preset operation matching the detection result includes: when the target to be detected is not blocked by a preset object, issuing a first reminder; wherein, the first reminder is used to prompt using a preset object to treat Detect the target for occlusion.
因此,通过在待检测目标未被遮挡时发出第一提醒,以及时提醒待检测目标未被预设物体遮挡的情况,进而被提醒者也能够及时采取对应的措施。Therefore, by issuing the first reminder when the object to be detected is not blocked, the situation that the object to be detected is not blocked by the preset object is timely reminded, and the person being reminded can also take corresponding measures in time.
在一些实施例中,检测结果还包括待检测目标被预设物体遮挡的遮挡方式是否为预设遮挡方式;执行与检测结果匹配的预设操作,包括:在待检测目标被预设物体遮挡且遮挡方式不属于预设遮挡方式的情况下,发出第二提醒;其中,第二提醒用于提示调整预设物体的遮挡方式。In some embodiments, the detection result further includes whether the occlusion mode in which the target to be detected is occluded by a preset object is a preset occlusion mode; performing a preset operation matching the detection result includes: when the target to be detected is occluded by a preset object and When the occlusion mode does not belong to the preset occlusion mode, a second reminder is issued; wherein, the second reminder is used to prompt to adjust the occlusion mode of the preset object.
因此,当遮挡方式不正确时,发出第二提醒,以便于及时调整待检测目标的遮挡方式。Therefore, when the occlusion mode is incorrect, a second reminder is issued, so as to adjust the occlusion mode of the target to be detected in time.
在一些实施例中,执行与检测结果匹配的预设操作,包括:在待检测目标被预设物体遮 挡的情况下,从第一图像中至少提取待检测目标的未被遮挡部分的第一特征,作为待检测目标的待识别特征;利用待识别特征,对待检测目标进行识别,并得到识别结果。In some embodiments, performing a preset operation matching the detection result includes: when the object to be detected is occluded by a preset object, extracting at least a first feature of an unoccluded portion of the object to be detected from the first image , as the to-be-identified feature of the target to be detected; using the to-be-identified feature to identify the target to be detected, and obtain the recognition result.
因此,在待检测目标被预设物体遮挡时,则提取未被遮挡部分的特征进行识别,实现了基于待检测目标的局部特征进行识别,而且由于该局部特征未被遮挡,故能够代表待检测目标,在一定程度上保证识别的准确性。Therefore, when the target to be detected is occluded by a preset object, the features of the unoccluded part are extracted for identification, which realizes the recognition based on the local features of the target to be detected, and since the local features are not occluded, it can represent the features to be detected. target, to a certain extent to ensure the accuracy of recognition.
在一些实施例中,从第一图像中至少提取待检测目标的未被遮挡部分的第一特征,作为待检测目标的待识别特征,包括:从第一图像中提取待检测目标的未被遮挡部分的第一特征,并获取待检测目标的被遮挡部分的第二特征;将第一特征和第二特征作为待检测目标的待识别特征。In some embodiments, extracting at least a first feature of an unoccluded part of the object to be detected from the first image as the feature to be identified of the object to be detected includes: extracting an unoccluded part of the object to be detected from the first image Part of the first feature, and obtains the second feature of the occluded part of the object to be detected; the first feature and the second feature are used as the feature to be identified of the object to be detected.
因此,除采用待检测目标未被遮挡部分的特征以外,还结合被遮挡部分的特征,由此可提高待检测目标的特征丰富度。Therefore, in addition to using the features of the unoccluded portion of the object to be detected, the feature of the occluded portion is also combined, thereby improving the feature richness of the object to be detected.
在一些实施例中,获取待检测目标的被遮挡部分的第二特征,包括:从第一图像中提取被遮挡部分的特征作为第二特征;或者,获取被遮挡部分的预设特征作为第二特征,其中,预设特征包括基于至少一个参考特征得到的特征,每个参考特征是对不存在被遮挡部分的参考目标中与被遮挡部分对应的区域提取得到的。In some embodiments, acquiring the second feature of the occluded portion of the object to be detected includes: extracting the feature of the occluded portion from the first image as the second feature; or, acquiring a preset feature of the occluded portion as the second feature features, wherein the preset features include features obtained based on at least one reference feature, and each reference feature is obtained by extracting an area corresponding to the occluded part in a reference target that does not have an occluded part.
因此,关于被遮挡部分的特征确定方式,可通过直接提取被遮挡部分的特征,由于被遮挡部分的特征能够在一定程度随着待检测目标的不同而不同,故此方式能够提高识别的准确性;也可通过获取预设特征作为被遮挡部分特征,此方式无需对被遮挡部分进行特征提取,可减少处理资源的损耗,且提高处理效率。Therefore, regarding the method of determining the features of the occluded part, the features of the occluded part can be directly extracted. Since the features of the occluded part can be different to a certain extent with different targets to be detected, this method can improve the accuracy of recognition; It is also possible to obtain a preset feature as the feature of the occluded part. This method does not need to perform feature extraction on the occluded part, which can reduce the consumption of processing resources and improve the processing efficiency.
在一些实施例中,利用待识别特征,对待检测目标进行识别,并得到识别结果,包括如下至少一项:在预设目标包括一个的情况下,获取待识别特征与预设目标的预存特征之间的第一相似度,并在第一相似度满足第一预设条件的情况下,确定识别结果包括待检测目标通过身份认证;在预设目标包括多个的情况下,分别获取待识别特征与每个预设目标的预存特征之间的第二相似度,并确定识别结果包括将待检测目标的身份确定为满足第二预设条件的第二相似度对应的预设目标的身份。In some embodiments, using the feature to be identified to identify the target to be detected, and obtaining a recognition result, includes at least one of the following: in the case that the preset target includes one, obtaining the difference between the feature to be identified and the pre-stored feature of the preset target If the first similarity satisfies the first preset condition, it is determined that the identification result includes the target to be detected passing the identity authentication; in the case of multiple preset targets, the features to be identified are obtained respectively The second similarity with the pre-stored features of each preset target, and determining the recognition result includes determining the identity of the target to be detected as the identity of the preset target corresponding to the second similarity that satisfies the second preset condition.
因此,通过计算与特定预设目标的预存特征之间的第一相似度,或计算与多个预设目标的预存特征之间的相似度,使得能够实现根据实际场景需求将待检测目标与特定某个预设目标进行比对,或与某个数据库中的预设目标进行比对。Therefore, by calculating the first similarity with the pre-stored features of a specific preset target, or calculating the similarity with the pre-stored features of a plurality of preset targets, it is possible to realize the identification of the target to be detected with the specific target according to the actual scene requirements. A preset target is compared or compared with a preset target in a database.
在一些实施例中,方法包括如下至少一项:第一预设条件包括第一相似度大于第一相似度阈值;第二预设条件包括第二相似度大于第二相似度阈值。In some embodiments, the method includes at least one of the following: the first preset condition includes that the first similarity is greater than a first similarity threshold; the second preset condition includes that the second similarity is greater than a second similarity threshold.
因此,通过将不同的场景中分别设置第一相似度阈值,使得识别结果更准确。Therefore, by setting the first similarity thresholds in different scenarios respectively, the recognition result is more accurate.
在一些实施例中,方法包括如下至少一项:在待识别特征包括待检测目标的被遮挡部分的第二特征的情况下的第一相似度阈值,小于在待识别特征不包括第二特征的情况下的第一相似度阈值;在待识别特征包括第二特征的情况下的第二相似度阈值,小于在待识别特征不包括第二特征的情况下的第二相似度阈值。In some embodiments, the method includes at least one of the following: a first similarity threshold when the feature to be identified includes a second feature of an occluded portion of the object to be detected is smaller than a threshold value when the feature to be identified does not include the second feature The first similarity threshold in the case; the second similarity threshold in the case where the feature to be identified includes the second feature, is smaller than the second similarity threshold in the case where the feature to be identified does not include the second feature.
因此,如果待识别特征中包含第二特征,第二特征可能会与待检测目标被遮挡部分的关键点的真实特征有所出入,因此,在这种情况下适当地减小相似度阈值能够提高识别的准确性。Therefore, if the feature to be identified contains the second feature, the second feature may be different from the real feature of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the recognition accuracy.
在一些实施例中,在获取待识别特征与预设目标的预存特征之间的第一相似度之前,方法还包括:响应于账号注册请求,为用户注册账号;从对用户拍摄得到的至少一帧第二图像中,确定满足预设质量要求的第二图像,并从确定的第二图像中提取用户的预设部位的特征;将预设部位的特征与账号建立关联,并将预设部位的特征保存作为预设目标的预存特征。In some embodiments, before acquiring the first similarity between the feature to be identified and the pre-stored feature of the preset target, the method further includes: in response to an account registration request, registering an account for the user; In the frame of the second image, a second image that meets the preset quality requirements is determined, and the features of the user's preset part are extracted from the determined second image; the features of the preset part are associated with the account, and the preset part is The feature of the saves the pre-stored feature as the preset target.
因此,通过先确定满足质量要求的第二图像来提取预设部位的特征以使得提取到的特征更准确。Therefore, the features of the preset part are extracted by first determining the second image that meets the quality requirements, so that the extracted features are more accurate.
在一些实施例中,在待检测目标被预设物体遮挡的情况下,在从第一图像中至少提取待检测目标的未被遮挡部分的第一特征之前,方法还包括以下至少一个步骤:从包含待检测目标的多帧第一图像中,确定满足预设质量要求的第一图像作为进行后续特征提取的第一图像; 对进行后续特征提取的第一图像进行预处理;对进行后续特征提取的第一图像进行活体检测,并在活体检测结果为待检测目标为活体的情况下,确定执行从第一图像中至少提取待检测目标的未被遮挡部分的第一特征及其后续步骤。In some embodiments, when the object to be detected is occluded by a preset object, before extracting at least the first feature of the unoccluded portion of the object to be detected from the first image, the method further includes at least one of the following steps: from Among the multiple frames of first images containing the target to be detected, determine the first image that meets the preset quality requirements as the first image for subsequent feature extraction; preprocess the first image for subsequent feature extraction; perform subsequent feature extraction Perform living body detection on the first image of the to-be-detected object, and when the living-body detection result is that the target to be detected is a living body, it is determined to extract at least the first feature of the unoccluded part of the target to be detected from the first image and its subsequent steps.
因此,通过在进行特征提取之前,先进行预处理,使得提取到的特征更准确,通过在待检测目标为活体的情况下才对待检测目标进行识别,从而增强了识别的安全性,可以在一定程度上防止假体攻击。Therefore, preprocessing is performed before feature extraction, so that the extracted features are more accurate. By identifying the target to be detected only when the target to be detected is a living body, the security of the recognition is enhanced, and it can be To a certain extent prevent prosthetic attack.
在一些实施例中,从包含待检测目标的多帧第一图像中,确定满足预设质量要求的第一图像作为进行后续特征提取的第一图像,包括:基于每帧第一图像的质量因子,对应得到每帧第一图像的质量分数,其中,第一图像的质量因子包括以下至少一者:待检测目标相对于拍摄器件的位姿信息、用于反映第一图像中待检测目标大小的参数信息、第一图像的亮度信息;基于质量分数,确定满足预设质量要求的第一图像作为进行后续特征提取的第一图像,其中,选择的第一图像的质量分数高于其他第一图像的质量分数。In some embodiments, from the multiple frames of first images containing the target to be detected, determining a first image that meets a preset quality requirement as the first image for subsequent feature extraction includes: based on a quality factor of each frame of the first image , correspondingly obtain the quality score of the first image of each frame, wherein the quality factor of the first image includes at least one of the following: pose information of the target to be detected relative to the photographing device, a value used to reflect the size of the target to be detected in the first image parameter information and brightness information of the first image; based on the quality score, determine the first image that meets the preset quality requirements as the first image for subsequent feature extraction, wherein the quality score of the selected first image is higher than that of other first images quality score.
因此,通过确定质量分数满足要求的图像进行特征提取,使得提取到的特征更能表示待检测目标。Therefore, feature extraction is performed by determining images whose quality scores meet the requirements, so that the extracted features can better represent the target to be detected.
在一些实施例中,对进行后续特征提取的第一图像进行预处理,包括:在第一图像包括多个待检测目标的情况,确定满足预设提取要求的待检测目标在第一图像中的目标区域,并去除第一图像中除目标区域以外的图像部分;和/或,检测到第一图像中待检测目标的倾斜角度大于预设角度,并将第一图像旋转至待检测目标的倾斜角度小于或等于预设角度。In some embodiments, preprocessing the first image for subsequent feature extraction includes: in the case that the first image includes multiple objects to be detected, determining the location of the objects to be detected in the first image that meet the preset extraction requirements target area, and remove the image portion other than the target area in the first image; and/or, detect that the inclination angle of the object to be detected in the first image is greater than a preset angle, and rotate the first image to the inclination of the object to be detected The angle is less than or equal to the preset angle.
因此,当第一图像中存在多个待检测目标时,仅确定满足预设提取要求的待检测目标,而将不满足要求的待检测目标丢弃,减小了不满足要求的待检测目标对识别结果的影响;其次,当第一图像中待检测目标的倾斜角度,则将其摆正,减少了因为待检测目标因为倾斜而造成的影响。Therefore, when there are multiple objects to be detected in the first image, only the objects to be detected that meet the preset extraction requirements are determined, and the objects to be detected that do not meet the requirements are discarded, reducing the identification of objects to be detected that do not meet the requirements. Second, when the inclination angle of the object to be detected in the first image is corrected, the influence caused by the inclination of the object to be detected is reduced.
在一些实施例中,预设提取要求包括待检测目标对应区域的面积大于其他待检测目标对应区域的面积,其他待检测目标包括除待检测目标以外的目标。In some embodiments, the preset extraction requirements include that the area of the area corresponding to the target to be detected is larger than the area of the area corresponding to other targets to be detected, and the other targets to be detected include targets other than the target to be detected.
因此,因为待检测目标的面积越大,提取到的特征则越准确,因此,通过选择面积更大的待检测目标使得待检测结果更准确。Therefore, because the larger the area of the object to be detected is, the more accurate the extracted features are. Therefore, by selecting the object to be detected with a larger area, the result to be detected is more accurate.
在一些实施例中,待检测目标包括人脸,预设物体包括口罩。In some embodiments, the target to be detected includes a human face, and the preset object includes a mask.
因此,通过判断人脸是否佩戴口罩,并执行对应操作,例如,若人脸没有佩戴口罩或佩戴口罩的方式不准确,则可发出对应的提醒,使得用户能够及时调整;若人脸佩戴口罩,则对人脸进行识别等。Therefore, by judging whether the face is wearing a mask and performing corresponding operations, for example, if the face does not wear a mask or the way of wearing a mask is inaccurate, a corresponding reminder can be issued so that the user can adjust in time; if the face wears a mask, face recognition, etc.
本申请实施例提供了一种图像检测装置,包括:图像获取模块,配置为获取包含待检测目标的第一图像;目标检测模块,配置为对第一图像进行检测,得到第一图像的检测结果,其中,检测结果包括第一图像中的待检测目标是否被预设物体遮挡;操作执行模块,配置为执行与检测结果匹配的预设操作。An embodiment of the present application provides an image detection device, comprising: an image acquisition module configured to acquire a first image containing a target to be detected; a target detection module configured to detect the first image to obtain a detection result of the first image , wherein the detection result includes whether the target to be detected in the first image is blocked by a preset object; the operation execution module is configured to execute a preset operation matching the detection result.
本申请实施例提供了一种电子设备,包括存储器和处理器,处理器用于执行存储器中存储的程序指令,以实现上述图像检测方法。An embodiment of the present application provides an electronic device, including a memory and a processor, where the processor is configured to execute program instructions stored in the memory, so as to implement the above image detection method.
本申请实施例提供了一种计算机可读存储介质,其上存储有程序指令,程序指令被处理器执行时实现上述图像检测方法。An embodiment of the present application provides a computer-readable storage medium, on which program instructions are stored, and the above-mentioned image detection method is implemented when the program instructions are executed by a processor.
本申请实施例提供了一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现上述的图像检测方法。An embodiment of the present application provides a computer program, including computer-readable code, when the computer-readable code is executed in an electronic device, the processor in the electronic device executes the image detection method described above.
本申请实施例提供一种图像检测方法和相关装置、设备、存储介质、计算机程序,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡,然后执行与检测结果匹配的预设操作,能够判断待检测目标是否被遮挡从而能够进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。The embodiments of the present application provide an image detection method and related devices, equipment, storage media, and computer programs. By detecting a first image containing a target to be detected, it is possible to obtain whether the target to be detected is blocked, and then execute an image detection method that matches the detection result. The preset operation can determine whether the object to be detected is occluded, so that a subsequent preset operation matching the detection result can be performed, and flexible processing can be performed based on the occlusion state of the object to be detected in the image.
应当理解的是,以上的一般描述和后文的细节描述仅是示例性和解释性的,而非限制本申请。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 application.
附图说明Description of drawings
此处的附图被并入说明书中并构成本说明书的一部分,这些附图示出了符合本申请的实施例,并与说明书一起用于说明本申请的技术方案。The accompanying drawings, which are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present application, and together with the description, serve to explain the technical solutions of the present application.
图1是本申请实施例图像检测方法一实施例的流程示意图;FIG. 1 is a schematic flowchart of an embodiment of an image detection method according to an embodiment of the present application;
图2是本申请实施例图像检测方法一实施例中第一图像示意图;FIG. 2 is a schematic diagram of a first image in an embodiment of an image detection method according to an embodiment of the present application;
图3是本申请实施例图像检测方法一实施例中经过预处理的第一图像示意图;3 is a schematic diagram of a preprocessed first image in an embodiment of an image detection method according to an embodiment of the present application;
图4是本申请实施例图像检测装置一实施例的结构示意图;FIG. 4 is a schematic structural diagram of an embodiment of an image detection apparatus according to an embodiment of the present application;
图5是本申请实施例电子设备一实施例的结构示意图;FIG. 5 is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present application;
图6是本申请实施例计算机可读存储介质一实施例的结构示意图。FIG. 6 is a schematic structural diagram of an embodiment of a computer-readable storage medium according to an embodiment of the present application.
具体实施方式detailed description
下面结合说明书附图,对本申请实施例的方案进行详细说明。The solutions of the embodiments of the present application will be described in detail below with reference to the accompanying drawings.
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、接口、技术之类的具体细节,以便透彻理解本申请。In the following description, for purposes of illustration and not limitation, specific details such as specific system structures, interfaces, techniques, etc. are set forth in order to provide a thorough understanding of the present application.
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。此外,本文中的“多”表示两个或者多于两个。另外,本文中术语“至少一种”表示多种中的任意一种或多种中的至少两种的任意组合,例如,包括A、B、C中的至少一种,可以表示包括从A、B和C构成的集合中选择的任意一个或多个元素。The term "and/or" in this article is only an association relationship to describe the associated objects, indicating that there can be three kinds of relationships, for example, A and/or B, it can mean that A exists alone, A and B exist at the same time, and A and B exist independently B these three cases. In addition, the character "/" in this document generally indicates that the related objects are an "or" relationship. Also, "multiple" herein means two or more than two. In addition, the term "at least one" herein refers to any combination of any one of the plurality or at least two of the plurality, for example, including at least one of A, B, and C, and may mean including from A, B, and C. Any one or more elements selected from the set of B and C.
本申请实施例中的图像检测方法可应用于具备图像处理能力的设备。此外,该设备可以具备图像采集或是视频采集功能,比如,该设备可以包括诸如摄像头等用于采集图像或是视频的部件。或是该设备可以通过与其他设备进行数据传输或是数据交互的方式,以从其他设备中获取所需的视频流或是图像,或是从其他设备的存储资源中访问所需的视频流或是图像等。其中,其他设备具备图像采集或是视频采集功能,且与该设备之间具备通信连接,比如,该设备可以与其他设备之间通过蓝牙、无线网络等方式进行数据传输或是数据交互,本申请实施例在此对于二者之间的通信方式不予限定,可以包括但不限于上述例举的情况。在一种实现方式中,该设备可以包括手机、平板电脑、可交互屏幕等,在此不予限定。The image detection method in the embodiment of the present application can be applied to a device with image processing capability. In addition, the device may have an image capture or video capture function, for example, the device may include components such as a camera for capturing images or videos. Or the device can obtain the required video stream or image from other devices by performing data transmission or data interaction with other devices, or access the required video streams from the storage resources of other devices or are images etc. Among them, other devices have image capture or video capture functions, and have a communication connection with the device, for example, the device can perform data transmission or data interaction with other devices through Bluetooth, wireless network, etc., this application The embodiment does not limit the communication mode between the two, which may include but not limited to the above-mentioned cases. In an implementation manner, the device may include a mobile phone, a tablet computer, an interactive screen, etc., which is not limited herein.
请参阅图1,图1是本申请实施例图像检测方法一实施例的流程示意图。其中,所述图像检测方法由电子设备执行,所述方法可以包括如下步骤:Please refer to FIG. 1 . FIG. 1 is a schematic flowchart of an embodiment of an image detection method according to an embodiment of the present application. Wherein, the image detection method is performed by an electronic device, and the method may include the following steps:
步骤S11:获取包含待检测目标的第一图像。Step S11: Acquire a first image containing the target to be detected.
其中,包含待检测目标的第一图像可以是直接调用本设备的摄像头采集的包含目标对象的初始图像,当然还可以是从其他设备中获取到的图像,也可以是经过选帧、调整亮度、分辨率等的图像。待检测目标也可以包括人脸、其他动物的面部或肢体等等。因此,获取包含待检测目标的第一图像的方式不限。其中,其他设备指的是分别利用不同中央处理器才能进行操作的设备。Among them, the first image containing the target to be detected may be the initial image containing the target object collected by directly calling the camera of the device, of course, it may be an image obtained from other devices, or it may be selected after frame selection, brightness adjustment, resolution, etc. The targets to be detected can also include human faces, faces or limbs of other animals, and so on. Therefore, the manner of acquiring the first image containing the target to be detected is not limited. Among them, other devices refer to devices that can only be operated by using different central processing units.
步骤S12:对第一图像进行检测,得到第一图像的检测结果,其中,检测结果包括第一图像中的待检测目标是否被预设物体遮挡。Step S12: Detect the first image to obtain a detection result of the first image, where the detection result includes whether the target to be detected in the first image is blocked by a preset object.
其中,预设物体指的是能够对待检测目标进行遮挡的任何物体,例如口罩、围巾、眼镜或者手臂、纸张等可视物体。The preset object refers to any object that can block the target to be detected, such as masks, scarves, glasses, or visible objects such as arms and paper.
对第一图像进行检测,在检测过程中需要对第一图像中是否包含待检测图像进行检测,若存在待检测目标,则判断待检测目标是否被预设物体遮挡。判断待检测目标是否被预设物体遮挡的方式可以是在对第一图像进行检测之前,先行训练一个遮挡检测模型,通过将第一图像输入遮挡检测模型(比如,可以为具备遮挡检测功能的神经网络),即可得知第一图像 中的待检测目标是否被预设物体遮挡。当然,在一些实施例中,判断待检测目标是否被预设物体遮挡的方式还可以是判断待检测目标中预设检测位置是否被遮挡,以及对预设检测位置遮挡的物体是否满足预设物体的条件。其中,可以提取遮挡物体与预设遮挡物体的特征,进行相似度的判断从而得出包含待检测目标是否被遮挡的检测结果。The first image is detected. During the detection process, it is necessary to detect whether the first image contains an image to be detected. If there is a target to be detected, it is determined whether the target to be detected is blocked by a preset object. The way of judging whether the target to be detected is occluded by a preset object may be to train an occlusion detection model before detecting the first image, and input the first image into the occlusion detection model (for example, it may be a neural network with occlusion detection function). network), it can be known whether the target to be detected in the first image is blocked by a preset object. Of course, in some embodiments, the way of judging whether the target to be detected is blocked by a preset object may also be judging whether the preset detection position in the target to be detected is blocked, and whether the object blocked by the preset detection position satisfies the preset object conditions of. The features of the occluded object and the preset occluded object can be extracted, and the similarity can be judged to obtain a detection result including whether the object to be detected is occluded.
步骤S13:执行与检测结果匹配的预设操作。Step S13: Execute a preset operation matching the detection result.
其中,检测结果可能是待检测目标被遮挡但不是被预设物体遮挡,待检测目标被预设物体遮挡但是遮挡的方式不是预设方式,待检测目标被预设物体遮挡且遮挡的方式与预设方式相同或待检测目标完全没有被遮挡。本申请实施例中,考虑第一图像中的待检测目标是否被预设物体遮挡的情况。当然,在一些实施例中,可将预设物体设置为任何物体,也就是采用遮挡检测模型,只要判断得出待检测目标被遮挡,则执行对应的预设操作。预设操作可以是与目标检测相关的任何操作,例如识别等。Wherein, the detection result may be that the target to be detected is occluded but not by the preset object, the target to be detected is occluded by the preset object but the occlusion method is not the preset method, the target to be detected is occluded by the preset object and the occlusion method is the same as the preset method. The setting method is the same or the target to be detected is not blocked at all. In the embodiment of the present application, it is considered whether the target to be detected in the first image is blocked by a preset object. Of course, in some embodiments, the preset object may be set to any object, that is, an occlusion detection model is used, and as long as it is determined that the object to be detected is occluded, a corresponding preset operation is performed. The preset operation can be any operation related to object detection, such as recognition, etc.
上述方案,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡,然后执行与检测结果匹配的预设操作,能够实现判断待检测目标是否被遮挡,从而进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。In the above solution, by detecting the first image containing the target to be detected to obtain whether the target to be detected is occluded, and then performing a preset operation matching the detection result, it is possible to determine whether the target to be detected is occluded, so as to carry out subsequent and The preset operation of detection result matching realizes flexible processing based on the occlusion state of the target to be detected in the image.
在一些实施例中,检测结果是利用神经网络对第一图像进行检测得到的。在对第一图像进行检测之前,先训练一个预设物体遮挡模型,使得训练好的预设物体遮挡模型能够检测第一图像中的待检测目标是否被预设物体遮挡。其中,预设物体可以是一个也可以是多个,例如两个、三个不同的物体,当预设物体是多个时,表明一个预设物体遮挡模型能够在判断待检测目标是否被预设物体遮挡的同时还能检测到待检测目标被哪一种预设物体遮挡。其中,待检测目标可以是人脸,预设物体可以是口罩。对应地,预设物体遮挡模型则是口罩检测模型。口罩检测模型可以检测待检测目标是否佩戴口罩,当然,在一些实施例中,还可同时检测到待检测目标在佩戴口罩的情况下,佩戴口罩的方式是否正确。通过提前训练好的神经网络来进行检测,使得检测结果更准确且检测速度更快。In some embodiments, the detection result is obtained by using a neural network to detect the first image. Before detecting the first image, a preset object occlusion model is trained first, so that the trained preset object occlusion model can detect whether the target to be detected in the first image is occluded by the preset object. The preset object may be one or more, such as two or three different objects. When there are multiple preset objects, it indicates that a preset object occlusion model can determine whether the target to be detected is preset When the object is occluded, it can also detect which preset object is occluded by the target to be detected. The target to be detected may be a face, and the preset object may be a mask. Correspondingly, the preset object occlusion model is a mask detection model. The mask detection model can detect whether the target to be detected wears a mask. Of course, in some embodiments, it can also simultaneously detect whether the target to be detected is wearing a mask in the correct way. The detection is performed by a neural network trained in advance, which makes the detection result more accurate and the detection speed faster.
在待检测目标未被预设物体遮挡的情况下,发出第一提醒,其中,第一提醒用于提示使用预设物体对待检测目标进行遮挡。其中,第一提醒可以有多种提醒方式,包括由人脸框框选的方式,若检测到待检测目标未被预设物体遮挡,那么就会将人脸区域以人脸框的形式框选出来,此时的人脸框可以带有警示性的颜色,例如红色或黄色,第一提醒还可以是人脸框与提示性文字结合,提示性文字例如您未佩戴口罩,请您佩戴口罩,当然,还可以是语音提醒的方式,或提示灯闪烁等形式,当然,这些形式可以多个配合使用,也可单独使用,此处不做规定。例如,当口罩检测模型检测到人脸未佩戴口罩,则发出第一提醒以提醒该人脸佩戴口罩对人脸的口鼻进行遮挡。通过在待检测目标未被遮挡时发出第一提醒,以及时提醒待检测目标未被预设物体遮挡的情况,进而被提醒者也能够及时采取对应的措施。In the case that the target to be detected is not blocked by a preset object, a first reminder is issued, wherein the first reminder is used to prompt the use of a preset object to block the target to be detected. Among them, the first reminder can have various reminder methods, including the method of frame selection by a face frame. If it is detected that the target to be detected is not blocked by a preset object, the face area will be framed in the form of a face frame. , the face frame at this time can have a warning color, such as red or yellow. The first reminder can also be a combination of the face frame and the prompt text. The prompt text, such as you are not wearing a mask, please wear a mask, of course , it can also be in the form of voice reminder, or in the form of flashing indicator lights. Of course, these forms can be used in combination or alone, which is not specified here. For example, when the mask detection model detects that the face does not wear a mask, a first reminder is issued to remind the face to wear a mask to cover the mouth and nose of the face. By issuing a first reminder when the target to be detected is not blocked, the situation that the target to be detected is not blocked by a preset object is timely reminded, and the person being reminded can also take corresponding measures in time.
在一些实施例中,检测结果还包括待检测目标被预设物体遮挡的遮挡方式是否为预设遮挡方式。其中,在训练预设物体遮挡模型这个神经网络时,可以在训练样本中标注预设遮挡方式,其中预设遮挡方式可以是正确的遮挡方式,以此训练预设物体遮挡模型使得训练好的预设物体遮挡模型能够在检测到待检测目标在被预设物体遮挡的情况下,判断预设物体的遮挡方式是否是预设遮挡方式。在待检测目标被预设物体遮挡且所述遮挡方式不属于预设遮挡方式的情况下,发出第二提醒。第二提醒用于提示调整预设物体的遮挡方式。例如,在待检测目标为人脸,预设物体为口罩,预设遮挡方式为正确的佩戴口罩方式。当检测到人脸佩戴口罩时,判断佩戴口罩的方式是否为正确的佩戴口罩方式,若不正确,则发出第二提醒以提示人脸调整预设物体的遮挡方式。当然,在一些实施例中,预设遮挡方式可以为多种遮挡方式,例如正确的遮挡方式、第一种错误的遮挡方式、第二种错误的遮挡方式等,当检测到待检测目标被预设物体遮挡的遮挡方式为第一错误的遮挡方式,则发出与第一种错误的遮挡方式对应的提醒,当检测到待检测目标被预设物体遮挡的遮挡方式为第二错误的遮挡方式,则发出与第二种错误的遮挡方式对应的提醒以提示待检测目标将遮挡方式调整为正确的遮挡方式。例如,同样在待检测目标为人脸,预设物体为口罩,正确的遮挡方式为口罩同时将鼻子和嘴巴遮盖住,第一种错误的遮挡方式为口罩遮住了鼻子但未遮住嘴巴,与第一种错误的 遮挡方式对应的提醒为提示人脸同时遮住嘴巴,第二种错误的遮挡方式为口罩遮住了嘴巴但未遮住鼻子,与第二种错误的遮挡方式对应的提醒为提示人脸同时遮住鼻子。当遮挡方式不正确时,发出第二提醒,以便于及时调整待检测目标的遮挡方式。其中,第二提醒的方式与第一提醒的方式类似,也可以由人脸框与文字提醒配合的形式以及人脸框与语音提醒或单独的文字提醒或单独的语音提醒或警示灯闪烁等,当然,若存在多种不同的预设遮挡方式,那么文字提醒或语音也对应设置多种,例如预设遮挡方式为第一种错误的遮挡方式,那么文字提醒与第一种错误的遮挡方式对应。In some embodiments, the detection result further includes whether the occlusion mode in which the target to be detected is occluded by the preset object is a preset occlusion mode. Among them, when training the neural network of the preset object occlusion model, the preset occlusion mode can be marked in the training sample, wherein the preset occlusion mode can be the correct occlusion mode, so that the preset object occlusion model is trained so that the trained pre- It is assumed that the object occlusion model can determine whether the occlusion mode of the preset object is the preset occlusion mode when it is detected that the target to be detected is occluded by the preset object. When the target to be detected is blocked by a preset object and the blocking mode does not belong to the preset blocking mode, a second reminder is issued. The second reminder is used to prompt to adjust the occlusion mode of the preset object. For example, when the target to be detected is a face, the preset object is a mask, and the preset occlusion method is the correct way of wearing a mask. When it is detected that the face is wearing a mask, it is determined whether the way of wearing the mask is the correct way of wearing the mask. If it is not correct, a second reminder is issued to prompt the face to adjust the blocking method of the preset object. Of course, in some embodiments, the preset occlusion mode may be various occlusion modes, such as the correct occlusion mode, the first wrong occlusion mode, the second wrong occlusion mode, etc. Assuming that the occlusion mode of object occlusion is the first wrong occlusion mode, a reminder corresponding to the first erroneous occlusion mode is issued, and when it is detected that the occlusion mode in which the target to be detected is occluded by the preset object is the second wrong occlusion mode, Then, a reminder corresponding to the second wrong occlusion mode is issued to prompt the target to be detected to adjust the occlusion mode to the correct occlusion mode. For example, also when the target to be detected is a face and the preset object is a mask, the correct occlusion method is that the mask covers the nose and mouth at the same time, and the first wrong occlusion method is that the mask covers the nose but does not cover the mouth. The reminder corresponding to the first wrong occlusion method is to remind the face to cover the mouth at the same time. The second wrong occlusion method is that the mask covers the mouth but not the nose. The reminder corresponding to the second wrong occlusion method is: Prompt the face to cover the nose at the same time. When the occlusion mode is incorrect, a second reminder is issued, so as to adjust the occlusion mode of the target to be detected in time. Wherein, the method of the second reminder is similar to that of the first reminder, and can also be in the form of a face frame and a text reminder, and a face frame and a voice reminder or a separate text reminder or a separate voice reminder or a warning light flashing, etc., Of course, if there are a variety of different preset blocking methods, then the text reminder or voice should be set accordingly. For example, if the preset blocking method is the first wrong blocking method, then the text reminder corresponds to the first wrong blocking method. .
在一些实施例中,一些业务场景中在待检测目标被预设物体遮挡的情况下,对待检测目标进行识别。在另一些业务场景中,若待检测目标未被预设物体遮挡,则不对待检测目标进行识别,例如,在某一时期或特殊时段需要在高铁或飞机等公众场合佩戴口罩的情况下,若检测到人脸未佩戴口罩,则不对人脸进行人脸识别,则未佩戴口罩的人脸就不能通过人脸识别进站。当然根据业务场景的需要,即使检测到待检测目标未被预设物体遮挡,还是可以对待检测目标进行识别。对待检测目标进行识别,需要对待检测目标进行特征提取,而在进行特征提取之前,可以从包含待检测目标的多帧第一图像中,确定满足预设质量要求的第一图像作为后续特征提取的第一图像。其中,确定满足预设质量要求的第一图像作为进行后续特征提取的第一图像的方式可以是基于每帧第一图像的质量因子,对应得到每帧第一图像的质量分数,其中,第一图像的质量因子包括以下至少一者:待检测目标相对于拍摄器件的位姿信息、用于反映第一图像中待检测目标大小的参数信息、第一图像的亮度信息。其中,待检测目标相对于拍摄器件的位姿信息可以是待检测目标相对于拍摄器件的角度信息。其中,这里的待检测目标相对于拍摄器件的角度信息可以是待检测目标相对于拍摄期间的镜头的角度信息。例如,以镜头为原点,建立三维坐标系,其中,镜头与地心的连线为X轴,镜头的正前方延线且与X轴垂直的为Y轴,同时与X轴和Y轴垂直的为Z轴。三维坐标系仅是为了表示待检测目标与拍摄器件的角度,在一些实施例中,三维坐标系的原点选取或三个方向的选择可与本申请实施例不同。其中角度可划分为相对于镜头XYZ方向上的角度,例如,待检测目标正对镜头则沿XYZ方向上的角度皆为0°(度),而待检测目标正侧对第一图像采集组件,则待检测目标相对于第一图像采集组件X方向上的角度为90°,沿Y方向上的角度为0°,沿Z方向上的角度也为0°,此处因为待检测目标绕X轴旋转了90°,所以待检测目标与X轴也就是相对于X方向的角度为90°。当然,各个方向上的角度越小越好。用于反映第一图像中待检测目标大小的参数信息包括待检测目标所占第一图像的面积大小,其中,面积大小可用待检测目标所占第一图像的区域大小表示。当然,前提是待检测目标是完整包含在第一图像中,若第一图像中仅包含待检测目标的一部分,那么,这帧第一图像中关于待检测目标的大小这一质量因子的得分就比较低。第一图像的亮度信息也并不是越高越好,而是越接近当前时刻的自然光的亮度越好,其中这一质量因子的得分就相对越高。其中,依据上述三个质量因子对图像质量的影响程度关系设置上述三个质量因子所占权重。例如,设置角度的权重为0.4,其余两个分别设置为0.3,当然,这仅是举例,各个质量因子之间的权重可根据需求自行设置,且在一些实施例中,除了这三个质量因子,还可以包括第一图像的模糊度等因素,只要能影响图像质量的因素都可以用于计算图像的质量分数。通过选择质量分数满足要求的图像进行特征提取,使得提取到的特征更能表示待检测目标。当然,权重的设置可以考虑到实际的图像检测精度需求以及图像检测设备的处理能力、资源占用情况等。例如,在一些实施例中,若图像检测设备的处理能力较高、资源占用较少,则可考量多个质量因子来计算质量分数,而如果图像检测设备的处理能力过低,则可适当采用几个质量因子来计算质量分,例如根据计算各个质量因子的所需时间或内存空间占用来选择合适的质量因子。因此,采用多少质量因子或采用哪几个质量因子,可灵活做出选择。当然,在一些实施例中,也可以是确定一个较低的质量分数阈值,若第一图像的质量分数低于质量分数阈值,就将其排除,保留质量分数大于该质量分数阈值的第一图像。In some embodiments, in some business scenarios, when the target to be detected is blocked by a preset object, the target to be detected is identified. In other business scenarios, if the target to be detected is not blocked by a preset object, the target to be detected will not be identified. If it is detected that the face does not wear a mask, the face recognition will not be performed, and the face without a mask will not be able to enter the station through face recognition. Of course, according to the needs of the business scenario, even if it is detected that the target to be detected is not blocked by a preset object, the target to be detected can still be identified. To identify the target to be detected, it is necessary to perform feature extraction on the target to be detected, and before the feature extraction is performed, the first image that meets the preset quality requirements can be determined from the multi-frame first images containing the target to be detected as the follow-up feature extraction. first image. The manner of determining the first image that meets the preset quality requirements as the first image for subsequent feature extraction may be based on the quality factor of each frame of the first image, correspondingly obtaining the quality score of each frame of the first image, wherein the first image The quality factor of the image includes at least one of the following: pose information of the target to be detected relative to the photographing device, parameter information used to reflect the size of the target to be detected in the first image, and brightness information of the first image. The pose information of the target to be detected relative to the photographing device may be angle information of the target to be detected relative to the photographing device. Wherein, the angle information of the target to be detected relative to the photographing device here may be the angle information of the target to be detected relative to the lens during shooting. For example, taking the lens as the origin, establish a three-dimensional coordinate system, in which the line connecting the lens and the center of the earth is the X axis, the line extending directly in front of the lens and perpendicular to the X axis is the Y axis, and the line perpendicular to the X axis and the Y axis is the Y axis. for the Z axis. The three-dimensional coordinate system is only used to represent the angle between the target to be detected and the photographing device. In some embodiments, the selection of the origin of the three-dimensional coordinate system or the selection of three directions may be different from the embodiments of the present application. The angle can be divided into angles relative to the XYZ direction of the lens. For example, if the target to be detected faces the lens, the angles along the XYZ direction are all 0° (degrees), and the front side of the target to be detected faces the first image acquisition component. Then the angle of the target to be detected relative to the first image acquisition component in the X direction is 90°, the angle along the Y direction is 0°, and the angle along the Z direction is also 0°. Here, because the target to be detected revolves around the X axis It is rotated by 90°, so the angle between the target to be detected and the X axis, that is, relative to the X direction, is 90°. Of course, the smaller the angle in all directions, the better. The parameter information used to reflect the size of the object to be detected in the first image includes the size of the area of the first image occupied by the object to be detected, where the area size can be represented by the size of the area of the first image occupied by the object to be detected. Of course, the premise is that the target to be detected is completely contained in the first image. If the first image only contains a part of the target to be detected, then the quality factor score of the size of the target to be detected in the first image of this frame is equal to relatively low. The brightness information of the first image is not as high as possible, but as the brightness of natural light at the current moment is better, and the score of this quality factor is relatively higher. Wherein, the weights occupied by the above three quality factors are set according to the influence degree relationship of the above three quality factors on the image quality. For example, the weight of the angle is set to 0.4, and the other two are set to 0.3 respectively. Of course, this is only an example. The weights between the various quality factors can be set according to the needs. In some embodiments, in addition to these three quality factors , and may also include factors such as the blur degree of the first image, as long as the factors that can affect the image quality can be used to calculate the quality score of the image. By selecting images whose quality scores meet the requirements for feature extraction, the extracted features can better represent the target to be detected. Of course, the setting of the weight can take into account the actual image detection accuracy requirements, the processing capability of the image detection device, and the resource occupancy. For example, in some embodiments, if the processing capability of the image detection device is high and the resource occupancy is small, multiple quality factors may be considered to calculate the quality score, and if the processing capability of the image detection device is too low, appropriate use of Several quality factors are used to calculate the quality score, for example, an appropriate quality factor is selected according to the time required to calculate each quality factor or the memory space occupied. Therefore, the choice of how many quality factors to use or which quality factors to use can be made flexibly. Of course, in some embodiments, a lower quality score threshold may also be determined. If the quality score of the first image is lower than the quality score threshold, it will be excluded, and the first image with the quality score greater than the quality score threshold will be retained. .
在一些实施例中,在对第一图像进行特征提取进行识别之前,还可以对后续特征提取的第一图像进行预处理。其中,预处理的方式可以是在第一图像中包括多个待检测目标的情况 下,确定满足预设提取要求的待检测目标在第一图像中的目标区域,并去除第一图像中除目标区域以外的图像部分。其中,这里的目标区域可以是包含一个待检测目标的区域。也就是说,在第一图像中包含多个待检测目标的情况下,并不是对完整的第一图像进行识别,而是仅针对满足预设提取要求的待检测目标的目标区域进行识别,因此,在一定程度上减少了其他待检测目标在识别过程中产生的噪音,从而减小了不满足要求的待检测目标对识别结果的影响。其中,预设提取要求可以是待检测目标对应区域的面积大于其他待检测目标对应区域的面积,其中其他待检测目标包括除待检测目标以外的目标。如果当第一图像中存在多个待检测目标,多个待检测目标所占面积可能不一致,面积更大的待检测目标在识别过程中的识别率相对更高,因此,选择面积更大的待检测目标进行识别。其中,如果存在多个待检测目标的面积相同时,可以对待检测目标的中心更接近第一图像中心的待检测目标进行识别,或者在另一些实施例中,可以分别获取所有的待检测目标对应的目标区域以进行目标检测,当然后者所述的所有待检测目标指的是面积大小并列第一或者面积皆大于一个预设面积提取阈值的待检测目标。In some embodiments, before the feature extraction is performed on the first image for identification, the first image for subsequent feature extraction may also be preprocessed. Wherein, the preprocessing method may be: in the case that the first image includes multiple targets to be detected, determine the target area of the target to be detected in the first image that meets the preset extraction requirements, and remove the target area in the first image. part of the image outside the area. The target area here may be an area containing a target to be detected. That is to say, when the first image contains multiple targets to be detected, the identification is not performed on the complete first image, but only on the target area of the target to be detected that meets the preset extraction requirements. Therefore, , to a certain extent, the noise generated by other targets to be detected during the recognition process is reduced, thereby reducing the influence of targets to be detected that do not meet the requirements on the recognition results. The preset extraction requirement may be that the area of the area corresponding to the target to be detected is larger than the area of the area corresponding to other targets to be detected, wherein the other targets to be detected include targets other than the target to be detected. If there are multiple objects to be detected in the first image, the areas occupied by the multiple objects to be detected may be inconsistent, and the objects to be detected with larger areas have a relatively higher recognition rate during the recognition process. Detection target for identification. Wherein, if there are multiple objects to be detected with the same area, the object to be detected whose center is closer to the center of the first image may be identified, or in other embodiments, the corresponding objects of all objects to be detected may be obtained separately. Of course, all the objects to be detected in the latter refer to the objects to be detected whose areas are tied first or whose areas are larger than a preset area extraction threshold.
在一些实施例中,在对第一图像进行特征提取进行识别之前,对后续特征提取的第一图像进行预处理还可以是,检测到第一图像中待检测目标的倾斜角度大于预设角度,并将第一图像旋转至待检测目标的倾斜角度小于或等于预设角度。在一些实施例中,旋转的方式除了旋转整张第一图像之外,还可以仅旋转待检测目标,或者包含待检测目标的目标区域,因此,摆正待检测目标的方式此处不做限定。其中,预设角度可以是顺时针或逆时针0°至180°以内,本申请实施例选择设置预设角度为0°,一些实施例中预设角度还可以是30°、35°等。其中,判断待检测目标是否倾斜了预设角度的方式可以是获取待检测目标中的预设第一关键点和预设第二关键点的连线与一竖直线的夹角,判断该夹角是否大于预设角度,若大于,则旋转第一图像使得该夹角小于或等于预设角度,且旋转之后的预设第一关键点位于预设第二关键的上方,此上方是相对于第一图像的底边确定。当然,倾斜角度还可以是待检测目标相对于第一图像的某一位置的倾斜角度,例如待检测目标相对于第一图像中心的倾斜角度。当然,这里的预设角度可以根据不同场景的需求进行设置,例如可根据待检测目标所在区域占第一图像的面积进行确定。例如,当待检测目标所在区域的面积大于第一面积预设值时,则可设置预设角度大于30°,当待检测目标所在区域的面积小于第二面积预设值时,则可设置预设角度小于30°。因为待检测目标所在区域的面积越大则说明待检测目标的面积越大,即待检测目标受到角度的影响越小,则对于待检测目标的倾斜角度越宽容,反之,则说明待检测目标受到倾斜角度的影响越大,则对待检测目标的倾斜角度越严格。当然,这只是举例,一些实施例中,还可设置其他面积与预设角度的对应关系等,此处不做规定。In some embodiments, before the feature extraction is performed on the first image for identification, the preprocessing of the first image for subsequent feature extraction may also be that it is detected that the inclination angle of the object to be detected in the first image is greater than a preset angle, and rotate the first image until the inclination angle of the object to be detected is less than or equal to the preset angle. In some embodiments, in addition to rotating the entire first image, the rotation method may only rotate the target to be detected, or the target area including the target to be detected. Therefore, the method of aligning the target to be detected is not limited here. . The preset angle may be within 0° to 180° clockwise or counterclockwise. In this embodiment of the present application, the preset angle is selected to be set to 0°. In some embodiments, the preset angle may also be 30°, 35°, and the like. Wherein, the way of judging whether the object to be detected is inclined by a preset angle may be to obtain the included angle between a line connecting a preset first key point and a preset second key point in the object to be detected and a vertical line, Whether the angle is greater than the preset angle, if it is greater, rotate the first image so that the included angle is less than or equal to the preset angle, and the preset first key point after rotation is located above the preset second key, which is relative to The bottom edge of the first image is determined. Of course, the inclination angle may also be the inclination angle of the object to be detected relative to a certain position of the first image, for example, the inclination angle of the object to be detected relative to the center of the first image. Of course, the preset angle here can be set according to the requirements of different scenarios, for example, it can be determined according to the area of the first image where the area where the target to be detected is located. For example, when the area of the area where the target to be detected is located is larger than the first area preset value, the preset angle can be set to be greater than 30°, and when the area of the area where the target to be detected is located is smaller than the second area preset value, the preset angle can be set. Set the angle to be less than 30°. Because the larger the area of the target to be detected is, the larger the area of the target to be detected is, that is, the less the target to be detected is affected by the angle, the more tolerant the inclination angle of the target to be detected is. The greater the influence of the tilt angle, the stricter the tilt angle of the object to be detected. Of course, this is just an example, and in some embodiments, other correspondences between areas and preset angles may also be set, which are not specified here.
例如,参见图2和图3,图2是本申请实施例图像检测方法一实施例中第一图像示意图,图3是本申请实施例图像检测方法一实施例中经过预处理的第一图像示意图。如图2所示,第一图像20中待检测目标21的下半部分被预设物体22遮挡,且待检测目标21明显向左倾斜,即待检测目标21的左上角点(第一预设关键点)和左下角点(第二预设关键点)的连线与一竖直线的夹角为30°,即待检测目标21的倾斜角度为30°大于预设角度0°,则将第一图像20向右,也就是顺时针旋转30°,旋转之后的第一图像如图3所示,图3中待检测目标21的左上角点(第一预设关键点)和左下角点(第二预设关键点)的连线与一竖直线的夹角为0°等于预设角度0°。For example, referring to FIGS. 2 and 3 , FIG. 2 is a schematic diagram of a first image in an embodiment of an image detection method according to an embodiment of the present application, and FIG. 3 is a schematic diagram of a preprocessed first image in an embodiment of the image detection method according to an embodiment of the present application. . As shown in FIG. 2 , the lower half of the object to be detected 21 in the first image 20 is blocked by a preset object 22 , and the object to be detected 21 is obviously inclined to the left, that is, the upper left corner of the object to be detected 21 (the first preset The angle between the connection line between the key point) and the lower left corner point (the second preset key point) and a vertical line is 30°, that is, the inclination angle of the target 21 to be detected is 30° greater than the preset angle of 0°, then the The first image 20 is rotated to the right, that is, rotated 30° clockwise. The rotated first image is shown in FIG. 3 . In FIG. 3 , the upper left corner point (the first preset key point) and the lower left corner point of the target 21 to be detected are shown in FIG. 3 . The included angle between the connection line (the second preset key point) and a vertical line is 0°, which is equal to the preset angle of 0°.
通过在第一图像中待检测目标的倾斜角度大于预设角度的情况下,则将待检测目标摆正,使得后续对待检测目标进行活体检测或目标识别的过程中减少了因为待检测目标因为倾斜而造成的影响。When the inclination angle of the target to be detected in the first image is greater than the preset angle, the target to be detected is straightened, so that the subsequent process of performing live detection or target recognition on the target to be detected is reduced because the target to be detected is inclined due to the inclination of the target. the impact caused.
在一些实施例中,在对第一图像进行特征提取进行识别之前,还可以对后续特征提取的第一图像进行活体检测,并在活体检测结果为待检测目标为活体的情况下,确定执行从所述第一图像中至少提取待检测目标的未被遮挡部分的第一特征及其后续步骤。其中,若第一图像中存在多个待检测目标时,选择面积最大的待检测目标进行活体检测。其中,可以通过将待检测目标对应的目标区域输入活体检测模型进行活体检测,其中活体检测模型是利用若干 个包含被预设物体遮挡的待检测目标的图像进行训练得到。通过在待检测目标为活体的情况下才对待检测目标进行识别,从而增强了识别的安全性,可以在一定程度上防止假体攻击。In some embodiments, before the feature extraction is performed on the first image for identification, a liveness detection may also be performed on the subsequent feature extraction first image, and when the liveness detection result is that the target to be detected is a living body, it is determined to execute the At least the first feature of the unoccluded part of the object to be detected is extracted from the first image and the subsequent steps thereof. Wherein, if there are multiple objects to be detected in the first image, the object to be detected with the largest area is selected for living body detection. The in vivo detection can be performed by inputting the target area corresponding to the target to be detected into the in vivo detection model, wherein the in vivo detection model is obtained by training a number of images containing the target to be detected occluded by the preset object. By identifying the target to be detected only when the target to be detected is a living body, the security of the identification is enhanced, and prosthetic attacks can be prevented to a certain extent.
其中,对待检测目标进行识别过程中,先从第一图像中至少提取待检测目标的未被遮挡部分的第一特征,作为待检测目标的待识别特征。其中,第一特征指的是待检测目标中未被遮挡的关键点的特征。其中,可以从第一图像中提取待检测目标的未被遮挡部分的第一特征,并获取待检测目标的被遮挡部分的第二特征,将第一特征和第二特征作为待检测目标的待识别特征。这里的第二特征是待检测目标被遮挡部分关键点的特征。其中,被遮挡部分的第二特征的获取方式可以有两种方式,一种是从第一图像中提取被遮挡部分的特征作为第二特征。也就是虽然这部分被预设物体遮挡,但是还是按照未被遮挡提取第一特征的方式对遮挡部分的第二特征进行提取,即不论待检测目标是否被预设物体遮挡皆采用相同的处理机制,即是否被预设物体遮挡并不影响特征的提取过程。当然,在一些实施例中,若没有预设遮挡待检测目标的物体,还是可使用这种方式对待检测目标中关键点特征的提取。例如,当待检测目标为人脸,预设物体为口罩,对第二特征提取的方式就是当做人脸没有被口罩遮挡,提取人脸上各个关键点的特征,也就是说对于佩戴口罩的人脸和没有佩戴口罩的人脸采用相同的处理机制,即佩戴口罩并不会对提取特征的过程产生影响。另一种方式是获取被遮挡部分的预设特征作为第二特征,其中,预设特征可以是基于至少一个参考特征得到的特征,每个参考特征是对不存在被遮挡部分的参考目标中与被遮挡部分对应的区域提取得到的。也就是说,在对第一图像进行识别之前,先对被遮挡部分的关键点预设参考特征,也就是对被遮挡部分的特征进行补齐。例如,预先提取若干个检测结果为不存在被遮挡部分的待检测目标中对应预设部位的特征,然后将提取到的若干个特征的平均值补齐作为被物体遮挡部分的参考特征,其中,可以是预先提取若干个检测结果为未被预设物体遮挡的待检测目标中对应预设部位的特征,然后将提取到的若干个特征的平均值补齐作为被预设物体遮挡部分的参考特征。例如,预先提取若干个不戴口罩的人脸中对应预设部位的特征,即戴口罩部分的特征,例如鼻子、嘴巴等,将提取的若干个特征的平均值补齐,作为被口罩遮住的部分预设的参考特征。关于被遮挡部分的特征确定方式,可通过直接提取被遮挡部分的特征,由于被遮挡部分的特征能够在一定程度会随着待检测目标的不同而不同,故此方式能够提高识别的准确性;也可通过获取预设特征作为被遮挡部分特征,此方式无需对被遮挡部分进行特征提取,可减少处理资源的损耗,且提高处理效率。Wherein, in the process of identifying the object to be detected, at least the first feature of the unoccluded part of the object to be detected is first extracted from the first image as the feature to be identified of the object to be detected. Wherein, the first feature refers to the feature of the key point that is not occluded in the target to be detected. Wherein, the first feature of the unoccluded part of the object to be detected can be extracted from the first image, and the second feature of the occluded part of the object to be detected can be obtained, and the first feature and the second feature are used as the object to be detected. Identify features. The second feature here is the feature of the key points of the occluded part of the target to be detected. There are two ways to obtain the second feature of the occluded portion. One is to extract the feature of the occluded portion from the first image as the second feature. That is to say, although this part is occluded by the preset object, the second feature of the occluded part is extracted according to the method of extracting the first feature that is not occluded, that is, the same processing mechanism is adopted regardless of whether the target to be detected is occluded by the preset object. , that is, whether it is occluded by a preset object does not affect the feature extraction process. Of course, in some embodiments, if there is no preset object blocking the target to be detected, this method can still be used to extract key point features in the target to be detected. For example, when the target to be detected is a face and the preset object is a mask, the method of extracting the second feature is to treat the face as not being blocked by the mask, and extract the features of each key point on the face, that is to say, for the face wearing a mask The same processing mechanism is used as the face without a mask, that is, wearing a mask will not affect the process of feature extraction. Another way is to obtain a preset feature of the occluded part as the second feature, wherein the preset feature may be a feature obtained based on at least one reference feature, and each reference feature is the difference between the reference target without the occluded part and the reference target. The area corresponding to the occluded part is extracted. That is to say, before identifying the first image, the reference features of the key points of the occluded part are preset, that is, the features of the occluded part are complemented. For example, a number of detection results are pre-extracted for the features corresponding to preset parts in the target to be detected that do not have an occluded part, and then the average value of the extracted several features is supplemented as the reference feature of the part occluded by the object, wherein, It may be to pre-extract the features of the corresponding preset parts in the target to be detected whose detection results are not occluded by the preset object, and then fill in the average value of the extracted features as the reference feature of the part occluded by the preset object. . For example, pre-extract the features of the corresponding preset parts in several faces without masks, that is, the features of the mask-wearing parts, such as nose, mouth, etc., and make up the average value of the extracted features as the mask covered by the mask. part of the preset reference feature. Regarding the method of determining the features of the occluded parts, the features of the occluded parts can be directly extracted. Since the features of the occluded parts can be different to a certain extent with the different objects to be detected, this method can improve the accuracy of recognition; The preset feature can be obtained as the feature of the occluded part, and this method does not need to perform feature extraction on the occluded part, which can reduce the consumption of processing resources and improve the processing efficiency.
在一些实施例中,在获得待检测目标的待识别特征之后,利用待识别特征对待检测目标进行识别。其中,识别的场景可以分为1:1的场景,以及1:N的场景,其中1:1指的是两个特征之间的比对,而1:N指的是一个特征与多个特征之间的比对。在1:1的场景中,也即是在预设目标包括一个的情况下,获取待识别特征与预设目标的预存特征之间的第一相似度,并在第一相似度满足第一预设条件的情况下,确定识别结果包括待检测目标通过身份认证。其中,第一预设条件可以是第一相似度大于第一相似度阈值。其中,在待识别特征包括待检测目标的被遮挡部分的第二特征的情况下的第一相似度阈值,小于在待识别特征不包括第二特征的情况下的第一相似度阈值。如果待识别特征中包含第二特征,第二特征可能会与待检测目标被遮挡部分的关键点真实的特征所有出入,因此,在这种情况下适当地减小相似度阈值能够提高识别的准确性。其中,待识别特征中不包括第二特征的情况下,第一相似度阈值的选取可以是根据被遮挡的关键点的数量所占待检测目标总体关键点的数量的比值来确定。例如,被遮挡部分的关键点是待检测目标总体关键点数量的三分之一,则可确定第一相似度阈值为未被遮挡的待检测目标识别的相似度阈值的三分之一。此时,可设置待识别特征中包括第二特征时,第一相似度阈值可比待识别特征中不包括第二特征情况下的第一相似度阈值小0.1,或小其他数值,此处不做规定。例如,未被遮挡的待检测目标识别的相似度阈值可以在0.6至1之间。当然,这仅是举例,一些实施例中,在待识别特征包括待检测目标的被遮挡部分的第二特征的情况下的第一相似度阈值,也可等于待识别特征不包括第二特征的情况下的第一相似度阈值,若待识别特征中包括第二特征时,也可按照上述方法确定可根据实际情况进行确定。In some embodiments, after obtaining the to-be-identified feature of the to-be-detected object, the to-be-identified feature is used to identify the to-be-detected object. Among them, the recognized scenes can be divided into 1:1 scenes and 1:N scenes, where 1:1 refers to the comparison between two features, and 1:N refers to one feature and multiple features comparison between. In a 1:1 scenario, that is, when the preset target includes one, the first similarity between the feature to be identified and the pre-stored feature of the preset target is obtained, and when the first similarity satisfies the first prediction In the case of setting conditions, it is determined that the identification result includes that the target to be detected has passed the identity authentication. The first preset condition may be that the first similarity is greater than the first similarity threshold. Wherein, the first similarity threshold when the feature to be identified includes the second feature of the occluded portion of the target to be detected is smaller than the first similarity threshold when the feature to be identified does not include the second feature. If the feature to be identified contains a second feature, the second feature may be different from the real feature of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the accuracy of identification sex. Wherein, when the feature to be identified does not include the second feature, the selection of the first similarity threshold may be determined according to the ratio of the number of occluded key points to the total number of key points of the target to be detected. For example, if the key points of the occluded part are one-third of the total number of key points of the target to be detected, the first similarity threshold may be determined to be one-third of the similarity threshold of the unobstructed target to be detected. At this time, when the feature to be identified includes the second feature, the first similarity threshold can be set to be 0.1 smaller than the first similarity threshold in the case where the feature to be identified does not include the second feature, or a smaller value, which is not done here. Regulation. For example, the similarity threshold for identifying the unoccluded target to be detected may be between 0.6 and 1. Of course, this is only an example. In some embodiments, the first similarity threshold in the case where the feature to be identified includes the second feature of the occluded part of the target to be detected may also be equal to the value of the feature to be identified that does not include the second feature. The first similarity threshold value in this case, if the feature to be identified includes the second feature, can also be determined according to the above method and can be determined according to the actual situation.
在一些实施例中,在获取待识别特征与预设目标的预存特征之间的第一相似度之前,先建立用户账号与预设目标的预存特征之间的关联。实现方式如下:响应于账号注册请求,为用户注册账号。其中,这里的账号可以是一些电子支付的账号,只要能够进行目标识别的应用程序皆可响应账号注册请求,为用户注册账号。用户可以在对应的应用程序中通过手机号注册,注册成功之后,用户获取到用户名、密码等信息。从对用户拍摄得到的至少一帧第二图像中,确定满足预设质量要求的第二图像,并从确定的第二图像中提取用户的预设部位的特征。其中,这里的预设部位同待检测目标的预设部位。其中,选择满足预设质量要求的第二图像的步骤同上述选择满足预设质量要求的第一图像的步骤。最后,将预设部位的特征与账号建立关联,并将预设部位的特征保存作为预设目标的预存特征。即用户的预设部位则为预设目标。In some embodiments, before acquiring the first similarity between the feature to be identified and the pre-stored feature of the preset target, an association between the user account and the pre-stored feature of the preset target is established first. The implementation is as follows: in response to an account registration request, register an account for the user. Among them, the account here can be some electronic payment accounts, as long as the application program that can perform target recognition can respond to the account registration request and register the account for the user. The user can register through the mobile phone number in the corresponding application. After the registration is successful, the user obtains the user name, password and other information. From at least one frame of the second image captured by the user, a second image that meets the preset quality requirements is determined, and the feature of the preset part of the user is extracted from the determined second image. Wherein, the preset part here is the same as the preset part of the target to be detected. The step of selecting the second image that meets the preset quality requirement is the same as the above-mentioned step of selecting the first image that meets the preset quality requirement. Finally, the feature of the preset part is associated with the account, and the feature of the preset part is saved as the pre-stored feature of the preset target. That is, the preset part of the user is the preset target.
其中,1:N的场景中,也即是在预设目标包括多个的情况下,分别获取待识别特征与每个预设目标的预存特征之间的第二相似度,并确定识别结果包括将待检测目标的身份确定为满足第二预设条件的第二相似度对应的预设目标的身份。其中,第二预设条件可以是第二相似度大于第二相似度阈值。其中,一般情况下,这里所指的满足第二预设条件,不仅要大于第二相似度阈值,而且往往是所有第二相似度里取最大值的参数。也即是选择最大第二相似度对应的预设目标身份作为待检测目标的身份。其中,在待识别特征包括第二特征的情况下的第二相似度阈值,小于在待识别特征不包括第二特征的情况下的第二相似度阈值。如果待识别特征中包含第二特征,第二特征可能会与待检测目标被遮挡部分的关键点真实的特征所有出入,因此,在这种情况下适当地减小相似度阈值能够提高识别的准确性。第二相似度阈值的确定方法同第一相似度阈值的确定方法。Among them, in the 1:N scenario, that is, in the case where there are multiple preset targets, the second similarity between the features to be identified and the pre-stored features of each preset target is obtained respectively, and it is determined that the recognition results include The identity of the target to be detected is determined as the identity of the preset target corresponding to the second degree of similarity satisfying the second preset condition. The second preset condition may be that the second similarity is greater than the second similarity threshold. Wherein, in general, satisfying the second preset condition referred to here is not only greater than the second similarity threshold, but is often a parameter that takes the maximum value among all the second similarity. That is, the preset target identity corresponding to the largest second similarity is selected as the identity of the target to be detected. Wherein, the second similarity threshold when the feature to be identified includes the second feature is smaller than the second similarity threshold when the feature to be identified does not include the second feature. If the feature to be identified contains a second feature, the second feature may be different from the real feature of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the accuracy of identification sex. The method for determining the second similarity threshold is the same as the method for determining the first similarity threshold.
1:N可以是涉及到很多张人脸的场景中,比如,一个办公楼宇或者一家公司在出入口安装了人脸识别闸机,这种场景下需要在楼宇或者公司范围内,将每个需要出入的人进行注册,并形成一个人脸库,当注册的人出现在闸机前时,闸机上的摄像头对人脸进行检测、抓拍,并将抓拍的人脸与人脸库中的进行比较,当比对成功时,打开闸机,当未注册的人出现在闸机时,应该比对不成功,闸机无响应。1:N can be in a scenario involving many faces. For example, an office building or a company has installed face recognition gates at the entrance and exit. When the registered person appears in front of the gate, the camera on the gate detects and captures the face, and compares the captured face with the face database. When the comparison is successful, open the gate, when an unregistered person appears at the gate, the comparison should be unsuccessful and the gate does not respond.
上述方案,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡,然后执行与检测结果匹配的预设操作,能够判断待检测目标是否被遮挡从而能够进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。In the above solution, by detecting the first image containing the object to be detected to obtain whether the object to be detected is blocked, and then performing a preset operation matching the detection result, it can be determined whether the object to be detected is blocked and subsequent detection can be performed The preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
基于前述的实施例,本申请实施例再提供一种图像检测方法,所述方法利用了基于深度学习算法的模型检测能力,并且从人脸核验场景入手,实现了1:1和1:N场景的图像检测流程,同时,提供了检查是否佩戴口罩的方法,以及提供了在佩戴口罩的过程中人脸比对和人脸检索的实现方式。Based on the foregoing embodiments, the embodiments of the present application further provide an image detection method, the method utilizes the model detection capability based on the deep learning algorithm, and starts from the face verification scene, and realizes the 1:1 and 1:N scenes At the same time, it provides a method for checking whether a mask is worn, as well as the realization method of face comparison and face retrieval in the process of wearing a mask.
(1)人脸核验场景主要包括1:1和1:N两个场景。(1) The face verification scenarios mainly include 1:1 and 1:N scenarios.
例如,在支付场景下的1:1是指实时抓拍的人脸照片与会员绑定的底库图片进行1:1的校验,如果确认是同一用户,则认证通过。又如,1:N场景更多涉及到人脸检索,比如一个办公楼宇或者一家公司在出入口安装了人脸识别闸机,这种场景下需要在楼宇或者公司范围内,将每个需要出入的用户进行注册,并形成一个人脸库。当用户出现在闸机前时,闸机上的摄像头对人脸进行检测、抓拍,并将抓拍的人脸图像与人脸库中的图片进行比较,当比对成功时,打开闸机,比对不成功时,闸机无响应,即闸机维持关闭状态。For example, 1:1 in the payment scenario refers to the 1:1 verification between the face photo captured in real time and the bottom library image bound by the member. If it is confirmed that they are the same user, the authentication is passed. For another example, the 1:N scenario is more related to face retrieval. For example, an office building or a company has installed face recognition gates at the entrance and exit. Users register and form a face database. When the user appears in front of the gate, the camera on the gate detects and captures the face, and compares the captured face image with the pictures in the face database. When the comparison is successful, the gate is opened, and the comparison When unsuccessful, the gate will not respond, that is, the gate will remain closed.
在一些实施例中,无论是在1:1场景下还是在1:N场景下,均需要进行活体的防范。例如照片(包括对人物进行拍摄得到的照片、电子合成照片等)、面具等假人的攻击。In some embodiments, whether in a 1:1 scenario or a 1:N scenario, protection against living bodies is required. For example, the attack of dummies such as photos (including photos obtained by taking pictures of people, electronically synthesized photos, etc.), masks, etc.
(2)1:1场景下的图像检测方法,可以通过以下方式实现:(2) The image detection method in the 1:1 scene can be implemented in the following ways:
首先,用户有一个账号,比如电子支付的账号。用户在所述电子支付账号对应的应用系统中通过手机号注册,注册成功后,用户获取到用户名、密码等信息,即得到一个电子支付账号。其次,所述应用系统通过一些活动引导用户进行绑定人脸的操作,当用户通过活体认证时,进行人脸识别,当视频中的人脸质量满足人脸采集需求时,采集用户的人脸图像。其中,可以选取在拍摄过程中质量最高的一帧,所述质量的评判标准包括人脸的角度、光照的 强弱、人脸的大小等维度中的一项或是多项。First, the user has an account, such as an account for electronic payment. The user registers through the mobile phone number in the application system corresponding to the electronic payment account. After the registration is successful, the user obtains information such as user name and password, that is, an electronic payment account. Secondly, the application system guides the user to perform the operation of binding the face through some activities. When the user passes the living body authentication, the face recognition is performed, and when the quality of the face in the video meets the face collection requirements, the user's face is collected. image. Wherein, a frame with the highest quality in the shooting process can be selected, and the evaluation criteria of the quality include one or more of the dimensions such as the angle of the human face, the intensity of the illumination, and the size of the human face.
可以将采集到的用户的人脸图像与该账号进行关联,具体可以与账号的标识进行关联,作为人脸底库的比对图片。当用户在线上消费时,订单确认后进入到支付环节,这时如果用户已经绑定人脸图像并选择人脸支付的话,会进入到人脸抓拍环节。在人脸检测时进行口罩佩戴的检查(即人脸属性检测),如果佩戴口罩,继续后续流程,如果未佩戴口罩,可以通过播放语音或展示文字等方式提醒用户佩戴口罩。The collected face image of the user can be associated with the account, specifically the identification of the account, as a comparison picture of the face base library. When the user consumes online, the order is confirmed and the payment link is entered. At this time, if the user has bound the face image and chooses face payment, it will enter the face capture link. During face detection, check the wearing of masks (that is, face attribute detection). If you wear a mask, continue the subsequent process. If you do not wear a mask, you can remind the user to wear a mask by playing voice or displaying text.
在用户佩戴口罩的情况下,进行人脸检测,在拍摄过程中的这段时间内,选出质量最高的一帧,并将选出的这一帧图片进行人脸对齐(例如人脸如果存在一定的倾斜角度,则进行人脸摆正处理),并基于对齐后的人脸图片进行人脸特征值提取。When the user wears a mask, perform face detection. During the shooting process, select the frame with the highest quality, and align the selected frame with the face (for example, if the face exists If the tilt angle is a certain angle, the face is straightened), and the face feature value extraction is performed based on the aligned face image.
其中,人脸特征值提取及比对有两种方式,第一种是包含口罩部分的人脸特征值提取,比如,人脸底库的图片中不带口罩的人脸特征值是A,采用同样的方式对戴口罩的人脸进行特征提取,提取出特征值A1,再对戴口罩的特征值A1和不带口罩的特征值A的特征向量进行比对。第二种是实现口罩以上可见部分的人脸特征值提取,假设全部人脸为128个关键点,口罩以上为64个关键点,则将口罩以上可见部分的64个关键点提取的特征值,与所述人脸底库的图片中对应的64个关键点提取的特征值进行比对。进而,将生成的特征值与该用户的所述人脸底库中的图片的特征值进行比对,超过比对阈值时(例如设置比对阈值为0.8,相似度超过0.8的则认为是同一用户),比对通过,人脸核验流程结束。Among them, there are two ways to extract and compare the facial feature value. The first is to extract the facial feature value including the mask part. For example, the feature value of the face without a mask in the image of the face base library is A. In the same way, extract the feature of the face wearing a mask, extract the feature value A1, and then compare the feature vector of the feature value A1 with the mask and the feature value A without the mask. The second is to extract the facial feature values of the visible part above the mask. Assuming that all faces have 128 key points and 64 key points above the mask, then extract the eigenvalues from the 64 key points of the visible part above the mask, Compare with the eigenvalues extracted from the corresponding 64 key points in the picture of the face base library. Further, the generated feature value is compared with the feature value of the picture in the user's described face base library, and when the comparison threshold is exceeded (for example, the comparison threshold is set to 0.8, and the similarity exceeds 0.8, it is considered to be the same user), the comparison is passed, and the face verification process ends.
(3)1:N场景下的图像检测方法,可以通过以下方式实现:(3) The image detection method in the 1:N scene can be implemented in the following ways:
首先,在办公楼宇人员管理业务系统中,录入每个有权限进入大厦的用户的照片(形成大厦的通行场景下的人脸底库的比对图片),此时所述人脸底库中的图片与大厦用户是一一对应的关系。其次,将所述人脸底库中的图片与闸机的人脸识别设备进行绑定关联,使闸机的人脸识别设备可以读取到所述人脸底库中的图片。当人员需要通过闸机时,闸机上的人脸识别设备检测到人脸信息后,进入到人脸抓拍状态(此时所述人脸识别设备上的摄像模块可以一直开启,进行人脸追踪,人脸框一直跟随人脸的移动而移动)。First, in the office building personnel management business system, enter the photo of each user who has permission to enter the building (forming a comparison picture of the face database under the traffic scene of the building). There is a one-to-one correspondence between pictures and building users. Secondly, the pictures in the face base library are bound and associated with the face recognition device of the gate, so that the face recognition equipment of the gate can read the pictures in the face base library. When a person needs to pass through the gate, the face recognition device on the gate detects the face information, and then enters the face capture state (at this time, the camera module on the face recognition device can be turned on all the time to perform face tracking, The face frame always moves with the movement of the face).
然后,在人脸检测时进行口罩佩戴的检查(即人脸属性检测),并根据不同的检查结果进行不同的操作,具体的操作内容可以参见上述1:1场景下的内容描述。Then, check the wearing of the mask during face detection (that is, face attribute detection), and perform different operations according to different inspection results. For the specific operation content, please refer to the content description in the above 1:1 scenario.
其中,1:N场景下的人脸特征值提取及检索也有两种方式,第一种是包含口罩部分的人脸特征值提取,所述人脸底库的比对图片中假设有A、B、C、D和E这五张不带口罩的人脸特征值,则采用同样的方式对戴口罩的人脸进行特征提取,提取出A1、B1、C1、D1和E1这五个特征值,在对戴口罩的特征值A1进行检索时,特征值A1和特征值A的特征向量的距离最短,则检索到对应的特征值A。第二种是实现口罩以上可见部分的人脸特征值提取,其中,特征值的生成部分与上述1:1场景下的方法相同,可以参见上述描述。当特征值生成后,进而,将生成的特征值在整个楼宇所有用户的人脸底库的图片中进行人脸特征检索(1:N的搜索),当存在超过比对阈值的特征值时,认为检索成功。检索成功,人脸识别设备传输打开信号,闸机开门,人脸核验流程结束。Among them, there are also two ways to extract and retrieve the facial feature value in the 1:N scene. The first is to extract the facial feature value including the mask part. It is assumed that there are A and B in the comparison picture of the face base library. , C, D, and E of the five face eigenvalues without masks, the same way is used to extract the features of the faces wearing masks, and the five eigenvalues A1, B1, C1, D1 and E1 are extracted. When retrieving the eigenvalue A1 of wearing a mask, if the distance between the eigenvalue A1 and the eigenvector of the eigenvalue A is the shortest, the corresponding eigenvalue A is retrieved. The second is to extract the facial feature value of the visible part above the mask, in which the generation part of the feature value is the same as the method in the above 1:1 scenario, please refer to the above description. After the eigenvalues are generated, the generated eigenvalues are then used for facial feature retrieval (1:N search) in the pictures of the face base database of all users in the entire building. When there are eigenvalues exceeding the comparison threshold, The retrieval is considered successful. If the retrieval is successful, the face recognition device transmits an opening signal, the gate opens, and the face verification process ends.
本申请实施例中,通过上述方法,在人脸识别前,可以检查用户是否佩戴口罩并进行提醒,以及在用户佩戴口罩的情况下,进行精准的人脸识别,并完成人脸核验流程,极大地提升了通行的效率,同时降低了摘口罩带来的风险。In the embodiment of the present application, through the above method, before face recognition, it is possible to check whether the user wears a mask and remind them, and when the user wears a mask, perform accurate face recognition and complete the face verification process. The efficiency of passage is greatly improved, while the risk of removing masks is reduced.
其中,图像检测方法的执行主体可以是图像检测装置,例如,图像检测方法可以由终端设备或服务器或其它处理设备执行,其中,终端设备可以为用户设备(User Equipment,UE)、移动设备、终端、蜂窝电话、无绳电话、个人数字助理(Personal Digital Assistant,PDA)、手持设备、计算设备、车载设备、可穿戴设备等。在一些可能的实现方式中,该图像检测方法可以通过处理器调用存储器中存储的计算机可读指令的方式来实现。The execution subject of the image detection method may be an image detection apparatus, for example, the image detection method may be executed by a terminal device or a server or other processing device, wherein the terminal device may be a user equipment (User Equipment, UE), a mobile device, a terminal , cellular phones, cordless phones, personal digital assistants (Personal Digital Assistant, PDA), handheld devices, computing devices, in-vehicle devices, wearable devices, etc. In some possible implementations, the image detection method may be implemented by the processor calling computer-readable instructions stored in the memory.
请参阅图4,图4是本申请实施例图像检测装置一实施例的结构示意图。图像检测装置40包括图像获取模块41、目标检测模块42以及操作执行模块43。图像获取模块41配置为获取包含待检测目标的第一图像;目标检测模块42配置为对第一图像进行检测,得到第一图像的检测结果,其中,检测结果包括第一图像中的待检测目标是否被预设物体遮挡;操作 执行模块43,配置为执行与检测结果匹配的预设操作。Please refer to FIG. 4 , which is a schematic structural diagram of an embodiment of an image detection apparatus according to an embodiment of the present application. The image detection device 40 includes an image acquisition module 41 , a target detection module 42 and an operation execution module 43 . The image acquisition module 41 is configured to acquire a first image containing the target to be detected; the target detection module 42 is configured to detect the first image to obtain a detection result of the first image, wherein the detection result includes the target to be detected in the first image Whether it is blocked by a preset object; the operation execution module 43 is configured to execute a preset operation matching the detection result.
上述方案,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡,然后执行与检测结果匹配的预设操作,能够判断待检测目标是否被遮挡从而能够进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。In the above solution, by detecting the first image containing the object to be detected to obtain whether the object to be detected is blocked, and then performing a preset operation matching the detection result, it can be determined whether the object to be detected is blocked and subsequent detection can be performed The preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
在一些实施例中,检测结果是目标检测模块42利用神经网络对第一图像进行检测得到的。In some embodiments, the detection result is obtained by detecting the first image by the target detection module 42 using a neural network.
上述方案,通过提前训练好的神经网络来进行检测,使得检测结果更准确且检测速度更快。In the above scheme, detection is performed by a neural network trained in advance, so that the detection result is more accurate and the detection speed is faster.
在一些实施例中,操作执行模块43执行与检测结果匹配的预设操作,包括:在待检测目标未被预设物体遮挡的情况下,发出第一提醒;其中,第一提醒用于提示使用预设物体对待检测目标进行遮挡。In some embodiments, the operation execution module 43 performs a preset operation matching the detection result, including: when the target to be detected is not blocked by a preset object, issuing a first reminder; wherein the first reminder is used to remind the user to use The preset object occludes the target to be detected.
上述方案,通过在待检测目标未被遮挡时发出第一提醒,以及时提醒待检测目标未被预设物体遮挡的情况,进而被提醒者也能够及时采取对应的措施。In the above solution, by issuing a first reminder when the object to be detected is not blocked, the situation that the object to be detected is not blocked by a preset object is timely reminded, and the person being reminded can also take corresponding measures in time.
在一些实施例中,检测结果还包括待检测目标被预设物体遮挡的遮挡方式是否为预设遮挡方式;操作执行模块43执行与检测结果匹配的预设操作,包括:在待检测目标被预设物体遮挡且遮挡方式不属于预设遮挡方式的情况下,发出第二提醒;其中,第二提醒用于提示调整预设物体的遮挡方式。In some embodiments, the detection result further includes whether the occlusion mode in which the target to be detected is occluded by a preset object is a preset occlusion mode; the operation execution module 43 performs a preset operation matching the detection result, including: In the case where the object is blocked and the blocking method does not belong to the preset blocking method, a second reminder is issued; wherein, the second reminder is used to prompt to adjust the blocking method of the preset object.
上述方案,当遮挡方式不正确时,发出第二提醒,以便于及时调整待检测目标的遮挡方式。In the above solution, when the occlusion mode is incorrect, a second reminder is issued, so as to adjust the occlusion mode of the target to be detected in time.
在一些实施例中,操作执行模块43执行与检测结果匹配的预设操作,包括:在待检测目标被预设物体遮挡的情况下,从第一图像中至少提取待检测目标的未被遮挡部分的第一特征,作为待检测目标的待识别特征;利用待识别特征,对待检测目标进行识别,并得到识别结果。In some embodiments, the operation execution module 43 performs a preset operation matching the detection result, including: when the object to be detected is occluded by a preset object, extracting at least the unoccluded part of the object to be detected from the first image The first feature of the object is used as the feature to be identified of the target to be detected; the feature to be identified is used to identify the target to be detected, and the identification result is obtained.
上述方案,在待检测目标被预设物体遮挡时,则提取未被遮挡部分的特征进行识别,实现了基于待检测目标的局部特征进行识别,而且由于该局部特征未被遮挡,故能够代表待检测目标,在一定程度上保证识别的准确性。In the above solution, when the target to be detected is occluded by a preset object, the features of the unoccluded part are extracted for identification, which realizes the recognition based on the local features of the target to be detected, and since the local features are not occluded, it can represent the target to be detected. Detect the target to ensure the accuracy of recognition to a certain extent.
在一些实施例中,操作执行模块43从第一图像中至少提取待检测目标的未被遮挡部分的第一特征,作为待检测目标的待识别特征,包括:从第一图像中提取待检测目标的未被遮挡部分的第一特征,并获取待检测目标的被遮挡部分的第二特征;将第一特征和第二特征作为待检测目标的待识别特征。In some embodiments, the operation execution module 43 extracts at least the first feature of the unoccluded part of the object to be detected from the first image as the feature to be identified of the object to be detected, including: extracting the object to be detected from the first image The first feature of the unoccluded part is obtained, and the second feature of the occluded part of the object to be detected is obtained; the first feature and the second feature are used as the feature to be identified of the object to be detected.
上述方案,除采用待检测目标未被遮挡部分的特征以外,还结合被遮挡部分的特征,由此可提高待检测目标的特征丰富度。In the above solution, in addition to using the features of the unoccluded part of the target to be detected, the feature of the occluded part is also combined, thereby improving the feature richness of the object to be detected.
在一些实施例中,操作执行模块43获取待检测目标的被遮挡部分的第二特征,包括:从第一图像中提取被遮挡部分的特征作为第二特征;或者,获取被遮挡部分的预设特征作为第二特征,其中,预设特征包括基于至少一个参考特征得到的特征,每个参考特征是对不存在被遮挡部分的参考目标中与被遮挡部分对应的区域提取得到的。In some embodiments, the operation execution module 43 obtains the second feature of the occluded portion of the object to be detected, including: extracting the feature of the occluded portion from the first image as the second feature; or, obtaining a preset of the occluded portion The feature is used as the second feature, wherein the preset feature includes a feature obtained based on at least one reference feature, and each reference feature is obtained by extracting an area corresponding to the occluded part in the reference target without the occluded part.
上述方案,关于被遮挡部分的特征确定方式,可通过直接提取被遮挡部分的特征,由于被遮挡部分的特征能够在一定程度会随着待检测目标的不同而不同,故此方式能够提高识别的准确性;也可通过获取预设特征作为被遮挡部分特征,此方式无需对被遮挡部分进行特征提取,可减少处理资源的损耗,且提高处理效率。In the above scheme, regarding the feature determination method of the occluded part, the features of the occluded part can be directly extracted. Since the features of the occluded part can be different to a certain extent with different targets to be detected, this method can improve the accuracy of recognition. It is also possible to obtain a preset feature as the feature of the occluded part. This method does not need to perform feature extraction on the occluded part, which can reduce the consumption of processing resources and improve the processing efficiency.
在一些实施例中,操作执行模块43利用待识别特征,对待检测目标进行识别,并得到识别结果包括如下至少一项:在预设目标包括一个的情况下,获取待识别特征与预设目标的预存特征之间的第一相似度,并在第一相似度满足第一预设条件的情况下,确定识别结果包括待检测目标通过身份认证;在预设目标包括多个的情况下,分别获取待识别特征与每个预设目标的预存特征之间的第二相似度,并确定识别结果包括将待检测目标的身份确定为满足第二预设条件的第二相似度对应的预设目标的身份。In some embodiments, the operation execution module 43 uses the feature to be identified to identify the target to be detected, and obtains the recognition result including at least one of the following: in the case that the preset target includes one, obtain the difference between the feature to be identified and the preset target. The first similarity between the pre-stored features, and in the case that the first similarity satisfies the first preset condition, it is determined that the identification result includes that the target to be detected has passed the identity authentication; in the case of multiple preset targets, respectively obtain The second similarity between the feature to be identified and the pre-stored feature of each preset target, and determining the recognition result includes determining the identity of the target to be detected as the preset target corresponding to the second similarity that satisfies the second preset condition. identity.
上述方案,通过计算与特定预设目标的预存特征之间的第一相似度,或计算与多个预设 目标的预存特征之间的相似度,使得能够实现根据实际场景需求将待检测目标与特定某个预设目标进行比对,或与某个数据库中的预设目标进行比对。The above scheme, by calculating the first similarity with the pre-stored features of a specific preset target, or calculating the similarity with the pre-stored features of multiple preset targets, so that the target to be detected can be compared with the actual scene requirements. A specific preset target is compared or compared with a preset target in a database.
在一些实施例中,第一预设条件包括第一相似度大于第一相似度阈值;第二预设条件包括第二相似度大于第二相似度阈值。In some embodiments, the first preset condition includes that the first similarity is greater than a first similarity threshold; the second preset condition includes that the second similarity is greater than a second similarity threshold.
上述方案,通过将不同的场景中分别设置第一相似度阈值,使得识别结果更准确。In the above solution, by setting the first similarity thresholds in different scenarios respectively, the recognition result is more accurate.
在一些实施例中,在待识别特征包括待检测目标的被遮挡部分的第二特征的情况下的第一相似度阈值,小于在待识别特征不包括第二特征的情况下的第一相似度阈值;在待识别特征包括第二特征的情况下的第二相似度阈值,小于在待识别特征不包括第二特征的情况下的第二相似度阈值。In some embodiments, the first similarity threshold when the feature to be identified includes the second feature of the occluded portion of the object to be detected is smaller than the first similarity threshold when the feature to be identified does not include the second feature Threshold; the second similarity threshold when the feature to be identified includes the second feature is smaller than the second similarity threshold when the feature to be identified does not include the second feature.
上述方案,如果待识别特征中包含第二特征,第二特征可能会与待检测目标被遮挡部分的关键点真实的特征所有出入,因此,在这种情况下适当地减小相似度阈值能够提高识别的准确性。In the above solution, if the feature to be identified contains a second feature, the second feature may be different from the real features of the key points of the occluded part of the target to be detected. Therefore, in this case, appropriately reducing the similarity threshold can improve the recognition accuracy.
在一些实施例中,图像检测装置40还包括预存模块(图未示)。在操作执行模块43获取待识别特征与预设目标的预存特征之间的第一相似度之前,预存模块配置为:响应于账号注册请求,为用户注册账号;从对用户拍摄得到的至少一帧第二图像中,确定满足预设质量要求的第二图像,并从确定的第二图像中提取用户的预设部位的特征;将预设部位的特征与账号建立关联,并将预设部位的特征保存作为预设目标的预存特征。In some embodiments, the image detection apparatus 40 further includes a pre-stored module (not shown). Before the operation execution module 43 obtains the first similarity between the feature to be identified and the pre-stored feature of the preset target, the pre-store module is configured to: in response to the account registration request, register an account for the user; In the second image, a second image that meets the preset quality requirements is determined, and the features of the user's preset part are extracted from the determined second image; the features of the preset part are associated with the account, and the features of the preset part are Features saves pre-existing features that are preset targets.
上述方案,通过先确定满足质量要求的第二图像来提取预设部位的特征以使得提取到的特征更准确。In the above solution, the features of the preset part are extracted by first determining the second image that meets the quality requirements, so that the extracted features are more accurate.
在一些实施例中,在待检测目标被预设物体遮挡的情况下,在从第一图像中至少提取待检测目标的未被遮挡部分的第一特征之前,操作执行模块43还配置为执行以下至少一个步骤:从包含待检测目标的多帧第一图像中,确定满足预设质量要求的第一图像作为进行后续特征提取的第一图像;对进行后续特征提取的第一图像进行预处理;对进行后续特征提取的第一图像进行活体检测,并在活体检测结果为待检测目标为活体的情况下,确定执行从第一图像中至少提取待检测目标的未被遮挡部分的第一特征及其后续步骤。In some embodiments, when the object to be detected is occluded by a preset object, before extracting at least the first feature of the unoccluded portion of the object to be detected from the first image, the operation execution module 43 is further configured to perform the following At least one step: from multiple frames of first images containing the target to be detected, determining a first image that meets preset quality requirements as the first image for subsequent feature extraction; preprocessing the first image for subsequent feature extraction; Perform in vivo detection on the first image for subsequent feature extraction, and when the result of the in vivo detection is that the target to be detected is a living body, determine to extract at least the first feature of the unoccluded part of the target to be detected from the first image and its next steps.
上述方案,通过在进行特征提取之前,先进行预处理,使得提取到的特征更准确,通过在待检测目标为活体的情况下才对待检测目标进行识别,从而增强了识别的安全性,可以在一定程度上防止假体攻击。In the above scheme, preprocessing is performed before feature extraction, so that the extracted features are more accurate, and the target to be detected is identified only when the target to be detected is a living body, thereby enhancing the security of identification, and can be used in Prevent prosthetic attack to some extent.
在一些实施例中,操作执行模块43从包含待检测目标的多帧第一图像中,确定满足预设质量要求的第一图像作为进行后续特征提取的第一图像,包括:基于每帧第一图像的质量因子,对应得到每帧第一图像的质量分数,其中,第一图像的质量因子包括以下至少一者:待检测目标相对于拍摄器件的位姿信息、用于反映第一图像中待检测目标大小的参数信息、第一图像的亮度信息;基于质量分数,确定满足预设质量要求的第一图像作为进行后续特征提取的第一图像,其中,选择的第一图像的质量分数高于其他第一图像的质量分数。In some embodiments, the operation execution module 43 determines, from the multiple frames of first images containing the target to be detected, the first image that meets the preset quality requirements as the first image for subsequent feature extraction, including: based on the first image of each frame The quality factor of the image corresponds to the quality score of the first image of each frame, wherein the quality factor of the first image includes at least one of the following: pose information of the target to be detected relative to the photographing device, used to reflect the information to be detected in the first image Detect the parameter information of the target size and the brightness information of the first image; based on the quality score, determine the first image that meets the preset quality requirements as the first image for subsequent feature extraction, wherein the quality score of the selected first image is higher than Quality scores for other first images.
上述方案,通过确定质量分数满足要求的图像进行特征提取,使得提取到的特征更能表示待检测目标。In the above solution, feature extraction is performed by determining images whose quality scores meet the requirements, so that the extracted features can better represent the target to be detected.
在一些实施例中,操作执行模块43对进行后续特征提取的第一图像进行预处理,包括:在第一图像包括多个待检测目标的情况,确定满足预设提取要求的待检测目标在第一图像中的目标区域,并去除第一图像中除目标区域以外的图像部分;和/或,检测到第一图像中待检测目标的倾斜角度大于预设角度,并将第一图像旋转至待检测目标的倾斜角度小于预设角度。In some embodiments, the operation execution module 43 preprocesses the first image for subsequent feature extraction, including: when the first image includes multiple objects to be detected, determining that the objects to be detected that meet the preset extraction requirements are in the first image. a target area in an image, and remove the image portion other than the target area in the first image; and/or, detect that the inclination angle of the object to be detected in the first image is greater than a preset angle, and rotate the first image to the target area to be detected The inclination angle of the detection target is smaller than the preset angle.
上述方案,当第一图像中存在多个待检测目标时,仅确定满足预设提取要求的待检测目标,而将不满足要求的待检测目标丢弃,减小了不满足要求的待检测目标对识别结果的影响;其次,当第一图像中待检测目标的倾斜角度,则将其摆正,减少了因为待检测目标因为倾斜而造成的影响。In the above solution, when there are multiple objects to be detected in the first image, only the objects to be detected that meet the preset extraction requirements are determined, and the objects to be detected that do not meet the requirements are discarded, thereby reducing the number of objects to be detected that do not meet the requirements. Influence of the recognition result; secondly, when the inclination angle of the object to be detected in the first image is corrected, the influence caused by the inclination of the object to be detected is reduced.
在一些实施例中,预设提取要求包括待检测目标对应区域的面积大于其他待检测目标对应区域的面积,其他待检测目标包括除待检测目标以外的目标。In some embodiments, the preset extraction requirements include that the area of the area corresponding to the target to be detected is larger than the area of the area corresponding to other targets to be detected, and the other targets to be detected include targets other than the target to be detected.
上述方案,因为待检测目标的面积越大,提取到的特征则越准确,因此,通过选择面积 更大的待检测目标使得待检测结果更准确。In the above scheme, because the larger the area of the target to be detected, the more accurate the extracted features will be. Therefore, by selecting the target to be detected with a larger area, the result to be detected is more accurate.
在一些实施例中,待检测目标包括人脸,预设物体包括口罩。In some embodiments, the target to be detected includes a human face, and the preset object includes a mask.
上述方案,通过判断人脸是否佩戴口罩,并执行对应操作,例如,若人脸没有佩戴口罩或佩戴口罩的方式不准确,则可发出对应的提醒,使得用户能够及时调整;若人脸佩戴口罩,则对人脸进行识别等。The above scheme, by judging whether the face wears a mask, and performing corresponding operations, for example, if the face does not wear a mask or the way of wearing a mask is inaccurate, a corresponding reminder can be issued so that the user can adjust in time; if the face wears a mask , face recognition, etc.
上述方案,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡,然后执行与检测结果匹配的预设操作,能够判断待检测目标是否被遮挡从而能够进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。In the above solution, by detecting the first image containing the object to be detected to obtain whether the object to be detected is blocked, and then performing a preset operation matching the detection result, it can be determined whether the object to be detected is blocked and subsequent detection can be performed The preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
请参阅图5,图5是本申请实施例电子设备一实施例的结构示意图。电子设备50包括存储器51和处理器52,处理器52用于执行存储器51中存储的程序指令,以实现上述任一图像检测方法实施例中的步骤。在一个实施场景中,电子设备50可以包括但不限于:微型计算机、服务器,此外,电子设备50还可以包括笔记本电脑、平板电脑等移动设备,在此不做限定。Please refer to FIG. 5 , which is a schematic structural diagram of an embodiment of an electronic device according to an embodiment of the present application. The electronic device 50 includes a memory 51 and a processor 52, and the processor 52 is configured to execute program instructions stored in the memory 51, so as to implement the steps in any of the above image detection method embodiments. In an implementation scenario, the electronic device 50 may include, but is not limited to, a microcomputer and a server. In addition, the electronic device 50 may also include mobile devices such as a notebook computer and a tablet computer, which are not limited herein.
其中,处理器52用于控制其自身以及存储器51以实现上述任一图像检测方法实施例中的步骤。处理器52还可以称为中央处理单元(Central Processing Unit,CPU)。处理器52可能是一种集成电路芯片,具有信号的处理能力。处理器52还可以是通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application Specific Integrated Circuit,ASIC)、现场可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。另外,处理器52可以由集成电路芯片共同实现。The processor 52 is configured to control itself and the memory 51 to implement the steps in any of the image detection method embodiments described above. The processor 52 may also be referred to as a central processing unit (Central Processing Unit, CPU). The processor 52 may be an integrated circuit chip with signal processing capability. The processor 52 may also be a general-purpose processor, a digital signal processor (Digital Signal Processor, DSP), an application-specific integrated circuit (Application Specific Integrated Circuit, ASIC), a Field-Programmable Gate Array (Field-Programmable Gate Array, FPGA) or other Programmable logic devices, discrete gate or transistor logic devices, discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. In addition, the processor 52 may be jointly implemented by an integrated circuit chip.
上述方案,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡,然后执行与检测结果匹配的预设操作,能够判断待检测目标是否被遮挡从而能够进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。In the above solution, by detecting the first image containing the target to be detected to obtain whether the target to be detected is blocked, and then performing a preset operation matching the detection result, it can be judged whether the target to be detected is blocked so that subsequent and detection can be performed The preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
请参阅图6,图6是本申请实施例计算机可读存储介质一实施例的结构示意图。计算机可读存储介质60存储有能够被处理器运行的程序指令61,程序指令61用于实现上述任一图像检测方法实施例中的步骤。Please refer to FIG. 6 , which is a schematic structural diagram of an embodiment of a computer-readable storage medium according to an embodiment of the present application. The computer-readable storage medium 60 stores program instructions 61 that can be executed by the processor, and the program instructions 61 are used to implement the steps in any of the above image detection method embodiments.
上述方案,通过对包含待检测目标的第一图像进行检测以得到待检测目标是否被遮挡,然后执行与检测结果匹配的预设操作,能够判断待检测目标是否被遮挡从而能够进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。In the above solution, by detecting the first image containing the object to be detected to obtain whether the object to be detected is blocked, and then performing a preset operation matching the detection result, it can be determined whether the object to be detected is blocked and subsequent detection can be performed The preset operation of result matching realizes flexible processing based on the occlusion state of the object to be detected in the image.
在一些实施例中,本申请实施例提供一种计算机程序,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行实现上述方法。In some embodiments, the embodiments of the present application provide a computer program, including computer-readable codes, when the computer-readable codes are executed in an electronic device, a processor in the electronic device executes the above method.
在一些实施例中,本申请实施例提供的装置具有的功能或包含的模块可以用于执行上文方法实施例描述的方法,其实现可以参照上文方法实施例的描述,为了简洁。In some embodiments, the functions or modules included in the apparatus provided in the embodiments of the present application may be used to execute the methods described in the above method embodiments, and for implementation, reference may be made to the above method embodiments for brevity.
上文对各个实施例的描述倾向于强调各个实施例之间的不同之处,其相同或相似之处可以互相参考,为了简洁。The above description of various embodiments has tended to emphasize the differences between the various embodiments, the same or similarities may be referred to each other for the sake of brevity.
在本申请所提供的几个实施例中,应该理解到,所揭露的方法和装置,可以通过其它的方式实现。例如,以上所描述的装置实施方式仅仅是示意性的,例如,模块或单元的划分,仅仅为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,装置或单元的间接耦合或通信连接,可以是电性、机械或其它的形式。In the several embodiments provided in this application, it should be understood that the disclosed method and apparatus may be implemented in other manners. For example, the device implementations described above are only illustrative. For example, the division of modules or units is only a logical function division. In actual implementation, there may be other divisions. For example, units or components may be combined or integrated. to another system, or some features can be ignored, or not implemented. On the other hand, the shown or discussed mutual coupling or direct coupling or communication connection may be through some interfaces, indirect coupling or communication connection of devices or units, which may be in electrical, mechanical or other forms.
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实施例的技术方案本质上或者说对现有技术做出贡献的部分或者该 技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)或处理器(Processor)执行本申请实施例各个实施方式方法的全部或部分步骤。而前述的存储介质包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically alone, or two or more units may be integrated into one unit. The above-mentioned integrated units may be implemented in the form of hardware, or may be implemented in the form of software functional units. The integrated unit, if implemented as a software functional unit and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on this understanding, the technical solutions of the embodiments of the present application can be embodied in the form of software products in essence, or the parts that contribute to the prior art, or all or part of the technical solutions, and the computer software products are stored in a storage The medium includes several instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) or a processor (Processor) to execute all or part of the steps of the methods in the various implementation manners of the embodiments of this application. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (Read-Only Memory, ROM), random access memory (Random Access Memory, RAM), magnetic disk or optical disk and other media that can store program codes .
工业实用性Industrial Applicability
本申请实施例提供了一种图像检测方法和相关装置、设备、存储介质、计算机程序,所述方法包括:获取包含待检测目标的第一图像;对所述第一图像进行检测,得到所述第一图像的检测结果,其中,所述检测结果包括所述第一图像中的待检测目标是否被预设物体遮挡;执行与所述检测结果匹配的预设操作。根据本申请实施例提供的图像检测方法,能够实现判断待检测目标是否被遮挡,从而进行后续的与检测结果匹配的预设操作,实现了基于图像中待检测目标的遮挡状态进行灵活处理。Embodiments of the present application provide an image detection method and related devices, equipment, storage media, and computer programs. The method includes: acquiring a first image containing an object to be detected; detecting the first image to obtain the The detection result of the first image, wherein the detection result includes whether the target to be detected in the first image is blocked by a preset object; and a preset operation matching the detection result is performed. According to the image detection method provided by the embodiment of the present application, it is possible to determine whether the object to be detected is occluded, so as to perform a subsequent preset operation matching the detection result, and realize flexible processing based on the occlusion state of the object to be detected in the image.

Claims (20)

  1. 一种图像检测方法,其中,所述方法包括:An image detection method, wherein the method comprises:
    获取包含待检测目标的第一图像;obtaining a first image containing the target to be detected;
    对所述第一图像进行检测,得到所述第一图像的检测结果,其中,所述检测结果包括所述第一图像中的待检测目标是否被预设物体遮挡;Detecting the first image to obtain a detection result of the first image, wherein the detection result includes whether the target to be detected in the first image is blocked by a preset object;
    执行与所述检测结果匹配的预设操作。A preset operation matching the detection result is performed.
  2. 根据权利要求1所述的方法,其中,所述检测结果是利用神经网络对所述第一图像进行检测得到的。The method according to claim 1, wherein the detection result is obtained by using a neural network to detect the first image.
  3. 根据权利要求1或2所述的方法,其中,所述执行与所述检测结果匹配的预设操作,包括:The method according to claim 1 or 2, wherein the performing a preset operation matching the detection result comprises:
    在所述待检测目标未被所述预设物体遮挡的情况下,发出第一提醒;其中,所述第一提醒用于提示使用所述预设物体对所述待检测目标进行遮挡。When the target to be detected is not blocked by the preset object, a first reminder is issued; wherein, the first reminder is used to prompt to use the preset object to block the target to be detected.
  4. 根据权利要求1至3任一项所述的方法,其中,所述检测结果包括所述待检测目标被预设物体遮挡的遮挡方式是否为预设遮挡方式;所述执行与所述检测结果匹配的预设操作,包括:The method according to any one of claims 1 to 3, wherein the detection result includes whether the occlusion mode in which the target to be detected is occluded by a preset object is a preset occlusion mode; the execution matches the detection result preset actions, including:
    在所述待检测目标被所述预设物体遮挡且所述遮挡方式不属于所述预设遮挡方式的情况下,发出第二提醒;其中,所述第二提醒用于提示调整所述预设物体的遮挡方式。When the target to be detected is blocked by the preset object and the blocking mode does not belong to the preset blocking mode, a second reminder is issued; wherein, the second reminder is used to prompt adjustment of the preset The way the object is occluded.
  5. 根据权利要求1至4任一项所述的方法,其中,所述执行与所述检测结果匹配的预设操作,包括:The method according to any one of claims 1 to 4, wherein the performing a preset operation matching the detection result comprises:
    在所述待检测目标被所述预设物体遮挡的情况下,从所述第一图像中至少提取所述待检测目标的未被遮挡部分的第一特征,作为所述待检测目标的待识别特征;In the case that the object to be detected is blocked by the preset object, extract at least the first feature of the unoccluded part of the object to be detected from the first image, as the object to be detected to be identified feature;
    利用所述待识别特征,对所述待检测目标进行识别,并得到识别结果。Using the feature to be identified, the target to be detected is identified, and an identification result is obtained.
  6. 根据权利要求5所述的方法,其中,所述从所述第一图像中至少提取所述待检测目标的未被遮挡部分的第一特征,作为所述待检测目标的待识别特征,包括:The method according to claim 5, wherein extracting at least the first feature of the unoccluded part of the object to be detected from the first image as the feature to be recognized of the object to be detected comprises:
    从所述第一图像中提取所述待检测目标的未被遮挡部分的第一特征,并获取所述待检测目标的被遮挡部分的第二特征;Extract the first feature of the unoccluded portion of the object to be detected from the first image, and obtain the second feature of the occluded portion of the object to be detected;
    将所述第一特征和第二特征作为所述待检测目标的待识别特征。The first feature and the second feature are used as to-be-identified features of the to-be-detected target.
  7. 根据权利要求6所述的方法,其中,所述获取所述待检测目标的被遮挡部分的第二特征,包括:The method according to claim 6, wherein the acquiring the second feature of the occluded portion of the object to be detected comprises:
    从所述第一图像中提取所述被遮挡部分的特征作为所述第二特征;或者,Extract the feature of the occluded portion from the first image as the second feature; or,
    获取所述被遮挡部分的预设特征作为所述第二特征,其中,所述预设特征包括基于至少一个参考特征得到的特征,每个所述参考特征是对不存在所述被遮挡部分的参考目标中与所述被遮挡部分对应的区域提取得到的。Acquiring a preset feature of the occluded portion as the second feature, wherein the preset feature includes a feature obtained based on at least one reference feature, and each of the reference features is for the absence of the occluded portion. It is obtained by extracting the area corresponding to the occluded part in the reference target.
  8. 根据权利要求5至7任一项所述的方法,其中,所述利用所述待识别特征,对所述待检测目标进行识别,并得到识别结果,包括如下至少一项:The method according to any one of claims 5 to 7, wherein, identifying the target to be detected by using the feature to be identified, and obtaining a recognition result, comprising at least one of the following:
    在预设目标包括一个的情况下,获取所述待识别特征与所述预设目标的预存特征之间的第一相似度,并在所述第一相似度满足第一预设条件的情况下,确定所述识别结果包括所述待检测目标通过身份认证;In the case that the preset target includes one, obtain the first similarity between the feature to be identified and the pre-stored feature of the preset target, and in the case that the first similarity satisfies a first preset condition , determine that the identification result includes that the target to be detected has passed identity authentication;
    在所述预设目标包括多个的情况下,分别获取所述待识别特征与每个所述预设目标的预存特征之间的第二相似度,并确定所述识别结果包括将所述待检测目标的身份确定为满足第二预设条件的第二相似度对应的预设目标的身份。In the case where there are multiple preset targets, obtain the second similarity between the feature to be identified and the pre-stored feature of each of the preset targets, respectively, and determine that the identification result includes adding the feature to be identified. The identity of the detection target is determined as the identity of the preset target corresponding to the second degree of similarity satisfying the second preset condition.
  9. 根据权利要求8所述的方法,其中,所述方法包括如下至少一项:The method of claim 8, wherein the method comprises at least one of the following:
    所述第一预设条件包括所述第一相似度大于第一相似度阈值;The first preset condition includes that the first similarity is greater than a first similarity threshold;
    所述第二预设条件包括所述第二相似度大于第二相似度阈值。The second preset condition includes that the second similarity is greater than a second similarity threshold.
  10. 根据权利要求9所述的方法,其中,所述方法包括如下至少一项:The method of claim 9, wherein the method comprises at least one of the following:
    在所述待识别特征包括所述待检测目标的被遮挡部分的第二特征的情况下的所述第一相似度阈值,小于在所述待识别特征不包括所述第二特征的情况下的所述第一相似度阈值;The first similarity threshold in the case where the feature to be recognized includes the second feature of the occluded part of the object to be detected is smaller than that in the case where the feature to be recognized does not include the second feature the first similarity threshold;
    在所述待识别特征包括所述第二特征的情况下的所述第二相似度阈值,小于在所述待识别特征不包括所述第二特征的情况下的所述第二相似度阈值。The second similarity threshold when the feature to be identified includes the second feature is smaller than the second similarity threshold when the feature to be identified does not include the second feature.
  11. 根据权利要求8至10任一项所述的方法,其中,在所述获取所述待识别特征与所述预设目标的预存特征之间的第一相似度之前,所述方法还包括:The method according to any one of claims 8 to 10, wherein before the acquiring the first similarity between the to-be-identified feature and the pre-stored feature of the preset target, the method further comprises:
    响应于账号注册请求,为用户注册账号;In response to an account registration request, register an account for the user;
    从对所述用户拍摄得到的至少一帧第二图像中,确定满足预设质量要求的所述第二图像,并从确定的所述第二图像中提取所述用户的预设部位的特征;From at least one frame of the second image captured by the user, determine the second image that meets the preset quality requirements, and extract the feature of the preset part of the user from the determined second image;
    将所述预设部位的特征与所述账号建立关联,并将所述预设部位的特征保存作为所述预设目标的预存特征。Associating the feature of the preset part with the account, and saving the feature of the preset part as a pre-stored feature of the preset target.
  12. 根据权利要求5至11中任一项所述的方法,其中,在所述待检测目标被所述预设物体遮挡的情况下,在所述从所述第一图像中至少提取所述待检测目标的未被遮挡部分的第一特征之前,所述方法还包括以下至少一个步骤:The method according to any one of claims 5 to 11, wherein in the case that the object to be detected is blocked by the preset object, at least the extraction of the object to be detected from the first image is performed. Before the first feature of the unoccluded portion of the target, the method further includes at least one of the following steps:
    从包含所述待检测目标的多帧第一图像中,确定满足预设质量要求的所述第一图像作为进行后续特征提取的所述第一图像;From the multiple frames of first images containing the target to be detected, determine the first image that meets the preset quality requirements as the first image for subsequent feature extraction;
    对进行后续特征提取的所述第一图像进行预处理;Preprocessing the first image for subsequent feature extraction;
    对进行后续特征提取的所述第一图像进行活体检测,并在活体检测结果为所述待检测目标为活体的情况下,确定执行所述从所述第一图像中至少提取所述待检测目标的未被遮挡部分的第一特征及其后续步骤。Perform in vivo detection on the first image for which subsequent feature extraction is performed, and when the result of the in vivo detection is that the target to be detected is a living body, determine to perform the extraction of at least the target to be detected from the first image The first feature of the unoccluded part of , and its subsequent steps.
  13. 根据权利要求12所述的方法,其中,所述从包含所述待检测目标的多帧第一图像中,确定满足预设质量要求的所述第一图像作为进行后续特征提取的所述第一图像,包括:The method according to claim 12, wherein the first image that meets a preset quality requirement is determined from the multiple frames of first images including the target to be detected as the first image for subsequent feature extraction images, including:
    基于每帧所述第一图像的质量因子,对应得到每帧所述第一图像的质量分数,其中,所述第一图像的质量因子包括以下至少一者:所述待检测目标相对于拍摄器件的位姿信息、用于反映所述第一图像中待检测目标大小的参数信息、所述第一图像的亮度信息;Based on the quality factor of the first image of each frame, the quality score of the first image of each frame is correspondingly obtained, wherein the quality factor of the first image includes at least one of the following: the object to be detected is relative to the photographing device pose information, parameter information used to reflect the size of the target to be detected in the first image, and brightness information of the first image;
    基于所述质量分数,确定满足预设质量要求的所述第一图像作为进行后续特征提取的所述第一图像,其中,所述选择的第一图像的所述质量分数高于其他所述第一图像的质量分数。Based on the quality score, the first image that meets the preset quality requirement is determined as the first image for subsequent feature extraction, wherein the quality score of the selected first image is higher than that of the other first images. The quality score of an image.
  14. 根据权利要求12或13所述的方法,其中,所述对进行后续特征提取的所述第一图像进行预处理,包括:The method according to claim 12 or 13, wherein the preprocessing of the first image for subsequent feature extraction comprises:
    在所述第一图像包括多个所述待检测目标的情况,确定满足预设提取要求的所述待检测目标在所述第一图像中的目标区域,并去除所述第一图像中除所述目标区域以外的图像部分;和/或,In the case that the first image includes a plurality of the objects to be detected, determine the target area of the objects to be detected in the first image that meets the preset extraction requirements, and remove all the objects in the first image. parts of the image outside the stated target area; and/or,
    检测到所述第一图像中所述待检测目标的倾斜角度大于预设角度,并将所述第一图像旋转至所述待检测目标的倾斜角度小于或等于所述预设角度。It is detected that the inclination angle of the object to be detected in the first image is greater than a preset angle, and the first image is rotated so that the inclination angle of the object to be detected is smaller than or equal to the preset angle.
  15. 根据权利要求14所述的方法,其中,所述预设提取要求包括所述待检测目标对应区域的面积大于其他待检测目标对应区域的面积,所述其他待检测目标包括除所述待检测目标以外的目标。The method according to claim 14, wherein the preset extraction requirement includes that the area corresponding to the target to be detected is larger than the area of the corresponding area of other targets to be detected, and the other targets to be detected include areas other than the target to be detected. other goals.
  16. 根据权利要求10所述的方法,其中,所述待检测目标包括人脸,所述预设物 体包括口罩。The method according to claim 10, wherein the target to be detected comprises a human face, and the preset object comprises a mask.
  17. 一种图像检测装置,其中,包括:An image detection device, comprising:
    图像获取模块,配置为获取包含待检测目标的第一图像;an image acquisition module, configured to acquire a first image containing the target to be detected;
    目标检测模块,配置为对所述第一图像进行检测,得到所述第一图像的检测结果,其中,所述检测结果包括所述第一图像中的待检测目标是否被预设物体遮挡;a target detection module, configured to detect the first image to obtain a detection result of the first image, wherein the detection result includes whether the target to be detected in the first image is blocked by a preset object;
    操作执行模块,配置为执行与所述检测结果匹配的预设操作。An operation execution module configured to execute a preset operation matching the detection result.
  18. 一种电子设备,其中,包括存储器和处理器,所述处理器用于执行所述存储器中存储的程序指令,以实现权利要求1至16任一项所述的方法。An electronic device, comprising a memory and a processor, wherein the processor is configured to execute program instructions stored in the memory, so as to implement the method of any one of claims 1 to 16.
  19. 一种计算机可读存储介质,其上存储有程序指令,其中,所述程序指令被处理器执行时实现权利要求1至16任一项所述的方法。A computer-readable storage medium having program instructions stored thereon, wherein the program instructions, when executed by a processor, implement the method of any one of claims 1 to 16.
  20. 一种计算机程序,其中,包括计算机可读代码,当所述计算机可读代码在电子设备中运行时,所述电子设备中的处理器执行用于实现权利要求1至16任一项所述的方法。A computer program, comprising computer-readable codes, when the computer-readable codes are executed in an electronic device, a processor in the electronic device executes the method for realizing any one of claims 1 to 16. method.
PCT/CN2021/088718 2020-09-22 2021-04-21 Image detection method and related apparatus, device, storage medium, and computer program WO2022062379A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2021564951A JP2022552754A (en) 2020-09-22 2021-04-21 IMAGE DETECTION METHOD AND RELATED DEVICE, DEVICE, STORAGE MEDIUM, AND COMPUTER PROGRAM
KR1020217035770A KR20220042301A (en) 2020-09-22 2021-04-21 Image detection method and related devices, devices, storage media, computer programs

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202011002322.1A CN112115886A (en) 2020-09-22 2020-09-22 Image detection method and related device, equipment and storage medium
CN202011002322.1 2020-09-22

Publications (1)

Publication Number Publication Date
WO2022062379A1 true WO2022062379A1 (en) 2022-03-31

Family

ID=73801500

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/088718 WO2022062379A1 (en) 2020-09-22 2021-04-21 Image detection method and related apparatus, device, storage medium, and computer program

Country Status (4)

Country Link
JP (1) JP2022552754A (en)
KR (1) KR20220042301A (en)
CN (1) CN112115886A (en)
WO (1) WO2022062379A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114955772A (en) * 2022-05-30 2022-08-30 阿里云计算有限公司 Processing method and device for electric vehicle

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112115886A (en) * 2020-09-22 2020-12-22 北京市商汤科技开发有限公司 Image detection method and related device, equipment and storage medium
CN113158732A (en) * 2020-12-31 2021-07-23 深圳市商汤科技有限公司 Image processing method and related device
CN113065394B (en) * 2021-02-26 2022-12-06 青岛海尔科技有限公司 Method for image recognition of article, electronic device and storage medium
CN113449696B (en) * 2021-08-27 2021-12-07 北京市商汤科技开发有限公司 Attitude estimation method and device, computer equipment and storage medium
CN113792662B (en) * 2021-09-15 2024-05-21 北京市商汤科技开发有限公司 Image detection method, device, electronic equipment and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095829A (en) * 2014-04-29 2015-11-25 华为技术有限公司 Face recognition method and system
CN111444862A (en) * 2020-03-30 2020-07-24 深圳信可通讯技术有限公司 Face recognition method and device
CN111597910A (en) * 2020-04-22 2020-08-28 深圳英飞拓智能技术有限公司 Face recognition method, face recognition device, terminal equipment and medium
CN112115886A (en) * 2020-09-22 2020-12-22 北京市商汤科技开发有限公司 Image detection method and related device, equipment and storage medium

Family Cites Families (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007148872A (en) * 2005-11-29 2007-06-14 Mitsubishi Electric Corp Image authentication apparatus
JP4957056B2 (en) * 2006-04-11 2012-06-20 パナソニック株式会社 Face authentication system and face authentication method
JP5480532B2 (en) * 2009-04-30 2014-04-23 グローリー株式会社 Image processing apparatus, image processing method, and program for causing computer to execute the method
US9177130B2 (en) * 2012-03-15 2015-11-03 Google Inc. Facial feature detection
JP5871764B2 (en) * 2012-09-28 2016-03-01 セコム株式会社 Face recognition device
US20140282269A1 (en) * 2013-03-13 2014-09-18 Amazon Technologies, Inc. Non-occluded display for hover interactions
JP2017224186A (en) * 2016-06-16 2017-12-21 株式会社 日立産業制御ソリューションズ Security system
JP7015216B2 (en) * 2018-06-25 2022-02-02 株式会社日立製作所 Biometric program, biometric method
JP2020052788A (en) * 2018-09-27 2020-04-02 キヤノン株式会社 Image processing system and method therefor, and program
CN110110681A (en) * 2019-05-14 2019-08-09 哈尔滨理工大学 It is a kind of for there is the face identification method blocked
CN110826519B (en) * 2019-11-14 2023-08-18 深圳华付技术股份有限公司 Face shielding detection method and device, computer equipment and storage medium
JP6852779B2 (en) * 2019-12-12 2021-03-31 日本電気株式会社 Image recognition device, image recognition method, and image recognition program
CN111598065A (en) * 2020-07-24 2020-08-28 上海肇观电子科技有限公司 Depth image acquisition method, living body identification method, apparatus, circuit, and medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105095829A (en) * 2014-04-29 2015-11-25 华为技术有限公司 Face recognition method and system
CN111444862A (en) * 2020-03-30 2020-07-24 深圳信可通讯技术有限公司 Face recognition method and device
CN111597910A (en) * 2020-04-22 2020-08-28 深圳英飞拓智能技术有限公司 Face recognition method, face recognition device, terminal equipment and medium
CN112115886A (en) * 2020-09-22 2020-12-22 北京市商汤科技开发有限公司 Image detection method and related device, equipment and storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114955772A (en) * 2022-05-30 2022-08-30 阿里云计算有限公司 Processing method and device for electric vehicle

Also Published As

Publication number Publication date
JP2022552754A (en) 2022-12-20
KR20220042301A (en) 2022-04-05
CN112115886A (en) 2020-12-22

Similar Documents

Publication Publication Date Title
WO2022062379A1 (en) Image detection method and related apparatus, device, storage medium, and computer program
US8705813B2 (en) Identification device, identification method, and storage medium
CN105612533B (en) Living body detection method, living body detection system, and computer program product
WO2021036436A1 (en) Facial recognition method and apparatus
CN109858371A (en) The method and device of recognition of face
US8422746B2 (en) Face authentication system and authentication method thereof
TWI439951B (en) Facial gender identification system and method and computer program products thereof
CN109858439A (en) A kind of biopsy method and device based on face
CN113366487A (en) Operation determination method and device based on expression group and electronic equipment
CN105868689A (en) Cascaded convolutional neural network based human face occlusion detection method
CN107169458B (en) Data processing method, device and storage medium
Wang et al. InSight: recognizing humans without face recognition
WO2018192448A1 (en) People-credentials comparison authentication method, system and camera
CN107844742B (en) Facial image glasses minimizing technology, device and storage medium
CN108108711B (en) Face control method, electronic device and storage medium
US11227171B2 (en) Detection system, detection device and method therefor
US11074469B2 (en) Methods and systems for detecting user liveness
CN107609515B (en) Double-verification face comparison system and method based on Feiteng platform
CN110612530A (en) Method for selecting a frame for use in face processing
CN107992845A (en) A kind of face recognition the method for distinguishing and device, computer equipment
US20210182584A1 (en) Methods and systems for displaying a visual aid and enhancing user liveness detection
WO2021082548A1 (en) Living body testing method and apparatus, server and facial recognition device
JP2012212968A (en) Image monitoring apparatus
Zhang et al. Detection of Face Wearing Mask Based on AdaBoost and YCrCb
Schneider et al. Feature based face localization and recognition on mobile devices

Legal Events

Date Code Title Description
ENP Entry into the national phase

Ref document number: 2021564951

Country of ref document: JP

Kind code of ref document: A

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 21870768

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21870768

Country of ref document: EP

Kind code of ref document: A1