CN115471916A - Smoking detection method, device, equipment and storage medium - Google Patents

Smoking detection method, device, equipment and storage medium Download PDF

Info

Publication number
CN115471916A
CN115471916A CN202211148966.0A CN202211148966A CN115471916A CN 115471916 A CN115471916 A CN 115471916A CN 202211148966 A CN202211148966 A CN 202211148966A CN 115471916 A CN115471916 A CN 115471916A
Authority
CN
China
Prior art keywords
change information
position change
smoking
mouth
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
CN202211148966.0A
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.)
Glodon Co Ltd
Original Assignee
Glodon 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 Glodon Co Ltd filed Critical Glodon Co Ltd
Priority to CN202211148966.0A priority Critical patent/CN115471916A/en
Publication of CN115471916A publication Critical patent/CN115471916A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/20Movements or behaviour, e.g. gesture recognition
    • G06V40/28Recognition of hand or arm movements, e.g. recognition of deaf sign language
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V20/00Scenes; Scene-specific elements
    • G06V20/50Context or environment of the image
    • G06V20/52Surveillance or monitoring of activities, e.g. for recognising suspicious objects
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06VIMAGE OR VIDEO RECOGNITION OR UNDERSTANDING
    • G06V40/00Recognition of biometric, human-related or animal-related patterns in image or video data
    • G06V40/10Human or animal bodies, e.g. vehicle occupants or pedestrians; Body parts, e.g. hands
    • G06V40/16Human faces, e.g. facial parts, sketches or expressions
    • G06V40/161Detection; Localisation; Normalisation

Landscapes

  • Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • General Health & Medical Sciences (AREA)
  • Human Computer Interaction (AREA)
  • Health & Medical Sciences (AREA)
  • Oral & Maxillofacial Surgery (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Psychiatry (AREA)
  • Social Psychology (AREA)
  • Image Analysis (AREA)

Abstract

The invention relates to the field of computer vision, in particular to a smoking detection method, a device, equipment and a storage medium, wherein the method comprises the following steps: acquiring a target image sequence; carrying out target detection on each target image in the target image sequence, and determining the position information of each target in the target image, wherein the target comprises a human body arm joint point, cigarettes and a mouth; determining whether the hand holds the cigarette or not based on the joint points of the human arms and the position of the cigarette; when the hand holds a cigarette, determining position change information between the hand and the mouth in the target image sequence based on the human arm joint points and the position information of the mouth; and determining the detection result of the smoking behavior according to the position change information. The method not only detects cigarettes, but also simultaneously detects whether smoking actions exist, judges whether smoking actions exist or not under the combination of the cigarettes and the smoking actions, and judges the smoking actions by adopting multiple modes, so that the accuracy of smoking action detection is improved.

Description

吸烟检测方法、装置、设备及存储介质Smoking detection method, device, equipment and storage medium

技术领域technical field

本发明涉及计算机视觉领域,具体涉及一种吸烟检测方法、装置、设备及存储介质。The invention relates to the field of computer vision, in particular to a smoking detection method, device, equipment and storage medium.

背景技术Background technique

为了控制火种危害,维护和改善施工现场的环境,确保施工现场的消防安全,需要严格避免吸烟行为。在室内场景中,通常通过烟雾传感器等设备对吸烟行为进行检测,但是烟感设备在户外场景中难以使用。In order to control fire hazards, maintain and improve the environment at the construction site, and ensure fire safety at the construction site, it is necessary to strictly avoid smoking. In indoor scenes, smoking behavior is usually detected by devices such as smoke sensors, but smoke detection devices are difficult to use in outdoor scenes.

现有技术中大多采用普通摄像头或红外摄像头来判断是否发生吸烟事件,通过红外摄像头捕捉高温点,继而判断是否有吸烟行为,但是由于红外摄像头需要高分辨率设备,价格昂贵,需要耗费的成本较大。若采用普通摄像头,则需要结合深度学习算法,对图片进行目标检测,检测图片中是否有香烟,进而判断是否存在吸烟行为。由于香烟是比较小的目标,通过普通目标检测方法可能会将图片中的其他类似形状物体误检为香烟,另外,若有人拿出香烟但未点燃及吸食,通过普通目标检测方法可能也会误检。Most of the existing technologies use ordinary cameras or infrared cameras to judge whether smoking incidents occur, capture high-temperature points through infrared cameras, and then judge whether there is smoking behavior, but because infrared cameras require high-resolution equipment and are expensive, the cost required is relatively high. big. If an ordinary camera is used, it is necessary to combine the deep learning algorithm to detect the target of the picture, detect whether there is a cigarette in the picture, and then judge whether there is smoking behavior. Since cigarettes are relatively small objects, other objects with similar shapes in the picture may be misdetected as cigarettes by ordinary object detection methods. check.

发明内容Contents of the invention

有鉴于此,本发明实施例提供了吸烟检测方法、装置、设备及存储介质,以解决吸烟行为检测准确率不高的问题。In view of this, embodiments of the present invention provide a smoking detection method, device, device, and storage medium to solve the problem of low accuracy in smoking behavior detection.

根据第一方面,本发明实施例提供了一种吸烟检测方法,包括:According to the first aspect, an embodiment of the present invention provides a smoking detection method, including:

获取目标图像序列;Obtain the target image sequence;

对所述目标图像序列中的各个目标图像进行目标检测,确定所述目标图像中各目标的位置信息,所述目标包括人体手臂关节点、香烟以及嘴巴;Perform target detection on each target image in the target image sequence, and determine the position information of each target in the target image, and the target includes human arm joints, cigarettes and mouth;

基于所述人体手臂关节点与所述香烟的位置,确定手部是否持有香烟;Based on the positions of the human arm joints and the cigarette, determine whether the hand holds the cigarette;

当所述手部持有香烟时,基于所述人体手臂关节点以及所述嘴巴的位置信息,确定所述目标图像序列中手部与所述嘴巴之间的位置变化信息;When the hand holds a cigarette, based on the position information of the human arm joints and the mouth, determine the position change information between the hand and the mouth in the target image sequence;

根据所述位置变化信息确定吸烟行为的检测结果。The detection result of the smoking behavior is determined according to the position change information.

本发明实施例提供的吸烟检测方法,获取目标图像序列,基于多种目标检测方法检测人体手臂关节点、香烟以及嘴巴的位置信息,判断是否持有香烟并判断是否存在吸烟动作或类似吸烟的动作,进而确定是否存在吸烟行为。该方法不仅对香烟进行检测,还同时检测是否存在吸烟动作,二者结合下再判断是否存在吸烟行为,采用多模式进行吸烟行为的判别,提高了吸烟行为检测的准确性。The smoking detection method provided by the embodiment of the present invention obtains the target image sequence, detects the position information of the joints of the human arm, the cigarette and the mouth based on various target detection methods, judges whether a cigarette is held, and judges whether there is a smoking action or an action similar to smoking , and then determine whether there is smoking behavior. The method not only detects cigarettes, but also detects whether there is a smoking action at the same time, and then judges whether there is a smoking behavior after combining the two, and uses multi-modes to distinguish the smoking behavior, which improves the accuracy of the smoking behavior detection.

在一些实施方式中,所述基于所述人体手臂关节点以及所述嘴巴的位置信息,确定所述目标图像序列中手部与所述嘴巴之间的位置变化信息,包括:In some embodiments, the determining the position change information between the hand and the mouth in the target image sequence based on the joint points of the human arm and the position information of the mouth includes:

对于每个所述目标图像,基于所述人体手臂关节点以及所述嘴巴的位置信息,确定所述手部与所述嘴巴之间的距离;For each of the target images, based on the position information of the human arm joints and the mouth, determine the distance between the hand and the mouth;

基于所述目标图像的时间顺序以及每个所述目标图像中所述手部与所述嘴巴之间的距离,确定所述位置变化信息。The position change information is determined based on the time sequence of the target images and the distance between the hand and the mouth in each of the target images.

本发明实施例提供的吸烟检测方法,确定每个目标图像中手部与嘴巴之间的距离,基于目标图像的时间顺序以及得到的手部与嘴巴之间的距离确定位置变化信息,由于吸烟动作是动态的,因此结合了多个目标图像中的信息以便后续进行吸烟动作的判断,提升了吸烟行为检测的准确性。The smoking detection method provided by the embodiment of the present invention determines the distance between the hand and the mouth in each target image, and determines the position change information based on the time sequence of the target image and the obtained distance between the hand and the mouth. It is dynamic, so the information in multiple target images is combined for subsequent judgment of smoking actions, which improves the accuracy of smoking behavior detection.

在一些实施方式中,所述基于所述目标图像的时间顺序以及每个所述目标图像中所述手部与所述嘴巴之间的距离,确定所述位置变化信息,包括:In some implementation manners, the determining the position change information based on the time sequence of the target images and the distance between the hand and the mouth in each target image includes:

基于所述目标图像的时间顺序以及每个所述目标图像中所述手部与所述嘴巴之间的距离,确定第一位置变化信息;determining first position change information based on the time sequence of the target images and the distance between the hand and the mouth in each of the target images;

对于每个所述目标图像,基于所述人体手臂关节点确定手臂肘关节的弯曲角度;For each of the target images, determine the bending angle of the elbow joint of the arm based on the joint points of the human arm;

基于所述目标图像的时间顺序以及所述手臂肘关节的弯曲角度确定第二位置变化信息。The second position change information is determined based on the time sequence of the target images and the bending angle of the elbow joint of the arm.

在一些实施方式中,所述根据所述位置变化信息确定吸烟行为的检测结果,包括:In some embodiments, the determination of the detection result of the smoking behavior according to the position change information includes:

将所述位置变化信息中的第一位置变化信息与预设第一阈值进行比较,并将所述位置变化信息中的第二位置变化信息与预设第一角度阈值进行比较,确定第一阶段吸烟动作的检测结果;comparing the first position change information in the position change information with a preset first threshold, and comparing the second position change information in the position change information with a preset first angle threshold to determine the first stage The detection result of smoking action;

将所述位置变化信息中的第一位置变化信息与预设第二阈值进行比较,并将所述位置变化信息中的第二位置变化信息与预设第二角度阈值进行比较,确定第二阶段吸烟动作的检测结果;comparing the first position change information in the position change information with a preset second threshold, and comparing the second position change information in the position change information with a preset second angle threshold to determine the second stage The detection result of smoking action;

根据所述第一阶段吸烟动作的检测结果和所述第二阶段吸烟动作的检测结果,确定吸烟行为的检测结果。The detection result of smoking behavior is determined according to the detection result of the first-stage smoking action and the detection result of the second-stage smoking action.

本发明实施例提供的吸烟检测方法,将位置变化信息中的第一位置变化信息和第二位置变化信息分别与预设第一阈值和预设第一角度阈值进行比较,从而判断是否存在第一阶段吸烟动作,将第一位置变化信息和第二位置变化信息分别与预设第二阈值和预设第二角度阈值进行比较,从而判断是否存在第二阶段吸烟动作。判断是否存在吸烟行为时,由于考虑了吸烟的动作,因此需要结合第一阶段吸烟动作的检测结果和第二阶段吸烟动作的检测结果进行综合判断,提升了吸烟行为检测的准确性。The smoking detection method provided by the embodiment of the present invention compares the first position change information and the second position change information in the position change information with the preset first threshold and the preset first angle threshold respectively, so as to determine whether there is a first For the staged smoking action, the first position change information and the second position change information are compared with the preset second threshold and the preset second angle threshold respectively, so as to determine whether there is a second-stage smoking action. When judging whether there is smoking behavior, since the smoking action is considered, it is necessary to combine the detection results of the first-stage smoking action and the detection results of the second-stage smoking action to make a comprehensive judgment, which improves the accuracy of smoking behavior detection.

在一些实施方式中,所述将所述位置变化信息中的第一位置变化信息与预设第一阈值进行比较,并将所述位置变化信息中的第二位置变化信息与预设第一角度阈值进行比较,确定第一阶段吸烟动作的检测结果,包括:In some embodiments, the first position change information in the position change information is compared with a preset first threshold, and the second position change information in the position change information is compared with a preset first angle Thresholds are compared to determine the detection results of the first-stage smoking action, including:

根据所述嘴巴的位置信息确定预设第一阈值;determining a preset first threshold according to the position information of the mouth;

在预设时间阈值内,当所述第一位置变化信息不大于所述预设第一阈值,且所述第二位置变化信息小于预设第一角度阈值时,确定存在第一阶段吸烟动作。Within the preset time threshold, when the first position change information is not greater than the preset first threshold and the second position change information is smaller than the preset first angle threshold, it is determined that there is a first-stage smoking action.

在一些实施方式中,所述将所述位置变化信息中的第一位置变化信息与预设第二阈值进行比较,并将所述位置变化信息中的第二位置变化信息与预设第二角度阈值进行比较,确定第二阶段吸烟动作的检测结果,包括:In some embodiments, the first position change information in the position change information is compared with a preset second threshold, and the second position change information in the position change information is compared with a preset second angle Thresholds are compared to determine the detection results of the second-stage smoking action, including:

根据所述人体手臂关节点确定预设第二阈值;determining a preset second threshold according to the joint points of the human arm;

在预设时间阈值内,当所述第一位置变化信息不小于所述预设第二阈值,且所述第二位置变化信息小于预设第二角度阈值时,确定存在第二阶段吸烟动作。Within the preset time threshold, when the first position change information is not less than the preset second threshold and the second position change information is smaller than the preset second angle threshold, it is determined that there is a second-stage smoking action.

在一些实施方式中,所述对所述目标图像序列中的各个目标图像进行目标检测,确定所述目标图像中各目标的位置信息,包括:In some implementation manners, the performing target detection on each target image in the target image sequence, and determining the position information of each target in the target image includes:

对所述目标图像进行检测,确定所述目标图像中的人体和香烟;Detecting the target image to determine the human body and cigarettes in the target image;

对所述人体进行骨骼关节点提取,确定所述人体手臂关节点;Extracting bone joint points from the human body to determine the arm joint points of the human body;

对所述人体的人脸进行检测,确定嘴巴的位置信息。The face of the human body is detected to determine the position information of the mouth.

本发明实施例提供的吸烟检测方法,同时检测目标图像中的人体和香烟,再基于检测到人体检测人体手臂关节点以及嘴巴的位置信息,同时采用了多种目标检测方法,提升了检测目标的准确性。The smoking detection method provided by the embodiment of the present invention detects the human body and the cigarette in the target image at the same time, and then detects the position information of the human arm joints and the mouth based on the detection of the human body. accuracy.

根据第二方面,本发明实施例提供了一种吸烟检测装置,所述装置包括:According to the second aspect, an embodiment of the present invention provides a smoking detection device, the device comprising:

图像获取模块,用于获取目标图像序列;An image acquisition module, configured to acquire a target image sequence;

第一检测模块,用于对所述目标图像序列中的各个目标图像进行目标检测,确定所述目标图像中各目标的位置信息,所述目标包括人体手臂关节点、香烟以及嘴巴;The first detection module is used to perform target detection on each target image in the target image sequence, and determine the position information of each target in the target image, and the target includes human arm joints, cigarettes and mouths;

香烟判断模块,用于基于所述人体手臂关节点与所述香烟的位置,确定手部是否持有香烟;A cigarette judging module, configured to determine whether the hand holds a cigarette based on the positions of the human arm joints and the cigarette;

第二检测模块,用于当所述手部持有香烟时,基于所述人体手臂关节点以及所述嘴巴的位置信息,确定所述目标图像序列中手部与所述嘴巴之间的位置变化信息;The second detection module is used to determine the position change between the hand and the mouth in the target image sequence based on the position information of the human arm joints and the mouth when the hand holds a cigarette information;

结果确定模块,用于根据所述位置变化信息确定吸烟行为的检测结果。The result determination module is configured to determine the detection result of the smoking behavior according to the position change information.

根据第三方面,本发明实施例提供了一种电子设备,包括:存储器和处理器,所述存储器和所述处理器之间互相通信连接,所述存储器中存储有计算机指令,所述处理器通过执行所述计算机指令,从而执行第一方面或者第一方面的任意一种实施方式中所述的吸烟检测方法。According to a third aspect, an embodiment of the present invention provides an electronic device, including: a memory and a processor, the memory and the processor are connected to each other in communication, the memory stores computer instructions, and the processor By executing the computer instructions, the smoking detection method described in the first aspect or any implementation manner of the first aspect is implemented.

根据第四方面,本发明实施例提供了一种计算机可读存储介质,所述计算机可读存储介质存储计算机指令,所述计算机指令用于使所述计算机执行第一方面或者第一方面的任意一种实施方式中所述的吸烟检测方法。According to a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable the computer to execute any of the first aspect or the first aspect. A smoking detection method described in an embodiment.

附图说明Description of drawings

为了更清楚地说明本发明具体实施方式或现有技术中的技术方案,下面将对具体实施方式或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施方式,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the specific implementation of the present invention or the technical solutions in the prior art, the following will briefly introduce the accompanying drawings that need to be used in the specific implementation or description of the prior art. Obviously, the accompanying drawings in the following description The drawings show some implementations of the present invention, and those skilled in the art can obtain other drawings based on these drawings without any creative work.

图1是根据本发明实施例的吸烟检测方法的流程图;Fig. 1 is the flowchart of the smoking detection method according to the embodiment of the present invention;

图2是根据本发明实施例的确定位置变化信息的方法的流程图;FIG. 2 is a flowchart of a method for determining location change information according to an embodiment of the present invention;

图3是根据本发明实施例的确定检测结果的方法的流程图;3 is a flowchart of a method for determining a detection result according to an embodiment of the present invention;

图4是根据本发明实施例的确定各目标位置信息的方法的流程图;4 is a flow chart of a method for determining location information of each target according to an embodiment of the present invention;

图5是根据本发明实施例的吸烟检测方法的示意图;5 is a schematic diagram of a smoking detection method according to an embodiment of the present invention;

图6是根据本发明实施例的吸烟检测方法的流程图;6 is a flowchart of a smoking detection method according to an embodiment of the present invention;

图7是根据本发明实施例的关节点检测示意图;Fig. 7 is a schematic diagram of joint point detection according to an embodiment of the present invention;

图8是根据本发明实施例的吸烟动作示意图;Fig. 8 is a schematic diagram of a smoking action according to an embodiment of the present invention;

图9是根据本发明实施例的吸烟行为检测装置的示意图;Fig. 9 is a schematic diagram of a smoking behavior detection device according to an embodiment of the present invention;

图10是本发明实施例提供的电子设备的硬件结构示意图。FIG. 10 is a schematic diagram of a hardware structure of an electronic device provided by an embodiment of the present invention.

具体实施方式detailed description

为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative efforts belong to the protection scope of the present invention.

根据本发明实施例,提供了一种吸烟检测方法实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。According to an embodiment of the present invention, an embodiment of a smoking detection method is provided. It should be noted that the steps shown in the flowcharts of the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions, and, although in The flowcharts show a logical order, but in some cases the steps shown or described may be performed in an order different from that shown or described herein.

在室内场景中,判断是否存在吸烟行为可以通过烟感设备,然而在户外场景,例如工地等需要命令禁止吸烟的场所,难以通过烟感设备检测是否存在吸烟行为。本发明实施例提供的吸烟检测方法即可用于上述不方便使用烟感设备的场景。In indoor scenes, it is possible to judge whether there is smoking behavior through smoke detection equipment. However, in outdoor scenes, such as construction sites and other places where smoking is prohibited, it is difficult to detect the existence of smoking behavior through smoke detection equipment. The smoking detection method provided by the embodiment of the present invention can be used in the above-mentioned scene where it is inconvenient to use a smoke detection device.

在本实施例中提供了一种吸烟检测方法,可用于如电脑、平板电脑或具有人工智能算力的摄像头等设备,图1是根据本发明实施例的吸烟检测方法的流程图,如图1所示,该流程包括如下步骤:In this embodiment, a smoking detection method is provided, which can be used in devices such as computers, tablet computers, or cameras with artificial intelligence computing power. Fig. 1 is a flow chart of a smoking detection method according to an embodiment of the present invention, as shown in Fig. 1 As shown, the process includes the following steps:

S11,获取目标图像序列。S11. Acquire a target image sequence.

目标图像是需要检测是否存在吸烟行为的场所的图像,可以通过场所中的监控摄像头获取视频图像,视频数据集包含了连续帧的目标图像,即目标图像序列。The target image is the image of the place where smoking behavior needs to be detected. The video image can be obtained through the surveillance camera in the place. The video data set contains the target image of continuous frames, that is, the target image sequence.

S12,对目标图像序列中的各个目标图像进行目标检测,确定目标图像中各目标的位置信息,目标包括人体手臂关节点、香烟以及嘴巴。S12. Perform target detection on each target image in the target image sequence, and determine the position information of each target in the target image, where the targets include human arm joints, cigarettes, and mouths.

目标图像序列包括多个目标图像,对各个目标图像进行目标检测,需要确认的目标包括人体手臂关节点、香烟以及嘴巴。The target image sequence includes multiple target images, and target detection is performed on each target image, and the targets to be confirmed include human arm joints, cigarettes, and mouths.

为了确定人体手臂关节点以及嘴巴的位置,需要对目标图像中的人体进行检测,进而基于检测到的人体进行关节点检测以及人脸检测,通过关节点检测确定人体的手臂关节点的坐标,手臂关节点包括腕关节、肘关节和肩关节等。通过人脸检测,确定嘴巴的坐标。In order to determine the position of the joint points of the human arm and the mouth, it is necessary to detect the human body in the target image, and then perform joint point detection and face detection based on the detected human body, and determine the coordinates of the human arm joint points through joint point detection. Joints include wrist joints, elbow joints and shoulder joints. Through face detection, determine the coordinates of the mouth.

通过目标检测算法检测目标图像中的香烟位置,在此之前首先需要检测目标图像中是否存在香烟,具体地,可以基于目标检测模型检测目标图像中的香烟状的物体,若检测到有香烟状的物体,再确定该物体的坐标。由于可能还存在其他类似香烟状的物体,本方案需要结合是否存在吸烟动作共同判断是否存在吸烟行为,因此在该步骤中的香烟指代所有检测到的香烟状的物体。The cigarette position in the target image is detected by the target detection algorithm. Before that, it is first necessary to detect whether there is a cigarette in the target image. Specifically, the cigarette-like object in the target image can be detected based on the target detection model. If a cigarette-like object is detected object, and then determine the coordinates of the object. Since there may be other cigarette-like objects, this solution needs to determine whether there is a smoking behavior together with whether there is a smoking action, so the cigarette in this step refers to all detected cigarette-like objects.

S13,基于人体手臂关节点与香烟的位置,确定手部是否持有香烟。S13, based on the positions of the human arm joints and the cigarette, determine whether the hand holds the cigarette.

判断人体手臂关节点与香烟的位置,主要是根据检测到的人体手臂关节点的坐标与检测到的香烟状的物体的坐标来判断手部是否持有该香烟状的物体,例如可以设定人体手臂关节点的检测框与香烟检测框的交并比需要大于某个阈值。另外,也可以根据得到的人体手臂关节点的坐标与香烟的坐标,计算香烟与手的距离,若计算得到的距离小于某个阈值,则可以确定手部持有香烟。Judging the position of the joints of the human arm and the cigarette is mainly based on the detected coordinates of the joints of the human arm and the coordinates of the detected cigarette-like object to determine whether the hand holds the cigarette-like object. For example, the human body can be set The intersection ratio between the detection frame of the arm joint point and the cigarette detection frame needs to be greater than a certain threshold. In addition, the distance between the cigarette and the hand can also be calculated according to the obtained coordinates of the joint points of the human arm and the coordinates of the cigarette. If the calculated distance is less than a certain threshold, it can be determined that the hand holds the cigarette.

S14,当手部持有香烟时,基于人体手臂关节点以及嘴巴的位置信息,确定目标图像序列中手部与嘴巴之间的位置变化信息。S14, when the hand holds the cigarette, based on the position information of the joint points of the human arm and the mouth, determine the position change information between the hand and the mouth in the target image sequence.

经过S13,当确定手部未持有香烟时,基本可以判断不存在吸烟行为,可能是将类似香烟形状的物体误检为香烟。After S13, when it is determined that the hand does not hold a cigarette, it can basically be judged that there is no smoking behavior, and it may be that an object similar to a cigarette is misdetected as a cigarette.

当确定手部持有香烟时,由于这里还不能完全确定检测到的是否是真正的香烟,可能会出现手部持有类似香烟形状物体的情况,因此不可简单判断是否存在吸烟行为,还需要判断是否存在吸烟动作。对吸烟动作的判断,需要结合多个目标图像,结合手部与嘴巴之间的位置变化信息进行综合判断。其中位置变化信息包括了手与嘴巴之间的距离、肘关节的弯曲角度等。首先需要确定手与嘴巴之间的距离关系,通过人体手臂关节点的位置包括腕关节、肘关节、肩关节以及手部关节等的位置。根据手部关节的坐标和嘴巴的坐标可以计算手与嘴巴之间的距离,根据手臂关节点可以确定肘关节的弯曲角度。由于吸烟动作是动态连续的,因此需要结合多个目标图像中手部与嘴巴之间的位置变化信息。位置变化信息包括手部与嘴巴之间的距离变化情况以及肘关节的弯曲角度的变化情况。When it is determined that the hand is holding a cigarette, since it is not completely sure whether the detected is a real cigarette, there may be a situation where the hand holds an object similar to a cigarette. Therefore, it is not possible to simply judge whether there is a smoking behavior, but also to judge Whether there is a smoking action. To judge the smoking action, it is necessary to combine multiple target images and the position change information between the hand and the mouth to make a comprehensive judgment. The position change information includes the distance between the hand and the mouth, the bending angle of the elbow joint, etc. First of all, it is necessary to determine the distance relationship between the hand and the mouth, through the position of the joint points of the human arm, including the positions of the wrist joint, elbow joint, shoulder joint and hand joint. The distance between the hand and the mouth can be calculated according to the coordinates of the hand joint and the mouth, and the bending angle of the elbow joint can be determined according to the arm joint points. Since the smoking action is dynamic and continuous, it is necessary to combine the position change information between the hand and the mouth in multiple target images. The position change information includes the change of the distance between the hand and the mouth and the change of the bending angle of the elbow joint.

将手部与嘴巴的距离、肘关节弯曲角度与设定的手部与嘴巴的距离阈值以及肘关节弯曲阈值进行比较,判断按时间顺序的目标图像序列中,是否存在手部远离嘴巴、手部靠近嘴巴,肘部弯曲在一定角度以内和以外等情形。Compare the distance between the hand and the mouth and the bending angle of the elbow joint with the set distance threshold between the hand and the mouth and the bending threshold of the elbow joint to determine whether there is a hand far away from the mouth or a hand in the target image sequence in chronological order. Proximity to the mouth, elbows bent in and out of a certain angle, etc.

S15,根据位置变化信息确定吸烟行为的检测结果。S15. Determine the detection result of the smoking behavior according to the position change information.

可以根据实际情况设定手部与嘴巴的距离阈值、肘关节弯曲角度阈值等,当手部与嘴巴之间的距离小于某距离阈值,且肘关节弯曲角度在某肘关节弯曲角度阈值以内,则判断存在手部靠近嘴巴动作。当手部与嘴巴之间的距离大于某距离阈值,且肘关节弯曲角度在某肘关节弯曲角度以外,则判断存在手部远离嘴巴动作。The distance threshold between the hand and the mouth, the elbow bending angle threshold, etc. can be set according to the actual situation. When the distance between the hand and the mouth is less than a certain distance threshold, and the elbow bending angle is within a certain elbow bending angle threshold, then It is judged that there is a movement of the hand close to the mouth. When the distance between the hand and the mouth is greater than a certain distance threshold and the bending angle of the elbow joint is outside a certain bending angle of the elbow joint, it is determined that there is a movement of the hand moving away from the mouth.

吸烟动作包括手部靠近嘴巴以及手部逐渐远离嘴巴,若在一定时间内,判断存在一定次数以上的手部靠近嘴巴动作以及手部逐渐远离嘴巴动作,基本可以判断存在吸烟动作或类似吸烟的动作。由于已经检测到存在手部持有香烟状的物体的情况,结合检测到存在吸烟或类似吸烟的动作,因此基本可以确定存在吸烟行为。若不存在吸烟动作或类似吸烟的动作,则可以确定目标图像序列的范围内不存在吸烟行为。若判断存在吸烟行为,则可以发出报警提示,以便相关人员及时对吸烟行为进行处理,保障场所的安全。Smoking actions include the hand approaching the mouth and the hand gradually moving away from the mouth. If it is judged that there are more than a certain number of hand approaching mouth movements and hand gradually moving away from the mouth within a certain period of time, it can basically be judged that there is a smoking action or an action similar to smoking. . Since the existence of a cigarette-like object held by the hand has been detected, combined with the detection of smoking or an action similar to smoking, it can basically be determined that there is a smoking behavior. If there is no smoking action or smoking-like action, it can be determined that there is no smoking action within the range of the target image sequence. If it is judged that there is a smoking behavior, an alarm prompt can be issued so that relevant personnel can deal with the smoking behavior in time to ensure the safety of the place.

本发明实施例提供的吸烟检测方法,获取目标图像序列,基于多种目标检测方法检测人体手臂关节点、香烟以及嘴巴的位置信息,判断是否持有香烟并判断是否存在吸烟动作或类似吸烟的动作,进而确定是否存在吸烟行为。该方法不仅对香烟进行检测,还同时检测是否存在吸烟动作,二者结合下再判断吸烟行为的检测结果,采用多模式进行吸烟行为的判别,提高了吸烟行为检测的准确性。The smoking detection method provided by the embodiment of the present invention obtains the target image sequence, detects the position information of the joints of the human arm, the cigarette and the mouth based on various target detection methods, judges whether a cigarette is held, and judges whether there is a smoking action or an action similar to smoking , and then determine whether there is smoking behavior. The method not only detects cigarettes, but also detects whether there is a smoking action at the same time, and then judges the detection result of the smoking behavior by combining the two, and uses multi-modes to distinguish the smoking behavior, which improves the accuracy of the smoking behavior detection.

在本实施例中提供了确定位置变化信息的方法,对应于图1中S14,可用于如电脑、平板电脑或具有人工智能算力的摄像头等设备,图2是根据本发明实施例的确定位置变化信息的方法的流程图,如图2所示,该流程包括如下步骤:In this embodiment, a method for determining position change information is provided, which corresponds to S14 in FIG. 1 and can be used for devices such as computers, tablet computers, or cameras with artificial intelligence computing power. FIG. 2 is a determination of position according to an embodiment of the present invention The flow chart of the method for changing information, as shown in Figure 2, the process includes the following steps:

S21,对于每个目标图像,基于人体手臂关节点以及嘴巴的位置信息,确定手部与嘴巴之间的距离。S21. For each target image, determine the distance between the hand and the mouth based on the position information of the joint points of the human arm and the mouth.

经过对目标图像进行多种目标检测,已经确定了目标图像中人体手臂关节点位置信息以及嘴巴位置信息,位置信息包括坐标信息。人体手臂关节点包括腕关节、肘关节、肩关节以及手部关节等,根据手部关节的坐标和嘴巴的坐标计算手部与嘴巴之间的距离。另外,还可以结合各手臂关节点计算肘关节的弯曲角度。After performing multiple target detections on the target image, the position information of the joint points of the human arm and the mouth in the target image have been determined, and the position information includes coordinate information. The human arm joints include wrist joints, elbow joints, shoulder joints, and hand joints. The distance between the hand and the mouth is calculated according to the coordinates of the hand joints and the coordinates of the mouth. In addition, the bending angle of the elbow joint can also be calculated in combination with each arm joint point.

S22,基于目标图像的时间顺序以及每个目标图像中手部与嘴巴之间的距离,确定位置变化信息。S22. Determine position change information based on the time sequence of the target images and the distance between the hand and the mouth in each target image.

位置变化信息包括手部与嘴巴之间的距离变化情况,以及肘关节弯曲角度的变化情况。由于吸烟动作是动态变化的,因此在判断是否存在吸烟动作时需要结合多张目标图像的检测结果,即结合目标图像的时间顺序判断在一定时间内位置变化信息是否符合吸烟动作的变化,例如手部与嘴巴之间的距离会在某预设阈值内的同时肘关节的弯曲角度小于某阈值,随着时间变化手部与嘴巴之间的距离逐渐变大且肘关节的弯曲角度大于某阈值。具体地,确定位置变化信息的步骤如下:The position change information includes the change of the distance between the hand and the mouth, and the change of the bending angle of the elbow joint. Since the smoking action changes dynamically, it is necessary to combine the detection results of multiple target images when judging whether there is a smoking action, that is, combine the time sequence of the target image to judge whether the position change information within a certain period of time conforms to the change of the smoking action, such as hand The distance between the hand and the mouth will be within a certain preset threshold and the bending angle of the elbow joint will be smaller than a certain threshold. As time goes by, the distance between the hand and the mouth will gradually increase and the bending angle of the elbow joint will be greater than a certain threshold. Specifically, the steps of determining location change information are as follows:

S221,基于目标图像的时间顺序以及每个目标图像中手部与嘴巴之间的距离,确定第一位置变化信息。S221. Determine first position change information based on the time sequence of the target images and the distance between the hand and the mouth in each target image.

第一位置变化信息包括手部与嘴巴之间的距离变化情况,记录在时间顺序的目标图像中手部与嘴巴之间的距离,可得到第一位置变化信息。The first position change information includes the change of the distance between the hand and the mouth, and the first position change information can be obtained by recording the distance between the hand and the mouth in the chronological target images.

S222,对于每个目标图像,基于人体手臂关节点确定手臂肘关节的弯曲角度。S222. For each target image, determine the bending angle of the elbow joint of the arm based on the joint points of the human arm.

人体手臂关节点包括腕关节、肘关节、肩关节等,由于已经确定手臂上各个关节的坐标,根据各关节的坐标,可以计算每一张目标图像中肘关节的弯曲角度。The human arm joint points include wrist joint, elbow joint, shoulder joint, etc. Since the coordinates of each joint on the arm have been determined, according to the coordinates of each joint, the bending angle of the elbow joint in each target image can be calculated.

S223,基于目标图像的时间顺序以及手臂肘关节的弯曲角度确定第二位置变化信息。S223. Determine second position change information based on the time sequence of the target images and the bending angle of the elbow joint of the arm.

第二位置变化信息包括手臂肘关节的弯曲角度的变化情况,记录在时间顺序的目标图像中手臂肘关节的弯曲角度可得到第二位置变化信息。The second position change information includes the change of the bending angle of the elbow joint of the arm, and the second position change information can be obtained by recording the bending angle of the elbow joint of the arm in the time sequence target images.

本发明实施例提供的吸烟检测方法,确定每个目标图像中手部与嘴巴之间的距离,基于目标图像的时间顺序以及得到的手部与嘴巴之间的距离确定位置变化信息,由于吸烟动作是动态的,因此结合了多个目标图像中的信息以便后续进行吸烟动作的判断,提升了吸烟行为检测的准确性。The smoking detection method provided by the embodiment of the present invention determines the distance between the hand and the mouth in each target image, and determines the position change information based on the time sequence of the target image and the obtained distance between the hand and the mouth. It is dynamic, so the information in multiple target images is combined for subsequent judgment of smoking actions, which improves the accuracy of smoking behavior detection.

在本实施例中提供了确定检测结果的方法,对应于图1中S15,可用于如电脑、平板电脑或具有人工智能算力的摄像头等设备,图3是根据本发明实施例的确定检测结果的方法的流程图,如图3所示,该流程包括如下步骤:In this embodiment, a method for determining the detection result is provided, which corresponds to S15 in FIG. 1 and can be used for devices such as computers, tablet computers, or cameras with artificial intelligence computing power. FIG. 3 is a determination of the detection result according to an embodiment of the present invention. The flow chart of the method, as shown in Figure 3, the process includes the following steps:

S31,将位置变化信息中的第一位置变化信息与预设第一阈值进行比较,并将位置变化信息中的第二位置变化信息与预设第一角度阈值进行比较,确定第一阶段吸烟动作的检测结果。S31, comparing the first position change information in the position change information with a preset first threshold, and comparing the second position change information in the position change information with a preset first angle threshold, to determine the first-stage smoking action test results.

第一位置变化信息包括在一定时间范围内手部与嘴巴之间的距离变化情况,预设第一阈值是根据实际情况设定的用于判断手部与嘴巴是否靠近的距离阈值。第二位置变化信息包括在一定时间范围内手臂肘关节的弯曲角度的变化情况,预设第一角度阈值是根据实际情况设定的用于辅助判断手部是否靠近嘴巴的角度阈值。通过将第一位置变化信息与预设第一阈值进行比较,并将第二位置变化信息与预设第一角度阈值进行比较,若在一定时间内手部与嘴巴之间的距离不大于预设第一阈值且手臂肘关节弯曲角度小于预设第一角度阈值,则可以确定存在第一阶段吸烟动作,即存在手部靠近嘴巴的动作。The first position change information includes the change of the distance between the hand and the mouth within a certain time range, and the preset first threshold is a distance threshold set according to the actual situation for judging whether the hand is close to the mouth. The second position change information includes the change of the bending angle of the elbow joint of the arm within a certain time range, and the preset first angle threshold is an angle threshold set according to the actual situation to assist in judging whether the hand is close to the mouth. By comparing the first position change information with the preset first threshold, and comparing the second position change information with the preset first angle threshold, if the distance between the hand and the mouth is not greater than the preset If the first threshold and the bending angle of the elbow joint of the arm is less than the preset first angle threshold, it can be determined that there is a first-stage smoking action, that is, there is an action of the hand approaching the mouth.

具体地,S31包括以下步骤:Specifically, S31 includes the following steps:

S311,根据嘴巴的位置信息确定预设第一阈值。S311. Determine a preset first threshold according to the position information of the mouth.

嘴巴的位置信息包括左嘴角的位置和右嘴角的位置,根据左嘴角的位置和右嘴角的位置可以得到左嘴角到右嘴角的距离,在本实施例中,将左嘴角到右嘴角的距离确定为预设第一阈值。预设第一阈值是根据实际情况进行设定的,考虑到个体差异,在本实施例中将左嘴角到右嘴角的距离作为预设第一阈值,在实际应用时也可采用其他方式设定预设第一阈值,具体不作限定。The position information of the mouth includes the position of the left corner of the mouth and the position of the right corner of the mouth. According to the position of the left corner of the mouth and the position of the right corner of the mouth, the distance from the left corner of the mouth to the right corner of the mouth can be obtained. In this embodiment, the distance from the left corner of the mouth to the right corner of the mouth is determined is the preset first threshold. The preset first threshold is set according to the actual situation. In consideration of individual differences, in this embodiment, the distance from the left corner of the mouth to the right corner of the mouth is used as the preset first threshold, which can also be set in other ways in practical applications The first threshold is preset, which is not specifically limited.

S312,在预设时间阈值内,当第一位置变化信息不大于预设第一阈值,且第二位置变化信息小于预设第一角度阈值时,确定存在第一阶段吸烟动作。S312. Within the preset time threshold, when the first position change information is not greater than the preset first threshold and the second position change information is smaller than the preset first angle threshold, determine that there is a first-stage smoking action.

当手部与嘴巴之间的距离不大于预设第一阈值,且手臂肘关节的弯曲角度小于预设第一角度阈值时,确定存在第一阶段吸烟动作,第一阶段吸烟动作即吸烟时,手部靠近嘴巴,手臂弯曲且在预设时间阈值内(例如,持续3秒及以上)。When the distance between the hand and the mouth is not greater than the preset first threshold, and the bending angle of the elbow joint of the arm is less than the preset first angle threshold, it is determined that there is a first-stage smoking action, and the first-stage smoking action is when smoking, The hand is close to the mouth, the arm is bent and within a preset time threshold (for example, for 3 seconds or more).

S32,将位置变化信息中的第一位置变化信息与预设第二阈值进行比较,并将位置变化信息中的第二位置变化信息与预设第二角度阈值进行比较,确定第二阶段吸烟动作的检测结果。S32, comparing the first position change information in the position change information with a preset second threshold, and comparing the second position change information in the position change information with a preset second angle threshold, to determine the second-stage smoking action test results.

第一位置变化信息包括在一定时间范围内手部与嘴巴之间的距离变化情况,预设第二阈值是根据实际情况设定的用于判断手部与嘴巴是否远离的距离阈值。第二位置变化信息包括在一定时间范围内手臂肘关节的弯曲角度的变化情况,预设第二角度阈值是根据实际情况设定的用于辅助判断手部是否远离嘴巴的角度阈值。通过将第一位置变化信息与预设第二阈值进行比较,并将第二位置变化信息与预设第二角度阈值进行比较,若在一定时间内手部与嘴巴之间的距离不小于预设第二阈值且手臂肘关节弯曲角度大于预设第一角度阈值,则可以确定存在第二阶段吸烟动作,即存在手部远离嘴巴的动作。The first position change information includes the change of the distance between the hand and the mouth within a certain time range, and the preset second threshold is a distance threshold set according to the actual situation for judging whether the hand is far away from the mouth. The second position change information includes the change of the bending angle of the elbow joint of the arm within a certain time range, and the preset second angle threshold is an angle threshold set according to the actual situation to assist in judging whether the hand is far away from the mouth. By comparing the first position change information with the preset second threshold, and comparing the second position change information with the preset second angle threshold, if the distance between the hand and the mouth is not less than the preset The second threshold and the bending angle of the elbow joint of the arm is greater than the preset first angle threshold, it can be determined that there is a second-stage smoking action, that is, there is an action where the hand moves away from the mouth.

具体地,S32包括以下步骤:Specifically, S32 includes the following steps:

S321,根据所述人体手臂关节点确定预设第二阈值。S321. Determine a preset second threshold according to the joint points of the human arm.

人体手臂关节点的位置信息包括左肩的位置和右肩的位置,根据左肩的位置和右肩的位置可以得到左肩到右肩的距离,在本实施例中,将左肩到右肩的距离确定为预设第二阈值。预设第二阈值是根据实际情况进行设定的,考虑到个体差异,在本实施例中将左肩到右肩的距离作为预设第二阈值,在实际应用时也可采用其他方式设定预设第二阈值,具体不作限定。The position information of the joint points of the human arm includes the position of the left shoulder and the position of the right shoulder. According to the position of the left shoulder and the position of the right shoulder, the distance from the left shoulder to the right shoulder can be obtained. In this embodiment, the distance from the left shoulder to the right shoulder is determined as Preset the second threshold. The preset second threshold is set according to the actual situation. Considering individual differences, in this embodiment, the distance from the left shoulder to the right shoulder is used as the preset second threshold. In actual application, other methods can also be used to set the preset threshold. A second threshold is set, which is not specifically limited.

S322,在预设时间阈值内,当第一位置变化信息不小于预设第二阈值,且第二位置变化信息小于预设第二角度阈值时,确定存在第二阶段吸烟动作。S322. Within the preset time threshold, when the first position change information is not less than the preset second threshold and the second position change information is less than the preset second angle threshold, determine that there is a second-stage smoking action.

当手部与嘴巴之间的距离不小于预设第二阈值,且手臂肘关节的弯曲角度大于预设第二角度阈值时,确定存在第二阶段吸烟动作,第二阶段吸烟动作即吸烟后,手部远离嘴巴且在预设时间阈值内(例如,持续3秒及以上)。When the distance between the hand and the mouth is not less than the preset second threshold, and the bending angle of the elbow joint of the arm is greater than the preset second angle threshold, it is determined that there is a second-stage smoking action, and the second-stage smoking action is after smoking, The hand is kept away from the mouth and within a preset time threshold (for example, for 3 seconds or more).

S33,根据第一阶段吸烟动作的检测结果和第二阶段吸烟动作的检测结果,确定吸烟行为的检测结果。S33. Determine the detection result of the smoking behavior according to the detection result of the smoking action in the first stage and the detection result of the smoking action in the second stage.

当第一阶段吸烟动作的检测结果为确定存在第一阶段吸烟动作,且第二阶段吸烟动作的检测结果为确定存在第二阶段吸烟动作,即确定在一定时间范围内,存在手部靠近嘴巴的吸烟动作以及手部远离嘴巴的动作,若判断存在一定次数以上的周期性第一阶段吸烟动作和第二阶段吸烟动作,结合检测到香烟状物体,即可确定存在吸烟行为。When the detection result of the first-stage smoking action is to determine the existence of the first-stage smoking action, and the detection result of the second-stage smoking action is to determine the existence of the second-stage smoking action, that is, it is determined that within a certain time range, there is a hand close to the mouth. Smoking action and the action of moving the hand away from the mouth. If it is judged that there are more than a certain number of periodic first-stage smoking actions and second-stage smoking actions, combined with the detection of a cigarette-like object, the existence of smoking behavior can be determined.

吸烟行为的检测结果还包括确定不存在吸烟行为,若不存在第一阶段吸烟动作,或不存在第二阶段吸烟动作,或二者都不存在,都可确定不存在吸烟动作,当不存在吸烟动作,即可确定不存在吸烟行为。The detection result of smoking behavior also includes determining that there is no smoking behavior. If there is no first-stage smoking action, or there is no second-stage smoking action, or both do not exist, it can be determined that there is no smoking action. action, it can be determined that there is no smoking behavior.

本发明实施例提供的吸烟检测方法,将位置变化信息中的第一位置变化信息和第二位置变化信息分别与预设第一阈值和预设第一角度阈值进行比较,从而判断是否存在第一阶段吸烟动作,将第一位置变化信息和第二位置变化信息分别与预设第二阈值和预设第二角度阈值进行比较,从而判断是否存在第二阶段吸烟动作。判断是否存在吸烟行为时,由于考虑了吸烟的动作,因此需要结合第一阶段吸烟动作的检测结果和第二阶段吸烟动作的检测结果进行综合判断,提升了吸烟行为检测的准确性。The smoking detection method provided by the embodiment of the present invention compares the first position change information and the second position change information in the position change information with the preset first threshold and the preset first angle threshold respectively, so as to determine whether there is a first For the staged smoking action, the first position change information and the second position change information are compared with the preset second threshold and the preset second angle threshold respectively, so as to determine whether there is a second-stage smoking action. When judging whether there is smoking behavior, since the smoking action is considered, it is necessary to combine the detection results of the first-stage smoking action and the detection results of the second-stage smoking action to make a comprehensive judgment, which improves the accuracy of smoking behavior detection.

在本实施例中提供了确定各目标位置信息的方法,对应于图1中S12,图4是根据本发明实施例的确定各目标位置信息的方法的流程图,如图4所示,该流程包括如下步骤:In this embodiment, a method for determining position information of each target is provided, corresponding to S12 in FIG. 1 , and FIG. 4 is a flow chart of a method for determining position information of each target according to an embodiment of the present invention. As shown in FIG. 4 , the flow Including the following steps:

S41,对目标图像进行检测,确定目标图像中的人体和香烟。S41. Detect the target image, and determine the human body and the cigarette in the target image.

对目标图像进行检测的过程中,可以采用多种目标检测模型对不同的目标进行检测,例如可以通过人体检测模型检测目标图像中的人体,即使用机器学习或深度学习在图片或视频流中检测出人体,并标注其位置。通过目标检测模型检测目标图像中香烟状的物体,为了避免误检,在该步骤检测的香烟指香烟状的物体,并非直接确定是否为香烟,还需后续结合吸烟动作进行综合判断。In the process of detecting the target image, various target detection models can be used to detect different targets. For example, the human body in the target image can be detected through the human body detection model, that is, machine learning or deep learning can be used to detect in pictures or video streams Figure out the human body and mark its location. To detect the cigarette-like object in the target image through the target detection model, in order to avoid false detection, the cigarette detected in this step refers to the cigarette-like object, and it is not directly determined whether it is a cigarette, but it needs to be comprehensively judged in combination with the smoking action.

S42,对人体进行骨骼关节点提取,确定人体手臂关节点。S42, extracting bone joint points from the human body, and determining human arm joint points.

在对人体检测后,可通过深度学习模型提取人体骨骼关节点,从而确定手臂的关节点,并用连接线按照人体结构连接这些关节点。After the human body is detected, the joint points of the human skeleton can be extracted through the deep learning model, so as to determine the joint points of the arm, and connect these joint points according to the human body structure with connecting lines.

S43,对人体的人脸进行检测,确定嘴巴的位置信息。S43. Detect the face of the human body, and determine the position information of the mouth.

在对人体检测后,可基于检测到的人体进行人脸检测,例如通过人脸关键点模型进行检测,检测出五官的位置,即可确定嘴巴的位置信息,嘴巴的位置信息可以包括左嘴角的坐标,右嘴角的坐标等。After detecting the human body, face detection can be performed based on the detected human body. For example, through the detection of the key point model of the face, the position of the facial features can be detected, and the position information of the mouth can be determined. The position information of the mouth can include the left corner of the mouth. Coordinates, coordinates of the right mouth corner, etc.

本发明实施例提供的吸烟检测方法,同时检测目标图像中的人体和香烟,再基于检测到人体检测人体手臂关节点以及嘴巴的位置信息,同时采用了多种目标检测方法,提升了检测目标的准确性。The smoking detection method provided by the embodiment of the present invention detects the human body and the cigarette in the target image at the same time, and then detects the position information of the human arm joints and the mouth based on the detection of the human body. accuracy.

在本实施例中提供了吸烟检测方法,可以基于摄像头加具有人工智能算力的边缘盒子的硬件组合,如图5所示,也可以基于具备人工智能算力的摄像头,方法的流程示意图如图6所示。当摄像头视频流被读入设备,将其分解成图像序列。图像序列经过多种目标检测模型,确定目标图像中的各目标。通过人体检测模型,例如Yolov5模型,基于机器学习或深度学习方法在目标图像中进行人体检测,并标注其位置。基于检测到的人体,采用人体骨骼关节点检测模型提取出人体关节点,例如openpose模型,在检测出人体关节点后用连接线按照人体结构连接这些关节点,如图7所示。基于检测到的人体进行人脸检测,也可以直接进行人脸检测,采用人脸关键点模型检测出左眼、右眼、鼻子、左嘴角以及右嘴角等,例如Retinaface模型。采用目标检测模型检测目标图像中的香烟状物体,例如MobileSSD或Yolo系列(v3、v4或v5)模型。需要注意的是,在本实施例中,几种目标检测既可以并行也可以串行使用。通过检测到的左嘴角、右嘴角以及人体手臂关节点判断是否存在吸烟动作。计算各目标图像中左嘴角和右嘴角的中点到手的距离,定义左嘴角到右嘴角的距离为预设第一阈值,左肩到右肩的距离为预设第二阈值。In this embodiment, a smoking detection method is provided, which can be based on the hardware combination of a camera plus an edge box with artificial intelligence computing power, as shown in Figure 5, or based on a camera with artificial intelligence computing power. The schematic flow diagram of the method is shown in the figure 6. When the camera video stream is read into the device, it is decomposed into a sequence of images. The image sequence passes through multiple object detection models to determine each object in the object image. Through the human detection model, such as the Yolov5 model, the human body is detected in the target image based on machine learning or deep learning methods, and its position is marked. Based on the detected human body, the joint points of the human body are extracted using a human skeleton joint point detection model, such as the openpose model. After detecting the joint points of the human body, connect these joint points according to the human body structure with connecting lines, as shown in Figure 7. Face detection is performed based on the detected human body, or face detection can be performed directly, and the left eye, right eye, nose, left mouth corner, and right mouth corner are detected by using the key point model of the face, such as the Retinaface model. Use a target detection model to detect cigarette-like objects in the target image, such as the MobileSSD or Yolo series (v3, v4 or v5) models. It should be noted that in this embodiment, several target detections can be used in parallel or serially. Judge whether there is a smoking action by detecting the left mouth corner, right mouth corner and human arm joints. Calculate the distance from the midpoint of the left and right mouth corners to the hand in each target image, define the distance from the left mouth corner to the right mouth corner as the preset first threshold, and define the distance from the left shoulder to the right shoulder as the preset second threshold.

在吸烟时,当手到嘴巴的距离不大于预设第一阈值并且肘关节的弯曲角度小于预设第一角度阈值,该动作保持一定时间以上(例如,3秒以上),即可判断存在第一阶段吸烟动作。之后手逐渐远离嘴巴,当手到嘴巴的距离不小于预设第二阈值并且肘关节的弯曲角度大于预设第二角度阈值,该动作保持一定时间以上(例如,3秒以上),即可判断存在第二阶段吸烟动作。之后进行周期性判断,若第一阶段吸烟动作和第二阶段吸烟动作在一定周期内重复设定次数,即判断存在吸烟动作,动作示意图如图8所示。在本实施例中,设定预设第一角度阈值为30度,预设第二角度阈值为150度。若检测到目标图像中存在香烟状物体,且香烟状物体的检测框与人体检测框的交并比大于一定数值,在本实施例中设定交并比阈值为0.8,在此前提下若判断存在吸烟动作,并且经过周期性判断,即吸烟动作在设定的时间周期内重复一定次数以上(例如3次以上),综合判断后则完全判定存在吸烟行为,否则仍不判断为存在吸烟行为。若判断存在吸烟行为,则可以发出报警提示,以保障所监控的场所的安全,避免火灾的发生。When smoking, when the distance from the hand to the mouth is not greater than the preset first threshold and the bending angle of the elbow joint is smaller than the preset first angle threshold, and this action is kept for a certain period of time (for example, more than 3 seconds), it can be judged that there is a second threshold. One-stage smoking action. After that, the hand gradually moves away from the mouth. When the distance from the hand to the mouth is not less than the preset second threshold and the bending angle of the elbow joint is greater than the preset second angle threshold, and the action is kept for a certain period of time (for example, more than 3 seconds), it can be judged There is a second phase of smoking action. Periodic judgment is then carried out. If the first-stage smoking action and the second-stage smoking action are repeated for a set number of times within a certain period, it is determined that there is a smoking action. The schematic diagram of the action is shown in Figure 8. In this embodiment, the preset first angle threshold is set to 30 degrees, and the preset second angle threshold is set to 150 degrees. If it is detected that there is a cigarette-like object in the target image, and the intersection ratio between the detection frame of the cigarette-like object and the human body detection frame is greater than a certain value, in this embodiment, the threshold value of the intersection ratio is set to 0.8. There is a smoking action, and after periodic judgment, that is, the smoking action is repeated more than a certain number of times (for example, more than 3 times) within a set time period. After comprehensive judgment, it is completely determined that there is smoking behavior, otherwise it is still not judged that there is smoking behavior. If it is judged that there is a smoking behavior, an alarm prompt can be issued to ensure the safety of the monitored place and avoid the occurrence of fire.

本实施例提供的基于视频或图片序列的吸烟检测方法,通过视频帧和目标检测做动作语义分析和目标捕捉,同时使用人体检测、人体关节点检测、目标检测以及人脸关键点检测来组合算法流程,根据吸烟动作的特征构造算法进行吸烟动作的判别,并结合香烟检测,采用多种判别机制,本方法中虽然是基于视频数据进行分析,但是可以对视频数据进行抽帧,解决基于静态图片检测导致检测精度较低的问题。The smoking detection method based on video or picture sequence provided in this embodiment uses video frame and target detection to perform action semantic analysis and target capture, and simultaneously uses human body detection, human body joint point detection, target detection and face key point detection to combine algorithms The process is based on the characteristics of the smoking action to construct an algorithm to distinguish the smoking action, and combined with cigarette detection, a variety of discrimination mechanisms are used. Although the analysis is based on video data in this method, video data can be extracted to solve the problem based on static pictures. detection leads to the problem of low detection accuracy.

在本实施例中还提供了一种吸烟行为检测装置,该装置用于实现上述实施例及实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“模块”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。In this embodiment, a device for detecting smoking behavior is also provided, and the device is used to implement the above embodiments and implementation modes, and what has been described will not be repeated. As used below, the term "module" may be a combination of software and/or hardware that realizes a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, implementations in hardware, or a combination of software and hardware are also possible and contemplated.

本实施例提供一种吸烟行为检测装置,如图9所示,包括:This embodiment provides a smoking behavior detection device, as shown in Figure 9, including:

图像获取模块51,用于获取目标图像序列;An image acquisition module 51, configured to acquire a target image sequence;

第一检测模块52,用于对所述目标图像序列中的各个目标图像进行目标检测,确定所述目标图像中各目标的位置信息,所述目标包括人体手臂关节点、香烟以及嘴巴;The first detection module 52 is configured to perform target detection on each target image in the target image sequence, and determine the position information of each target in the target image, and the target includes human arm joints, cigarettes and mouths;

香烟判断模块53,用于基于所述人体手臂关节点与所述香烟的位置,确定手部是否持有香烟;A cigarette judging module 53, configured to determine whether the hand holds a cigarette based on the positions of the human arm joints and the cigarette;

第二检测模块54,用于当所述手部持有香烟时,基于所述人体手臂关节点以及所述嘴巴的位置信息,确定所述目标图像序列中手部与所述嘴巴之间的位置变化信息;The second detection module 54 is configured to determine the position between the hand and the mouth in the target image sequence based on the position information of the human arm joint points and the mouth when the hand holds a cigarette change information;

结果确定模块55,用于根据所述位置变化信息确定吸烟行为的检测结果。The result determination module 55 is configured to determine the detection result of the smoking behavior according to the position change information.

在一些实施方式中,第二检测模块54包括:In some embodiments, the second detection module 54 includes:

距离确定单元,用于对于每个所述目标图像,基于所述人体手臂关节点以及所述嘴巴的位置信息,确定所述手部与所述嘴巴之间的距离;a distance determination unit, configured to determine the distance between the hand and the mouth based on the position information of the joint points of the human arm and the mouth for each of the target images;

位置变化信息确定单元,用于基于所述目标图像的时间顺序以及每个所述目标图像中所述手部与所述嘴巴之间的距离,确定所述位置变化信息。The position change information determining unit is configured to determine the position change information based on the time sequence of the target images and the distance between the hand and the mouth in each target image.

在一些实施方式中,位置变化信息确定单元包括:In some implementations, the position change information determining unit includes:

第一位置变化信息子单元,用于基于所述目标图像的时间顺序以及每个所述目标图像中所述手部与所述嘴巴之间的距离,确定第一位置变化信息;A first position change information subunit, configured to determine first position change information based on the time sequence of the target images and the distance between the hand and the mouth in each of the target images;

弯曲角度确定子单元,用于对于每个所述目标图像,基于所述人体手臂关节点确定手臂肘关节的弯曲角度;A bending angle determination subunit, configured to determine, for each of the target images, the bending angle of the elbow joint of the arm based on the joint points of the human arm;

第二位置变化信息子单元,用于基于所述目标图像的时间顺序以及所述手臂肘关节的弯曲角度确定第二位置变化信息。The second position change information subunit is configured to determine second position change information based on the time sequence of the target images and the bending angle of the elbow joint of the arm.

在一些实施方式中,结果确定模块55包括:In some embodiments, the outcome determination module 55 includes:

第一结果确定单元,用于将所述位置变化信息中的第一位置变化信息与预设第一阈值进行比较,并将所述位置变化信息中的第二位置变化信息与预设第一角度阈值进行比较,确定第一阶段吸烟动作的检测结果;A first result determining unit, configured to compare the first position change information in the position change information with a preset first threshold, and compare the second position change information in the position change information with a preset first angle Threshold value is compared to determine the detection result of the smoking action in the first stage;

第二结果确定单元,用于将所述位置变化信息中的第一位置变化信息与预设第二阈值进行比较,并将所述位置变化信息中的第二位置变化信息与预设第二角度阈值进行比较,确定第二阶段吸烟动作的检测结果;A second result determining unit, configured to compare the first position change information in the position change information with a preset second threshold, and compare the second position change information in the position change information with a preset second angle Threshold value is compared to determine the detection result of the second-stage smoking action;

检测结果确定单元,用于根据所述第一阶段吸烟动作的检测结果和所述第二阶段吸烟动作的检测结果,确定吸烟行为的检测结果。The detection result determining unit is configured to determine the detection result of the smoking behavior according to the detection result of the first-stage smoking action and the detection result of the second-stage smoking action.

在一些实施方式中,第一结果确定单元包括:In some embodiments, the first result determination unit includes:

第一阈值确定子单元,用于根据所述嘴巴的位置信息确定预设第一阈值;A first threshold determination subunit, configured to determine a preset first threshold according to the position information of the mouth;

第一动作确定子单元,用于在预设时间阈值内,当所述第一位置变化信息不大于所述预设第一阈值,且所述第二位置变化信息小于预设第一角度阈值时,确定存在第一阶段吸烟动作。The first action determination subunit is configured to, within a preset time threshold, when the first position change information is not greater than the preset first threshold and the second position change information is smaller than the preset first angle threshold , to determine the existence of the first-stage smoking action.

在一些实施方式中,第二结果确定单元包括:In some embodiments, the second result determination unit includes:

第二阈值确定子单元,用于根据所述人体手臂关节点确定预设第二阈值;A second threshold determination subunit, configured to determine a preset second threshold according to the joint points of the human arm;

第二动作确定子单元,用于在预设时间阈值内,当所述第一位置变化信息不小于所述预设第二阈值,且所述第二位置变化信息小于预设第二角度阈值时,确定存在第二阶段吸烟动作。The second action determination subunit is configured to, within a preset time threshold, when the first position change information is not less than the preset second threshold and the second position change information is less than the preset second angle threshold , to determine the presence of a second-stage smoking action.

在一些实施方式中,第一检测模块52包括:In some embodiments, the first detection module 52 includes:

目标检测单元,用于对所述目标图像进行检测,确定所述目标图像中的人体和香烟;a target detection unit, configured to detect the target image and determine the human body and cigarettes in the target image;

关节点确定单元,用于对所述人体进行骨骼关节点提取,确定所述人体手臂关节点;a joint point determination unit, configured to extract the skeleton joint points of the human body, and determine the joint points of the human arm;

位置信息确定单元,用于对所述人体的人脸进行检测,确定嘴巴的位置信息。The position information determination unit is used to detect the face of the human body and determine the position information of the mouth.

本实施例中的吸烟行为检测装置是以功能单元的形式来呈现,这里的单元是指ASIC电路,执行一个或多个软件或固定程序的处理器和存储器,和/或其他可以提供上述功能的器件。The smoking behavior detection device in this embodiment is presented in the form of a functional unit, where the unit refers to an ASIC circuit, a processor and memory that execute one or more software or fixed programs, and/or other devices that can provide the above functions device.

上述各个模块的更进一步的功能描述与上述对应实施例相同,在此不再赘述。Further functional descriptions of the above-mentioned modules are the same as those in the above-mentioned corresponding embodiments, and will not be repeated here.

本发明实施例还提供一种电子设备,具有上述图9所示的吸烟行为检测装置。An embodiment of the present invention also provides an electronic device having the smoking behavior detection device shown in FIG. 9 above.

请参阅图10,图10是本发明实施例提供的一种电子设备的结构示意图,如图10所示,该电子设备可以包括:至少一个处理器601,例如CPU(Central Processing Unit,中央处理器),至少一个通信接口603,存储器604,至少一个通信总线602。其中,通信总线602用于实现这些组件之间的连接通信。其中,通信接口603可以包括显示屏(Display)、键盘(Keyboard),可选通信接口603还可以包括标准的有线接口、无线接口。存储器604可以是高速RAM存储器(Random Access Memory,易挥发性随机存取存储器),也可以是非不稳定的存储器(non-volatile memory),例如至少一个磁盘存储器。存储器604可选的还可以是至少一个位于远离前述处理器601的存储装置。其中处理器601可以结合图9所描述的装置,存储器604中存储应用程序,且处理器601调用存储器604中存储的程序代码,以用于执行上述任一方法步骤。Please refer to FIG. 10. FIG. 10 is a schematic structural diagram of an electronic device provided by an embodiment of the present invention. As shown in FIG. 10, the electronic device may include: at least one processor 601, such as a CPU (Central Processing Unit, central processing unit ), at least one communication interface 603, memory 604, and at least one communication bus 602. Wherein, the communication bus 602 is used to realize connection and communication between these components. Wherein, the communication interface 603 may include a display screen (Display) and a keyboard (Keyboard), and the optional communication interface 603 may also include a standard wired interface and a wireless interface. The memory 604 may be a high-speed RAM memory (Random Access Memory, volatile random access memory), or a non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the memory 604 may also be at least one storage device located away from the aforementioned processor 601 . Wherein the processor 601 may be combined with the apparatus described in FIG. 9 , the memory 604 stores an application program, and the processor 601 invokes the program code stored in the memory 604 to execute any of the above method steps.

其中,通信总线602可以是外设部件互连标准(peripheral componentinterconnect,简称PCI)总线或扩展工业标准结构(extended industry standardarchitecture,简称EISA)总线等。通信总线602可以分为地址总线、数据总线、控制总线等。为便于表示,图10中仅用一条粗线表示,但并不表示仅有一根总线或一种类型的总线。Wherein, the communication bus 602 may be a peripheral component interconnect (PCI for short) bus or an extended industry standard architecture (EISA for short) bus or the like. The communication bus 602 can be divided into an address bus, a data bus, a control bus, and the like. For ease of representation, only one thick line is used in FIG. 10 , but it does not mean that there is only one bus or one type of bus.

其中,存储器604可以包括易失性存储器(英文:volatile memory),例如随机存取存储器(英文:random-access memory,缩写:RAM);存储器也可以包括非易失性存储器(英文:non-volatile memory),例如快闪存储器(英文:flash memory),硬盘(英文:hard diskdrive,缩写:HDD)或固态硬盘(英文:solid-state drive,缩写:SSD);存储器604还可以包括上述种类的存储器的组合。Wherein, the memory 604 may include a volatile memory (English: volatile memory), such as a random-access memory (English: random-access memory, abbreviated as RAM); the memory may also include a non-volatile memory (English: non-volatile memory), such as flash memory (English: flash memory), hard disk (English: hard diskdrive, abbreviated: HDD) or solid-state hard drive (English: solid-state drive, abbreviated: SSD); the storage 604 can also include the above-mentioned types of storage The combination.

其中,处理器601可以是中央处理器(英文:central processing unit,缩写:CPU),网络处理器(英文:network processor,缩写:NP)或者CPU和NP的组合。Wherein, the processor 601 may be a central processing unit (English: central processing unit, abbreviated: CPU), a network processor (English: network processor, abbreviated: NP) or a combination of CPU and NP.

其中,处理器601还可以进一步包括硬件芯片。上述硬件芯片可以是专用集成电路(英文:application-specific integrated circuit,缩写:ASIC),可编程逻辑器件(英文:programmable logic device,缩写:PLD)或其组合。上述PLD可以是复杂可编程逻辑器件(英文:complex programmable logic device,缩写:CPLD),现场可编程逻辑门阵列(英文:field-programmable gate array,缩写:FPGA),通用阵列逻辑(英文:generic arraylogic,缩写:GAL)或其任意组合。Wherein, the processor 601 may further include a hardware chip. The aforementioned hardware chip may be an application-specific integrated circuit (English: application-specific integrated circuit, abbreviation: ASIC), a programmable logic device (English: programmable logic device, abbreviation: PLD) or a combination thereof. The above-mentioned PLD can be a complex programmable logic device (English: complex programmable logic device, abbreviation: CPLD), field-programmable logic gate array (English: field-programmable gate array, abbreviation: FPGA), general array logic (English: generic array logic , Abbreviation: GAL) or any combination thereof.

可选地,存储器604还用于存储程序指令。处理器601可以调用程序指令,实现如本申请实施例中所示的吸烟检测方法。Optionally, the memory 604 is also used to store program instructions. The processor 601 may invoke program instructions to implement the smoking detection method shown in the embodiment of the present application.

本发明实施例还提供了一种非暂态计算机存储介质,所述计算机存储介质存储有计算机可执行指令,该计算机可执行指令可执行上述任意方法实施例中的吸烟检测方法。其中,所述存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory,ROM)、随机存储记忆体(Random Access Memory,RAM)、快闪存储器(Flash Memory)、硬盘(Hard DiskDrive,缩写:HDD)或固态硬盘(Solid-State Drive,SSD)等;所述存储介质还可以包括上述种类的存储器的组合。The embodiment of the present invention also provides a non-transitory computer storage medium, the computer storage medium stores computer-executable instructions, and the computer-executable instructions can execute the smoking detection method in any method embodiment above. Wherein, the storage medium may be a magnetic disk, an optical disk, a read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a flash memory (Flash Memory), a hard disk (Hard Disk) DiskDrive, abbreviation: HDD) or solid-state disk (Solid-State Drive, SSD), etc.; the storage medium may also include a combination of the above-mentioned types of memory.

