Safety helmet and reflective vest integrated detection method, system, device and storage medium

By using the YOLOv5s model to annotate the anchor frames of reflective vests and safety helmets in the video stream of a construction site, and combining inter-frame judgment and distance threshold, the problem of insufficient reflective vest detection in existing detection algorithms is solved, realizing integrated detection of safety helmets and reflective vests, improving detection accuracy and real-time performance, and reducing computational costs.

CN115830639BActive Publication Date: 2026-02-27XI AN JIAOTONG UNIV
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211614679.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-12-13
Publication Date
2026-02-27
Estimated Expiration
2042-12-13

AI Technical Summary

Technical Problem

Existing construction site safety detection algorithms often focus on detecting safety helmets while neglecting the detection of reflective clothing. This results in the detection of a single item, poor real-time performance, and poor usability. Furthermore, the recognition accuracy is insufficient in complex scenarios, leading to a large number of false positives and false negatives.

Method used

The YOLOv5s baseline model is used for target detection. Anchor frames for reflective clothing and safety helmets are marked. Whether the worker is wearing a safety helmet is determined by continuous frames. The anchor frame is assigned based on a preset ratio threshold and Euclidean distance, and anomaly detection information is generated.

Benefits of technology

This technology enables integrated detection of safety helmets and reflective vests, improving detection accuracy and real-time performance, reducing computational costs, eliminating safety hazards, and enhancing detection efficiency and reliability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115830639B_ABST
    Figure CN115830639B_ABST
Patent Text Reader

Abstract

The application belongs to the field of computer vision, and discloses a safety helmet and reflective vest integrated detection method, system, device and storage medium, which comprises the following steps: acquiring to-be-detected video stream information, extracting to-be-detected pictures frame by frame according to the to-be-detected video stream information, calling a preset target detection model, labeling reflective vest detection anchor frames and safety helmet detection anchor frames on each to-be-detected picture, and obtaining anchor frame labeling results of each to-be-detected picture; according to the anchor frame labeling results of each to-be-detected picture, taking the position of the labeled reflective vest detection anchor frame in each to-be-detected picture as a to-be-detected worker, and judging whether each to-be-detected worker has a safety helmet in continuous n to-be-detected pictures; when the current to-be-detected worker does not have a safety helmet in the continuous n to-be-detected pictures, generating detection abnormal information of the current to-be-detected worker. The safety helmet and reflective vest integrated detection method realizes integrated detection of safety helmets and reflective vests, and improves detection efficiency and reliability.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application belongs to the field of computer vision, and relates to a hard hat and reflective vest integrated detection method, system, device and storage medium. BACKGROUND

[0002] Target detection is a task of classifying and locating targets in images or videos, and has wide applications in many fields such as industry, agriculture, signal traffic and medical treatment. Therefore, for a long time, target detection technology has been a research hotspot and difficulty in the field of computer vision. The construction industry has the characteristics of many open high tasks, large variation of working conditions, complex on-site environment, limited work and many unsafe factors, and has been a relatively dangerous industry for a long time. Although safety accidents frequently occur on construction sites, most construction workers have poor safety protection awareness, and often do not wear safety hats or wear reflective vests due to laziness or a lucky mentality, which brings great safety hazards to construction work. In order to prevent trouble from happening, it is particularly important to timely and effectively remind construction workers to do a good job in self-protection.

[0003] In summary, the existing safety detection methods for construction workers on construction sites are as follows: (1) traditional manual detection, safety officers are set up at the entrance of the construction site and inside the construction site to manually check construction workers to detect whether workers wear safety hats or wear reflective vests. However, this method has strong personal subjectivity, low detection accuracy and slow detection speed. (2) using a two-stage detection algorithm represented by Faster RCNN to detect the safety of construction workers, although the detection accuracy is high, and to a certain extent, the labor cost is reduced, but the detection speed is slow, and it is more suitable for single frame picture detection scene, and cannot realize real-time detection of video stream. (3) using a single-stage detection algorithm represented by YOLO algorithm to detect the safety of construction workers, compared with the two-stage detection algorithm, the detection speed is faster.

[0004] However, the existing construction site safety detection algorithm at this stage often focuses on the detection of safety hats, ignoring the key factor of reflective vest detection. Secondly, the detection algorithm based on deep learning cannot completely and accurately judge each frame of the video stream when processing the construction site video stream with large noise, more interference and dense personnel. Unidentified target objects occur from time to time. And the existing detection algorithm can only identify safety hats or safety clothes, and lacks matching processing of safety hats and safety clothes for individuals, which leads to insufficient or repeated judgment of the warning object, which will inevitably produce a large number of false positives and false negatives. SUMMARY

[0005] The purpose of the present application is to overcome the shortcomings of the prior art, such as single detection object, poor real-time detection and poor usability, and to provide a safety helmet and reflective vest integrated detection method, system, device and storage medium.

[0006] To achieve the above purpose, the present application adopts the following technical solutions:

[0007] In a first aspect, the present application provides a safety helmet and reflective vest integrated detection method, comprising:

[0008] Obtain the to-be-detected video stream information, and extract the to-be-detected pictures frame by frame according to the to-be-detected video stream information;

[0009] Call a preset target detection model to label the reflective vest detection anchor box and the safety helmet detection anchor box on each frame of the to-be-detected picture, and obtain the anchor box labeling result of each frame of the to-be-detected picture;

[0010] According to the anchor box labeling result of each frame of the to-be-detected picture, the position of the labeled reflective vest detection anchor box in each frame of the to-be-detected picture is taken as a to-be-detected worker, and it is judged whether each to-be-detected worker has a safety helmet in the continuous n frames of to-be-detected pictures;

[0011] When the current to-be-detected worker does not have a safety helmet in the continuous n frames of to-be-detected pictures, generate detection abnormal information of the current to-be-detected worker.

[0012] Optionally, the preset target detection model is obtained by training a YOLOv5s benchmark model using a preset training set.

[0013] Optionally, the anchor box labeling result of the i-th frame of the to-be-detected picture in the anchor box labeling result of each frame of the to-be-detected picture is: Wherein, is the labeling information of the z-th anchor box of the anchor box labeling result of the i-th frame of the to-be-detected picture, and the labeling information includes the anchor box upper left corner coordinates, the anchor box lower right corner coordinates and the anchor box category Wherein, helmet is the safety helmet detection anchor box, and clothes is the reflective vest detection anchor box.

[0014] Optionally, according to the anchor box labeling result of each frame of the to-be-detected picture, the position of the labeled reflective vest detection anchor box in each frame of the to-be-detected picture is taken as a to-be-detected worker, and it is judged whether each to-be-detected worker has a safety helmet in the continuous n frames of to-be-detected pictures, comprising:

