CN116758587A - Method and device for detecting wearing of safety helmet, electronic equipment and storage medium - Google Patents

Method and device for detecting wearing of safety helmet, electronic equipment and storage medium Download PDF

Info

Publication number
CN116758587A
CN116758587A CN202310715549.8A CN202310715549A CN116758587A CN 116758587 A CN116758587 A CN 116758587A CN 202310715549 A CN202310715549 A CN 202310715549A CN 116758587 A CN116758587 A CN 116758587A
Authority
CN
China
Prior art keywords
head
human body
video image
detected
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202310715549.8A
Other languages
Chinese (zh)
Inventor
丁剑剑
姚兴仁
闫印强
杨利达
姜海昆
范宇
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Changyang Technology Beijing Co ltd
Original Assignee
Changyang Technology Beijing Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Changyang Technology Beijing Co ltd filed Critical Changyang Technology Beijing Co ltd
Priority to CN202310715549.8A priority Critical patent/CN116758587A/en
Publication of CN116758587A publication Critical patent/CN116758587A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/74Image or video pattern matching; Proximity measures in feature spaces
    • G06V10/761Proximity, similarity or dissimilarity measures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V10/00Arrangements for image or video recognition or understanding
    • G06V10/70Arrangements for image or video recognition or understanding using pattern recognition or machine learning
    • G06V10/764Arrangements for image or video recognition or understanding using pattern recognition or machine learning using classification, e.g. of video objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/40Scenes; Scene-specific elements in video content
    • G06V20/46Extracting features or characteristics from the video content, e.g. video fingerprints, representative shots or key frames

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Artificial Intelligence (AREA)
  • Health & Medical Sciences (AREA)
  • Computing Systems (AREA)
  • Databases & Information Systems (AREA)
  • Evolutionary Computation (AREA)
  • General Health & Medical Sciences (AREA)
  • Medical Informatics (AREA)
  • Software Systems (AREA)
  • Human Computer Interaction (AREA)
  • Image Analysis (AREA)

Abstract

The invention provides a method and a device for detecting the wearing of a safety helmet, electronic equipment and a storage medium, wherein the method comprises the following steps: acquiring an industrial area monitoring video image, and performing category detection on the video image by using a pre-trained detection model; the detected categories at least comprise head unworn safety helmets and human bodies; when the type of the head-unworn safety helmet and the type of the human body are detected for the video images, determining whether the head of each head-unworn safety helmet in the video images has a real human body matched with the head of each head-unworn safety helmet; if yes, outputting an alarm. According to the scheme, the false detection condition can be reduced, and the detection accuracy is improved.

Description