虽然结合附图描述了本发明的实施例,但是本领域技术人员可以在不脱离本发明的精神和范围的情况下做出各种修改和变型,这样的修改和变型均落入由所附权利要求所限定的范围之内。Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art can make various modifications and variations without departing from the spirit and scope of the present invention. within the bounds of the requirements.

Claims (10)

1. A method of smoking detection, comprising:
acquiring a target image sequence;
performing target detection on each target image in the target image sequence, and determining position information of each target in the target image, wherein the target comprises a human body arm joint point, a cigarette and a mouth;
determining whether the hand holds the cigarette or not based on the joint points of the human arm and the position of the cigarette;
when the hand holds a cigarette, determining position change information between the hand and the mouth in the target image sequence based on the human arm joint points and the position information of the mouth;
and determining the detection result of the smoking behavior according to the position change information.
2. The method of claim 1, wherein the determining position change information between a hand and the mouth in the target image sequence based on the human arm joint point and the position information of the mouth comprises:
for each of the target images, determining a distance between the hand and the mouth based on the human arm joint points and the position information of the mouth;
determining the position change information based on a temporal order of the target images and a distance between the hand and the mouth in each of the target images.
3. The method of claim 2, wherein determining the position change information based on the temporal order of the target images and the distance between the hand and the mouth in each of the target images comprises:
determining first position change information based on the time sequence of the target images and the distance between the hand and the mouth in each of the target images;
for each of the target images, determining a bending angle of an elbow joint of an arm based on the human arm joint points;
determining second position change information based on the temporal sequence of the target images and the bend angle of the elbow joint.
4. The method of claim 1, wherein determining the detection result of smoking behavior according to the location change information comprises:
comparing first position change information in the position change information with a preset first threshold value, and comparing second position change information in the position change information with a preset first angle threshold value to determine a detection result of smoking action at a first stage;
comparing first position change information in the position change information with a preset second threshold value, and comparing second position change information in the position change information with a preset second angle threshold value to determine a detection result of second-stage smoking actions;
and determining the detection result of the smoking behavior according to the detection result of the first stage smoking action and the detection result of the second stage smoking action.
5. The method according to claim 4, wherein the comparing the first position change information in the position change information with a preset first threshold value and the comparing the second position change information in the position change information with a preset first angle threshold value to determine the detection result of the first stage smoking action comprises:
determining a preset first threshold according to the position information of the mouth;
and determining that a first stage smoking action exists when the first position change information is not greater than the preset first threshold and the second position change information is smaller than a preset first angle threshold within a preset time threshold.
6. The method according to claim 4, wherein the comparing the first position change information in the position change information with a preset second threshold value and the comparing the second position change information in the position change information with a preset second angle threshold value to determine the detection result of the second stage smoking action comprises:
determining a preset second threshold according to the human arm joint point;
and in a preset time threshold, when the first position change information is not smaller than the preset second threshold and the second position change information is smaller than a preset second angle threshold, determining that second-stage smoking actions exist.
7. The method according to any one of claims 1-6, wherein the performing object detection on each object image in the sequence of object images and determining position information of each object in the object images comprises:
detecting the target image, and determining a human body and cigarettes in the target image;
extracting skeleton joint points of the human body, and determining arm joint points of the human body;
and detecting the human face of the human body and determining the position information of the mouth.
8. A smoking detection device, the device comprising:
the image acquisition module is used for acquiring a target image sequence;
the first detection module is used for carrying out target detection on each target image in the target image sequence and determining the position information of each target in the target images, wherein the target comprises a human body arm joint point, a cigarette and a mouth;
the cigarette judging module is used for determining whether the hand holds a cigarette or not based on the joint points of the human arm and the position of the cigarette;
the second detection module is used for determining position change information between the hand and the mouth in the target image sequence based on the human body arm joint points and the position information of the mouth when the hand holds a cigarette;
and the result determining module is used for determining the detection result of the smoking behavior according to the position change information.
9. An electronic device, comprising:
a memory and a processor, the memory and the processor being communicatively connected to each other, the memory having stored therein computer instructions, the processor executing the computer instructions to perform the smoking detection method according to any one of claims 1 to 7.
10. A computer-readable storage medium having stored thereon computer instructions for causing a computer to perform the smoking detection method of any one of claims 1-7.
CN202211148966.0A 2022-09-21 2022-09-21 Smoking detection method, device, equipment and storage medium Pending CN115471916A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211148966.0A CN115471916A (en) 2022-09-21 2022-09-21 Smoking detection method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211148966.0A CN115471916A (en) 2022-09-21 2022-09-21 Smoking detection method, device, equipment and storage medium