[0015] For each anchor box of each frame of the to-be-detected picture:

[0016] When , the current anchor box is taken as a to-be-detected worker and the to-be-detected worker is obtained according to the labeling information of the current anchor box Worker information: {position, has_helmet, left_frame}; where position represents the worker's position, has_helmet indicates whether a safety helmet is being worn (initial value: False), and left_frame represents the remaining number of frames in the current detection cycle (initial value: n).

[0017] According to the workers to be tested The worker's location is used to determine the worker to be tested. The position of the worker set W to be detected in the (i-1)th frame of the image to be detected i-1 The positional relationship of each worker to be tested;

[0018] When workers are waiting to be tested The worker's position is W i-1 The r-th worker to be tested The position of the worker to be detected in the i-th frame of the image is determined by the position of the worker to be detected. Worker information update for workers awaiting testing Worker information, and the workers to be tested The number of remaining frames in the current detection cycle in the worker information is reduced by 1;

[0019] When workers are waiting to be tested The worker's position is not W i-1 When any worker to be detected is positioned in the i-th frame of the image to be detected, the worker to be detected will be... Add to W i-1 In the process, after traversing all anchor box marker information of the anchor box marker results of the i-th frame of the image to be detected, the set W of the workers to be detected in the i-th frame of the image to be detected is obtained. i ;

[0020] when At that time, based on the current anchor frame's marking information and W i The worker information of each worker to be inspected is collected, the worker to be inspected belonging to the current anchor frame is determined, and has_helmet = True is set in the worker information of the worker to be inspected belonging to the current anchor frame; where has_helmet = True indicates that a safety helmet is being worn.

[0021] When the worker information of the worker to be detected has left_frame=0 and has_helmet=False, the worker to be detected does not have a safety helmet in any of the n consecutive frames of images to be detected.

[0022] Optionally, the step is based on the worker to be tested. The worker's location is used to determine the worker to be tested. The position of the worker set W to be detected in the (i-1)th frame of the image to be detected i-1The positional relationships of the workers to be tested include:

[0023] Get W i-1 The location of each worker to be tested, and according to W i-1 The location of each worker to be tested is determined, and W is calculated. i-1 The worker positions and the workers to be tested in the middle The area of ​​intersection between worker positions; and calculate W. i-1 The worker positions and the workers to be tested in the middle The intersection area between worker positions and The ratio of the area of ​​the anchor frame;

[0024] When W i-1 The r-th worker to be tested Worker location and worker to be tested The intersection area between worker positions and When the ratio of the anchor frame area to the total area is greater than a preset ratio threshold, the worker to be inspected... The worker's position is W i-1 The r-th worker to be tested The position in the image to be detected in the i-th frame;

[0025] When W i-1 The worker's location and the worker being tested are not found in the data. The intersection area between worker positions and When the ratio of the anchor frame area to the total area is greater than a preset ratio threshold, the worker to be inspected... The worker's position is not W i-1 The position of any worker to be detected in the i-th frame of the image to be detected.

[0026] Optionally, the step of matching the current anchor frame's marking information with W... i The worker information for each worker to be inspected is used to determine the workers to be inspected belonging to the current anchor frame, including:

[0027] Get W i The workers whose has_helmet=False in the worker information are identified to obtain the set of workers to be calculated.

[0028] Based on the current anchor frame's marking information, obtain the current anchor frame's position: (dx1, dy1) and (dx2, dy2); where (dx1, dy1) is the coordinate of the current anchor frame's top-left corner, and (dx2, dy2) is the coordinate of the current anchor frame's bottom-right corner.

[0029] According to W iworker information of each to-be-detected worker, obtaining worker positions of each to-be-detected worker in the to-be-calculated worker set: (wx1, wy1) and (wx2, wy2); wherein (wx1, wy1) is a left upper corner coordinate of a current to-be-detected worker, and (wx2, wy2) is a right lower corner coordinate of the current to-be-detected worker;

[0030] The center point coordinates (chx, chy) of the current anchor frame and the center point coordinates (ccx, ccy) of each to-be-detected worker in the to-be-calculated worker set are calculated by the following formula:

[0031]

[0032]

[0033] The Euclidean distance real_distance between the center point coordinates (ccx, ccy) of each to-be-detected worker in the to-be-calculated worker set and the center point coordinates (chx, chy) of the current anchor frame is calculated by the following formula:

[0034]

[0035] For each to-be-detected worker in the to-be-calculated worker set:

[0036] When chx < wx1 or chx > wx2, the maximum acceptable distance max_distance of the current to-be-detected worker to the current anchor frame is calculated by the following formula:

[0037]

[0038] y = |chy-ccy|

[0039]

[0040] When chx > wx1 and chx < wx2, the maximum acceptable distance max_distance of the current to-be-detected worker to the current anchor frame is calculated by the following formula:

[0041] x = |chx-ccx|

[0042]

[0043]

[0044] wherein h_threashld is a preset parameter;

[0045] For each to-be-calculated worker, when the Euclidean distance between the center point coordinate of the current to-be-detected worker and the center point coordinate of the current anchor frame is less than the maximum acceptable distance of the current to-be-detected worker to the current anchor frame, the to-be-detected worker to which the current anchor frame belongs is the current to-be-detected worker.

[0046] Optionally, the method further comprises: when the current to-be-detected worker does not exist in the safety helmet in the continuous n frames of to-be-detected pictures, saving the nth frame of to-be-detected picture; and rendering the detection abnormal information of the current to-be-detected worker on the nth frame of to-be-detected picture, and performing visual display.

[0047] In a second aspect, the present application provides a safety helmet and reflective vest integrated detection system, comprising:

[0048] The data acquisition module is configured to acquire to-be-detected video stream information, and extract to-be-detected pictures frame by frame according to the to-be-detected video stream information.

[0049] The target detection module is configured to call a preset target detection model, label reflective vest detection anchor frames and safety helmet detection anchor frames on each frame of to-be-detected picture, and obtain anchor frame labeling results of each frame of to-be-detected picture.

[0050] The abnormality detection module is configured to, according to the anchor frame labeling results of each frame of to-be-detected picture, take the position of the labeled reflective vest detection anchor frame in each frame of to-be-detected picture as a to-be-detected worker, and judge whether the safety helmet exists in the continuous n frames of to-be-detected pictures for each to-be-detected worker.

[0051] The abnormality processing module is configured to, when the current to-be-detected worker does not exist in the safety helmet in the continuous n frames of to-be-detected pictures, generate detection abnormal information of the current to-be-detected worker.

