An alarm method and device, electronic equipment and storage medium

By identifying and associating the motion trajectory and identity of objects in an image sequence, and determining whether to generate an alarm signal based on positional relationships, the problem of false alarms in existing technologies is solved, and higher alarm accuracy is achieved.

CN114255444BActive Publication Date: 2026-06-09HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
Filing Date
2021-12-17
Publication Date
2026-06-09

AI Technical Summary

Technical Problem

In existing technologies, determining whether to generate an alarm based solely on the number of objects can easily lead to false alarms.

Method used

By identifying the motion trajectories and identity sequences of objects in an image sequence, and associating them based on their location, the number of associated objects is counted to generate an alarm signal.

Benefits of technology

This improves the accuracy of alarms and reduces the occurrence of false alarms.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114255444B_ABST
    Figure CN114255444B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide an alarm method and device, electronic equipment and storage medium, relating to the technical field of data processing, comprising: identifying each object in an image sequence, and extracting a motion trajectory sequence of each object; extracting an identity sequence of a target object in the image sequence, wherein the identity sequence comprises an identity region where the identity of the same target object in the image sequence is located; associating the motion trajectory sequence and the identity sequence based on the positional relationship between each object region in the motion trajectory sequence and each identity region in the identity sequence; and counting a first number of associated objects in the identified objects that have an association relationship, and generating an alarm signal if the first number meets a preset alarm condition. The embodiments of the present application can improve the accuracy of the alarm.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of data processing technology, and in particular to an alarm method, device, electronic device and storage medium. Background Technology

[0002] In scenarios such as banks, shopping malls, and factories, it is usually necessary to determine whether to generate an alarm signal based on the number of objects in the scenario for ease of management.

[0003] In related technologies, it is generally necessary to acquire images of a scene, identify all objects in the scene based on the images, count the number of all objects, and generate an alarm signal when the number exceeds a preset threshold. For example, in a shopping mall, it is necessary to count the number of all people, and trigger an alarm when the number of people exceeds a preset threshold.

[0004] The above approach, which relies solely on the number of objects to determine whether an alarm needs to be triggered, is prone to false alarms. Summary of the Invention

[0005] The purpose of this application is to provide an alarm method, device, electronic device, and storage medium to improve the accuracy of alarms. The specific technical solution is as follows:

[0006] In a first aspect, embodiments of this application provide an alarm method, the method comprising:

[0007] Identify each object in an image sequence and extract the motion trajectory sequence of each object, wherein the motion trajectory sequence includes: the object region where the same object is located in the images contained in the image sequence;

[0008] Extract the identity identifier sequence of target objects whose identity identifiers meet preset recognition conditions from the image sequence, wherein the identity identifier sequence includes: the identifier region where the identity identifiers of the same target object are located in the images contained in the image sequence;

[0009] Based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence, the motion trajectory sequence and the identity identifier sequence are associated.

[0010] The system counts the first number of related objects among the identified objects, and generates an alarm signal when the first number meets a preset alarm condition.

[0011] In one embodiment of this application, the step of counting a first number of associated objects among the identified objects, and generating an alarm signal when the first number meets a preset alarm condition, includes:

[0012] The system counts a first number of related objects among the identified objects and a second number of non-related objects among the identified objects. An alarm signal is generated when the first number and the second number meet preset alarm conditions.

[0013] In one embodiment of this application, after the step of associating the motion trajectory sequence with the identity sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity sequence, the method further includes:

[0014] According to the time sequence, multiple motion trajectory sequences associated with the same identity identifier sequence are merged.

[0015] In one embodiment of this application, associating the motion trajectory sequence with the identity sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity sequence includes:

[0016] The system searches for motion trajectory sequences and identity identification sequences whose positions between an object region and an identification region meet preset positional conditions. It then associates the found motion trajectory sequences and identity identification sequences. The positional conditions include: the distance between the object region and the identification region is less than a preset distance threshold in a consecutive preset number of image frames; the size of the overlapping area between the object region and the identification region exceeds a preset region threshold in a consecutive preset number of image frames; or the relative positional relationship between the object region and the identification region remains unchanged in a consecutive preset number of image frames.

[0017] In one embodiment of this application, the step of counting a first number of associated objects among the identified objects, and generating an alarm signal when the first number meets a preset alarm condition, includes:

[0018] For each identity sequence, based on the target object corresponding to the identity sequence, the object corresponding to the motion trajectory sequence associated with the identity sequence is marked;

[0019] The system counts the first number of marked objects among the identified objects, and generates an alarm signal if the first number meets a preset alarm condition.

[0020] Secondly, embodiments of this application provide an alarm device, the device comprising:

[0021] The first sequence extraction module is used to identify each object in the image sequence and extract the motion trajectory sequence of each object, wherein the motion trajectory sequence includes: the object region where the same object is located in the images contained in the image sequence;

[0022] The second sequence extraction module is used to extract the identity identifier sequence of target objects whose identity identifiers meet preset recognition conditions in the image sequence, wherein the identity identifier sequence includes: the identifier region where the identity identifiers of the same target object are located in the images contained in the image sequence;

[0023] The sequence association module is used to associate the motion trajectory sequence with the identity identification sequence based on the positional relationship between each object region in the motion trajectory sequence and each identification region in the identity identification sequence;

[0024] The signal generation module is used to count the first number of related objects among the identified objects, and generate an alarm signal when the first number meets the preset alarm conditions.

[0025] In one embodiment of this application, the signal generation module is specifically used for:

[0026] The system counts a first number of related objects among the identified objects and a second number of non-related objects among the identified objects. An alarm signal is generated when the first number and the second number meet preset alarm conditions.

[0027] In one embodiment of this application, the apparatus further includes a sequence merging module, used for:

[0028] After associating the motion trajectory sequence with the identity sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence, multiple motion trajectory sequences associated with the same identity identifier sequence are merged according to the time sequence.

[0029] In one embodiment of this application, the sequence association module is specifically used for:

[0030] The system searches for motion trajectory sequences and identity identification sequences whose positions between an object region and an identification region meet preset positional conditions. It then associates the found motion trajectory sequences and identity identification sequences. The positional conditions include: the distance between the object region and the identification region is less than a preset distance threshold in a consecutive preset number of image frames; the size of the overlapping area between the object region and the identification region exceeds a preset region threshold in a consecutive preset number of image frames; or the relative positional relationship between the object region and the identification region remains unchanged in a consecutive preset number of image frames.

[0031] In one embodiment of this application, the signal generation module is specifically used for:

[0032] For each identity sequence, based on the target object corresponding to the identity sequence, the object corresponding to the motion trajectory sequence associated with the identity sequence is marked;

[0033] The system counts the first number of marked objects among the identified objects, and generates an alarm signal if the first number meets a preset alarm condition.

[0034] Thirdly, embodiments of this application provide an electronic device, including a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus;

[0035] Memory, used to store computer programs;

[0036] When a processor executes a program stored in memory, it implements the alarm method steps described in any of the first aspects.

[0037] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the alarm method steps described in any of the first aspects.

[0038] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the alarm methods described above.

[0039] Beneficial effects of the embodiments in this application:

[0040] The alarm scheme provided in this application embodiment can identify each object in an image sequence and extract the motion trajectory sequence of each object. The motion trajectory sequence includes: object regions where the same object is located in the images contained in the image sequence; extracting the identity identifier sequence of target objects in the image sequence whose identity identifiers meet preset recognition conditions, wherein the identity identifier sequence includes: identifier regions where the identity identifiers of the same target object are located in the images contained in the image sequence; associating the motion trajectory sequence with the identity identifier sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence; counting a first number of associated objects among the identified objects, and generating an alarm signal when the first number meets preset alarm conditions. This allows for the identification of all objects in a scene based on the image sequence, and also allows for the identification of target objects in the scene whose identity identifiers meet preset recognition conditions based on the image sequence. The first number of target objects meeting the recognition conditions among all identified objects determines whether an alarm is needed, thereby achieving alarm determination based on the identity of the objects in the scene. Therefore, applying the scheme provided in this application embodiment can improve the accuracy of alarms. Attached Figure Description

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

[0042] Figure 1 A flowchart illustrating an alarm method provided in an embodiment of this application;

[0043] Figure 2 This is a schematic diagram illustrating an inclusion relationship between an object region and an identifier region, provided as an embodiment of this application.

[0044] Figure 3 This is a schematic diagram illustrating an intersection between an object region and an identifier region, provided as an embodiment of this application.

[0045] Figure 4 This is a schematic diagram illustrating the relative positional relationship between an object area and an identifier area, provided as an embodiment of this application.

[0046] Figure 5 A schematic diagram illustrating an association relationship provided for an embodiment of this application;

[0047] Figure 6 A flowchart illustrating another alarm method provided in an embodiment of this application;

[0048] Figure 7 This is a schematic diagram of the structure of an alarm device provided in an embodiment of this application;

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

[0050] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art based on this application are within the scope of protection of this application.

[0051] To improve the accuracy of alarms, embodiments of this application provide an alarm method, device, electronic device, and storage medium, which will be described in detail below.

[0052] This application provides an alarm method that can be applied to electronic devices such as image acquisition devices, NVRs (Network Video Recorders), computers, and servers. The method includes:

[0053] Identify each object in an image sequence and extract the motion trajectory sequence of each object, wherein the motion trajectory sequence includes: the object region where the same object is located in the images contained in the image sequence;

[0054] Extract the identity identifier sequence of target objects in the image sequence that meet the preset recognition conditions, wherein the identity identifier sequence includes: the identifier region where the identity identifier of the same target object is located in the images contained in the image sequence;

[0055] Based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence, the motion trajectory sequence and the identity identifier sequence are associated.

[0056] The system counts the first number of related objects among the identified objects, and generates an alarm signal when the first number meets the preset alarm conditions.

[0057] The solution provided in the above embodiments can, on the one hand, identify all objects in a scene based on an image sequence, and on the other hand, identify target objects in the scene whose identity markers meet preset identification conditions based on an image sequence. It then determines whether an alarm needs to be triggered based on a first number of target objects that meet the identification conditions among all identified objects, thereby achieving alarm determination based on the identity of objects in the scene. Therefore, it is evident that applying the solution provided in the above embodiments can improve the accuracy of alarms.