Publications (1)

Publication Number Publication Date
CN115471916A true CN115471916A (en) 2022-12-13

Family

ID=84334462

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211148966.0A Pending CN115471916A (en) 2022-09-21 2022-09-21 Smoking detection method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN115471916A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116434295A (en) * 2023-03-07 2023-07-14 深圳市铁越电气有限公司 Smoking identification method and system based on target detection and key point detection
CN116884034A (en) * 2023-07-10 2023-10-13 中电金信软件有限公司 Object identification method and device
CN116977625A (en) * 2023-07-19 2023-10-31 广州高新兴机器人有限公司 Smoking behavior detection method, device, medium and equipment based on patrol robot
CN117409484A (en) * 2023-12-14 2024-01-16 四川汉唐云分布式存储技术有限公司 Cloud-guard-based client offence detection method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488841A (en) * 2020-04-15 2020-08-04 上海眼控科技股份有限公司 Smoking behavior detection method and device, computer equipment and storage medium
CN111832434A (en) * 2020-06-23 2020-10-27 广州市保伦电子有限公司 A campus smoking behavior identification method and processing terminal under the protection of privacy
CN113971839A (en) * 2021-12-23 2022-01-25 宏景科技股份有限公司 Method, device, equipment and medium for detecting abnormal human body behaviors in images and videos
CN114463779A (en) * 2020-10-22 2022-05-10 北京鸿享技术服务有限公司 Smoking identification method, device, equipment and storage medium

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111488841A (en) * 2020-04-15 2020-08-04 上海眼控科技股份有限公司 Smoking behavior detection method and device, computer equipment and storage medium
CN111832434A (en) * 2020-06-23 2020-10-27 广州市保伦电子有限公司 A campus smoking behavior identification method and processing terminal under the protection of privacy
CN114463779A (en) * 2020-10-22 2022-05-10 北京鸿享技术服务有限公司 Smoking identification method, device, equipment and storage medium
CN113971839A (en) * 2021-12-23 2022-01-25 宏景科技股份有限公司 Method, device, equipment and medium for detecting abnormal human body behaviors in images and videos

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116434295A (en) * 2023-03-07 2023-07-14 深圳市铁越电气有限公司 Smoking identification method and system based on target detection and key point detection
CN116884034A (en) * 2023-07-10 2023-10-13 中电金信软件有限公司 Object identification method and device
CN116977625A (en) * 2023-07-19 2023-10-31 广州高新兴机器人有限公司 Smoking behavior detection method, device, medium and equipment based on patrol robot
CN117409484A (en) * 2023-12-14 2024-01-16 四川汉唐云分布式存储技术有限公司 Cloud-guard-based client offence detection method, device and storage medium