[0052] In a third aspect, the present application provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the safety helmet and reflective vest integrated detection method when executing the computer program.

[0053] In a fourth aspect, the present application provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program implements the steps of the safety helmet and reflective vest integrated detection method when executed by a processor.

[0054] Compared with the prior art, the present application has the following beneficial effects:

[0055] This invention presents an integrated detection method for safety helmets and reflective vests. By calling a preset target detection model, it marks reflective vest detection anchor frames and safety helmet detection anchor frames on each frame of the image to be detected, obtaining the anchor frame marking results for each frame. Then, based on these anchor frame marking results, the positions marked with reflective vest detection anchor frames in each frame are designated as workers to be detected. The method then determines whether each worker is wearing a safety helmet in n consecutive frames, ultimately achieving integrated detection of both safety helmets and reflective vests. This increases workers' awareness of the importance of wearing reflective vests correctly and significantly reduces the occurrence of potentially unsafe behaviors, which is of great significance for improving the safety of construction site production activities. Furthermore, by using the positions marked with reflective vest detection anchor frames in each frame as workers to be detected, workers farther from the camera are no longer considered abnormal detection targets in noisy, distracting, or densely populated scenes. This approach significantly reduces computational costs, as the algorithm only needs to detect the main figures in the current image frame, improving detection efficiency and reliability. Attached Figure Description

[0056] Figure 1 This is a flowchart of the integrated testing method for safety helmets and reflective vests according to an embodiment of the present invention.

[0057] Figure 2 This is a flowchart of the anchor frame processing for a single frame of an image to be detected, according to an embodiment of the present invention.

[0058] Figure 3 This is a schematic diagram illustrating the principle of the worker movement prediction algorithm in an embodiment of the present invention.

[0059] Figure 4 This is a schematic diagram illustrating the principle of the helmet ownership decision algorithm in an embodiment of the present invention.

[0060] Figure 5 This is an example diagram illustrating a system that issues a warning when a worker is not wearing a safety helmet, according to an embodiment of the present invention.

[0061] Figure 6 This is an example diagram illustrating the system's identification of workers wearing safety helmets and reflective vests in compliance with regulations, as shown in this embodiment of the invention.

[0062] Figure 7 This is an example diagram of the local video anomaly detection results according to an embodiment of the present invention. Detailed Implementation

[0063] In the following, the technical solutions in the embodiments of the present application will be described clearly and completely in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative efforts shall fall within the protection scope of the present application.

[0064] It should be noted that the terms "first", "second", and the like in the specification and claims of the present application and the above-described drawings are used to distinguish similar objects, and do not necessarily indicate a specific order or a chronological sequence. It should be understood that the data thus used can be interchanged under appropriate circumstances, so that the embodiments of the present application described herein can be implemented in an order other than that illustrated or described herein. In addition, the terms "include" and "have" and any variations thereof are intended to cover non-exclusive inclusion, for example, a process, method, system, product, or device including a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but can include other steps or units not clearly listed or inherent to the process, method, product, or device.

[0065] As discussed in the background, the current construction site safety detection method still has the following problems which have not been solved. First, the safety helmet and reflective vest recognition model has been relatively mature. When working on a construction site, wearing a reflective vest in compliance can alert passing personnel and vehicles, protecting the personal safety of workers. However, the current landing construction site safety detection algorithm often focuses on the detection of safety helmets, ignoring the detection of reflective vests, and integrated recognition schemes are even less. Second, the detection algorithm based on deep learning cannot make completely accurate judgments for each frame in the video stream when dealing with a construction site video stream with large scene noise, many interference objects, and dense personnel. Unidentified target objects occur from time to time. The current real-time detection algorithm can only identify safety helmets or safety vests, and there is insufficient research on simultaneous identification of both, and there is a lack of matching processing of safety helmets and safety vests for individuals, resulting in insufficient or repeated judgments of the warning object. This processing method will inevitably produce a large number of false positives and false negatives.

[0066] The present application will be described in further detail below in conjunction with the drawings:

[0067] Referring to Figure 1 In an embodiment of the present application, a safety helmet and reflective vest integrated detection method is provided, which effectively solves the technical problems of single detection object, poor real-time detection, and poor ease of use of traditional construction worker safety detection technology. Specifically, the method includes the following steps:

[0068] S1: Obtain to-be-detected video stream information, and extract to-be-detected pictures frame by frame according to the to-be-detected video stream information.

[0069] S2: Call a preset target detection model, label a reflective vest detection anchor box and a safety helmet detection anchor box on each frame of to-be-detected picture, and obtain an anchor box labeling result of each frame of to-be-detected picture.

[0070] S3: According to the anchor box labeling result of each frame of to-be-detected picture, the position of the labeled reflective vest detection anchor box in each frame of to-be-detected picture is taken as a to-be-detected worker, and whether each to-be-detected worker has a safety helmet in n consecutive frames of to-be-detected picture is judged.

[0071] S4: When the current to-be-detected worker does not have a safety helmet in n consecutive frames of to-be-detected picture, detection abnormal information of the current to-be-detected worker is generated.

[0072] In summary, the safety helmet and reflective vest integrated detection method of the present application calls a preset target detection model, labels a reflective vest detection anchor box and a safety helmet detection anchor box on each frame of to-be-detected picture, and obtains an anchor box labeling result of each frame of to-be-detected picture. Then, according to the anchor box labeling result of each frame of to-be-detected picture, the position of the labeled reflective vest detection anchor box in each frame of to-be-detected picture is taken as a to-be-detected worker, and whether each to-be-detected worker has a safety helmet in n consecutive frames of to-be-detected picture is judged. Finally, the safety helmet and reflective vest integrated detection is realized, the importance of workers wearing reflective vests in compliance is improved, the occurrence of behaviors with safety hazards is largely eliminated, and it is of great significance to improve the safety of production activities on construction sites. At the same time, the position of the labeled reflective vest detection anchor box in each frame of to-be-detected picture is regarded as a to-be-detected worker. In scenes with high scene noise, many interference objects and high personnel density, workers far from the camera position are no longer regarded as abnormal detection objects. This approach greatly reduces the computational cost, and the algorithm only needs to detect the main characters in the current picture frame, improving the detection efficiency and reliability of the algorithm.

[0073] In a possible implementation, the preset target detection model is obtained by training a YOLOv5s benchmark model using a preset training set.

[0074] Specifically, in the present embodiment, based on VOC2021, VOC2028 and safety clothes and safety helmet recognition competition public data set, 879, 313 and 1314 picture samples are selected respectively, and after being labeled according to VOC data format, they are used as a training set required for training. The YOLOv5s benchmark model is used for transfer learning on the training set, and the model after training is completed is used as the final target detection model.