[0058] See Figure 1 , Figure 1 This is a flowchart illustrating an alarm method provided in an embodiment of this application. The method includes the following steps S101-S104:

[0059] S101, identify each object in the image sequence and extract the motion trajectory sequence of each object.

[0060] The motion trajectory sequence includes the object region where the same object is located in the image sequence.

[0061] The aforementioned image sequence may be a series of video frames captured by an image acquisition device, which can be deployed in the control area to capture images of objects in that area.

[0062] The aforementioned objects can be people, animals, goods, vehicles, etc.

[0063] The object region mentioned above can be the entire area of ​​the object in the image. For example, if the object is a vehicle, the object region can be the body area of ​​the vehicle in the image. Alternatively, the object region can be a local area of ​​the object in the image. For example, if the object is a person, the object region can be the head and shoulder area of ​​the person in the image.

[0064] Specifically, an image sequence can be obtained from an image acquisition device. Object recognition can be performed on each image in the image sequence to obtain the object region where the object is located in each image. Based on the recognition results, the object regions belonging to the same object in the image sequence can be determined, thereby extracting the motion trajectory sequence corresponding to each object.

[0065] In one embodiment of this application, when extracting the motion trajectory sequence of each object, the object region where each object is located in each image contained in the image sequence can be identified. For each object region, an object region adjacent to the position of the object region is found in the image adjacent to the image. This object region is used as the object region of the same object in different images, thereby adding the above object regions to the same motion trajectory sequence to obtain the motion trajectory sequence of the same object.

[0066] In addition, in one embodiment of this application, each object in the most recently acquired image in the image sequence can be identified to obtain the object region where each object is located in the image. For each object region, from the acquired motion trajectory sequence, a motion trajectory sequence in the sequence in which the distance between the latest object region and the object region is less than a preset region distance threshold is found, and the object region is added to the found motion trajectory sequence. The aforementioned region distance threshold can be 0.5 meters, 0.2 meters, 0.1 meters, etc., and this embodiment of the application does not limit it to this value.

[0067] S102, Extract the identity sequence of the target object in the image sequence that meets the preset recognition conditions.

[0068] The identity sequence includes the identifier region where the identity identifier of the same target object is located in the images contained in the image sequence.

[0069] The aforementioned identification can be a face, license plate, clothing, employee badge, vehicle body, etc.

[0070] The aforementioned identification area can be the area where the identity identifier of an object in the image is located. For example, if the object is a person and the identity identifier is a face, the aforementioned identification area can be the face area of ​​the person in the image.

[0071] The identification criteria mentioned above can be: personnel wearing work badges, personnel wearing red clothing, vehicles with blue body color, or objects belonging to a pre-registered object library, etc.

[0072] In one embodiment of this application, when extracting the identity identifier sequence, the identifier region containing the identity identifier of the object contained in each image in the image sequence can be detected, and then the identity identifier in the identifier region can be identified. The object whose identified identity identifier meets the preset identification conditions can be selected as the target object. Based on the identification result, the identifier region in the image sequence belonging to the same object can be determined, thereby extracting the identity identifier sequence corresponding to each target object.

[0073] In addition, the identifier regions containing the identity identifiers of objects in each image in the image sequence can be detected. Then, according to the positional relationship of the identifier regions contained in different images, the identifier regions of the same object in different images can be determined, and the identifier region sequences of each object in different images can be extracted. For each object's identifier region sequence, a preset number of identifier regions with the highest image quality are determined from the sequence. Then, the identity identifiers in the aforementioned identifier regions to be verified are identified, and it is determined whether the identification result meets the preset identification conditions. If so, the object contained in the sequence is determined to be the target object, and the sequence is used as the motion trajectory sequence corresponding to the target object.

[0074] The image quality mentioned above may include the clarity of the marked area, the orientation of the object in the marked area, the completeness of the object in the marked area, etc. The preset quantity can be 1, 3, 5, etc., and this application embodiment does not limit it.

[0075] In one embodiment of this application, when determining a target object, feature extraction can be performed on the identification region of each object to obtain the identity features of each object. The identity features are then compared with the condition values ​​that characterize the above-mentioned identification conditions. If the identity features match the condition values, the object is considered to be the target object.

[0076] For example, the aforementioned identity feature could be the color of clothing, and the aforementioned condition value could be red. In this case, the color feature of the object's clothing in the identification area can be extracted as the object's identity feature. Then, this identity feature is compared with red. If the comparison is successful, it means that the color of the object's clothing is red, which meets the recognition condition, and thus the object can be considered as the target object.

[0077] S103, based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence, associate the motion trajectory sequence with the identity identifier sequence.

[0078] Specifically, based on the positional relationship between each object region in each motion trajectory sequence and each identifier region in each identity identifier sequence, it can be determined whether the object contained in the motion trajectory sequence and the object contained in the identity identifier sequence are the same object. If they are, the motion trajectory sequence and the identity identifier sequence can be associated.

[0079] In one embodiment of this application, after associating the motion trajectory sequence with the identity identifier sequence, multiple motion trajectory sequences associated with the same identity identifier sequence can be merged according to the time sequence.

[0080] Specifically, when a motion trajectory sequence is associated with an identity identifier sequence, it means that the object contained in the motion trajectory sequence and the object contained in the identity identifier sequence are the same object. For multiple motion trajectory sequences associated with the same identity identifier sequence, it means that the objects contained in the multiple motion trajectory sequences are the same object. Therefore, the multiple motion trajectory sequences can be merged according to the order of the acquisition time of the images contained in each motion trajectory sequence.

[0081] This prevents the motion trajectory sequence belonging to the same object from being divided into multiple motion trajectory sequences due to reasons such as the object being occluded or leaving the image during the motion process, thereby improving the accuracy of the extracted motion trajectory sequence and avoiding repeated statistics on multiple motion trajectory sequences of the same object in the future, thus improving the accuracy of the alarm.

[0082] S104, count the first number of related objects among the identified objects that have a relationship, and generate an alarm signal if the first number meets the preset alarm conditions.

[0083] The alarm condition can be that the first quantity exceeds a preset upper limit threshold, which can be 5, 8, 12, etc., or the first quantity is lower than a preset lower limit threshold, which can be 3, 2, 6, etc.

[0084] The aforementioned associated objects are: objects whose corresponding motion trajectory sequences are associated with identity identifier sequences.

[0085] Specifically, the objects identified in step S101 above can be understood as all objects in the scene. The associated objects with a relationship can be understood as target objects whose identity meets the preset identification conditions. Therefore, the first quantity can reflect the number of target objects whose identity meets the identification conditions among all objects in the scene. When the first quantity meets the alarm conditions, an alarm signal can be generated to trigger an alarm.

[0086] For example, in a security check scenario, the aforementioned identification could be an armband, and the identification condition could be an armband representing a security personnel. In this case, the target object could be understood as a security personnel. The alarm condition could be that the first number is lower than a preset threshold for the number of security personnel. That is, in a security check scenario, if the number of security personnel among all personnel is less than the aforementioned threshold, then a security loophole is considered to exist, and an alarm signal can be generated to trigger an alarm.

[0087] In one embodiment of this application, when the image sequence contains multiple frames of images, a first number of related objects with a relationship can be counted among the objects identified in each frame of the image. When the first number counted in any image meets the alarm condition, an alarm signal can be generated.

[0088] In addition, an alarm signal can be generated when the first quantity counted in at least a preset number of alarm frames in the image sequence meets the alarm conditions. The preset number of alarms can be 5, 8, 15, etc.

[0089] In the above scheme, an alarm signal may be generated when the first quantity counted in any preset number of alarm frames in the image sequence meets the alarm condition; or an alarm signal may be generated when the first quantity counted in consecutive preset number of alarm frames in the image sequence meets the alarm condition.

[0090] For example, in a banking scenario, assuming the target is staff members, the alarm condition can be that the number of staff members in a consecutive 30-frame image sequence is less than 2. That is, when the number of staff members in a consecutive 30-frame image sequence is less than 2, it is considered that the staff member has left their post, and an alarm signal is generated.

[0091] The alarm scheme provided in the above embodiments can identify each object in an image sequence and extract the motion trajectory sequence of each object. The motion trajectory sequence includes: object regions where the same object is located in the images contained in the image sequence; extracting the identity identifier sequence of target objects in the image sequence whose identity identifiers meet preset recognition conditions, wherein the identity identifier sequence includes: identifier regions where the identity identifiers of the same target object are located in the images contained in the image sequence; associating the motion trajectory sequence with the identity identifier sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence; counting a first number of associated objects among the identified objects, and generating an alarm signal when the first number meets preset alarm conditions. This allows for the identification of all objects in a scene based on the image sequence, and also allows for the identification of target objects in the scene whose identity identifiers meet preset recognition conditions based on the image sequence. The first number of target objects meeting the recognition conditions among all identified objects determines whether an alarm is needed, thereby achieving alarm determination based on the identity of the objects in the scene. Therefore, the scheme provided in the above embodiments can improve the accuracy of alarms.

[0092] In one embodiment of this application, when associating the motion trajectory sequence with the identity identifier sequence in step S103 above, a motion trajectory sequence and an identity identifier sequence whose positions between the object area and the identifier area meet preset position conditions can be found, and the found motion trajectory sequence and identity identifier sequence can be associated.

[0093] The positional conditions include: the distance between the object region and the marker region is less than a preset distance threshold in a consecutive preset number of frames, or the size of the overlapping area between the object region and the marker region exceeds a preset region threshold in a consecutive preset number of frames, or the relative positional relationship between the object region and the marker region remains unchanged in a consecutive preset number of frames.

[0094] The preset quantity can be 5, 7, 11, etc.

[0095] Specifically, in one approach, the distance between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence can be calculated. It can be determined whether there are a consecutive preset number of object regions whose distances to the identifier regions are less than a distance threshold. If so, the objects contained in the motion trajectory sequence and the objects contained in the identity identifier sequence are considered to be the same object. Therefore, the motion trajectory sequence and the identity identifier sequence can be associated.

[0096] Wherein, the aforementioned distance may be the distance between the first marker point of the object region and the second marker point of the identification region. The first marker point may be the midpoint of the region, the lower left vertex, the location point of the object in the region, etc., and the second marker point may be the midpoint of the region, the upper right vertex, the location point of the object in the region, etc. The embodiments of this application do not limit this.

[0097] In another approach, the size of the overlapping area between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence can be calculated. It can be determined whether there are consecutive preset number of overlapping areas between object regions and identifier regions whose size exceeds the region threshold. If so, it is considered that the objects contained in the motion trajectory sequence and the objects contained in the identity identifier sequence are the same objects. Therefore, the above motion trajectory sequence and identity identifier sequence can be associated.

[0098] The positional relationship between the object region and the identifier region can be separate, contain, or intersect. In the case of containment or intersection, there is an overlapping area between the object region and the identifier region.

[0099] For example, see Figure 2 , Figure 2 This is a schematic diagram illustrating the inclusion relationship between an object region and a label region provided in an embodiment of this application. Assuming the object is a person, the object region is the head and shoulder region shown in the head and shoulder frame, and the label region is the face region shown in the identity information frame. It can be seen that the object region includes the label region. Therefore, the size of the label region can be directly used as the size of the overlapping area between the object region and the label region.

[0100] For example, see Figure 3 , Figure 3 This is a schematic diagram illustrating the intersection between an object region and a label region provided in an embodiment of this application. Assuming the object is a person, the object region is the head and shoulder region shown in the head and shoulder frame, and the label region is the name tag region shown in the identity information frame. It can be seen that there is an intersection between the object region and the label region. Therefore, the size of the overlapping area between the object region and the label region can be calculated.

[0101] In another approach, the relative positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence can be obtained. It can be determined whether there are a number of consecutive preset number of object regions and identifier regions whose relative positional relationship remains unchanged. If so, it is considered that the objects contained in the motion trajectory sequence and the objects contained in the identity identifier sequence are the same objects. Therefore, the above motion trajectory sequence and identity identifier sequence can be associated.

[0102] The aforementioned relative positional relationships may include: the orientation and distance relationships between the object area and the identifier area.

[0103] See Figure 4 , Figure 4 This is a schematic diagram illustrating the relative positional relationship between an object area and an identifier area provided in an embodiment of this application. Assuming the object is a person, the object area is the head and shoulder area shown in the head and shoulder frame, and the identifier area is the area where the work badge is hung, shown in the identity information frame. The orientation and distance relationship between the object area and the identifier area can be determined, and the relative positional relationship between the object area and the identifier area can be obtained. If the relative positional relationship between the object area and the identifier area remains unchanged for a consecutive preset number of times, it is considered that the object contained in the motion trajectory sequence and the object contained in the identity identifier sequence are the same object. Therefore, the above motion trajectory sequence and identity identifier sequence can be associated.

[0104] In one embodiment of this application, any one of the three methods described above can be used to associate the motion trajectory sequence with the identity identifier sequence, or any combination of two or three of the three methods can be used to associate the motion trajectory sequence with the identity identifier sequence. This application embodiment does not limit this.

[0105] See Figure 5 , Figure 5 This is a schematic diagram illustrating an association relationship provided in an embodiment of this application. Assuming the object is a person, the object area is the head and shoulder region shown in the head and shoulder frame, and the identifier area is the area containing the XX identifier representing the identity, shown in the identity information frame. Time1, Time2, Time3, and Time4 represent the acquisition times of different images. It can be seen that in the camera frame, the relative positional relationship between the object area and the identifier area remains unchanged for four consecutive frames in both the motion trajectory sequence and the identity identifier sequence. Therefore, it can be considered that the motion trajectory sequence and the identity identifier sequence belong to the same object, and thus, they can be associated.

[0106] In one embodiment of this application, when generating an alarm signal in step S104 above, the following can be done:

[0107] The system counts the first number of related objects among the identified objects and the second number of non-related objects among the identified objects. An alarm signal is generated when the first number and the second number meet the preset alarm conditions.

[0108] The alarm conditions mentioned above may be that the first quantity exceeds the first upper limit threshold, and / or the first quantity is lower than the first lower limit threshold, and / or the second quantity exceeds the second upper limit threshold, and / or the second quantity is lower than the second lower limit threshold, etc.

[0109] Specifically, the number of associated objects whose corresponding motion trajectory sequences and identity identification sequences are related among all objects identified in step S101 can be counted as the first number, and the number of non-associated objects whose corresponding motion trajectory sequences and identity identification sequences are not related can be counted as the second number. Based on the first number and the second number, a joint judgment is made, and an alarm signal is generated to trigger an alarm when the first number and the second number meet the alarm conditions.

[0110] For example, in a banking scenario, the aforementioned objects are personnel, and the aforementioned identification can be name tags. The identification condition can be name tags that represent staff members. In this case, the target objects can be understood as staff members. In the above case, the associated objects whose corresponding motion trajectory sequences are related to the identity tag sequences can be understood as staff members. The non-associated objects whose corresponding motion trajectory sequences are not related to the identity tag sequences can be understood as non-staff members. The alarm condition can be that the first number is lower than the preset first lower threshold and the second number is higher than the preset second upper threshold. That is, in a banking scenario, if the number of staff members is less than the aforementioned first lower threshold and the number of non-staff members exceeds the second upper threshold, then a work vulnerability is considered to exist, and an alarm signal can be generated to trigger an alarm.