Method and device for detecting wearing of safety helmet, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of safety management, in particular to a method and a device for detecting wearing of a safety helmet, electronic equipment and a storage medium.
Background
The wearing of helmets in an industrial area is a necessary condition for ensuring the safety of constructors themselves. Currently, more and more industrial areas adopt a deep learning scheme to detect whether constructors wear safety helmets. However, the industrial area often has the characteristic of complex scene, and the single deep learning model is easy to cause false detection.
Disclosure of Invention
The embodiment of the invention provides a method and a device for detecting the wearing of a safety helmet, electronic equipment and a storage medium, which can reduce the false detection condition.
In a first aspect, an embodiment of the present invention provides a method for detecting wearing of a helmet, including:
acquiring an industrial area monitoring video image, and performing category detection on the video image by using a pre-trained detection model; the detected categories at least comprise head unworn safety helmets and human bodies;
when the type of the head-unworn safety helmet and the type of the human body are detected for the video images, determining whether the head of each head-unworn safety helmet in the video images has a real human body matched with the head of each head-unworn safety helmet; if yes, outputting an alarm.
In one possible implementation, the determining whether each head in the video image has a real human body matching that of the head without the helmet, includes:
determining whether each human body detected in the video image is a real human body based on the number of human bodies in the category of the human body detected in the video image;
and matching the real human body in the video image with the head of each head of the video image, which is not provided with the safety helmet, one by one, and if so, determining that the head of the matched head, which is not provided with the safety helmet, is the head of the real human body.
In one possible implementation manner, the determining, based on the number of human bodies in the category of the human bodies detected in the video image, whether each human body detected in the video image is a real human body includes:
if the number of human bodies in the category of human bodies detected in the video image is a plurality, performing, for each human body detected in the video image: slicing the video image based on the detection frame corresponding to the human body to obtain a slice image comprising the human body; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image;
and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining a real human body according to the similarities between the feature vectors.
In one possible implementation manner, the determining the real human body according to the similarity between the feature vectors includes:
for each feature vector, performing: and determining whether the similarity between the feature vector and each other feature vector is smaller than a first set threshold, if so, determining the human body corresponding to the feature vector as a non-real human body, and if not, determining the human body corresponding to the feature vector as a real human body.
In one possible implementation, the method for matching a real human body in the video image with a head of the video image, where the head is not wearing a helmet, includes:
determining a first position of a pixel point contained in the real human body in the video image;
determining a first number of pixels contained in a head of the head, which is not wearing a helmet, and a second position of the pixels in the video image;
determining a second number of pixels where the head and the real human body position coincide according to the first position and the second position;
and determining whether the ratio of the second quantity to the first quantity is larger than a second set threshold value, and if so, determining that the real human body is matched with the head of the head with the helmet not worn.
In one possible implementation, before matching the real human body in the video image with the head of each head-unworn helmet in the video image one by one, the method further includes:
if the number of heads of the head-unworn safety helmet detected in the video image is a plurality, executing, for each head of the head-unworn safety helmet detected in the video image: slicing the video image based on the detection frame corresponding to the head to obtain a slice image comprising the head; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image;
and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining real heads according to the similarities between the feature vectors so as to match the real human body in the video image with the real heads of the video image, which are not provided with safety helmets, one by one.
In one possible implementation, the detection model is a yolov5 model when the video image is subjected to class detection using a pre-trained detection model.
In a second aspect, an embodiment of the present invention further provides a helmet wear detection device, including:
the acquisition unit is used for acquiring the industrial area monitoring video image;
the detection unit is used for carrying out category detection on the video image by utilizing a pre-trained detection model; the detected categories at least comprise head unworn safety helmets and human bodies;
a determining unit configured to determine, when a category of a head-unworn helmet and a category of a human body are detected for the video image, whether a head of each head-unworn helmet in the video image has a real human body matched therewith; if yes, the alarm unit is triggered to output an alarm.
In a third aspect, an embodiment of the present invention further provides an electronic device, including a memory and a processor, where the memory stores a computer program, and when the processor executes the computer program, the method described in any embodiment of the present specification is implemented.
In a fourth aspect, embodiments of the present invention also provide a computer-readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform a method according to any of the embodiments of the present specification.
The embodiment of the invention provides a method, a device, electronic equipment and a storage medium for detecting the wearing of a safety helmet, wherein a detection model is utilized to detect the type of a video image, so that the detected type at least comprises two types of the safety helmet which is not worn on the head and a human body, and if the type of the safety helmet which is not worn on the head and the human body are detected in the video image, whether the head of each head of the safety helmet which is not worn on the head in the video image is provided with a real human body matched with the head is determined, and therefore mutual matching detection is carried out between the two types to determine whether an alarm needs to be carried out. Therefore, the false detection condition can be reduced, and the detection accuracy is improved.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings that are required in the embodiments or the description of the prior art will be briefly described, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a method for detecting the wearing of a helmet according to an embodiment of the present invention;
FIG. 2 is a flowchart of another method for detecting the wearing of a helmet according to an embodiment of the present invention;
FIG. 3 is a hardware architecture diagram of an electronic device according to an embodiment of the present invention;
fig. 4 is a structural diagram of a helmet wearing detection device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments, and all other embodiments obtained by those skilled in the art without making any inventive effort based on the embodiments of the present invention are within the scope of protection of the present invention.
Referring to fig. 1, an embodiment of the present invention provides a method for detecting wearing of a helmet, including:
step 100, acquiring an industrial area monitoring video image, and performing category detection on the video image by using a pre-trained detection model; the detected categories at least comprise head unworn safety helmets and human bodies;
102, when the type of the head-unworn safety helmet and the type of the human body are detected for the video image, determining whether the head of each head-unworn safety helmet in the video image has a real human body matched with the head-unworn safety helmet; if yes, outputting an alarm.
In the embodiment of the invention, the detection model is utilized to detect the types of the video images, so that the detected types at least comprise two types of the head-unworn safety helmet and the human body, and if the type of the head-unworn safety helmet and the type of the human body are detected in the video images, whether the head of each head-unworn safety helmet in the video images has a real human body matched with the head-unworn safety helmet or not is determined, and therefore, the mutual matching detection is utilized between the two types to determine whether an alarm needs to be carried out or not. Therefore, the false detection condition can be reduced, and the detection accuracy is improved.
The manner in which the individual steps shown in fig. 1 are performed is described below.
Firstly, aiming at step 100, acquiring an industrial area monitoring video image, and performing category detection on the video image by utilizing a pre-trained detection model; the detected categories include at least head unworn helmets and human body.
In the embodiment of the invention, the monitoring camera is arranged in the industrial area to monitor the operators in the industrial area. By acquiring the video stream output by the camera, each video frame can be used as a video image to be detected for category detection, and the video frame to be detected for category detection can be determined according to preset detection conditions.
In the category detection, in order to improve the detection accuracy and reduce the false detection rate, the detected categories may include at least a category of a head-unworn safety helmet and a category of a human body, and the two categories may be mutually matched for detection. Further, the detected categories may also include the category of head-worn helmets.
In the embodiment of the invention, when the detection model is used for detecting the category of the video image, the mode of outputting the corresponding category detection frame can be adopted. Specifically, a detection frame with the head wearing the safety helmet, a detection frame with the head not wearing the safety helmet, and a human body detection frame are output.
The detection model may be a yolov5 model when the corresponding class is output using a detection box. When the yolov5 model detects the category of the video image, self-adaptive anchor frame calculation can be performed, and whether the video image has the category required to be detected or not can be rapidly inferred.
Then, when the type of the head-unworn safety helmet and the type of the human body are detected for the video image, determining whether the head of each head-unworn safety helmet in the video image has a real human body matched with the head-unworn safety helmet or not for step 102; if yes, outputting an alarm.
In the embodiment of the present invention, after the video image is input into the detection model, the result output by the detection model may at least include the following cases:
in the first case, the type of wearing the safety helmet on the head and the type of the human body are detected in the video image.
And in the second case, detecting the type of the head part which is not worn with the safety helmet and the type of the human body in the video image.
And thirdly, detecting the type of wearing the safety helmet on the head, the type of not wearing the safety helmet on the head and the type of the human body in the video image.
In the first case, the type of the head-unworn helmet is not detected, and thus, the type detection of the next video image can be performed without giving an alarm.
For the second case and the third case, since the type of the head-unworn safety helmet is detected, the second case and the third case are combined into a case, that is, the type of the head-unworn safety helmet and the type of the human body are detected by the video image, and further detection is needed for the case of the head-unworn safety helmet to determine whether the case of the head-unworn safety helmet is true or not. In the embodiment of the invention, whether the head is not wearing the safety helmet is determined to be true by detecting whether the head of the head not wearing the safety helmet has a true human body matched with the head in the video image.
Specifically, referring to FIG. 2, the present step 102 may include the following steps 1020-1022:
1020. determining whether each human body detected in the video image is a real human body based on the number of human bodies in the category of the human body detected in the video image;
in the embodiment of the invention, as the condition that the human body in the video image possibly exists as an unreal human body, in order to ensure the detection accuracy, whether each human body detected by using the detection model is an actual human body or not needs to be determined first, and the unreal human body is filtered, so that the accuracy of a subsequent matching result can be improved.
In one embodiment of the present invention, when the number of detected human bodies is different, detection of a real human body may be performed in different manners:
mode one:
if the number of the detected human bodies in the category of the human bodies in the video image is one, detecting the real human bodies in the video image by using a pre-trained living human body detection model.
Mode two:
if the number of human bodies in the category of human bodies detected in the video image is a plurality, performing, for each human body detected in the video image: slicing the video image based on the detection frame corresponding to the human body to obtain a slice image comprising the human body; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image;
and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining a real human body according to the similarities between the feature vectors.
When slicing the video image, the slice may be performed according to the contour of the corresponding detection frame, or may be performed in a manner of including the minimum rectangle of the corresponding detection frame, so as to obtain a slice image of the human body.
The pedestrian re-recognition model can output feature vectors of pedestrian features corresponding to the slice images, and the non-real human body can be filtered out according to the similarity by calculating the similarity between every two feature vectors.
Specifically, when determining a real human body according to the similarity between the feature vectors, the method includes: to perform, for each feature vector: and determining whether the similarity between the feature vector and each other feature vector is smaller than a first set threshold, if so, determining the human body corresponding to the feature vector as a non-real human body, and if not, determining the human body corresponding to the feature vector as a real human body.
For example, three human bodies, namely a human body 1, a human body 2 and a human body 3, are detected in the video image, and feature vectors corresponding to the three human bodies one by one are the feature vector 1, the feature vector 2 and the feature vector 3, and the following similarity is assumed by calculating the similarity between the three feature vectors:
for feature vector 1: the similarity with the feature vector 2 is smaller than a first set threshold value, and the similarity with the feature vector 3 is smaller than the first set threshold value;
for feature vector 2: the similarity with the feature vector 1 is smaller than a first set threshold value, and the similarity with the feature vector 3 is larger than the first set threshold value;
for feature vector 3: the similarity with the feature vector 1 is smaller than a first set threshold value, and the similarity with the feature vector 2 is larger than the first set threshold value;
then, it may be determined that the similarity between the feature vector 1 and each of the other feature vectors is smaller than the first set threshold, so that the human body 1 corresponding to the feature vector 1 is a non-real human body, and the human body 2 corresponding to the feature vector 2 and the human body 3 corresponding to the feature vector 3 are real human bodies.
When the number of human bodies in the category of human bodies detected in the video image is plural, the detection may be performed using the living human body detection model in the first mode, but the second mode has a smaller detection complexity than the detection mode using the living human body detection model in the first mode.
In another embodiment of the present invention, the above-mentioned method for detecting whether the human body is a real human body may be used to detect whether the head of the head without the safety helmet is a real human body head, and when the number of detected heads is different, the detection of the real human body head may be performed in different manners:
in the first mode, when the number of heads of which the safety helmet is not worn on the heads detected in the video image is 1, the heads in the video image are detected to be the real human heads by using a pre-trained living human body detection model in the same way as the real human body detection mode.
In the second aspect, if the number of heads of the head-unworn helmets detected in the video image is plural, the method is performed for each head of the head-unworn helmets detected in the video image: slicing the video image based on the detection frame corresponding to the head to obtain a slice image comprising the head; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image;
and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining real heads according to the similarities between the feature vectors so as to match the real human body in the video image with the real heads of the video image, which are not provided with safety helmets, one by one.
The method for determining the real head according to the similarity between the feature vectors is the same as the above-mentioned real human body detection method, and is not described in detail herein.
The third set threshold value used when determining the real head using the similarity between the plurality of feature vectors is smaller than the first set threshold value used when determining the real human body using the similarity between the plurality of feature vectors.
In the embodiment of the invention, the pedestrian re-identification model has the characteristics of good robustness, strong feature extraction capability and strong generalization capability, and can well meet the extraction requirements of the feature vectors of the video images in the industrial area. The feature vector comparison between the detection frames of the same class has strong adaptability to different scenes, so that the labor cost required by selecting feature algorithms and rules according to different scenes is saved.
1022. And matching the real human body in the video image with the head of each head of the video image, which is not provided with the safety helmet, one by one, and if so, determining that the head of the matched head, which is not provided with the safety helmet, is the head of the real human body.
In the embodiment of the invention, the method for matching a real human body in a video image with a head of the video image without wearing a safety helmet comprises the following steps:
s1, determining a first position of a pixel point contained in the real human body in the video image;
s2, determining a first number of pixel points contained in the head of the head without the safety helmet and a second position of the pixel points in the video image;
s3, determining a second number of pixel points where the head and the real human body coincide according to the first position and the second position;
s4, determining whether the ratio of the second quantity to the first quantity is larger than a second set threshold value, and if so, determining that the real human body is matched with the head of the head with the safety helmet.
By calculating the ratio of the number of pixels where the head and the real human body coincide to the number of pixels of the head, if the ratio is greater than a second set threshold, the ratio of the head to the real human body is high, and the head can be determined to be the head of the real human body, so that the head can be determined to be the head of the real human body, and the head is not worn with a safety helmet and needs to be warned. If the ratio is smaller than the second set threshold, the head is not the head of the real human body, and if the head is matched with each real human body and the ratio is smaller than the second set threshold, the head is not the head of the real human body, and no alarm is needed for the detection result of the head not wearing the safety helmet. Therefore, the detection frame which is not successfully matched can be filtered, and the false detection condition is reduced.
As shown in fig. 3 and 4, the embodiment of the invention provides a safety helmet wearing detection device. The apparatus embodiments may be implemented by software, or may be implemented by hardware or a combination of hardware and software. In terms of hardware, as shown in fig. 3, a hardware architecture diagram of an electronic device where a helmet wear detection apparatus provided by an embodiment of the present invention is located, where in addition to a processor, a memory, a network interface, and a nonvolatile memory shown in fig. 3, the electronic device where the apparatus is located may generally include other hardware, such as a forwarding chip responsible for processing a message, and so on. For example, as shown in fig. 4, the device in a logic sense is formed by reading a corresponding computer program in a nonvolatile memory into a memory by a CPU of an electronic device where the device is located. The detection device is worn to helmet that this embodiment provided includes:
an acquisition unit 401, configured to acquire an industrial area monitoring video image;
a detection unit 402, configured to perform category detection on the video image using a pre-trained detection model; the detected categories at least comprise head unworn safety helmets and human bodies;
a determining unit 403 configured to determine, when a category of a head-unworn helmet and a category of a human body are detected for the video image, whether a head of each head-unworn helmet in the video image has a real human body matched therewith; if yes, the alarm unit 404 is triggered to output an alarm.
In one embodiment of the present invention, the determining unit is specifically configured to: determining whether each human body detected in the video image is a real human body based on the number of human bodies in the category of the human body detected in the video image; and matching the real human body in the video image with the head of each head of the video image, which is not provided with the safety helmet, one by one, and if so, determining that the head of the matched head, which is not provided with the safety helmet, is the head of the real human body.
In one embodiment of the present invention, the determining unit determines, based on the number of human bodies in the category of human bodies detected in the video image, whether each human body detected in the video image is a real human body, specifically includes:
if the number of human bodies in the category of human bodies detected in the video image is a plurality, performing, for each human body detected in the video image: slicing the video image based on the detection frame corresponding to the human body to obtain a slice image comprising the human body; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image;
and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining a real human body according to the similarities between the feature vectors.
In one embodiment of the present invention, when the determining unit performs the determining of the real human body according to the similarity between the feature vectors, the determining unit specifically includes:
for each feature vector, performing: and determining whether the similarity between the feature vector and each other feature vector is smaller than a first set threshold, if so, determining the human body corresponding to the feature vector as a non-real human body, and if not, determining the human body corresponding to the feature vector as a real human body.
In one embodiment of the present invention, the determining unit, when performing matching of a real human body in the video image with a head of the video image, on which the head of the video image does not wear the helmet, specifically includes: determining a first position of a pixel point contained in the real human body in the video image; determining a first number of pixels contained in a head of the head, which is not wearing a helmet, and a second position of the pixels in the video image; determining a second number of pixels where the head and the real human body position coincide according to the first position and the second position; and determining whether the ratio of the second quantity to the first quantity is larger than a second set threshold value, and if so, determining that the real human body is matched with the head of the head with the helmet not worn.
In an embodiment of the invention, the determining unit is further adapted to: if the number of heads of the head-unworn safety helmet detected in the video image is a plurality, executing, for each head of the head-unworn safety helmet detected in the video image: slicing the video image based on the detection frame corresponding to the head to obtain a slice image comprising the head; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image; and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining real heads according to the similarities between the feature vectors so as to match the real human body in the video image with the real heads of the video image, which are not provided with safety helmets, one by one.
In one embodiment of the present invention, the detection model is a yolov5 model when the video image is subjected to category detection by using a pre-trained detection model.
It will be appreciated that the structure illustrated in the embodiments of the present invention is not intended to be limiting in any particular way for a headgear wear detection device. In other embodiments of the invention, a headgear wear detection device may include more or fewer components than shown, or certain components may be combined, certain components may be split, or different arrangements of components. The illustrated components may be implemented in hardware, software, or a combination of software and hardware.
The content of information interaction and execution process between the modules in the device is based on the same conception as the embodiment of the method of the present invention, and specific content can be referred to the description in the embodiment of the method of the present invention, which is not repeated here.
The embodiment of the invention also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the method for detecting the wearing of the safety helmet in any embodiment of the invention when executing the computer program.
The embodiment of the invention also provides a computer readable storage medium, wherein the computer readable storage medium is stored with a computer program, and the computer program when being executed by a processor, causes the processor to execute the method for detecting the wearing of the safety helmet in any embodiment of the invention.
Specifically, a system or apparatus provided with a storage medium on which a software program code realizing the functions of any of the above embodiments is stored, and a computer (or CPU or MPU) of the system or apparatus may be caused to read out and execute the program code stored in the storage medium.
In this case, the program code itself read from the storage medium may realize the functions of any of the above-described embodiments, and thus the program code and the storage medium storing the program code form part of the present invention.
Examples of the storage medium for providing the program code include a floppy disk, a hard disk, a magneto-optical disk, an optical disk (e.g., CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), a magnetic tape, a nonvolatile memory card, and a ROM. Alternatively, the program code may be downloaded from a server computer by a communication network.
Further, it should be apparent that the functions of any of the above-described embodiments may be implemented not only by executing the program code read out by the computer, but also by causing an operating system or the like operating on the computer to perform part or all of the actual operations based on the instructions of the program code.
Further, it is understood that the program code read out by the storage medium is written into a memory provided in an expansion board inserted into a computer or into a memory provided in an expansion module connected to the computer, and then a CPU or the like mounted on the expansion board or the expansion module is caused to perform part and all of actual operations based on instructions of the program code, thereby realizing the functions of any of the above embodiments.
It is noted that relational terms such as first and second, and the like, are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one …" does not exclude the presence of additional identical elements in a process, method, article or apparatus that comprises the element.
Those of ordinary skill in the art will appreciate that: all or part of the steps for implementing the above method embodiments may be implemented by hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, where the program, when executed, performs steps including the above method embodiments; and the aforementioned storage medium includes: various media in which program code may be stored, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above embodiments are only for illustrating the technical solution of the present invention, and are not limiting; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. A method of headgear wear detection comprising:
acquiring an industrial area monitoring video image, and performing category detection on the video image by using a pre-trained detection model; the detected categories at least comprise head unworn safety helmets and human bodies;
when the type of the head-unworn safety helmet and the type of the human body are detected for the video images, determining whether the head of each head-unworn safety helmet in the video images has a real human body matched with the head of each head-unworn safety helmet; if yes, outputting an alarm.
2. The method of claim 1, wherein the determining whether each head in the video image has a real human body matching a head on which the helmet is not worn comprises:
determining whether each human body detected in the video image is a real human body based on the number of human bodies in the category of the human body detected in the video image;
and matching the real human body in the video image with the head of each head of the video image, which is not provided with the safety helmet, one by one, and if so, determining that the head of the matched head, which is not provided with the safety helmet, is the head of the real human body.
3. The method of claim 2, wherein the determining whether each human detected in the video image is a real human based on the number of human in the category of human detected in the video image comprises:
if the number of human bodies in the category of human bodies detected in the video image is a plurality, performing, for each human body detected in the video image: slicing the video image based on the detection frame corresponding to the human body to obtain a slice image comprising the human body; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image;
and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining a real human body according to the similarities between the feature vectors.
4. A method according to claim 3, wherein determining the real human body according to the similarity between the plurality of feature vectors comprises:
for each feature vector, performing: and determining whether the similarity between the feature vector and each other feature vector is smaller than a first set threshold, if so, determining the human body corresponding to the feature vector as a non-real human body, and if not, determining the human body corresponding to the feature vector as a real human body.
5. The method of claim 2, wherein the way in which a real human body in the video image is matched to a head in the video image that is not wearing a helmet, comprises:
determining a first position of a pixel point contained in the real human body in the video image;
determining a first number of pixels contained in a head of the head, which is not wearing a helmet, and a second position of the pixels in the video image;
determining a second number of pixels where the head and the real human body position coincide according to the first position and the second position;
and determining whether the ratio of the second quantity to the first quantity is larger than a second set threshold value, and if so, determining that the real human body is matched with the head of the head with the helmet not worn.
6. The method of claim 2, further comprising, prior to matching the real human body in the video image one by one with the head of each head of the video image that is not wearing a helmet:
if the number of heads of the head-unworn safety helmet detected in the video image is a plurality, executing, for each head of the head-unworn safety helmet detected in the video image: slicing the video image based on the detection frame corresponding to the head to obtain a slice image comprising the head; inputting the slice image into a pedestrian re-identification model to obtain a feature vector of the slice image;
and carrying out pairwise similarity calculation on the obtained plurality of feature vectors, and determining real heads according to the similarities between the feature vectors so as to match the real human body in the video image with the real heads of the video image, which are not provided with safety helmets, one by one.
7. The method of any one of claims 1-6, wherein the detection model is a yolov5 model when the video image is subjected to class detection using a pre-trained detection model.
8. A headgear wear detection device, comprising:
the acquisition unit is used for acquiring the industrial area monitoring video image;
the detection unit is used for carrying out category detection on the video image by utilizing a pre-trained detection model; the detected categories at least comprise head unworn safety helmets and human bodies;
a determining unit configured to determine, when a category of a head-unworn helmet and a category of a human body are detected for the video image, whether a head of each head-unworn helmet in the video image has a real human body matched therewith; if yes, the alarm unit is triggered to output an alarm.
9. An electronic device comprising a memory and a processor, the memory having stored therein a computer program, the processor implementing the method of any of claims 1-7 when the computer program is executed.
10. A computer readable storage medium having stored thereon a computer program which, when executed in a computer, causes the computer to perform the method of any of claims 1-7.
CN202310715549.8A 2023-06-16 2023-06-16 Method and device for detecting wearing of safety helmet, electronic equipment and storage medium Pending CN116758587A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310715549.8A CN116758587A (en) 2023-06-16 2023-06-16 Method and device for detecting wearing of safety helmet, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310715549.8A CN116758587A (en) 2023-06-16 2023-06-16 Method and device for detecting wearing of safety helmet, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116758587A true CN116758587A (en) 2023-09-15