[0075] The YOLOv5s benchmark model is used for transfer learning on the training set for both reflective vest and safety helmet objects, considering the difference in class prediction accuracy under unbalanced data sets. By dynamically adjusting the input ratio of safety helmet and reflective vest, the detection accuracy of the model for reflective vest and safety helmet is greatly improved, with a recall rate of 97.1% and 94.5% respectively, and the recognition accuracy is greatly improved.

[0076] In a possible implementation, the anchor box labeling result of the i-th frame of the to-be-detected picture is: wherein, is the labeling information of the z-th anchor box of the anchor box labeling result of the i-th frame of the to-be-detected picture, and the labeling information includes the upper-left corner coordinates of the anchor box, the lower-right corner coordinates of the anchor box, and the anchor box category wherein, helmet is a safety helmet detection anchor box, and clothes is a reflective vest detection anchor box.

[0077] Optionally, the method further includes: according to the anchor box labeling result of each frame of the to-be-detected picture, labeling the position of the reflective vest detection anchor box in each frame of the to-be-detected picture as a to-be-detected worker, and determining whether the to-be-detected worker exists in the safety helmet in the continuous n frames of the to-be-detected picture.

[0078] When , the current anchor box is taken as the to-be-detected worker , and the worker information of the to-be-detected worker is obtained according to the labeling information of the current anchor box: {position, has_helmet, left_frame}, wherein position represents the position of the worker, has_helmet represents whether the safety helmet is worn, the initial value is False, left_frame represents the remaining frame number of the current detection period, and the initial value is n; according to the position of the to-be-detected worker , the position relationship between the to-be-detected worker and each to-be-detected worker in the set W i-1 of to-be-detected workers in the i-1-th frame of the to-be-detected picture is determined; when the position of the to-be-detected worker is the position of the r-th to-be-detected worker i-1 in the set W of to-be-detected workers in the i-th frame of the to-be-detected picture, the worker information of the to-be-detected worker is updated according to the worker information of the to-be-detected worker , and the remaining frame number of the current detection period in the worker information of the to-be-detected worker is reduced by 1; when the position of the to-be-detected worker is not the position of the r-th to-be-detected worker i-1position of any worker in W in the i-th frame of the picture to be detected, the worker to be detected is added to W i-1 , all anchor box marking information of the anchor box marking result of the i-th frame of the picture to be detected is traversed, and a worker set W i .

[0079] When , according to the marking information of the current anchor box and the worker information of each worker in W i , the worker to be detected to which the current anchor box belongs is determined, and has_helmet in the worker information of the worker to be detected to which the current anchor box belongs is set to True; wherein has_helmet=True indicates that a safety helmet is worn; when left_frame=0 and has_helmet=False in the worker information of the worker to be detected, the current worker to be detected does not exist in the safety helmet in the continuous n frames of the picture to be detected.

[0080] Specifically, considering the complex real construction site environment, multiple workers may appear in the same camera, and the detection accuracy of the picture may be reduced due to mutual occlusion between workers. Therefore, the relative position of the reflective vest marked in the current picture to be detected is regarded as the worker to be detected, and the worker set W i of the i-th frame of the picture to be detected is recorded as W n ={w1, w2,..., wn}, wherein w j ={position, has_helmet, left_frame} represents the relevant information of the j-th worker to be detected, wherein position represents the position of the worker, i.e. the position information of the reflective vest of the worker, has_helmet represents whether a safety helmet is worn, and left_frame represents the remaining frame number of the current detection period, the initial value is n, if the safety helmet is not detected in the continuous n frames of detection, the picture will be saved in real time and an abnormal warning will be given. Otherwise, it is regarded as a normal situation.

[0081] Referring to Figure 2 , the specific steps are as follows:

[0082] Step 21, obtaining the anchor box marking result of each frame of the picture to be detected D={F1, F2,..., Fn}, i ,...}, represents the processing result of the i-th frame of the picture to be detected, and more processing results of the picture to be detected are stored in the set D with the playing of the video stream media. For a single element represents the upper left corner coordinate of the anchor box, represents the bottom-right coordinate of the anchor box, which can determine the anchor box position using two-point coordinates, represents the anchor box category, where cls e {helmet, clothes}.

[0083] Step 22, according to the time sequence, take F from the set D i , for F i each element , that is, each anchor box of each frame of the picture to be detected is processed.

[0084] Step 23, preferably, in order to consider the prediction of video streams of different resolutions, first, the coordinates corresponding to the anchor box are standardized, and the specific formula is as follows:

[0085]

[0086] Where pic_width is the width of the picture to be detected, and pic_height is the height of the picture to be detected.

[0087] Step 24, judge the anchor box category, if then the subsequent processing is carried out according to steps 241 and 242, if processing is carried out according to step 243.

[0088] Step 241, if represents the current anchor box is the position of a reflective clothing in the i-th frame. First, infer the position relationship between the current anchor box and the corresponding worker to be detected in the previous frame, that is, the set W i-1 , if the current anchor box is a worker to be detected in the new position of the i-th frame of the picture to be detected, update the position information of the worker w k , left_frame minus one updates the remaining frame number of the current detection cycle in the worker information. If the current anchor box does not match any worker to be detected in W i-1 , it indicates that a new worker to be detected k appears in the video stream. Initialize the worker to be detected k, where position is initialized as the anchor box position of the current anchor box, left_frame is initialized as n, and has_helmet is initialized as False. Finally, store the worker to be detected w k in the worker set W i .

[0089] Step 242, judge the current worker to be detected w kThe remaining frame count for the current detection cycle is left_frame. If the remaining frame count for the current detection cycle is 0 and has_helmet = False, it is considered that the worker to be detected has not been detected with a safety helmet in n consecutive frames of images to be detected, and the current frame of images to be detected is stored as an abnormal result; if the remaining frame count for the current detection cycle is 0 and has_helmet = True, it is considered that the worker to be detected has been detected with a safety helmet in n consecutive frames of images to be detected, then left_frame is set to the initial value n, has_helmet is set to the initial value False, and a new detection cycle begins.

[0090] Step 243, if This indicates that the current anchor frame is the position of the safety helmet of a worker to be detected in the i-th frame of the image to be detected. It infers the worker to be detected corresponding to the current safety helmet and sets has_helmet = True in the worker information of the worker to which the current anchor frame belongs.

[0091] In one possible implementation, see Figure 3 This provides a worker movement prediction algorithm, used to predict worker movement based on the movement of the worker to be detected. The worker's location is used to determine the worker to be tested. The position of the worker set W to be detected in the (i-1)th frame of the image to be detected i-1 The positional relationships of the workers to be tested are determined by the following steps:

[0092] Step 31, obtain W i-1 The location of each worker to be tested, and according to W i-1 The location of each worker to be tested is determined, and W is calculated. i-1 The worker positions and the workers to be tested in the middle The area of ​​the intersection between worker positions, cover_range; calculate W. i-1 The worker positions and the workers to be tested in the middle The intersection area between worker positions and The ratio of the anchor frame area to the cover_rate.

[0093] Step 32, when W i-1 The r-th worker to be tested Worker location and worker to be tested The intersection area between worker positions and When the ratio of the anchor frame area to the total area exceeds the preset ratio threshold w_threshold, the worker to be inspected... The worker's position is W i-1 The r-th worker to be tested The position in the image to be detected in the i-th frame; when Wi-1 The intersection area between the worker position of the worker to be detected and the anchor box area of the anchor box The ratio of the intersection area between the worker position of the worker to be detected and the anchor box area of the anchor box is greater than a preset ratio threshold value, and the worker position of the worker to be detected is not W The position of any worker to be detected in the i-th frame of the picture to be detected. i-1 The position of any worker to be detected in the i-th frame of the picture to be detected.

[0094] wherein w_threshold is valued according to actual experience, and is 0.6 in the embodiment.

[0095] In a possible implementation, a safety helmet attribution decision algorithm is provided, which is used to determine the worker to be detected to which the current anchor box belongs according to the label information of the current anchor box and the worker information of each worker to be detected in W i The worker to be detected to which the current anchor box belongs is determined according to the label information of the current anchor box and the worker information of each worker to be detected in W

[0096] Step 41, obtaining the worker to be detected whose has_helmet in the worker information in W i is False, to obtain a worker set to be calculated; obtaining the anchor box position of the current anchor box: (dx1, dy1) and (dx2, dy2) according to the label information of the current anchor box; wherein (dx1, dy1) is the left upper corner coordinate of the current anchor box, and (dx2, dy2) is the right lower corner coordinate of the current anchor box; obtaining the worker position of each worker to be detected in the worker set to be calculated according to the worker information of each worker to be detected in W i is False, to obtain a worker set to be calculated; obtaining the anchor box position of the current anchor box: (dx1, dy1) and (dx2, dy2) according to the label information of the current anchor box; wherein (dx1, dy1) is the left upper corner coordinate of the current anchor box, and (dx2, dy2) is the right lower corner coordinate of the current anchor box; obtaining the worker position of each worker to be detected in the worker set to be calculated according to the worker information of each worker to be detected in W

[0097] wherein if the has_helmet of the worker to be detected w j is True, it indicates that the safety helmet has been detected in the detection period, and it is not necessary to be detected again, and if the has_helmet of the worker to be detected w j is False, it is necessary to determine whether the safety helmet corresponding to the current anchor box belongs to the worker to be detected.

[0098] Step 42, calculating the center point coordinates (chx, chy) of the current anchor box and the center point coordinates (ccx, ccy) of each worker to be detected in the worker set to be calculated by the following formula:

[0099]

[0100]

[0101] ​Step 43, calculate the Euclidean distance real_distance between the center point coordinate (ccx, ccy) of each to-be-detected worker in the to-be-calculated worker set and the center point coordinate (chx, chy) of the current anchor frame by the following formula:

[0102]

[0103] Step 44, for each to-be-detected worker in the to-be-calculated worker set: when chx < wx1 || chx > wx2, calculate the maximum acceptable distance max_distance of the current to-be-detected worker to the current anchor frame by the following formula:

[0104]

[0105] y = |chy-ccy|

[0106]

[0107] When chx > wx1 & chx < wx2, calculate the maximum acceptable distance max_distance of the current to-be-detected worker to the current anchor frame by the following formula:

[0108] x = |chx-ccx|

[0109]

[0110]

[0111] Wherein, h_threashld is a preset parameter, which is taken as 0.95 in the embodiment.

[0112] Step 45, for each to-be-detected worker in the to-be-calculated worker set: when the Euclidean distance between the center point coordinate of the current to-be-detected worker and the center point coordinate of the current anchor frame is less than the maximum acceptable distance of the current to-be-detected worker to the current anchor frame, the to-be-detected worker to which the current anchor frame belongs is the current to-be-detected worker.

[0113] Referring to Figure 4 , the principle of the hard hat attribution decision algorithm is illustrated, wherein (1) represents the recognition result of the hard hat on both sides of the reflective vest when the to-be-detected worker turns sideways, (2) represents the farthest acceptable distance of the hard hat from the reflective vest under the condition of (1), (3) represents the recognition result of the hard hat above the reflective vest when the to-be-detected worker stands straight, and (4) represents the farthest acceptable distance of the hard hat from the reflective vest under the condition of (3).

[0114] In a possible implementation, the safety helmet and reflective vest integrated detection method further includes: when the current worker to be detected does not exist in the safety helmet in the continuous n frames of the to-be-detected pictures, saving the nth frame of the to-be-detected picture; and rendering the detection abnormal information of the current worker to be detected on the nth frame of the to-be-detected picture, and performing visual display.

[0115] Specifically, in the embodiment, the front-end page is developed by using Vue.js and Element-UI components, in the back-end development work, the target detection and abnormal detection functions are completed by using Python language. The Vue.js file is packaged and deployed to the server, the Ajax asynchronous request is sent through the Axios library, the front-end data is submitted to the back-end, and the response result is returned after the back-end processing, and the data interaction is completed.

[0116] The left side of the front-end page is a menu bar, providing an image detection entrance and a video stream detection entrance. In the “image detection” sub-page, after the user uploads the to-be-detected picture, the Axios library is used to send an Ajax asynchronous request, and the picture data is uploaded to the back-end. The back-end interface responds to the request and receives the data for target detection, sends the detection result to the front-end, and performs page rendering to display the detection result. When the system detects that the worker does not wear a safety helmet or a reflective vest in compliance, a warning is given; otherwise, it is prompted that it can pass normally. Under the “video detection” menu, there are two secondary sub-menus of “local video upload detection” and “camera data real-time monitoring”. In the “local video upload detection” sub-page, the user uploads the to-be-detected video, and the video stream data is submitted to the back-end through the Axios library. The back-end view function decomposes the received video stream into multiple to-be-detected picture samples frame by frame, processes the abnormal detection algorithm, and saves the picture frames determined as abnormal. After the front-end sends a request to display the abnormal picture, the back-end responds to the request, sends the abnormal picture frame to the front-end for page refreshing and rendering. The data sending and result display in the “camera data real-time monitoring” sub-page are similar to the processing process in the “local video upload detection” sub-page, which will not be described here.

[0117] An abnormal detection system visualization platform is provided, which provides image target detection function and video stream abnormal detection function. The multi-target detection function of safety helmet and reflective vest is realized, which can be used in the detection scene of safety helmet and reflective vest wearing when workers enter the construction site. When the system detects that the worker does not wear a safety helmet or a reflective vest in compliance, a warning is given, otherwise it is prompted that it can pass normally, which improves the safety awareness of workers. The real-time abnormal detection and safety warning function for video stream data is provided, the real-time warning greatly reduces the probability of safety accidents, and eliminates potential safety hazards of production activities. In addition, the front-end page of the visualization platform is friendly, the interoperability is strong, the back-end algorithm calculation speed is fast, and the usability is strong.

[0118] Referring to Figure 5 , when it is detected that the worker does not comply with wearing a safety helmet or a reflective vest, the system gives a warning that there is a safety hazard. Referring to Figure 6 , when it is detected that the worker complies with wearing a safety helmet and a reflective vest, the system gives a normal passing prompt. Referring to Figure 7 , the "local video upload detection" subpage display, the user uploads the video to be detected, and the system performs abnormal detection on the video stream. If the detection result is abnormal, the picture frame with the abnormality is displayed in the page.

[0119] The following is an apparatus embodiment of the present application, which can be used to execute the method embodiment of the present application. For details not disclosed in the apparatus embodiment, please refer to the method embodiment of the present application.

[0120] In another embodiment of the present application, a safety helmet and reflective vest integrated detection system is provided, which can be used to implement the safety helmet and reflective vest integrated detection method described above. Specifically, the safety helmet and reflective vest integrated detection system includes a data acquisition module, a target detection module, an abnormality detection module, and an abnormality processing module. The data acquisition module is configured to acquire video stream information to be detected and extract a picture to be detected frame by frame according to the video stream information to be detected. The target detection module is configured to call a preset target detection model, label a reflective vest detection anchor box and a safety helmet detection anchor box on each frame of the picture to be detected, and obtain an anchor box labeling result of each frame of the picture to be detected. The abnormality detection module is configured to take the position of the reflective vest detection anchor box labeled in each frame of the picture to be detected as a worker to be detected, and determine whether each worker to be detected has a safety helmet in consecutive n frames of the picture to be detected. The abnormality processing module is configured to generate detection abnormality information of the current worker to be detected when the current worker to be detected does not have a safety helmet in consecutive n frames of the picture to be detected.

[0121] In a possible implementation, the preset target detection model is obtained by training a YOLOv5s benchmark model using a preset training set.

[0122] In a possible implementation, the anchor box labeling result of the i-th frame of the picture to be detected in the anchor box labeling result of each frame of the picture to be detected is: wherein, is the labeling information of the z-th anchor box of the anchor box labeling result of the i-th frame of the picture to be detected, and the labeling information includes an anchor box upper left corner coordinate, an anchor box lower right corner coordinate, and an anchor box category wherein, helmet is a safety helmet detection anchor box, and clothes is a reflective vest detection anchor box.

[0123] In one possible implementation, the step of determining whether a worker is wearing a safety helmet in each of the n consecutive frames of images to be detected, based on the anchor frame marking results of each frame of images to be detected, using the positions of the anchor frames marked with reflective vest detection anchor frames as the workers to be detected, and determining whether each worker to be detected is wearing a safety helmet in the n consecutive frames of images to be detected includes: for each anchor frame of each frame of images to be detected: when At that time, the current anchor frame is used as the worker to be inspected. And obtain the workers to be inspected based on the current anchor frame marking information. Worker information: {position, has_helmet, left_frame}; where position represents the worker's position, has_helmet indicates whether a safety helmet is being worn (initially False), and left_frame represents the remaining frames in the current detection cycle (initially n); based on the worker to be detected... The worker's location is used to determine the worker to be tested. The position of the worker set W to be detected in the (i-1)th frame of the image to be detected i-1 The positional relationship of each worker to be tested; when the workers to be tested... The worker's position is W i-1 The r-th worker to be tested The position of the worker to be detected in the i-th frame of the image is determined by the position of the worker to be detected. Worker information update for workers awaiting testing Worker information, and the workers to be tested The remaining number of frames in the current detection cycle in the worker information is decremented by 1; when the worker to be detected... The worker's position is not W i-1 When any worker to be detected is positioned in the i-th frame of the image to be detected, the worker to be detected will be... Add to W i-1 In the process, after traversing all anchor box marker information of the anchor box marker results of the i-th frame of the image to be detected, the set W of the workers to be detected in the i-th frame of the image to be detected is obtained. i ;when At that time, based on the current anchor frame's marking information and W i The worker information of each worker to be detected is collected, the worker to which the current anchor frame belongs is determined, and has_helmet = True in the worker information of the worker to which the current anchor frame belongs. Where has_helmet = True means that a safety helmet is worn. When left_frame = 0 and has_helmet = False in the worker information of the worker to be detected, the worker to be detected does not have a safety helmet in any of the n consecutive frames of the images to be detected.

[0124] In one possible implementation, the method based on the worker to be tested... The worker's location is used to determine the worker to be tested. The position of the worker set W to be detected in the (i-1)th frame of the image to be detected i-1 The positional relationships of the workers to be tested include: obtaining W i-1 The location of each worker to be tested, and according to W i-1 The location of each worker to be tested is determined, and W is calculated. i-1 The worker positions and the workers to be tested in the middle The area of ​​intersection between worker positions; and calculate W. i-1 The worker positions and the workers to be tested in the middle The intersection area between worker positions and The ratio of the area of ​​the anchor frame; when W i-1 The r-th worker to be tested Worker location and worker to be tested The intersection area between worker positions and When the ratio of the anchor frame area to the total area is greater than a preset ratio threshold, the worker to be inspected... The worker's position is W i-1 The r-th worker to be tested The position in the image to be detected in the i-th frame; when W i-1 The worker's location and the worker being tested are not found in the data. The intersection area between worker positions and When the ratio of the anchor frame area to the total area is greater than a preset ratio threshold, the worker to be inspected... The worker's position is not W i-1 The position of any worker to be detected in the i-th frame of the image to be detected.

[0125] In one possible implementation, the step of matching the current anchor frame's marking information with W... i The worker information of each worker to be inspected is used to determine the worker to be inspected belonging to the current anchor frame, including: obtaining W. i The workers to be detected whose has_helmet = False in the worker information are used to obtain the worker set to be calculated; based on the current anchor frame's marker information, the anchor frame positions of the current anchor frame are obtained: (dx1, dy1) and (dx2, dy2); where (dx1, dy1) is the coordinate of the upper left corner of the current anchor frame, and (dx2, dy2) is the coordinate of the lower right corner of the current anchor frame; based on W iworker information of each worker in the to-be-calculated worker set, obtaining worker positions of each worker in the to-be-calculated worker set: (wx1, wy1) and (wx2, wy2); wherein (wx1, wy1) is a left upper corner coordinate of the current to-be-detected worker, and (wx2, wy2) is a right lower corner coordinate of the current to-be-detected worker; calculating a center point coordinate (chx, chy) of the current anchor frame and a center point coordinate (ccx, ccy) of each worker in the to-be-calculated worker set through the following formula:

[0126]

[0127]

[0128] calculating the Euclidean distance real_distance between the center point coordinate (ccx, ccy) of each worker in the to-be-calculated worker set and the center point coordinate (chx, chy) of the current anchor frame through the following formula:

[0129]

[0130] For each worker in the to-be-calculated worker set: when chx < wx1 || chx > wx2, calculating the maximum acceptable distance max_distance of the current to-be-detected worker to the current anchor frame through the following formula:

[0131]

[0132] y = |chy-ccy|

[0133]

[0134] when chx > wx1 & chx < wx2, calculating the maximum acceptable distance max_distance of the current to-be-detected worker to the current anchor frame through the following formula:

[0135] x = |chx-ccx|

[0136]

[0137]

[0138] wherein h_threashld is a preset parameter.

[0139] For each worker in the to-be-calculated worker set: when the Euclidean distance between the center point coordinate of the current to-be-detected worker and the center point coordinate of the current anchor frame is < the maximum acceptable distance of the current to-be-detected worker to the current anchor frame, the to-be-detected worker to which the current anchor frame belongs is the current to-be-detected worker.

[0140] In a possible implementation, the method further includes a display module configured to save the nth frame of the to-be-detected picture when the current to-be-detected worker does not wear the safety helmet in the n frames of the to-be-detected picture in succession; and render and visually display the detection abnormal information of the current to-be-detected worker on the nth frame of the to-be-detected picture.

[0141] The foregoing embodiments of the safety helmet and reflective vest integrated detection method relate to all relevant contents of the steps, which can be cited as the function description of the function modules corresponding to the safety helmet and reflective vest integrated detection system in the embodiments of the present application, and will not be described here.

[0142] The division of the modules in the embodiments of the present application is illustrative, and is only a logical function division. In actual implementation, another division manner can be used. In addition, each function module in each embodiment of the present application can be integrated in one processor, or can be physically separated, or two or more modules can be integrated in one module. The integrated module can be realized in the form of hardware or in the form of a software function module.

[0143] In another embodiment of the present application, a computer device is provided, which includes a processor and a memory. The memory is configured to store a computer program, and the computer program includes program instructions. The processor is configured to execute the program instructions stored in the computer storage medium. The processor can be a central processing unit (CPU), and can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The processor is the computing core and control core of the terminal, and is suitable for implementing one or more instructions, and is specifically suitable for loading and executing one or more instructions in the computer storage medium to implement a corresponding method flow or a corresponding function. The processor in the embodiments of the present application can be used for the operation of the safety helmet and reflective vest integrated detection method.

[0144] In another embodiment of the present application, the present application further provides a storage medium, specifically a computer readable storage medium (Memory), which is a memory device in a computer device, used for storing programs and data. It can be understood that the computer readable storage medium herein can include an internal storage medium in the computer device, and of course can also include an extended storage medium supported by the computer device. The computer readable storage medium provides a storage space, which stores an operating system of the terminal. In addition, one or more instructions suitable for being loaded and executed by the processor are also stored in the storage space, and the instructions can be one or more computer programs (including program codes). It should be noted that the computer readable storage medium herein can be a high-speed RAM memory, or a non-volatile memory such as at least one disk memory. One or more instructions stored in the computer readable storage medium can be loaded and executed by the processor to implement the corresponding steps of the safety helmet and reflective vest integrated detection method in the above embodiments.

[0145] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROMs, optical storage, etc.) containing computer-usable program code.

[0146] The present application is described with reference to flowcharts and / or block diagrams of the method, device (system), and computer program product according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of the flows and / or blocks in the flowcharts 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, a special-purpose computer, an embedded processor, or other programmable data processing apparatus to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing apparatus produce a device implemented in the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocks Figure 1 an apparatus that implements the function specified in the flow or flows and / or block or blocks.

[0147] These computer program instructions can also be stored in a computer readable memory capable of directing the computer or other programmable data processing apparatus to work in a specific manner, so that the instructions stored in the computer readable memory produce a manufactured product including instruction apparatus, which implements the flowcharts and / or block diagrams. Figure 1 one or more flows and / or blocksFigure 1 the function specified in the one or more blocks.

[0148] These computer program instructions can also be loaded into computer or other programmable data processing devices, so that a series of operation steps are performed on the computer or other programmable data processing devices to generate computer-implemented processing, so that the instructions executed on the computer or other programmable data processing devices provide a process for implementing the flow Figure 1 the flow or flows and / or blocks Figure 1 the steps of the function specified in the one or more blocks.

[0149] Finally, it should be noted that: the above examples are only used to illustrate the technical solutions of the present application, but not to limit it, although the above embodiments of the present application have been described in detail, those skilled in the art should understand: the specific embodiments of the present application can be modified or replaced by the same, without departing from the spirit and scope of the present application, any modification or equivalent replacement, which should be covered within the scope of protection of the claims of the present application.

Claims