[0111] In one embodiment of this application, the alarm conditions may include multiple conditions. In one case, an alarm signal is generated when the first quantity and the second quantity satisfy any one of the multiple conditions; in another case, an alarm signal is generated when the first quantity and the second quantity satisfy each of the conditions.

[0112] In one embodiment of this application, when generating an alarm signal in step S104 above, the following can be done:

[0113] For each identity sequence, based on the target object corresponding to the identity sequence, the object corresponding to the motion trajectory sequence associated with the identity sequence is marked; the first number of marked objects among the identified objects is counted, and an alarm signal is generated when the first number meets the preset alarm conditions.

[0114] The marking content used to mark the object may be: the identity information of the target object corresponding to the identity identification sequence, the association identifier representing the motion trajectory sequence of the object and the identity identification sequence, etc. This application embodiment does not limit this.

[0115] Specifically, after associating the motion trajectory sequence and identity identifier sequence belonging to the same object in step S103 above, for each identity identifier sequence with an association relationship, the object to which the motion trajectory sequence associated with the identity identifier sequence belongs can be marked based on the target object corresponding to the identity identifier sequence. In this way, when counting the first number of associated objects among the identified objects, since the marked objects are the objects with an association between the motion trajectory sequence and the identity identifier sequence, the number of marked objects among the identified objects can be directly counted as the first number, and then the first number can be used to determine whether to generate an alarm signal.

[0116] See Figure 6 , Figure 6 This is a flowchart illustrating another alarm method provided in an embodiment of this application. The method includes the following steps S601-S606:

[0117] S601 identifies each object in an image sequence and extracts the motion trajectory sequence of each object.

[0118] S602, Extract the identity sequence of the target object in the image sequence that meets the preset recognition conditions.

[0119] S603, find the motion trajectory sequence and identity identifier sequence between the object area and the identifier area that meet the preset position conditions, and associate the found motion trajectory sequence and identity identifier sequence.

[0120] The positional conditions include: the distance between the object region and the marker region is less than a preset distance threshold in a consecutive preset number of frames, or the size of the overlapping area between the object region and the marker region exceeds a preset region threshold in a consecutive preset number of frames, or the relative positional relationship between the object region and the marker region remains unchanged in a consecutive preset number of frames.

[0121] S604, according to the time sequence, merge multiple motion trajectory sequences associated with the same identity identifier sequence.

[0122] S605, for each identity sequence, based on the target object corresponding to the identity sequence, mark the object corresponding to the motion trajectory sequence associated with the identity sequence.

[0123] S606, count the first number of marked objects among the identified objects, and count the second number of unmarked objects among the identified objects. If the first number and the second number meet the preset alarm conditions, generate an alarm signal.

[0124] The alarm scheme provided in the above embodiments can identify each object in an image sequence and extract the motion trajectory sequence of each object. The motion trajectory sequence includes: object regions where the same object is located in the images contained in the image sequence; extracting the identity identifier sequence of target objects in the image sequence whose identity identifiers meet preset recognition conditions, wherein the identity identifier sequence includes: identifier regions where the identity identifiers of the same target object are located in the images contained in the image sequence; associating the motion trajectory sequence with the identity identifier sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence; counting a first number of associated objects among the identified objects, and generating an alarm signal when the first number meets preset alarm conditions. This allows for the identification of all objects in a scene based on the image sequence, and also allows for the identification of target objects in the scene whose identity identifiers meet preset recognition conditions based on the image sequence. The first number of target objects meeting the recognition conditions among all identified objects determines whether an alarm is needed, thereby achieving alarm determination based on the identity of the objects in the scene. Therefore, the scheme provided in the above embodiments can improve the accuracy of alarms.

[0125] Corresponding to the alarm method described above, this application also provides an alarm device, which will be described in detail below.

[0126] See Figure 7 , Figure 7 This is a schematic diagram of an alarm device provided in an embodiment of this application. The device includes:

[0127] The first sequence extraction module 701 is used to identify each object in the image sequence and extract the motion trajectory sequence of each object, wherein the motion trajectory sequence includes: the object region where the same object is located in the images contained in the image sequence;

[0128] The second sequence extraction module 702 is used to extract the identity identifier sequence of the target object whose identity identifier meets the preset recognition conditions in the image sequence, wherein the identity identifier sequence includes: the identifier region where the identity identifier of the same target object is located in the images contained in the image sequence;

[0129] The sequence association module 703 is used to associate the motion trajectory sequence with the identity identification sequence based on the positional relationship between each object region in the motion trajectory sequence and each identification region in the identity identification sequence;

[0130] The signal generation module 704 is used to count the first number of related objects that have a relationship among the identified objects, and generate an alarm signal when the first number meets the preset alarm conditions.

[0131] In one embodiment of this application, the signal generation module 704 is specifically used for:

[0132] The system counts a first number of related objects among the identified objects and a second number of non-related objects among the identified objects. An alarm signal is generated when the first number and the second number meet preset alarm conditions.

[0133] In one embodiment of this application, the apparatus further includes a sequence merging module, used for:

[0134] After associating the motion trajectory sequence with the identity sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence, multiple motion trajectory sequences associated with the same identity identifier sequence are merged according to the time sequence.

[0135] In one embodiment of this application, the sequence association module 703 is specifically used for:

[0136] The system searches for motion trajectory sequences and identity identification sequences whose positions between an object region and an identification region meet preset positional conditions. It then associates the found motion trajectory sequences and identity identification sequences. The positional conditions include: the distance between the object region and the identification region is less than a preset distance threshold in a consecutive preset number of image frames; the size of the overlapping area between the object region and the identification region exceeds a preset region threshold in a consecutive preset number of image frames; or the relative positional relationship between the object region and the identification region remains unchanged in a consecutive preset number of image frames.

[0137] In one embodiment of this application, the signal generation module 704 is specifically used for:

[0138] For each identity sequence, based on the target object corresponding to the identity sequence, the object corresponding to the motion trajectory sequence associated with the identity sequence is marked;

[0139] The system counts the first number of marked objects among the identified objects, and generates an alarm signal if the first number meets a preset alarm condition.

[0140] The alarm scheme provided in the above embodiments can identify each object in an image sequence and extract the motion trajectory sequence of each object. The motion trajectory sequence includes: object regions where the same object is located in the images contained in the image sequence; extracting the identity identifier sequence of target objects in the image sequence whose identity identifiers meet preset recognition conditions, wherein the identity identifier sequence includes: identifier regions where the identity identifiers of the same target object are located in the images contained in the image sequence; associating the motion trajectory sequence with the identity identifier sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence; counting a first number of associated objects among the identified objects, and generating an alarm signal when the first number meets preset alarm conditions. This allows for the identification of all objects in a scene based on the image sequence, and also allows for the identification of target objects in the scene whose identity identifiers meet preset recognition conditions based on the image sequence. The first number of target objects meeting the recognition conditions among all identified objects determines whether an alarm is needed, thereby achieving alarm determination based on the identity of the objects in the scene. Therefore, the scheme provided in the above embodiments can improve the accuracy of alarms.

[0141] This application also provides an electronic device, such as... Figure 8 As shown, it includes a processor 801, a communication interface 802, a memory 803, and a communication bus 804. The processor 801, communication interface 802, and memory 803 communicate with each other via the communication bus 804.

[0142] Memory 803 is used to store computer programs;

[0143] The processor 801 is used to implement an alarm method when executing a program stored in the memory 803.

[0144] The communication bus mentioned in the above electronic devices can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. This communication bus can be divided into address bus, data bus, control bus, etc. For ease of illustration, only one thick line is used to represent it in the diagram, but this does not mean that there is only one bus or one type of bus.

[0145] The communication interface is used for communication between the aforementioned electronic devices and other devices.

[0146] The memory may include random access memory (RAM) or non-volatile memory (NVM), such as at least one disk storage device. Optionally, the memory may also be at least one storage device located remotely from the aforementioned processor.

[0147] The processors mentioned above can be general-purpose processors, including central processing units (CPUs), network processors (NPs), etc.; they can also be digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.

[0148] In another embodiment provided in this application, a computer-readable storage medium is also provided, which stores a computer program that, when executed by a processor, implements the steps of any of the above-described alarm methods.

[0149] In another embodiment provided in this application, a computer program product containing instructions is also provided, which, when run on a computer, causes the computer to execute any of the alarm methods described above.

[0150] The alarm scheme provided in the above embodiments can identify each object in an image sequence and extract the motion trajectory sequence of each object. The motion trajectory sequence includes: object regions where the same object is located in the images contained in the image sequence; extracting the identity identifier sequence of target objects in the image sequence whose identity identifiers meet preset recognition conditions, wherein the identity identifier sequence includes: identifier regions where the identity identifiers of the same target object are located in the images contained in the image sequence; associating the motion trajectory sequence with the identity identifier sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence; counting a first number of associated objects among the identified objects, and generating an alarm signal when the first number meets preset alarm conditions. This allows for the identification of all objects in a scene based on the image sequence, and also allows for the identification of target objects in the scene whose identity identifiers meet preset recognition conditions based on the image sequence. The first number of target objects meeting the recognition conditions among all identified objects determines whether an alarm is needed, thereby achieving alarm determination based on the identity of the objects in the scene. Therefore, the scheme provided in the above embodiments can improve the accuracy of alarms.

[0151] In the above embodiments, implementation can be achieved entirely or partially through software, hardware, firmware, or any combination thereof. When implemented using software, it can be implemented entirely or partially in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, all or part of the processes or functions described in the embodiments of this application are generated. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) means. The computer-readable storage medium can be any available medium that a computer can access or a data storage device such as a server or data center that integrates one or more available media. The available medium can be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid state disk (SSD)).

[0152] It should be noted that, in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0153] The various embodiments in this specification are described in a related manner. Similar or identical parts between embodiments can be referred to mutually. Each embodiment focuses on describing the differences from other embodiments. In particular, the device embodiments, electronic device embodiments, computer-readable storage medium embodiments, and computer program product embodiments are basically similar to the method embodiments, so the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.

[0154] The above description is merely a preferred embodiment of this application and is not intended to limit the scope of protection of this application. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application are included within the scope of protection of this application.

Claims

1. An alarm method, characterized in that, The method includes: Identify each object in an image sequence and extract the motion trajectory sequence of each object, wherein the motion trajectory sequence includes: the object region where the same object is located in the images contained in the image sequence; The identification regions containing the identity identifiers of objects in each image of the image sequence are detected. Feature extraction is performed on the detected identification regions to obtain the identity features of each object. The identity features of each object are compared with the condition values ​​of preset recognition conditions. If the identity features of the object match the condition value, the object is taken as the target object. For each target object, the identification regions in the image sequence belonging to the target object are determined, and the identity identifier sequence of the target object is extracted. The identity identifier sequence includes: the identification regions containing the identity identifiers of the same target object in the images contained in the image sequence. Based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence, the motion trajectory sequence and the identity identifier sequence are associated. The system counts the first number of related objects among the identified objects. When the first number meets a preset alarm condition, an alarm signal is generated. The identified objects include all objects in the scene, and the related objects are target objects whose identity identifiers meet the preset identification conditions. The first number of related objects identified by the statistics, and the generation of an alarm signal when the first number meets a preset alarm condition, includes: The system counts a first number of related objects among the identified objects and a second number of non-related objects among the identified objects. An alarm signal is generated when the first number and the second number meet preset alarm conditions.

2. The method according to claim 1, characterized in that, After the step of associating the motion trajectory sequence and the identity sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity sequence, the method further includes: According to the time sequence, multiple motion trajectory sequences associated with the same identity identifier sequence are merged.

3. The method according to claim 1, characterized in that, The step of associating the motion trajectory sequence with the identity identifier sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence includes: The system searches for motion trajectory sequences and identity identification sequences whose positions between an object region and an identification region meet preset positional conditions. It then associates the found motion trajectory sequences and identity identification sequences. The positional conditions include: the distance between the object region and the identification region is less than a preset distance threshold in a consecutive preset number of image frames; the size of the overlapping area between the object region and the identification region exceeds a preset region threshold in a consecutive preset number of image frames; or the relative positional relationship between the object region and the identification region remains unchanged in a consecutive preset number of image frames.

4. The method according to any one of claims 1-3, characterized in that, The method involves counting a first number of related objects among the identified objects, and generating an alarm signal when the first number meets a preset alarm condition, including: For each identity sequence, based on the target object corresponding to the identity sequence, the object corresponding to the motion trajectory sequence associated with the identity sequence is marked; The system counts the first number of marked objects among the identified objects, and generates an alarm signal if the first number meets a preset alarm condition.

5. An alarm device, characterized in that, The device includes: The first sequence extraction module is used to identify each object in the image sequence and extract the motion trajectory sequence of each object, wherein the motion trajectory sequence includes: the object region where the same object is located in the images contained in the image sequence; The second sequence extraction module is used to detect the identification regions of the objects contained in each image of the image sequence, extract features from the detected identification regions to obtain the identification features of each object, compare the identification features of each object with the condition values ​​of preset recognition conditions, and if the identification features of the object match the condition values, then the object is taken as the target object. For each target object, the identification regions in the image sequence belonging to the target object are determined, and the identification sequence of the target object is extracted. The identification sequence includes the identification regions of the same target object in the images contained in the image sequence. The sequence association module is used to associate the motion trajectory sequence with the identity identification sequence based on the positional relationship between each object region in the motion trajectory sequence and each identification region in the identity identification sequence; The signal generation module is used to count the first number of related objects among the identified objects, and generate an alarm signal when the first number meets the preset alarm conditions. The identified objects include all objects in the scene, and the related objects are target objects whose identity identifiers meet the preset identification conditions. The signal generation module is specifically used to count the first number of related objects among the identified objects that have a relationship, and to count the second number of non-related objects among the identified objects that do not have a relationship, and to generate an alarm signal when the first number and the second number meet the preset alarm conditions.

6. The apparatus according to claim 5, characterized in that, The device further includes a sequence merging module for: After associating the motion trajectory sequence with the identity identifier sequence based on the positional relationship between each object region in the motion trajectory sequence and each identifier region in the identity identifier sequence, multiple motion trajectory sequences associated with the same identity identifier sequence are merged according to the time sequence. The sequence association module is specifically used for: The system finds motion trajectory sequences and identity identification sequences whose positions between an object region and an identification region meet preset position conditions. The found motion trajectory sequences and identity identification sequences are then associated. The position conditions include: the distance between the object region and the identification region is less than a preset distance threshold in a consecutive preset number of image frames; or the size of the overlapping area between the object region and the identification region exceeds a preset region threshold in a consecutive preset number of image frames; or the relative positional relationship between the object region and the identification region remains unchanged in a consecutive preset number of image frames. The signal generation module is specifically used for: For each identity sequence, based on the target object corresponding to the identity sequence, the object corresponding to the motion trajectory sequence associated with the identity sequence is marked; The system counts the first number of marked objects among the identified objects, and generates an alarm signal if the first number meets a preset alarm condition.

7. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the method described in any one of claims 1-4.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the method described in any one of claims 1-4.