Mask wearing detection method, device and electronic equipment

By acquiring schlieren images and dividing image blocks based on airflow intensity to determine airflow difference, and combining airflow deviation threshold and mask threshold, the problem of low mask detection accuracy in existing technologies is solved, enabling accurate identification of oddly shaped and black masks and improving detection precision.

CN116665263BActive Publication Date: 2026-11-06ZHEJIANG UNIVIEW TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211371012.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-03
Publication Date
2026-11-06
Estimated Expiration
2042-11-03

AI Technical Summary

Technical Problem

Existing mask detection algorithms cannot identify special types of masks, such as oddly shaped masks and black masks, resulting in low accuracy of detection results.

Method used

By acquiring the schlieren image of the object to be detected, the image blocks are divided based on the airflow intensity corresponding to the schlieren image, and the airflow difference is judged. The detection result is determined by combining the airflow deviation threshold and the mask threshold, and the final judgment is made by combining the mask recognition algorithm.

Benefits of technology

It improves the accuracy of mask testing results, and can accurately identify special types of masks such as oddly shaped and black masks, thus enhancing the precision of the testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116665263B_ABST
    Figure CN116665263B_ABST
Patent Text Reader

Abstract

The application provides a mask wearing detection method and device and electronic equipment, and relates to the technical field of image processing. The method comprises the following steps: acquiring a schlieren image of a to-be-detected object; determining a detection result corresponding to the to-be-detected object based on the airflow intensity corresponding to the schlieren image; wherein the detection result comprises not wearing a mask or wearing a mask. In this way, the detection result corresponding to the to-be-detected object can be accurately determined based on the airflow intensity corresponding to the schlieren image, the problem of low accuracy of the mask detection result in the prior art is solved, and the accuracy of the mask detection result is effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing technology, and in particular to a method, apparatus and electronic device for detecting mask wearing. Background Technology

[0002] With the pandemic raging, wearing masks can prevent the spread of the virus to some extent. Therefore, mask-wearing checks are conducted at the entrances and exits of various public places to prevent the spread of the virus.

[0003] When conducting mask-wearing checks, access control devices are installed at entrances and exits. These devices use mask recognition algorithms to detect whether people are wearing masks. The results of the mask-wearing checks include whether someone is not wearing a mask or is wearing a mask.

[0004] However, mask recognition algorithms have certain limitations. For example, they cannot recognize oddly shaped masks or special types of masks such as black masks, which leads to lower accuracy in mask detection results. Summary of the Invention

[0005] This application provides a method, apparatus, and electronic device for detecting mask wearing, which solves the problem of low accuracy of mask detection results in the prior art, thereby effectively improving the accuracy of mask detection results.

[0006] This application provides a method for detecting mask wearing, which may include:

[0007] Obtain the schlieren image of the object to be detected.

[0008] Based on the airflow intensity corresponding to the schlieren image, the detection result corresponding to the object to be detected is determined; wherein, the detection result includes whether a mask is not being worn or a mask is being worn.

[0009] According to an embodiment of this application, a mask-wearing detection method is provided, wherein determining the detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image includes:

[0010] Starting from the center point of the face of the object to be detected in the schlieren image, the schlieren image is divided into multiple image blocks in sequence according to a preset offset interval in terms of the face orientation.

[0011] The detection result is determined based on the airflow intensity corresponding to the plurality of image blocks; wherein, the airflow intensity corresponding to the image block is determined by the average brightness of the image block.

[0012] According to an embodiment of this application, a mask wearing detection method is provided, the method further includes:

[0013] Face detection is performed on the schlieren image to determine the face coordinates and face contour of the object to be detected.

[0014] The center point of the face is determined based on the face coordinates and the face contour.

[0015] According to an embodiment of this application, a method for detecting mask wearing includes determining the detection result based on the airflow intensity corresponding to the plurality of image blocks, comprising:

[0016] Starting from the second image block among the plurality of image blocks, determine whether the difference between the airflow intensity corresponding to the first image block and the airflow intensity corresponding to the second image block is greater than the airflow deviation threshold.

[0017] If the difference is greater than or equal to the airflow deviation threshold, the distance between the second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance.

[0018] If the difference is less than the airflow deviation threshold, the third image block is determined as the new second image block, and the second image block is determined as the new first image block. It is then determined whether the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than the airflow deviation threshold. This process continues until the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than or equal to the airflow deviation threshold. Then, the distance between the new second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance.

[0019] According to an embodiment of this application, a method for detecting mask wearing includes determining the detection result based on the target distance, which includes:

[0020] If the target distance is greater than or equal to the mask threshold, the first detection result is determined to be that no mask is being worn; if the target distance is less than the mask threshold, the first detection result is determined to be that a mask is being worn.

[0021] The detection result corresponding to the object to be detected is determined based on the first detection result.