1. A method for detecting an integrated safety helmet and reflective vest, characterized in that, include: Obtain the video stream information to be detected, and extract the image to be detected frame by frame based on the video stream information; The preset target detection model is called to mark the anchor boxes for reflective clothing detection and safety helmet detection on each frame of the image to be detected, and the anchor box marking results of each frame of the image to be detected are obtained. Based on the anchor frame marking results of each frame of the image to be detected, the position of the anchor frame marked with the reflective clothing detection in each frame of the image to be detected is taken as the worker to be detected, and it is determined whether each worker to be detected has a safety helmet in n consecutive frames of the image to be detected. If the worker to be inspected does not have a safety helmet in any of the n consecutive frames of images to be inspected, generate the detection anomaly information for the worker to be inspected. In the anchor box marking results of each frame of the image to be detected, the anchor box marking result of the i-th frame of the image to be detected is: ,in, This refers to the labeling information of the z-th anchor box in the anchor box labeling result of the i-th frame of the image to be detected. The coordinates of the top left corner of the anchor frame, the coordinates of the bottom right corner of the anchor frame, and the anchor frame category. ,in, For testing the anchor frame of the safety helmet, Anchor frame for inspecting reflective clothing; The step of determining whether a worker is wearing a safety helmet in n consecutive frames of images to be detected, based on the anchor frame marking results of each frame of images to be detected, includes: For each anchor box of the image to be detected in each frame: when At that time, the current anchor frame is used as the worker to be inspected. And obtain the workers to be inspected based on the marking information of the current anchor frame. Worker information: ;in, Indicates the worker's location. Indicates whether a helmet is worn; the initial value is... , This represents the number of frames remaining in the current detection cycle, with an initial value of n; According to the workers to be tested The worker's location is used to determine the worker to be tested. The position of the worker set to be detected in the (i-1)th frame of the image to be detected The positional relationship of each worker to be tested; When workers are waiting to be tested The worker's position is The r-th worker to be tested The position of the worker to be detected in the i-th frame of the image is determined by the position of the worker to be detected. Worker information update for workers awaiting testing Worker information, and the workers to be tested The number of remaining frames in the current detection cycle in the worker information is reduced by 1; When workers are waiting to be tested The worker's position is not When any worker to be detected is positioned in the i-th frame of the image to be detected, the worker to be detected will be... Add to In the process, after traversing all anchor box marker information of the anchor box marker results of the i-th frame of the image to be detected, the set of workers to be detected for the i-th frame of the image to be detected is obtained. ; when At that time, based on the current anchor frame's marking information and... The worker information of each worker to be inspected is used to determine the worker to be inspected belonging to the current anchor frame, and the worker information of the worker to be inspected belonging to the current anchor frame is set to... = ;in, = This indicates that a safety helmet is being worn; In the worker information of the worker to be tested, =0 and = At this time, the worker to be inspected does not have a safety helmet in any of the n consecutive frames of images to be inspected.

2. The integrated testing method for safety helmets and reflective vests according to claim 1, characterized in that, The preset target detection model is obtained by training the YOLOv5s benchmark model using a preset training set.

3. The integrated testing method for safety helmets and reflective vests according to claim 1, characterized in that, According to the workers to be tested The worker's location is used to determine the worker to be tested. The position of the worker set to be detected in the (i-1)th frame of the image to be detected The positional relationships of the workers to be tested include: Get The location of each worker to be tested, and according to... The location of each worker to be tested is calculated. The worker positions and the workers to be tested in the middle The area of ​​intersection between worker positions; and calculate The worker positions and the workers to be tested in the middle The intersection area between worker positions and The ratio of the area of ​​the anchor frame; when The r-th worker to be tested Worker location and worker to be tested The intersection area between worker positions and When the ratio of the anchor frame area to the total area is greater than a preset ratio threshold, the worker to be inspected... The worker's position is The r-th worker to be tested The position in the image to be detected in the i-th frame; when The worker's location and the worker being tested are not found in the data. The intersection area between worker positions and When the ratio of the anchor frame area to the total area is greater than a preset ratio threshold, the worker to be inspected... The worker's position is not The position of any worker to be detected in the i-th frame of the image to be detected.

4. The integrated testing method for safety helmets and reflective vests according to claim 1, characterized in that, The information based on the current anchor frame markings and The worker information for each worker to be inspected is used to determine the workers to be inspected belonging to the current anchor frame, including: Get Information on Chinese workers = The workers to be tested are used to obtain the set of workers to be calculated; Based on the current anchor frame's marking information, obtain the current anchor frame's position: ;in, This represents the coordinates of the top left corner of the current anchor frame. This refers to the coordinates of the bottom right corner of the current anchor frame; according to The worker information of each worker to be tested is collected, and the worker location of each worker to be tested in the worker set to be calculated is obtained: ;in, The coordinates of the top left corner of the worker currently being inspected. The coordinates of the bottom right corner of the worker currently being inspected; The coordinates of the center point of the current anchor frame are calculated using the following formula. and the coordinates of the center point of each worker to be tested in the worker set to be calculated : The coordinates of the center points of each worker to be tested in the worker set to be calculated are obtained by the following formula. and the center point coordinates of the current anchor frame Euclidean distance between : For each worker to be tested in the worker set to be calculated: when At that time, the maximum acceptable distance between the worker being inspected and the current anchor frame is calculated using the following formula. : when At that time, the maximum acceptable distance between the worker being inspected and the current anchor frame is calculated using the following formula. : in, These are preset parameters; For each worker to be inspected in the worker set to be calculated: the Euclidean distance between the center point coordinates of the current worker to be inspected and the center point coordinates of the current anchor frame. When the maximum acceptable distance between the worker to be inspected and the current anchor frame is reached, the worker to be inspected belonging to the current anchor frame is the current worker to be inspected.

5. The integrated testing method for safety helmets and reflective vests according to claim 1, characterized in that, Also includes: If the worker to be inspected does not have a safety helmet in any of the n consecutive frames of images to be inspected, save the nth frame of images to be inspected. It also renders and visualizes the detection anomaly information of the worker to be detected on the nth frame of the image to be detected.

6. An integrated helmet and reflective vest detection system based on the integrated helmet and reflective vest detection method of claim 1, characterized in that, include: The data acquisition module is used to acquire the video stream information to be detected and extract the image to be detected frame by frame based on the video stream information. The target detection module is used to call the preset target detection model, mark the reflective clothing detection anchor boxes and safety helmet detection anchor boxes on each frame of the image to be detected, and obtain the anchor box marking results of each frame of the image to be detected. The anomaly detection module is used to determine the position of the reflective vest detection anchor frame marked in each frame of the image to be detected as the worker to be detected based on the anchor frame marking results of each frame of the image to be detected, and to determine whether each worker to be detected has a safety helmet in n consecutive frames of the image to be detected. The anomaly handling module is used to generate detection anomaly information for the current worker if no safety helmet is found in any of the n consecutive frames of images to be detected.

7. A computer 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 computer program, it implements the steps of the integrated detection method for safety helmets and reflective vests as described in any one of claims 1 to 5.

8. A computer-readable storage medium storing a computer program, characterized in that, When the computer program is executed by the processor, it implements the steps of the integrated detection method for safety helmets and reflective vests as described in any one of claims 1 to 5.

Citation Information

Patent Citations

  • Lightweight YOLO v4 security protection detection method based on attention mechanism improvement

    CN113516076A