Family

ID=87950913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310715549.8A Pending CN116758587A (en) 2023-06-16 2023-06-16 Method and device for detecting wearing of safety helmet, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116758587A (en)

Similar Documents

Publication Publication Date Title
US8619135B2 (en) Detection of abnormal behaviour in video objects
US9842269B2 (en) Video processing apparatus, video processing method, and recording medium
KR101764845B1 (en) A video surveillance apparatus for removing overlap and tracking multiple moving objects and method thereof
US11727578B2 (en) Crowd type classification system, crowd type classification method and storage medium for storing crowd type classification program
US20150278584A1 (en) Object discriminating apparatus and method
US20110280442A1 (en) Object monitoring system and method
CN111325265A (en) Detection method and device for tampered image
US20200084416A1 (en) Information processing apparatus, control method, and program
Yang et al. Video anomaly detection for surveillance based on effective frame area
KR101268596B1 (en) Foreground extraction apparatus and method using CCB and MT LBP
CN116758587A (en) Method and device for detecting wearing of safety helmet, electronic equipment and storage medium
EP4332910A1 (en) Behavior detection method, electronic device, and computer readable storage medium
US11620360B2 (en) Methods and systems for recognizing object using machine learning model
CN114067401A (en) Target detection model training and identity verification method and device
KR20230012171A (en) Object detection and identification system for TOD in incidental images based on deep learning and method thereof
CN110781710B (en) Target object clustering method and device
CN113469095B (en) Gait-based character secondary verification method and device
US11640712B2 (en) Information processing apparatus, video image summarization method, and storage medium
US20170068848A1 (en) Display control apparatus, display control method, and computer program product
CN115631477B (en) Target identification method and terminal
US12073697B2 (en) Method, an apparatus and a system for managing an event to generate an alert indicating a subject is likely to be unauthorized
CN112417922B (en) Target identification method and device
US20240095906A1 (en) Anomaly detection method, anomaly detection device, and recording medium
US20210097392A1 (en) Classification and re-identification
KR20150055269A (en) Survellance video division apparatus and method for comprising indexing function

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination