Method, device, storage medium and processor for detecting safety cotton hat wearing

CN115527239BActive Publication Date: 2026-09-25PIPECHINA SOUTH CHINA CO +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211238737.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-10-11
Publication Date
2026-09-25
Estimated Expiration
2042-10-11

AI Technical Summary

Technical Problem

若施工人员未正确佩戴安全棉帽,则安全棉帽可能过度前倾或者后仰

Benefits of technology

[0019]通过上述技术方案,能够实时检测待检测对象是否佩戴有安全棉帽,在确定待检测对象的头部在待检测图像中的第一矩形区域,以及安全棉帽所在的第二矩形区域的情况下,确定第一矩形区域与第二矩形区域的宽度比值,通过宽度比值能够及时确定待检测对象佩戴安全棉帽的佩戴准确度,确保待检测对象的人身安全,避免由安全棉帽佩戴不准确而造成安全事故。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115527239B_ABST
    Figure CN115527239B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a method and device for detecting the wearing of a safety cotton cap, a storage medium and a processor. The method comprises: acquiring a to-be-detected image of a to-be-detected object by an image acquisition device; in the case where it is determined according to the to-be-detected image that the to-be-detected object wears a safety cotton cap on the head, determining a first rectangular region of the head of the to-be-detected object in the to-be-detected image, the first rectangular region including a second rectangular region where the safety cotton cap is located; determining the width ratio of the first rectangular region and the second rectangular region; and determining the wearing accuracy of the safety cotton cap worn by the to-be-detected object according to the width ratio. Through the above technical solution, it can be determined in real time whether the to-be-detected object wears a safety cotton cap, and the wearing accuracy of the safety cotton cap worn by the to-be-detected object can be determined in time through the width ratio, so as to ensure the personal safety of the to-be-detected object and avoid safety accidents caused by inaccurate wearing of the safety cotton cap.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of image processing, and more specifically to a method, apparatus, storage medium, and processor for detecting the wearing of a safety cap. Background Technology

[0002] Safety hats are protective gear used to prevent head injuries from impacts. A safety hat consists of a leather or leather outer shell, an inner shell, an insulation layer, and a lining. A certain amount of space is left between the shell and the lining to cushion and disperse the instantaneous impact force, thereby avoiding or reducing direct injury to the head. Safety hats provide wind protection, warmth, corrosion resistance, and are not prone to aging. They also have good shock absorption and penetration resistance.

[0003] When working in extremely cold environments, the proper wearing of safety helmets by construction workers is crucial to their safety. If workers do not wear their helmets correctly, the helmets may be tilted excessively forward or backward. A helmet tilted forward severely obstructs the worker's vision, preventing them from seeing the work situation ahead and potentially causing unnecessary injury. Due to the harsh temperatures and complex conditions at construction sites, a helmet tilted backward is insufficient to provide effective protection. Summary of the Invention

[0004] The purpose of this application is to provide a method, apparatus, storage medium, and processor for detecting the wearing of a safety cap.

[0005] To achieve the above objectives, the first aspect of this application provides a method for detecting the wearing of a safety cap, comprising:

[0006] The image of the object to be detected is acquired using an image acquisition device;

[0007] If it is determined from the image to be detected that the head of the object to be detected is wearing a safety cap, the head of the object to be detected is located in a first rectangular region in the image to be detected. The first rectangular region includes the second rectangular region where the safety cap is located.

[0008] Determine the width ratio between the first rectangular region and the second rectangular region;

[0009] The accuracy of the wearing of the safety cap on the object to be tested is determined based on the width ratio.

[0010] In embodiments of this application, the first rectangular region further includes a third rectangular region where the face of the subject to be tested is located. The method further includes: when it is determined that the subject to be tested is wearing a safety cap and the third rectangular region includes the frontal face of the subject to be tested, determining a first center point of a first target region corresponding to the nose of the subject to be tested in the first rectangular region; determining a second center point of a second target region corresponding to the lips of the subject to be tested in the second rectangular region and a target position point for the safety cap; determining the wearing accuracy of the safety cap worn by the subject to be tested based on a first distance between the first center point and the target position point and a second distance between the second center point and the first center point.