[0022] According to an embodiment of this application, a method for detecting mask wearing includes determining the detection result corresponding to the object to be detected based on the first detection result, comprising:

[0023] The first detection result is determined as the detection result;

[0024] or,

[0025] Obtain the second detection result corresponding to the object to be detected based on the mask recognition algorithm; if both the first detection result and the second detection result indicate that the object is wearing a mask, then the detection result is determined to be wearing a mask; if at least one of the first detection result and the second detection result indicates that the object is not wearing a mask, then the detection result is determined to be not wearing a mask.

[0026] According to an embodiment of this application, a mask wearing detection method is provided, the method further includes:

[0027] Obtain schlieren image samples of multiple preset objects wearing standard masks.

[0028] For each schlieren image sample, the offset interval corresponding to the schlieren image sample is determined based on finding the edge of the mask in the schlieren image sample, and the airflow deviation corresponding to the schlieren image sample is determined based on the offset interval.

[0029] The average value of the offset intervals corresponding to each of the multiple schlieren image samples is determined as the preset offset interval, and the average value of the airflow deviations corresponding to each of the schlieren image samples is determined as the airflow deviation threshold.

[0030] According to an embodiment of this application, a mask wearing detection method is provided, wherein the schlieren image is a schlieren image in a concave mirror, and the step of obtaining the schlieren image of the object to be detected includes:

[0031] Obtain the initial schlieren image corresponding to the object to be detected.

[0032] Based on the initial schlieren image, it is determined whether the object to be detected is located at the center of the concave mirror.

[0033] If the object to be detected is determined to be at the center position, the initial schlieren image is determined as the schlieren image.

[0034] This application also provides a mask wearing detection device, which may include:

[0035] The first acquisition unit is used to acquire the schlieren image of the object to be detected.

[0036] The first processing unit is used to determine the detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image; wherein the detection result includes whether or not a mask is being worn.

[0037] According to an embodiment of this application, a mask-wearing detection device is provided. The first processing unit is specifically used to divide the schlieren image into multiple image blocks based on a preset offset interval, starting from the center point of the face of the object to be detected in the schlieren image and in terms of the face orientation; and to determine the detection result based on the airflow intensity corresponding to the multiple image blocks; wherein, the airflow intensity corresponding to the image block is determined by the average brightness of the image block.

[0038] According to an embodiment of this application, a mask wearing detection device is provided, which further includes a second processing unit and a third processing unit.

[0039] The second processing unit is used to perform face detection on the schlieren image and determine the face coordinates and face contour of the object to be detected;

[0040] The third processing unit is used to determine the center point of the face based on the face coordinates and the face contour.

[0041] According to an embodiment of this application, a mask-wearing detection device is provided. The first processing unit is specifically configured to, starting from the second image block among the plurality of image blocks, determine whether the difference between the airflow intensity corresponding to the first image block and the airflow intensity corresponding to the second image block is greater than an airflow deviation threshold. If the difference is greater than or equal to the airflow deviation threshold, the distance between the second image block and the center point of the face is determined as a target distance, and the detection result is determined based on the target distance. If the difference is less than the airflow deviation threshold, a third image block is determined as a new second image block, and the second image block is determined as a new first image block. The difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is determined as greater than the airflow deviation threshold, until it is determined that the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than or equal to the airflow deviation threshold. Then, the distance between the new second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance.

[0042] According to an embodiment of this application, a mask-wearing detection device is provided. The first processing unit is specifically used to determine that if the target distance is greater than or equal to a mask threshold, the first detection result is that no mask is being worn; if the target distance is less than the mask threshold, the first detection result is that a mask is being worn; and to determine the detection result corresponding to the object to be detected based on the first detection result.

[0043] According to an embodiment of this application, a mask-wearing detection device is provided. The first processing unit is specifically used to determine the first detection result as the detection result; or to obtain a second detection result corresponding to the object to be detected based on a mask recognition algorithm; if both the first detection result and the second detection result are wearing a mask, then the detection result is determined to be wearing a mask; if at least one of the first detection result and the second detection result is not wearing a mask, then the detection result is determined to be not wearing a mask.

[0044] According to an embodiment of this application, a mask wearing detection device is provided, which further includes a second acquisition unit, a fourth processing unit, and a fifth processing unit.

[0045] The second acquisition unit is used to acquire schlieren image samples of multiple preset objects wearing standard masks.

[0046] The fourth processing unit is used to determine the offset interval corresponding to each schlieren image sample based on finding the mask edge in the schlieren image sample, and to determine the airflow deviation corresponding to the schlieren image sample based on the offset interval.

[0047] The fifth processing unit is used to determine the average value of the offset intervals corresponding to each of the multiple schlieren image samples as the preset offset interval, and to determine the average value of the airflow deviations corresponding to each of the schlieren image samples as the airflow deviation threshold.

[0048] According to an embodiment of this application, a mask wearing detection device is provided, wherein the schlieren image is a schlieren image in a concave mirror, and the first acquisition unit is specifically used to acquire an initial schlieren image corresponding to the object to be detected; based on the initial schlieren image, determine whether the object to be detected is located at the center position of the concave mirror; if it is determined that the object to be detected is located at the center position, determine the initial schlieren image as the schlieren image.

[0049] This application also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the mask wearing detection method as described above.

[0050] This application also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the mask-wearing detection method as described above.

[0051] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the mask wearing detection method as described above.

[0052] The mask-wearing detection method, apparatus, and electronic device provided in this application acquire a schlieren image of the object to be detected; based on the airflow intensity corresponding to the schlieren image, the detection result corresponding to the object to be detected is determined; wherein, the detection result includes not wearing a mask or wearing a mask. In this way, based on the airflow intensity corresponding to the schlieren image, the detection result corresponding to the object to be detected can be accurately determined, solving the problem of low accuracy of mask detection results in the prior art, thereby effectively improving the accuracy of mask detection results. Attached Figure Description

[0053] To more clearly illustrate the technical solutions in this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0054] Figure 1 This application provides a schematic diagram of airflow around the human body when wearing a mask and when not wearing a mask.

[0055] Figure 2 This is a schematic diagram of a mask-wearing detection system provided in an embodiment of this application;

[0056] Figure 3 A schematic flowchart illustrating a mask-wearing detection method provided in an embodiment of this application;

[0057] Figure 4 This is a flowchart illustrating a method for determining the detection result of an object to be detected based on the airflow intensity corresponding to a schlieren image, as provided in an embodiment of this application.

[0058] Figure 5 A schematic diagram illustrating the division of a schlieren image into multiple image blocks, provided as an embodiment of this application;

[0059] Figure 6 This is a schematic diagram of the structure of a mask-wearing detection device provided in an embodiment of this application;

[0060] Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application. Detailed Implementation

[0061] To make the objectives, technical solutions, and advantages of this application clearer, the technical solutions of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0062] In the embodiments of this application, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.

[0063] The technical solution provided in this application can be applied to mask-wearing detection scenarios. Currently, with the pandemic raging, wearing masks can prevent the spread of the virus to some extent. Therefore, access control devices are installed at the entrances and exits of various public places. These devices use mask recognition algorithms to detect whether people are wearing masks. The mask-wearing detection result includes whether someone is not wearing a mask or is wearing a mask.

[0064] However, mask recognition algorithms have certain limitations. For example, they cannot recognize oddly shaped masks or special types of masks such as black masks, which leads to lower accuracy in mask detection results.

[0065] To address the issue of low accuracy in existing mask testing technologies and effectively improve the accuracy of mask testing results, it is considered that airflow occurs when people are in a space, and the airflow around the human body differs between wearing a mask and not wearing a mask. For example, see... Figure 1 As shown, Figure 1 This application provides a schematic diagram of the airflow around a human body when wearing a mask and not wearing a mask. Based on this, this application provides a mask-wearing detection method, which acquires a schlieren image of the object to be detected; and determines the detection result corresponding to the object based on the airflow intensity corresponding to the schlieren image; wherein the detection result includes not wearing a mask or wearing a mask. In this way, based on the airflow intensity corresponding to the schlieren image, the detection result corresponding to the object to be detected can be accurately determined, solving the problem of low accuracy of mask detection results in the prior art, thereby effectively improving the accuracy of mask detection results.

[0066] To implement the mask-wearing detection method provided in this application, this application also provides a mask-wearing detection system. For example, see [link to relevant documentation]. Figure 2As shown, Figure 2 This diagram illustrates a mask-wearing detection system provided in this application embodiment. The system includes a facial recognition access control system, a concave mirror, and a camera. The access control system primarily handles user access permissions and mask-wearing detection. When a person faces the access control system for identity verification, they are positioned to the side relative to the concave mirror and camera. Since air density affects light refraction, the brightness changes in the mirror within the camera can be observed through the light source, camera, and concave mirror. When the point light source is on, light shines onto the concave mirror, and the reflected light converges to a single point. If the edge of the camera is considered a blade, the camera is directly behind the light point, and a dark spot, or schlieren, is formed in the concave mirror within the viewfinder. This schlieren image can be used in the mask-wearing detection method provided in this application embodiment, providing a detection basis for the mask-wearing detection method.

[0067] Where X1 represents the lateral distance between the access control system and the concave mirror, X2 represents the lateral distance between the camera and the concave mirror, and Y represents the longitudinal distance between the access control system and the concave mirror.

[0068] It should be noted that while personnel are verifying their identity at the access control system, the system also requests the camera to capture their facial image. If identity verification fails, it indicates that the person does not have access permission, and a "no permission" message can be output directly. If identity verification is successful, it indicates that the person has access permission, and it can be further determined whether the "mask detection function" is enabled. If the "mask detection function" is not enabled, "mask detection successful" can be output directly. If the "mask detection function" is enabled, the mask wearing detection method provided in this application embodiment can be used to detect mask wearing.

[0069] The mask-wearing detection method provided in this application will be described in detail below through several specific embodiments. It is understood that these specific embodiments can be combined with each other, and the same or similar concepts or processes may not be described again in some embodiments.

[0070] Example 1

[0071] Figure 3 This is a schematic flowchart illustrating a mask-wearing detection method provided in an embodiment of this application. This mask-wearing detection method can be executed by software and / or hardware devices. For examples, please refer to [link to example]. Figure 3 As shown, the mask-wearing detection method may include:

[0072] S301. Obtain the schlieren image of the object to be detected.

[0073] Among them, the schlieren image is the schlieren image in the concave mirror.

[0074] For example, when acquiring the schlieren image of the object to be tested, considering that if the object to be tested is not located at the center of the concave mirror, the clarity of the captured schlieren image will be poor. Therefore, in order to ensure that the acquired schlieren image is clear, we can first acquire an initial schlieren image of the object to be tested and determine whether the object to be tested is located at the center of the concave mirror based on the initial schlieren image. If it is determined that the object to be tested is located at the center of the concave mirror, it means that the initial schlieren image is clear. Therefore, the initial schlieren image can be directly determined as the schlieren image to be acquired in this step. This ensures that the acquired schlieren image is a high-clarity schlieren image, providing a better detection basis for subsequent mask wearing detection. Conversely, if the object to be tested is not located at the center of the concave mirror, it indicates that the initial schlieren image is unclear. Therefore, a new schlieren image needs to be acquired, and the object to be tested is then determined to be at the center of the concave mirror based on the new schlieren image. This process continues until the object to be tested is determined to be at the center of the concave mirror based on the new schlieren image, and the new schlieren image is then designated as the schlieren image to be acquired in this step. This ensures that the acquired schlieren image is a high-resolution schlieren image, providing a better basis for subsequent mask-wearing detection.

[0075] For example, when determining whether the object to be detected is at the center of the concave mirror based on the initial schlieren image, intelligent algorithms such as YOLO can be used to detect the initial schlieren image, determine the face coordinates in the initial schlieren image, and determine the center position of the concave mirror based on the horizontal distance X1 between the access control and the concave mirror, the horizontal distance X2 between the camera and the concave mirror, and the vertical distance Y between the access control and the concave mirror. Then, based on the center position of the concave mirror and the face coordinates, it can be determined whether the object to be detected is at the center position of the concave mirror. If the object to be detected is at the center position of the concave mirror, the initial schlieren image can be directly determined as the schlieren image to be acquired in this step. Conversely, if the object to be detected is not at the center position of the concave mirror, a prompt message can be output, prompting the person to move forward or backward, and a new schlieren image can be acquired. Then, based on the new schlieren image, it can be determined whether the object to be detected is at the center position of the concave mirror, until the object to be detected is determined to be at the center position of the concave mirror based on the new schlieren image, and the new schlieren image is determined as the schlieren image to be acquired in this step.

[0076] After obtaining the schlieren image of the object to be detected, the detection result corresponding to the object to be detected can be determined based on the airflow intensity corresponding to the schlieren image, that is, the following S302 is executed:

[0077] S302. Based on the airflow intensity corresponding to the schlieren image, determine the detection result corresponding to the object to be detected; wherein, the detection result includes whether or not a mask is being worn.

[0078] The airflow intensity can be determined by the average brightness in the schlieren image. In general, the average brightness in the schlieren image can be approximated as the airflow intensity corresponding to the schlieren image.

[0079] As can be seen, in this embodiment, a schlieren image of the object to be detected is acquired; and the detection result corresponding to the object to be detected is determined based on the airflow intensity corresponding to the schlieren image; wherein, the detection result includes whether a mask is being worn or not. In this way, based on the airflow intensity corresponding to the schlieren image, the detection result corresponding to the object to be detected can be accurately determined, solving the problem of low accuracy of mask detection results in the prior art, thereby effectively improving the accuracy of mask detection results.

[0080] Based on the above Figure 3 The illustrated embodiment, in order to facilitate understanding of how the detection result corresponding to the object to be detected is determined based on the airflow intensity corresponding to the schlieren image in the above-described S302, will be explained below. Figure 4 The second embodiment shown describes in detail the technical solution for determining the detection result of the object to be detected based on the airflow intensity corresponding to the schlieren image.

[0081] Example 2

[0082] Figure 4 This is a flowchart illustrating a method for determining the detection result of an object to be detected based on the airflow intensity corresponding to a schlieren image, as provided in an embodiment of this application. This method can also be executed by software and / or hardware devices. For examples, please refer to [link to example]. Figure 4 As shown, the method may include:

[0083] S401. Starting from the center point of the face of the object to be detected in the schlieren image, the schlieren image is divided into multiple image blocks in sequence according to the face orientation based on a preset offset interval.

[0084] Here, the center point of the face is the centroid position in the face region, and the preset offset interval can be understood as the distance the image region moves each time.

[0085] It is understood that, in the embodiments of this application, the setting of the preset offset interval is related to the setting of the subsequent airflow deviation threshold.

[0086] For example, in the embodiments of this application, when determining the center point of the face of the object to be detected in the schlieren image, face detection can be performed on the schlieren image first to determine the face coordinates and face contour of the object to be detected; and the center point of the face can be determined based on the face coordinates and face contour, thereby determining the center point of the face of the object to be detected in the schlieren image.

[0087] After determining the center point of the face of the object to be detected in the schlieren image, the schlieren image can be divided into multiple image blocks based on a preset offset interval, starting from the center point of the face of the object to be detected in the schlieren image, and proceeding sequentially along the face orientation. (See [reference needed]). Figure 5 As shown, Figure 5 This application provides a schematic diagram illustrating the division of a schlieren image into multiple image blocks, in conjunction with... Figure 5 As can be seen, starting from the center point of the face, the schlieren image is divided into n image blocks according to a preset offset interval along the face orientation. These n image blocks are image block 1, image block 2, ..., image block n. Image block 1 can be denoted as the first image block, image block 2 as the second image block, ..., image block n as the nth image block. The first image block is closest to the center point of the face, the second image block is second closest, ..., the nth image block is farthest from the center point of the face, thus dividing the schlieren image into n image blocks.

[0088] For example, in this embodiment of the application, when determining the preset offset interval and the airflow deviation threshold, schlieren image samples of multiple preset objects wearing standard masks can be obtained first. For each schlieren image sample, the offset interval corresponding to the schlieren image sample can be determined based on finding the mask edge in the schlieren image sample, and the airflow deviation corresponding to the schlieren image sample can be determined based on the offset interval; then, the average value of the offset intervals corresponding to multiple schlieren image samples is determined as the preset offset interval, and the average value of the airflow deviations corresponding to each schlieren image sample is determined as the airflow deviation threshold, thereby determining the preset offset interval and the airflow deviation threshold.

[0089] After dividing the image into multiple image blocks, the detection result can be determined based on the airflow intensity corresponding to the multiple image blocks, i.e., the following S402 is executed:

[0090] S402. Determine the detection result based on the airflow intensity corresponding to multiple image blocks; wherein, the airflow intensity corresponding to the image block is determined by the average brightness of the image block.

[0091] The airflow intensity corresponding to the image block can be determined by the average brightness of the image block region. In general, the average brightness of the image block region can be approximated as the airflow intensity corresponding to the image block.

[0092] For example, when determining the detection result based on the airflow intensity corresponding to multiple image blocks, considering that the first image block closest to the center point of the face does not have a preceding image block, it is possible to start from the second image block among the multiple image blocks and determine whether the difference between the airflow intensity corresponding to the first image block and the airflow intensity corresponding to the second image block is greater than the airflow deviation threshold. If the difference is greater than or equal to the airflow deviation threshold, the distance between the second image block and the center point of the face can be directly determined as the target distance, and the detection result can be determined based on the target distance.

[0093] Conversely, if the difference is less than the airflow deviation threshold, the third image block is determined as the new second image block, and the second image block is determined as the new first image block. It is then determined whether the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than the airflow deviation threshold. This process continues until the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than or equal to the airflow deviation threshold. In this case, the distance between the new second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance.

[0094] Combination Figure 5 As shown, assuming n image blocks are obtained, when determining the detection result based on the airflow intensity corresponding to the n image blocks, we can start from image block 2 and determine whether the difference between the airflow intensity corresponding to image block 1 and the airflow intensity corresponding to image block 2 is greater than the airflow deviation threshold. If it is less than the airflow deviation threshold, we continue to determine whether the difference between the airflow intensity corresponding to image block 2 and the airflow intensity corresponding to image block 3 is greater than the airflow deviation threshold. If it is still less than the airflow deviation threshold, we continue to determine whether the difference between the airflow intensity corresponding to image block 3 and the airflow intensity corresponding to image block 4 is greater than the airflow deviation threshold. If it is greater than the airflow deviation threshold, the distance between image block 4 and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance.

[0095] For example, when determining the detection result based on the target distance, if the target distance is greater than or equal to the mask threshold, the first detection result is determined to be not wearing a mask; if the target distance is less than the mask threshold, the first detection result is determined to be wearing a mask, thus obtaining the first detection result; then the detection result corresponding to the object to be tested is determined based on the first detection result.