Similar Documents

Publication Publication Date Title
CN115471916A (en) Smoking detection method, device, equipment and storage medium
CN109508688B (en) Skeleton-based behavior detection method, terminal equipment and computer storage medium
US11430265B2 (en) Video-based human behavior recognition method, apparatus, device and storage medium
US10438077B2 (en) Face liveness detection method, terminal, server and storage medium
WO2020000912A1 (en) Behavior detection method and apparatus, and electronic device and storage medium
WO2021169616A1 (en) Method and apparatus for detecting face of non-living body, and computer device and storage medium
US9646571B1 (en) Panoramic video augmented reality
CN112001886A (en) A temperature detection method, device, terminal and readable storage medium
CN111488775B (en) Device and method for judging degree of visibility
CN111079536B (en) Behavior analysis method, storage medium and device based on human body key point time sequence
CN108090340B (en) Face recognition processing method, face recognition processing device and intelligent terminal
WO2022095359A1 (en) Anti-screen-capturing-based information security protection method and apparatus, electronic device and medium
CN113076903A (en) Target behavior detection method and system, computer equipment and machine readable medium
CN111444555A (en) A temperature measurement information display method, device and terminal equipment
WO2022199360A1 (en) Moving object positioning method and apparatus, electronic device, and storage medium
CN111241983A (en) Posture detection method, device and system, electronic equipment and storage medium
CN114613010A (en) Training method and device for detecting model, and method and device for detecting smoking behavior
CN111986229A (en) Video target detection method, device and computer system
US11393181B2 (en) Image recognition system and updating method thereof
CN112328822A (en) Image pre-marking method, device and terminal equipment
CN113610835B (en) Humanoid detection method for nursing cameras
CN107995442A (en) Processing method, device and the computing device of video data
CN111626265A (en) Multi-camera downlink identification method and device and computer readable storage medium
WO2022091577A1 (en) Information processing device and information processing method
JP6991045B2 (en) Image processing device, control method of image processing device

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