[0011] In embodiments of this application, the first rectangular region further includes a third rectangular region containing the face of the subject to be detected. Determining the wearing accuracy of the safety cap worn by the subject to be detected based on the width ratio includes: when the third rectangular region includes the frontal face of the subject to be detected, determining a first target value based on the width ratio and a first standard ratio; when the first target value is equal to a first numerical value, determining the wearing accuracy as a first accuracy; when the first target value is greater than or equal to a second numerical value and less than the first numerical value, or when the first target value is greater than the first numerical value and less than the third numerical value, determining the wearing accuracy as a second accuracy; when the first target value is greater than or equal to a third numerical value, or when the first target value is less than the second numerical value, determining the wearing accuracy as a third accuracy; wherein, the first accuracy is greater than the second accuracy, and the second accuracy is greater than the third accuracy.

[0012] In an embodiment of this application, the method further includes: if the wearing accuracy is determined to be a third accuracy, waiting for a preset time and then performing the step of acquiring the image of the object to be detected through the image acquisition device again, and detecting the image to be detected again to determine the wearing accuracy of the safety cap worn by the object to be detected again.

[0013] In embodiments of this application, the method further includes: determining a preset duration as a first preset duration when the width ratio is less than or equal to a first preset ratio; and determining a preset duration as a second preset duration when the width ratio is greater than the first preset ratio and less than or equal to a second preset ratio, wherein the second preset duration is greater than the first preset duration.

[0014] In an embodiment of this application, the method further includes: after re-determining the accuracy of the wearing of the safety cap worn by the object to be tested, determining the number of historical tests when the accuracy of the wearing of the safety cap worn by the object to be tested is the third accuracy; determining a correction coefficient for a preset duration based on the number of historical tests; and correcting the preset duration based on the correction coefficient, so as to acquire the image of the object to be tested again through the image acquisition device according to the corrected preset duration.

[0015] In the embodiments of this application, determining the wearing accuracy of the safety cap worn by the object to be tested based on the width ratio includes: when the third rectangular area includes the side face of the object to be tested, determining a second target value based on the width ratio and a second standard ratio; when the second target value is equal to a first value, determining the wearing accuracy as a first accuracy; when the second target value is greater than the first value and less than a third value, determining the wearing accuracy as a second accuracy; and when the second target value is greater than or equal to the third value, determining the wearing accuracy as a third accuracy.

[0016] A second aspect of this application provides a processor configured to perform the above-described method for detecting the wearing of a safety cap.

[0017] A third aspect of this application provides a device for detecting the wearing of a safety cap, including the processor described above.

[0018] A fourth aspect of this application provides a machine-readable storage medium storing instructions that, when executed by a processor, configure the processor to perform the aforementioned method for detecting the wearing of a safety cap.

[0019] The above technical solution can detect in real time whether the subject is wearing a safety cap. After determining that the subject's head is in the first rectangular area of ​​the image to be detected and the safety cap is in the second rectangular area, the width ratio of the first rectangular area to the second rectangular area can be determined. The width ratio can be used to determine the accuracy of the subject wearing the safety cap, ensuring the subject's personal safety and avoiding safety accidents caused by inaccurate wearing of the safety cap.

[0020] Other features and advantages of the embodiments of this application will be described in detail in the following detailed description section. Attached Figure Description

[0021] The accompanying drawings are provided to further illustrate the embodiments of this application and form part of the specification. They are used together with the following detailed description to explain the embodiments of this application, but do not constitute a limitation on the embodiments of this application. In the drawings:

[0022] Figure 1 The illustration shows a schematic flowchart of a method for detecting the wearing of a safety cap according to an embodiment of this application;

[0023] Figure 2 This illustration schematically shows an application environment diagram of a method for detecting the wearing of a safety cap according to an embodiment of this application;

[0024] Figure 3The diagram illustrates the internal structure of a computer device according to an embodiment of this application. Detailed Implementation

[0025] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the specific embodiments described herein are only for illustration and explanation of the embodiments of this application and are not intended to limit the embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0026] Figure 1 A schematic flowchart illustrating a method for detecting the wearing of a safety cap according to an embodiment of this application is shown. Figure 1 As shown in one embodiment of this application, a method for detecting the wearing of a safety cap is provided, comprising the following steps:

[0027] Step 101: Acquire the image of the object to be detected using an image acquisition device.

[0028] Step 102: If it is determined from the image to be detected that the head of the object to be detected is wearing a safety cap, the head of the object to be detected is located in a first rectangular region in the image to be detected. The first rectangular region includes the second rectangular region where the safety cap is located.

[0029] Step 103: Determine the width ratio of the first rectangular region to the second rectangular region.

[0030] Step 104: Determine the accuracy of the wearing of the safety cap on the object to be tested based on the width ratio.