[0096] For example, when determining the mask threshold, the target distance corresponding to each of multiple schlieren image samples can be determined first. To facilitate the distinction between the aforementioned "target distances," in this embodiment, the target distances corresponding to each of the multiple schlieren image samples can be denoted as target distance samples. It is understood that the method for determining the target distance sample corresponding to each schlieren image sample is similar to the method for determining the target distance corresponding to the schlieren image described above; please refer to the relevant description of determining the target distance corresponding to the schlieren image above. Here, this embodiment will not repeat the details.

[0097] Assuming that the identified multiple schlieren image samples each correspond to m target distance samples, namely: x1, x2, ..., xm, and these data follow a normal distribution, we can first calculate the mean and variance of this set of target distance samples, and then determine the mask threshold according to the quantiles of the normal distribution, specifically including:

[0098] First, calculate the mean μ and standard deviation σ for x1, x2, ..., xm to determine the expected value μ and variance σ. 2 The normal distribution can be denoted as N(μ,σ). 2 Different mask thresholds correspond to different accuracy of the first detection result. For example, under a normal curve, if the lower limit of the airflow deviation threshold is μ-2σ, it means that statistically, there is approximately a 97.73% probability of being judged as not wearing a mask, i.e., the correct identification rate of not wearing a mask is 97.73%. Of course, it also means that some cases that should not be judged as not wearing a mask are misjudged. A threshold of the form μ-kσ can be understood as the mask threshold. As k increases, the mask threshold decreases, thus encompassing more cases that should be judged as not wearing a mask, and simultaneously increasing the probability of identifying cases where a mask is worn as not wearing a mask. In other words, the larger k is, the smaller the probability of identifying cases where a mask is worn as not wearing a mask. It is understood that in the embodiments of this application, k does not need to be set to an integer. For each specific k and mask threshold μ-kσ, the statistically significant correct identification rate of not wearing a mask can be derived from the above normal distribution N(μ,σ). 2 The probability density function of ) is directly calculated, that is, the correct recognition rate P is:

[0099]

[0100] Where x represents the target distance sample corresponding to the schlieren image sample. Using the above formula, assuming a correct recognition rate P is set in advance, the corresponding k can be determined based on P, thereby determining μ-kσ, which is the mask threshold.

[0101] For example, when determining the detection result corresponding to the object to be detected based on the first detection result, depending on whether the final detection result corresponding to the object to be detected is determined solely based on the first detection result, the following two possible implementation methods may be included:

[0102] In one possible implementation, if the detection result corresponding to the final object to be detected is determined only based on the first detection result, then the first detection result can be directly determined as the final detection result corresponding to the object to be detected. In this way, based on the airflow intensity corresponding to the schlieren image, the detection result corresponding to the object to be detected can be accurately determined, which solves the problem of low accuracy of mask detection results in the prior art, thereby effectively improving the accuracy of mask detection results.

[0103] In another possible implementation, instead of determining the final detection result of the object to be detected solely based on the first detection result, the final detection result of the object to be detected is determined by combining the detection results obtained from the mask recognition algorithm. In this case, a second detection result corresponding to the object to be detected based on the mask recognition algorithm can be obtained. If both the first and second detection results indicate that the object is wearing a mask, then the detection result is determined to be wearing a mask. If at least one of the first and second detection results indicates that the object is not wearing a mask, then the detection result is determined to be not wearing a mask. By combining the first and second detection results corresponding to the object to be detected, the detection result corresponding to the object can be accurately determined, solving the problem of low accuracy in mask detection results in existing technologies, thereby effectively improving the accuracy of mask detection results.

[0104] For example, the mask recognition algorithm can be a visible light path and an infrared path input algorithm, or it can be other mask recognition algorithms. The specific algorithm can be set according to actual needs. Here, the embodiments of this application do not impose specific limitations.

[0105] The mask-wearing detection device provided in this application is described below. The mask-wearing detection device described below can be referred to in correspondence with the mask-wearing detection method described above.

[0106] Figure 6 This is a schematic diagram of a mask-wearing detection device provided in an embodiment of this application. For an example, please refer to [link / reference]. Figure 6 As shown, the mask-wearing detection device 60 may include:

[0107] The first acquisition unit 601 is used to acquire the schlieren image of the object to be detected.

[0108] The first processing unit 602 is used to determine the detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image; wherein the detection result includes whether or not a mask is being worn.

[0109] Optionally, the first processing unit 602 is specifically used to divide the schlieren image into multiple image blocks in the direction of the face orientation, starting from the center point of the face of the object to be detected in the schlieren image; and to determine the detection result based on the airflow intensity corresponding to the multiple image blocks; wherein the airflow intensity corresponding to the image block is determined by the average brightness of the image block.

[0110] Optionally, the mask-wearing detection device 60 also includes a second processing unit and a third processing unit.

[0111] The second processing unit is used to perform face detection on the schlieren image and determine the face coordinates and face contour of the object to be detected.

[0112] The third processing unit is used to determine the center point of the face based on the face coordinates and face contour.

[0113] Optionally, the first processing unit 602 is specifically configured to, starting from the second image block among multiple image blocks, determine whether the difference between the airflow intensity corresponding to the first image block and the airflow intensity corresponding to the second image block is greater than an airflow deviation threshold; if the difference is greater than or equal to the airflow deviation threshold, then the distance between the second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance; if the difference is less than the airflow deviation threshold, then the third image block is determined as the new second image block, the second image block is determined as the new first image block, and it is determined whether the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than the airflow deviation threshold, until it is determined that the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than or equal to the airflow deviation threshold, then the distance between the new second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance.

[0114] Optionally, the first processing unit 602 is specifically used to determine the first detection result as not wearing a mask if the target distance is greater than or equal to the mask threshold; and to determine the first detection result as wearing a mask if the target distance is less than the mask threshold; and to determine the detection result corresponding to the object to be detected based on the first detection result.

[0115] Optionally, the first processing unit 602 is specifically used to determine the first detection result as the detection result; or to obtain the second detection result corresponding to the object to be detected based on the mask recognition algorithm; if both the first detection result and the second detection result are wearing a mask, then the detection result is determined to be wearing a mask; if at least one of the first detection result and the second detection result is not wearing a mask, then the detection result is determined to be not wearing a mask.

[0116] Optionally, the mask wearing detection device 60 also includes a second acquisition unit, a fourth processing unit, and a fifth processing unit.

[0117] The second acquisition unit is used to acquire schlieren image samples of multiple preset objects wearing standard masks.

[0118] The fourth processing unit is used to determine the offset interval corresponding to each schlieren image sample based on finding the mask edge in the schlieren image sample, and to determine the airflow deviation corresponding to the schlieren image sample based on the offset interval.

[0119] The fifth processing unit is used to determine the average value of the offset intervals corresponding to each of the multiple schlieren image samples as the preset offset interval, and to determine the average value of the airflow deviations corresponding to each of the schlieren image samples as the airflow deviation threshold.

[0120] Optionally, the schlieren image is a schlieren image in a concave mirror. The first acquisition unit 601 is specifically used to acquire the initial schlieren image corresponding to the object to be detected; based on the initial schlieren image, determine whether the object to be detected is located at the center of the concave mirror; if it is determined that the object to be detected is located at the center, the initial schlieren image is determined as the schlieren image.

[0121] The mask-wearing detection device 60 provided in this application embodiment can execute the technical solution of the mask-wearing detection method in any of the above embodiments. Its implementation principle and beneficial effects are similar to those of the mask-wearing detection method. Please refer to the implementation principle and beneficial effects of the mask-wearing detection method. It will not be repeated here.

[0122] Figure 7 This is a schematic diagram of the physical structure of an electronic device provided in an embodiment of this application, such as... Figure 7 As shown, the electronic device may include a processor 710, a communications interface 720, a memory 730, and a communication bus 740. The processor 710, communications interface 720, and memory 730 communicate with each other via the communication bus 740. The processor 710 can call logical instructions in the memory 730 to execute a mask-wearing detection method. This method includes: acquiring a schlieren image of the object to be detected; determining a detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image; wherein the detection result includes whether a mask is being worn or not.

[0123] Furthermore, the logical instructions in the aforementioned memory 730 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0124] On the other hand, this application also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the mask-wearing detection method provided by the above methods. The method includes: acquiring a schlieren image of the object to be detected; determining a detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image; wherein the detection result includes not wearing a mask or wearing a mask.

[0125] In another aspect, this application also provides a non-transitory computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the mask-wearing detection method provided by the above methods, the method comprising: acquiring a schlieren image of a target object; determining a detection result corresponding to the target object based on the airflow intensity corresponding to the schlieren image; wherein the detection result includes not wearing a mask or wearing a mask.

[0126] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.

[0127] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.

[0128] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of this application, and are not intended to limit them. Although this application has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features. Such modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of this application.

Claims