[0031] When detecting objects wearing safety caps, the processor can acquire images of the objects through image acquisition devices. These devices can be cameras, camcorders, recorders, or other equipment with image acquisition capabilities. To acquire a large number of images of the objects in real time, intelligent cameras can be used. After capturing images of the objects, the intelligent camera can promptly transmit the acquired images to the processor via wireless transmission or priority transmission.

[0032] After acquiring the image to be detected, the processor can extract feature data from the image using the YOLOv3 algorithm and classify the feature data to determine whether the head of the object in the real-time image is wearing a safety cap. If it is determined from the image that the object is wearing a safety cap, the processor can further determine the first rectangular region of the object's head in the image. This first rectangular region may include a second rectangular region containing the safety cap. The length of the first rectangular region can be equal to the length of the second rectangular region.

[0033] If the processor determines, based on the image to be detected, that the object being detected is not wearing a safety cap, the processor can send an alarm and can re-acquire the image of the object after a specified interval, and determine whether the object is wearing a safety cap based on the re-acquired image. If a first rectangular region and a second rectangular region are defined, the processor can determine the width ratio between the first and second rectangular regions. The processor can further determine the accuracy of the safety cap being worn by the object based on the width ratio.

[0034] The above technical solution can detect in real time whether the subject is wearing a safety cap. After determining that the subject's head is in the first rectangular area of ​​the image to be detected and the safety cap is in the second rectangular area, the width ratio of the first rectangular area to the second rectangular area can be determined. The width ratio can be used to determine the accuracy of the subject wearing the safety cap, ensuring the subject's personal safety and avoiding safety accidents caused by inaccurate wearing of the safety cap.

[0035] In one embodiment, the first rectangular region further includes a third rectangular region where the face of the subject to be tested is located. The method further includes: when it is determined that the subject to be tested is wearing a safety cap and the third rectangular region includes the frontal face of the subject to be tested, determining a first center point of a first target region corresponding to the nose of the subject to be tested in the first rectangular region; determining a second center point of a second target region corresponding to the lips of the subject to be tested in the second rectangular region and a target position point for the safety cap; and determining the wearing accuracy of the safety cap worn by the subject to be tested based on a first distance between the first center point and the target position point and a second distance between the second center point and the first center point.

[0036] The first rectangular region may further include a third rectangular region encompassing the face of the subject being tested. If the subject is wearing a safety cap and the third rectangular region includes the subject's face, the processor can determine the first center point of the first target area within the first rectangular region corresponding to the subject's nose. The processor can further determine the second center point of the second target area within the second rectangular region corresponding to the subject's lips, and the target location point for the safety cap. The target location point may refer to the center point of the safety cap's brim. Having determined the first center point, the second center point, and the target location point, the processor can first determine the first distance between the first center point and the target location point, and the second distance between the second center point and the first center point. After determining the first and second distances, the processor can determine the accuracy of the safety cap's fit based on these distances.

[0037] Specifically, the processor can acquire preset first distance ratios, second distance ratios, third distance ratios, and fourth distance ratios. The first distance ratio is greater than or equal to 2 and less than the second distance ratio; the second distance ratio is greater than the first distance ratio and less than the third distance ratio; the third distance ratio is greater than the second distance ratio and less than the fourth distance ratio; and the fourth distance ratio is greater than the third distance ratio and less than or equal to 4. The processor can determine the distance ratio between the first and second distances. If the distance ratio is less than or equal to the first distance ratio, the processor can determine the wearing accuracy of the safety cap worn by the object under test as the first accuracy. The first accuracy can refer to a wearing accuracy of 90% or higher. In this case, the object under test is wearing the safety cap correctly, and no prompt for adjustment of the safety cap is required. If the distance ratio is greater than the first distance ratio and less than or equal to the second distance ratio, or greater than the second distance ratio and less than or equal to the third distance ratio, the processor can determine the wearing accuracy of the safety cap worn by the object under test as the second accuracy. The second level of accuracy can refer to a wearing accuracy of 80% to 90%. In this case, the subject is not wearing the safety cap correctly, and a prompt can be issued to adjust the cap to achieve an accuracy of over 90%. If the distance ratio is greater than the third distance ratio and less than or equal to the fourth distance ratio, the processor can also determine the wearing accuracy of the safety cap to be the third level of accuracy. The third level of accuracy can refer to a wearing accuracy of 60% to 80%. In this case, the subject is not wearing the safety cap correctly, and a prompt can be issued to adjust the cap to achieve an accuracy of over 80%.

[0038] like Figure 2As shown, the first center point can refer to the tip of the nose of the object to be tested in the first target area (A). The second center point can refer to the center point of the lips of the object to be tested in the second target area (B). The target position point can refer to the center point of the brim of the safety cap (C). The first distance between the first center point and the target position point is P, and the second distance between the second center point and the first center point is L0. The preset first distance ratio, second distance ratio, third distance ratio, and fourth distance ratio can be a1, a2, a3, and a4, respectively. If P / L0≤a1, the accuracy of the safety cap worn by the object to be tested is the first accuracy. If a1<P / L0≤a2 or a2<P / L0≤a3, the accuracy of the safety cap worn by the object to be tested is the second accuracy. If a3<P / L0≤a4, the accuracy of the safety cap worn by the object to be tested is the third accuracy.

[0039] In one embodiment, the first rectangular area further includes a third rectangular area containing the face of the subject to be detected. Determining the wearing accuracy of the safety cap worn by the subject to be detected based on the width ratio includes: when the third rectangular area includes the frontal face of the subject to be detected, determining a first target value based on the width ratio and a first standard ratio; when the first target value is equal to a first numerical value, determining the wearing accuracy as a first accuracy; when the first target value is greater than or equal to a second numerical value and less than the first numerical value, or when the first target value is greater than the first numerical value and less than the third numerical value, determining the wearing accuracy as a second accuracy; when the first target value is greater than or equal to a third numerical value, or when the first target value is less than the second numerical value, determining the wearing accuracy as a third accuracy; wherein, the first accuracy is greater than the second accuracy, and the second accuracy is greater than the third accuracy.

[0040] The first rectangular region may further include a third rectangular region containing the face of the object to be detected. When the third rectangular region includes the frontal face of the object to be detected, the processor can determine a first target value based on a width ratio and a first standard ratio. Specifically, the ratio between the width ratio and the first standard ratio can be determined as the first target value. The first standard ratio can refer to the ratio of the width of the area containing the head of the object to the width of the area containing the safety cap, assuming the safety cap is worn correctly and the third rectangular region includes the frontal face of the object. Upon determining the first target value, the processor can acquire preset first, second, and third values, and compare the first target value with each of these values ​​to determine the accuracy of the safety cap being worn by the object.

[0041] When the first target value equals the first numerical value, the processor determines the wearing accuracy as the first accuracy. When the first target value is greater than or equal to the second numerical value and less than the first numerical value, or when the first target value is greater than the first numerical value and less than the third numerical value, the processor determines the wearing accuracy as the second accuracy. When the first target value is greater than or equal to the third numerical value, or when the first target value is less than the second numerical value, the processor determines the wearing accuracy as the third accuracy. The first accuracy can refer to a wearing accuracy of 90% or higher, indicating that the subject is correctly wearing the safety cap. The second accuracy can refer to a wearing accuracy of 80% to 90%, indicating that the subject is not correctly wearing the safety cap. The third accuracy can refer to a wearing accuracy of 60% to 80%, indicating that the subject is not correctly wearing the safety cap.

[0042] In one embodiment, the method further includes: if the wearing accuracy is determined to be a third accuracy, waiting for a preset time and then performing the step of acquiring the image of the object to be detected through the image acquisition device again, and detecting the image to be detected again to determine the wearing accuracy of the safety cap worn by the object to be detected.

[0043] If the accuracy of wearing the hat is determined to be the third level, the processor can wait for a preset time and then execute the step of acquiring the image of the object to be detected through the image acquisition device again, and then detect the image of the object to be detected again to determine the accuracy of wearing the safety hat worn by the object to be detected.

[0044] In one embodiment, the method further includes: determining a preset duration as a first preset duration when the width ratio is less than or equal to a first preset ratio; and determining a preset duration as a second preset duration when the width ratio is greater than the first preset ratio and less than or equal to a second preset ratio, wherein the second preset duration is greater than the first preset duration.

[0045] When the wearing accuracy is determined to be the third accuracy level, the processor can obtain a first preset ratio and a second preset ratio, and compare the width ratio with the first preset ratio and the second preset ratio respectively. If the width ratio is less than or equal to the first preset ratio, the processor can determine the preset duration as the first preset duration. If the width ratio is greater than the first preset ratio and less than or equal to the second preset ratio, the processor can determine the preset duration as the second preset duration. The second preset duration is longer than the first preset duration.

[0046] In one embodiment, when the wearing accuracy is determined to be a third accuracy, the processor can also obtain a third preset ratio and a fourth preset ratio, and compare the width ratio with the third preset ratio and the fourth preset ratio, respectively. If the width ratio is greater than the second preset ratio and less than or equal to the third preset ratio, the preset duration is determined to be the third preset duration. If the width ratio is greater than the third preset ratio and less than or equal to the fourth preset ratio, the preset duration is determined to be the fourth preset duration. Wherein, the fourth preset duration is greater than the third preset duration, and the third preset duration is greater than the second preset duration.

[0047] After determining the third accuracy, the processor can obtain the first preset ratio and the second preset ratio, and compare the width ratio with the first preset ratio and the second preset ratio respectively. It should be noted that the third accuracy can be determined in two cases (the first target value is greater than or equal to the third value, or the first target value is less than the second value). However, the first preset ratio and the second preset ratio obtained in each case can be different values ​​or the same value, and the corresponding first preset duration and second preset duration can also be customized according to the actual situation.

[0048] In one embodiment, the method further includes: determining the historical number of times the accuracy of wearing the safety cap on the subject under test is the third accuracy, after re-determining the accuracy of wearing the safety cap on the subject under test; determining a correction coefficient for a preset duration based on the historical number of times of testing; and correcting the preset duration based on the correction coefficient, so as to acquire the image of the subject under test again through the image acquisition device according to the corrected preset duration.

[0049] After re-determining the accuracy of the safety cap worn by the subject under inspection, the processor can determine the number of historical inspections when the accuracy of the safety cap worn by the subject under inspection is at the third accuracy level. The processor can further determine a correction coefficient for a preset duration based on the historical inspection count. Specifically, the processor can compare the historical inspection count with a preset inspection count to determine the correction coefficient for the preset duration. For example, the processor can obtain a first preset inspection count W1, a second preset inspection count W2, a third preset inspection count W3, and a fourth preset inspection count W4, where 0 < W1 < W2 < W3 < W4. If the historical inspection count is less than or equal to the first preset inspection count W1, the correction coefficient for the preset duration is determined to be y1. If the historical inspection count is greater than the first preset inspection count W1 and less than or equal to the second preset inspection count W2, the correction coefficient for the preset duration is determined to be y2. If the historical inspection count is greater than the second preset inspection count W2 and less than or equal to the third preset inspection count W3, the correction coefficient for the preset duration is determined to be y3. If the number of historical detections is greater than the third preset number of detections W3 and less than or equal to the fourth preset number of detections W4, a correction coefficient of y4 is determined for the preset duration. The processor can adjust the preset duration according to the correction coefficient, so that the image of the object to be detected can be acquired again through the image acquisition device according to the adjusted preset duration.

[0050] In one embodiment, determining the wearing accuracy of the safety cap worn by the object to be tested based on the width ratio includes: when the third rectangular area includes the side face of the object to be tested, determining a second target value based on the width ratio and a second standard ratio; when the second target value is equal to a first value, determining the wearing accuracy as a first accuracy; when the second target value is greater than the first value and less than a third value, determining the wearing accuracy as a second accuracy; and when the second target value is greater than or equal to the third value, determining the wearing accuracy as a third accuracy.

[0051] When the third rectangular area includes the side profile of the object to be detected, the processor can determine a second target value based on the width ratio and a second standard ratio. Specifically, the processor can determine the second target value as the ratio between the width ratio and the second standard ratio. The second standard ratio can refer to the ratio of the width of the area containing the object's head to the width of the area containing the safety cap, assuming the safety cap is correctly worn and the third rectangular area includes the side profile of the object. Upon determining the second target value, the processor can acquire preset first, second, and third values, and compare the second target value with each of these values ​​to determine the accuracy of the safety cap's wearing on the object. If the second target value equals the first value, the processor determines the wearing accuracy as a first accuracy. If the second target value is greater than the first value and less than the third value, the processor determines the wearing accuracy as a second accuracy. If the second target value is greater than or equal to the third value, the processor determines the wearing accuracy as a third accuracy.

[0052] The above technical solution can detect in real time whether the subject is wearing a safety cap. After determining the first rectangular area where the subject's head is located and the second rectangular area where the safety cap is located in the image, the width ratio of the first rectangular area to the second rectangular area can be determined. The width ratio can be used to determine the accuracy of the subject wearing the safety cap, ensuring the subject's personal safety and avoiding safety accidents caused by inaccurate wearing of the safety cap.

[0053] Figure 1 This is a flowchart illustrating a method for detecting the wearing of a safety cap in one embodiment. It should be understood that, although... Figure 1 The steps in the flowchart are shown sequentially as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order in which these steps are executed, and they can be performed in other orders. Figure 1 At least some of the steps in the process may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least some of the sub-steps or stages of other steps.

[0054] In one embodiment, a processor is provided for running a program, wherein the program executes the method described above for detecting the wearing of a safety cap.

[0055] In one embodiment, a device for detecting the wearing of a safety cap is provided, including the processor described above.

[0056] In one embodiment, a storage medium is provided on which a program is stored, which, when executed by a processor, implements the method described above for detecting the wearing of a safety cap.

[0057] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 3 As shown. The computer device includes a processor A01, a network interface A02, a memory (not shown), and a database (not shown) connected via a system bus. The processor A01 provides computing and control capabilities. The memory includes internal memory A03 and a non-volatile storage medium A04. The non-volatile storage medium A04 stores an operating system B01, a computer program B02, and a database (not shown). The internal memory A03 provides an environment for the operation of the operating system B01 and the computer program B02 stored in the non-volatile storage medium A04. The database stores data such as the accuracy of the wearing of the object to be detected. The network interface A02 is used for communication with external terminals via a network connection. When the computer program B02 is executed by the processor A01, it implements a method for detecting the wearing of a safety cap.

[0058] Those skilled in the art will understand that Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0059] This application provides a device including a processor, a memory, and a program stored in the memory and executable on the processor. When the processor executes the program, it performs the following steps: acquiring an image of the object to be detected through an image acquisition device; determining, based on the image, that the object is wearing a safety cap, a first rectangular region in the image where the object's head is located, including a second rectangular region where the safety cap is located; determining the width ratio between the first and second rectangular regions; and determining the accuracy of the safety cap being worn by the object based on the width ratio.

[0060] In one embodiment, the first rectangular region further includes a third rectangular region where the face of the subject to be tested is located. The method further includes: when it is determined that the subject to be tested is wearing a safety cap and the third rectangular region includes the frontal face of the subject to be tested, determining a first center point of a first target region corresponding to the nose of the subject to be tested in the first rectangular region; determining a second center point of a second target region corresponding to the lips of the subject to be tested in the second rectangular region and a target position point for the safety cap; and determining the wearing accuracy of the safety cap worn by the subject to be tested based on a first distance between the first center point and the target position point and a second distance between the second center point and the first center point.

[0061] In one embodiment, the first rectangular area further includes a third rectangular area containing the face of the subject to be detected. Determining the wearing accuracy of the safety cap worn by the subject to be detected based on the width ratio includes: when the third rectangular area includes the frontal face of the subject to be detected, determining a first target value based on the width ratio and a first standard ratio; when the first target value is equal to a first numerical value, determining the wearing accuracy as a first accuracy; when the first target value is greater than or equal to a second numerical value and less than the first numerical value, or when the first target value is greater than the first numerical value and less than the third numerical value, determining the wearing accuracy as a second accuracy; when the first target value is greater than or equal to a third numerical value, or when the first target value is less than the second numerical value, determining the wearing accuracy as a third accuracy; wherein, the first accuracy is greater than the second accuracy, and the second accuracy is greater than the third accuracy.

[0062] In one embodiment, the method further includes: if the wearing accuracy is determined to be a third accuracy, waiting for a preset time and then performing the step of acquiring the image of the object to be detected through the image acquisition device again, and detecting the image to be detected again to determine the wearing accuracy of the safety cap worn by the object to be detected.

[0063] In one embodiment, the method further includes: determining a preset duration as a first preset duration when the width ratio is less than or equal to a first preset ratio; and determining a preset duration as a second preset duration when the width ratio is greater than the first preset ratio and less than or equal to a second preset ratio, wherein the second preset duration is greater than the first preset duration.

[0064] In one embodiment, the method further includes: determining the historical number of times the accuracy of wearing the safety cap on the subject under test is the third accuracy, after re-determining the accuracy of wearing the safety cap on the subject under test; determining a correction coefficient for a preset duration based on the historical number of times of testing; and correcting the preset duration based on the correction coefficient, so as to acquire the image of the subject under test again through the image acquisition device according to the corrected preset duration.

[0065] In one embodiment, determining the wearing accuracy of the safety cap worn by the object to be tested based on the width ratio includes: when the third rectangular area includes the side face of the object to be tested, determining a second target value based on the width ratio and a second standard ratio; when the second target value is equal to a first value, determining the wearing accuracy as a first accuracy; when the second target value is greater than the first value and less than a third value, determining the wearing accuracy as a second accuracy; and when the second target value is greater than or equal to the third value, determining the wearing accuracy as a third accuracy.

[0066] This application also provides a computer program product, which, when executed on a data processing device, is suitable for executing an initialization program having the following method steps: acquiring an image of a target object through an image acquisition device; determining, based on the image, that the target object is wearing a safety cap, a first rectangular region in the image where the target object's head is located, the first rectangular region including a second rectangular region where the safety cap is located; determining the width ratio between the first rectangular region and the second rectangular region; and determining the accuracy of the safety cap being worn by the target object based on the width ratio.

[0067] In one embodiment, the first rectangular region further includes a third rectangular region where the face of the subject to be tested is located. The method further includes: when it is determined that the subject to be tested is wearing a safety cap and the third rectangular region includes the frontal face of the subject to be tested, determining a first center point of a first target region corresponding to the nose of the subject to be tested in the first rectangular region; determining a second center point of a second target region corresponding to the lips of the subject to be tested in the second rectangular region and a target position point for the safety cap; and determining the wearing accuracy of the safety cap worn by the subject to be tested based on a first distance between the first center point and the target position point and a second distance between the second center point and the first center point.

[0068] In one embodiment, the first rectangular area further includes a third rectangular area containing the face of the subject to be detected. Determining the wearing accuracy of the safety cap worn by the subject to be detected based on the width ratio includes: when the third rectangular area includes the frontal face of the subject to be detected, determining a first target value based on the width ratio and a first standard ratio; when the first target value is equal to a first numerical value, determining the wearing accuracy as a first accuracy; when the first target value is greater than or equal to a second numerical value and less than the first numerical value, or when the first target value is greater than the first numerical value and less than the third numerical value, determining the wearing accuracy as a second accuracy; when the first target value is greater than or equal to a third numerical value, or when the first target value is less than the second numerical value, determining the wearing accuracy as a third accuracy; wherein, the first accuracy is greater than the second accuracy, and the second accuracy is greater than the third accuracy.

[0069] In one embodiment, the method further includes: if the wearing accuracy is determined to be a third accuracy, waiting for a preset time and then performing the step of acquiring the image of the object to be detected through the image acquisition device again, and detecting the image to be detected again to determine the wearing accuracy of the safety cap worn by the object to be detected.

[0070] In one embodiment, the method further includes: determining a preset duration as a first preset duration when the width ratio is less than or equal to a first preset ratio; and determining a preset duration as a second preset duration when the width ratio is greater than the first preset ratio and less than or equal to a second preset ratio, wherein the second preset duration is greater than the first preset duration.

[0071] In one embodiment, the method further includes: determining the historical number of times the accuracy of wearing the safety cap on the subject under test is the third accuracy, after re-determining the accuracy of wearing the safety cap on the subject under test; determining a correction coefficient for a preset duration based on the historical number of times of testing; and correcting the preset duration based on the correction coefficient, so as to acquire the image of the subject under test again through the image acquisition device according to the corrected preset duration.

[0072] In one embodiment, determining the wearing accuracy of the safety cap worn by the object to be tested based on the width ratio includes: when the third rectangular area includes the side face of the object to be tested, determining a second target value based on the width ratio and a second standard ratio; when the second target value is equal to a first value, determining the wearing accuracy as a first accuracy; when the second target value is greater than the first value and less than a third value, determining the wearing accuracy as a second accuracy; and when the second target value is greater than or equal to the third value, determining the wearing accuracy as a third accuracy.

[0073] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0074] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0075] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0076] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0077] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.

[0078] Memory may include non-persistent memory in computer-readable media, such as random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM. Memory is an example of computer-readable media.

[0079] Computer-readable media includes both permanent and non-permanent, removable and non-removable media that can store information using any method or technology. Information can be computer-readable instructions, data structures, modules of programs, or other data. Examples of computer storage media include, but are not limited to, phase-change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, CD-ROM, digital versatile optical disc (DVD) or other optical storage, magnetic tape, magnetic magnetic disk storage or other magnetic storage devices, or any other non-transferable medium that can be used to store information accessible by a computing device. As defined herein, computer-readable media does not include transient computer-readable media, such as modulated data signals and carrier waves.

[0080] It should also be noted that the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such process, method, article, or apparatus. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes that element.

[0081] The above are merely embodiments of this application and are not intended to limit the scope of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of the claims of this application.

Claims

1. A method for detecting the wearing of a safety cap, characterized in that, The method includes: The image of the object to be detected is acquired using an image acquisition device; If it is determined from the image to be detected that the head of the object to be detected is wearing a safety cap, a first rectangular region of the head of the object to be detected is determined in the image to be detected. The first rectangular region includes a second rectangular region where the safety cap is located and a third rectangular region where the face of the object to be detected is located. Determine the width ratio between the first rectangular region and the second rectangular region; The accuracy of the wearing of the safety cap by the object to be tested is determined based on the width ratio. The step of determining the accuracy of the wearing of the safety cap worn by the object to be tested based on the width ratio includes: When the third rectangular region includes the frontal face of the object to be detected, a first target value is determined based on the width ratio and the first standard ratio; If the first target value is equal to the first numerical value, the wearing accuracy is determined to be the first accuracy. If the first target value is greater than or equal to the second value and less than the first value, or if the first target value is greater than the first value and less than the third value, the wearing accuracy is determined to be the second accuracy. If the first target value is greater than or equal to the third value, or if the first target value is less than the second value, the wearing accuracy is determined to be the third accuracy. Wherein, the first accuracy is greater than the second accuracy, and the second accuracy is greater than the third accuracy; The step of determining the accuracy of the wearing of the safety cap worn by the object to be tested based on the width ratio further includes: When the third rectangular region includes the side profile of the object to be detected, a second target value is determined based on the width ratio and the second standard ratio; If the second target value is equal to the first value, the wearing accuracy is determined to be the first accuracy. If the second target value is greater than the first value and less than the third value, the wearing accuracy is determined to be the second accuracy. If the second target value is greater than or equal to the third value, the wearing accuracy is determined to be the third accuracy.

2. The method for detecting the wearing of a safety cap according to claim 1, characterized in that, The first rectangular region also includes a third rectangular region containing the face of the object to be detected, and the method further includes: If it is determined that the subject is wearing a safety cap and the third rectangular area includes the frontal face of the subject, then the first center point of the first target area corresponding to the nose of the subject is determined in the first rectangular area. Determine the second center point of the second target area corresponding to the lips of the object to be detected within the second rectangular region, and the target position point for the safety cap; The accuracy of the safety cap worn by the object to be tested is determined based on the first distance between the first center point and the target location point, and the second distance between the second center point and the first center point.

3. The method for detecting the wearing of a safety cap according to claim 1, characterized in that, The method further includes: If the wearing accuracy is determined to be the third accuracy, after waiting for a preset time, the step of acquiring the image of the object to be detected through the image acquisition device is executed again, and the image to be detected is detected again to determine the wearing accuracy of the safety cap worn by the object to be detected.

4. The method for detecting the wearing of a safety cap according to claim 3, characterized in that, The method further includes: If the width ratio is less than or equal to the first preset ratio, the preset duration is determined to be the first preset duration. If the width ratio is greater than the first preset ratio and less than or equal to the second preset ratio, the preset duration is determined to be the second preset duration, wherein the second preset duration is greater than the first preset duration.

5. The method for detecting the wearing of a safety cap according to claim 3, characterized in that, The method further includes: After re-determining the accuracy of the wearing of the safety cap on the subject to be tested, determine the number of historical tests when the accuracy of the wearing of the safety cap on the subject to be tested is the third accuracy. A correction coefficient for the preset duration is determined based on the number of historical detections. The preset duration is adjusted according to the correction coefficient, so that the image of the object to be detected is acquired again through the image acquisition device according to the adjusted preset duration.

6. A processor, characterized in that, It is configured to perform the method for detecting the wearing of a safety cap as described in any one of claims 1 to 5.

7. A device for detecting the wearing of a safety cap, characterized in that, The device includes the processor according to claim 6.

8. A machine-readable storage medium storing instructions thereon, characterized in that, When executed by a processor, the instruction causes the processor to be configured to perform the method for detecting the wearing of a safety cap according to any one of claims 1 to 5.

Citation Information

Patent Citations

  • Method, system and terminal for realizing wearing identification of safety helmet and computer readable storage medium

    CN109670441A

  • Mask wearing state identification method, device and equipment and readable storage medium

    CN112818953A