1. A method for detecting mask wearing, characterized in that, include: Obtain the schlieren image of the object to be detected; Based on the airflow intensity corresponding to the schlieren image, the detection result corresponding to the object to be detected is determined; wherein, the detection result includes not wearing a mask or wearing a mask; The step of determining the detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image includes: Starting from the center point of the face of the object to be detected in the schlieren image, the schlieren image is divided into multiple image blocks in sequence based on a preset offset interval in the direction of the face orientation. The detection result is determined based on the airflow intensity corresponding to the plurality of image blocks; wherein, the airflow intensity corresponding to the image block is determined by the average brightness of the image block; Determining the detection result based on the airflow intensity corresponding to the plurality of image patches includes: Starting from the second image block among the plurality of image blocks, determine whether the difference between the airflow intensity corresponding to the first image block and the airflow intensity corresponding to the second image block is greater than the airflow deviation threshold; The detection result is determined based on whether the difference is greater than the airflow deviation threshold; The step of determining the detection result based on whether the difference is greater than the airflow deviation threshold includes: If the difference is greater than or equal to the airflow deviation threshold, the distance between the second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance. If the difference is less than the airflow deviation threshold, the third image block is determined as the new second image block, the second image block is determined as the new first image block, and it is determined whether the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than the airflow deviation threshold. This process continues until it is determined that the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than or equal to the airflow deviation threshold. Then, the distance between the new second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance. The step of determining the detection result based on the target distance includes: If the target distance is greater than or equal to the mask threshold, the first detection result is determined to be no mask being worn; if the target distance is less than the mask threshold, the first detection result is determined to be mask being worn; the detection result corresponding to the object to be detected is determined based on the first detection result.

2. The mask wearing detection method according to claim 1, characterized in that, The method further includes: Face detection is performed on the schlieren image to determine the face coordinates and face contour of the object to be detected; The center point of the face is determined based on the face coordinates and the face contour.

3. The mask wearing detection method according to claim 1, characterized in that, Determining the detection result corresponding to the object to be detected based on the first detection result includes: The first detection result is determined as the detection result; or, Obtain the second detection result corresponding to the object to be detected based on the mask recognition algorithm; if both the first detection result and the second detection result indicate that the object is wearing a mask, then the detection result is determined to be wearing a mask; if at least one of the first detection result and the second detection result indicates that the object is not wearing a mask, then the detection result is determined to be not wearing a mask.

4. The mask wearing detection method according to claim 1, characterized in that, The method further includes: Acquire schlieren image samples of multiple preset objects wearing standard masks; For each schlieren image sample, based on finding the mask edge in the schlieren image sample, the offset interval corresponding to the schlieren image sample is determined, and the airflow deviation corresponding to the schlieren image sample is determined based on the offset interval; The average value of the offset intervals corresponding to each of the multiple schlieren image samples is determined as the preset offset interval, and the average value of the airflow deviations corresponding to each of the schlieren image samples is determined as the airflow deviation threshold.

5. The mask wearing detection method according to any one of claims 1-2, characterized in that, The schlieren image is a schlieren image in a concave mirror, and the acquisition of the schlieren image of the object to be detected includes: Obtain the initial schlieren image corresponding to the object to be detected; Based on the initial schlieren image, it is determined whether the object to be detected is located at the center of the concave mirror; If the object to be detected is determined to be at the center position, the initial schlieren image is determined as the schlieren image.

6. A mask-wearing detection device, characterized in that, include: The first acquisition unit is used to acquire the schlieren image of the object to be detected; The first processing unit is used to determine the detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image; wherein, the detection result includes not wearing a mask or wearing a mask; The first processing unit is configured to determine the detection result corresponding to the object to be detected based on the airflow intensity corresponding to the schlieren image, including: Starting from the center point of the face of the object to be detected in the schlieren image, the schlieren image is divided into multiple image blocks in sequence based on a preset offset interval in the direction of the face orientation. The detection result is determined based on the airflow intensity corresponding to the plurality of image blocks; wherein, the airflow intensity corresponding to the image block is determined by the average brightness of the image block; The first processing unit is configured to determine the detection result based on the airflow intensity corresponding to the plurality of image patches, including: Starting from the second image block among the plurality of image blocks, determine whether the difference between the airflow intensity corresponding to the first image block and the airflow intensity corresponding to the second image block is greater than the airflow deviation threshold; The detection result is determined based on whether the difference is greater than the airflow deviation threshold; The step of determining the detection result based on whether the difference is greater than the airflow deviation threshold includes: If the difference is greater than or equal to the airflow deviation threshold, the distance between the second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance. If the difference is less than the airflow deviation threshold, the third image block is determined as the new second image block, the second image block is determined as the new first image block, and it is determined whether the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than the airflow deviation threshold. This process continues until it is determined that the difference between the airflow intensity corresponding to the new first image block and the airflow intensity corresponding to the new second image block is greater than or equal to the airflow deviation threshold. Then, the distance between the new second image block and the center point of the face is determined as the target distance, and the detection result is determined based on the target distance. The step of determining the detection result based on the target distance includes: If the target distance is greater than or equal to the mask threshold, the first detection result is determined to be that no mask is being worn; if the target distance is less than the mask threshold, the first detection result is determined to be that a mask is being worn. The detection result corresponding to the object to be detected is determined based on the first detection result.

7. An electronic device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the mask wearing detection method as described in any one of claims 1 to 5.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the mask wearing detection method as described in any one of claims 1 to 5.

9. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by the processor, it implements the mask wearing detection method as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Mask wearing recognition method, device and equipment and readable storage medium

    CN111523473A