Perimeter security system detection method and device, electronic equipment and storage medium
By extracting target animations from videos captured by devices outside the perimeter security system and overlaying them onto the system video, it is possible to determine whether an alarm is triggered. This solves the problems of low testing efficiency and high cost in perimeter security systems, thereby improving system reliability and reducing maintenance costs.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-23
- Publication Date
- 2026-04-14
AI Technical Summary
Existing perimeter security systems suffer from low testing efficiency, high costs, and difficulty in ensuring accuracy during deployment and maintenance. Furthermore, they are prone to algorithm failures or functional degradation, making it difficult to detect and address these issues in a timely manner.
The system extracts the target animation from videos captured by devices outside the perimeter security system and overlays it onto the system's video to determine whether an alarm is triggered. If the determination result is inconsistent with the observation result, the system is determined to be abnormal.
This enables the verification of the normal working status of the perimeter security system without waiting for real events to trigger alarms, reducing operation and maintenance costs and minimizing security risks caused by algorithm failure or functional degradation.
Smart Images

Figure CN121864940A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of security technology, and in particular to a method, apparatus, electronic device and storage medium for detecting perimeter security systems. Background Technology
[0002] With the development of artificial intelligence, existing perimeter security systems have acquired the capabilities of proactive sensing, intelligent analysis, and real-time early warning, undertaking the core tasks of preventing illegal intrusions and protecting the safety of people and property.
[0003] However, in actual deployment, existing perimeter security systems typically require real people or vehicles to trigger alarms after users configure the perimeter detection area and algorithm parameters to verify whether the system is functioning correctly. Testing the system's response to false alarms from small animals requires long waiting times for natural events, resulting in low testing efficiency. Testing the system's response to specific behaviors such as fence climbing, crawling, or vehicles driving in the wrong direction requires significant manpower for simulation, which is costly, and the accuracy and repeatability of the test results are difficult to guarantee. Furthermore, existing perimeter security systems may experience algorithm failures or functional degradation during actual operation, which users often fail to detect in time, leading to a failure to trigger alarms when actual intrusions occur, resulting in serious security risks.
[0004] Therefore, how to improve the reliability of perimeter security systems while reducing operation and maintenance costs has become an urgent technical problem to be solved. Summary of the Invention
[0005] The purpose of this application is to provide a perimeter security system detection method, apparatus, electronic device, and storage medium to improve the reliability of the perimeter security system while reducing operation and maintenance costs. The specific technical solution is as follows:
[0006] A first aspect of this application provides a perimeter security system detection method, the method comprising:
[0007] The first video obtained by the perimeter security system from the perimeter detection area is acquired, wherein no object that could trigger the alarm of the perimeter security system appears in the detection area set in the first video;
[0008] The target animation is superimposed on the first video to obtain the second video. The target animation is an animation of the first sample object moving in a preset direction extracted from the third video. The third video is captured by other devices outside the perimeter security system.
[0009] Obtain the judgment result of whether the behavior of the first sample object in the second video can trigger the alarm of the perimeter security system;
[0010] The second video is input to the perimeter security system for perimeter detection, and the perimeter detection is observed to determine whether it triggers an alarm in the perimeter security system, thus obtaining the observation results.
[0011] If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
[0012] In one possible implementation, the determination of whether the behavior of the first sample object in the second video can trigger an alarm in the perimeter security system includes:
[0013] Acquire multiple first self-check rules pre-set for the perimeter security system. Each first self-check rule includes: object type, movement direction, and expected alarm tendency, wherein the expected alarm tendency is used to indicate whether to alarm or not.
[0014] Search for a target self-check rule among the plurality of first self-check rules, wherein the object type of the target self-check rule is the same as the type of the first sample object, and the movement direction of the target self-check rule is the same as the preset direction;
[0015] If the expected alarm tendency of the target self-inspection rule is to trigger an alarm, then the judgment result is determined to be that an alarm can be triggered.
[0016] If the expected alarm tendency of the target self-check rule is not to trigger an alarm, then the judgment result is determined to be that an alarm cannot be triggered.
[0017] In one possible implementation, the method further includes:
[0018] In response to a change in the parameter represented by the first parameter identifier, multiple second self-check rules pre-set for the perimeter security system are obtained. Each second self-check rule includes: object type, movement direction, first parameter identifier, and alarm condition, wherein the first parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm condition.
[0019] Search for the target self-check rule among the plurality of second self-check rules;
[0020] If the alarm conditions of the target self-inspection rule are met, the judgment result is determined to be that an alarm can be triggered.
[0021] If the alarm conditions of the target self-check rule are not met, the judgment result is determined to be that the alarm cannot be triggered.
[0022] In one possible implementation, the method further includes:
[0023] In response to a change in the parameter represented by the second parameter identifier, multiple third self-check rules pre-set for the perimeter security system are obtained. Each third self-check rule includes: object type, movement direction, second parameter identifier, and alarm mode. The second parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm mode.
[0024] The target self-test rule is found among the multiple third self-test rules, and the alarm method of the target self-test rule is used as the target alarm method.
[0025] If the observation results indicate that no alarm was triggered, or that an alarm was triggered in a non-target alarm manner, then the perimeter security system is determined to be abnormal.
[0026] In one possible implementation, the step of overlaying the target animation onto the first video to obtain the second video includes:
[0027] The target animation is scaled according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the third video is captured.
[0028] Overlay the scaled target animation onto the first video;
[0029] The first self-test rule also includes the shooting distance range;
[0030] The shooting distance range of the target self-inspection rule covers the expected detection distance.
[0031] In one possible implementation, the method further includes:
[0032] Retrieve the target animation from the preset material library;
[0033] The resource library was pre-built in the following manner:
[0034] For each combination of type and direction, at least one video, including the third video, is acquired as a fourth video, wherein the fourth video is obtained by another device capturing the movement of the object of the type along the direction.
[0035] The motion animations of objects are extracted from each fourth video using pixel-level image segmentation and stored in the material library.
[0036] In one possible implementation, the step of overlaying the target animation onto the first video to obtain the second video includes:
[0037] The target animation is scaled according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the second video is captured.
[0038] Overlay the scaled target animation onto the first video;
[0039] For each type and direction combination, at least one fourth video is obtained, including:
[0040] For each combination of type, direction, and distance, at least one fourth video is obtained, wherein the shooting distance of the object in the fourth video is the expected detection distance.
[0041] A second aspect of this application provides a perimeter security system detection device, the device comprising:
[0042] The video acquisition module is used to acquire a first video obtained by the perimeter security system from the perimeter detection area, wherein no object that can trigger the alarm of the perimeter security system appears in the detection area set in the first video;
[0043] The video overlay module is used to overlay the target animation onto the first video to obtain the second video. The target animation is an animation of the first sample object moving in a preset direction, extracted from the third video. The third video is captured by other devices outside the perimeter security system.
[0044] The result acquisition module is used to acquire the judgment result of whether the behavior of the first sample object in the second video can trigger the alarm of the perimeter security system;
[0045] The perimeter detection module is used to input the second video to the perimeter security system for perimeter detection, and to observe whether the perimeter detection triggers an alarm in the perimeter security system, thereby obtaining the observation results;
[0046] An anomaly determination module is used to determine that the perimeter security system is abnormal if the judgment result is inconsistent with the observation result.
[0047] In one possible implementation, the result acquisition module includes:
[0048] The rule acquisition submodule is used to acquire multiple first self-check rules pre-set for the perimeter security system. Each first self-check rule includes: object type, movement direction and expected alarm tendency, and the expected alarm tendency is used to indicate whether to alarm or not.
[0049] The rule search submodule is used to search for a target self-check rule among the plurality of first self-check rules, wherein the object type of the target self-check rule is the same as the type of the first sample object, and the movement direction of the target self-check rule is the same as the preset direction;
[0050] The alarm judgment submodule is used to determine that if the expected alarm tendency of the target self-check rule is to trigger an alarm, the judgment result is that an alarm can be triggered; if the expected alarm tendency of the target self-check rule is not to trigger an alarm, the judgment result is that an alarm cannot be triggered.
[0051] In one possible implementation, the device further includes:
[0052] The first acquisition module is used to acquire multiple second self-test rules pre-set for the perimeter security system in response to a change in the parameter represented by the first parameter identifier. Each second self-test rule includes: object type, movement direction, first parameter identifier, and alarm condition. The first parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm condition.
[0053] The first search module is used to search for the target self-check rule among the plurality of second self-check rules;
[0054] The first judgment module is used to determine that if the alarm conditions of the target self-inspection rule are met, the judgment result is that an alarm can be triggered; if the alarm conditions of the target self-inspection rule are not met, the judgment result is that an alarm cannot be triggered.
[0055] In one possible implementation, the device further includes:
[0056] The second acquisition module is used to acquire multiple third self-check rules pre-set for the perimeter security system in response to a change in the parameter represented by the second parameter identifier. Each third self-check rule includes: object type, movement direction, second parameter identifier, and alarm mode. The second parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm mode.
[0057] The second search module is used to search for the target self-test rule among the multiple second self-test rules, and use the alarm method of the target self-test rule as the target alarm method;
[0058] The second judgment module is used to determine that the perimeter security system is abnormal if the observation result indicates that no alarm was triggered, or if an alarm was triggered in a non-target alarm manner.
[0059] In one possible implementation, the video overlay module includes:
[0060] The video scaling submodule is used to scale the target animation according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the third video is captured.
[0061] The video overlay submodule is used to overlay the scaled target animation onto the first video;
[0062] The first self-test rule also includes the shooting distance range;
[0063] The shooting distance range of the target self-inspection rule covers the expected detection distance.
[0064] In one possible implementation, the device further includes:
[0065] The animation acquisition module is used to acquire the target animation from the preset material library;
[0066] The resource library was pre-built in the following manner:
[0067] For each combination of type and direction, at least one video, including the third video, is acquired as a fourth video, wherein the fourth video is obtained by another device capturing the movement of the object of the type along the direction.
[0068] The motion animations of objects are extracted from each fourth video using pixel-level image segmentation and stored in the material library.
[0069] In one possible implementation, the video overlay module is specifically used for:
[0070] The target animation is scaled according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the second video is captured.
[0071] Overlay the scaled target animation onto the first video;
[0072] For each type and direction combination, at least one fourth video is obtained, including:
[0073] For each combination of type, direction, and distance, at least one fourth video is obtained, wherein the shooting distance of the object in the fourth video is the expected detection distance.
[0074] A third aspect of this application provides an electronic device, including:
[0075] Memory, used to store computer programs;
[0076] The processor, when executing a program stored in memory, implements any of the perimeter security system detection methods described above.
[0077] A fourth aspect of this application provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements any of the perimeter security system detection methods described above.
[0078] This application also provides a computer program product containing instructions that, when run on a computer, cause the computer to execute any of the perimeter security system detection methods described above.
[0079] Beneficial effects of the embodiments in this application:
[0080] This application provides a perimeter security system detection method, apparatus, electronic device, and storage medium. The method involves extracting an animation of a first sample moving in a preset direction from a third video captured by other devices outside the perimeter security system, and superimposing this animation onto the first video captured by the perimeter security system to obtain a second video. Then, it obtains a judgment result on whether the behavior of the first sample object in the second video can trigger an alarm in the perimeter security system, and inputs the second video into the perimeter security system for detection to determine whether perimeter detection triggers an alarm. If the behavior of the first sample object can trigger an alarm in the perimeter security system, and the perimeter detection triggers an alarm, then the perimeter security system is considered to be normal; otherwise, the perimeter security system is considered to be abnormal. In this way, during the deployment and operation of the perimeter security system, the method of this application can be used to verify whether the perimeter security system is working properly and whether there are any problems such as algorithm failure or functional degradation during operation, without waiting for real events to trigger alarms to verify the accuracy of the perimeter security system, and without investing a lot of manpower in manual simulation, thus reducing operation and maintenance costs and reducing the risk that the perimeter security system will fail to alarm due to algorithm failure or functional degradation. In this way, the reliability of the perimeter security system is improved while reducing operation and maintenance costs.
[0081] Of course, implementing any product or method of this application does not necessarily require achieving all of the advantages described above at the same time. Attached Figure Description
[0082] 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.
[0083] Figure 1This is a first schematic diagram of a perimeter security system detection method provided in an embodiment of this application;
[0084] Figure 2 This is a second schematic diagram of the perimeter security system detection method provided in the embodiments of this application;
[0085] Figure 3 This is a third schematic diagram of the perimeter security system detection method provided in the embodiments of this application;
[0086] Figure 4 This is a fourth schematic diagram of the perimeter security system detection method provided in the embodiments of this application;
[0087] Figure 5 A fifth schematic diagram of the perimeter security system detection method provided in the embodiments of this application;
[0088] Figure 6a A first flowchart for constructing a material library provided in an embodiment of this application;
[0089] Figure 6b A second flowchart for constructing a material library provided in an embodiment of this application;
[0090] Figure 7 Example diagram of the perimeter security system configuration interface provided in the embodiments of this application;
[0091] Figure 8 This is a schematic diagram of the perimeter security system detection device provided in the embodiments of this application;
[0092] Figure 9 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0093] 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.
[0094] To verify the proper functioning of a perimeter security system, one approach involves overlaying computer-generated simulated objects onto the video captured by the system, creating a simulated video. The perimeter system then checks this simulated video for verification. However, the texture, lighting, and motion blur details of the computer-generated simulated objects differ significantly from those of the real video footage. This results in a large discrepancy between the accuracy of the perimeter security system in the test scenario and its accuracy in real-world scenarios, ultimately leading to lower reliability of the perimeter security system in real-world conditions.
[0095] To improve the reliability of perimeter security systems while reducing maintenance costs, a first aspect of this application provides a perimeter security system detection method, such as... Figure 1 The diagram shown is a first embodiment of the perimeter security system detection method provided in this application. The method includes the following steps:
[0096] Step S10: Obtain the first video of the perimeter detection area captured by the perimeter security system;
[0097] In the first video, no object that could trigger the perimeter security system alarm appeared in the detection area set up;
[0098] Step S20: Overlay the target animation onto the first video to obtain the second video;
[0099] The target animation is the animation of the first sample object moving in a preset direction extracted from the third video. The third video is captured by other devices outside the perimeter security system.
[0100] Step S30: Obtain the judgment result of whether the behavior of the first sample object in the second video can trigger the perimeter security system alarm;
[0101] Step S40: Input the second video to the perimeter security system for perimeter detection, and observe whether the perimeter detection triggers an alarm in the perimeter security system to obtain the observation results;
[0102] Step S50: If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
[0103] Understandably, if the judgment result is consistent with the observation result, then the perimeter security system is considered to be functioning normally.
[0104] Using the embodiments of this application, the animation of the first sample moving in a preset direction is extracted from a third video captured by other devices outside the perimeter security system, and this animation is superimposed on the first video captured by the perimeter security system to obtain a second video; then it is determined whether the behavior of the first sample object in the second video can trigger an alarm of the perimeter security system, and the second video is input to the perimeter security system for detection to determine whether the perimeter detection triggers an alarm of the perimeter security system; if the behavior of the first sample object can trigger an alarm of the perimeter security system, and the perimeter detection triggers an alarm of the perimeter security system, then it is considered that the perimeter security system has not experienced any abnormality, otherwise it is considered that the perimeter security system has experienced an abnormality. In this way, during the deployment and operation of the perimeter security system, the method of this application can be used to verify whether the perimeter security system is working properly and whether there are any problems such as algorithm failure or functional degradation during operation, without waiting for real events to trigger alarms to verify the accuracy of the perimeter security system, and without investing a lot of manpower in manual simulation, thus reducing operation and maintenance costs and reducing the risk that the perimeter security system will fail to alarm due to algorithm failure or functional degradation. In this way, the reliability of the perimeter security system is improved while reducing operation and maintenance costs.
[0105] For example, if, in a certain scenario, a stray dog enters the detection area from a distance and is deemed a safety threat to people in the current detection environment, then an alarm should be triggered, and the alarm type should be "animal intrusion." To verify whether the perimeter security system will trigger an alarm when a stray dog enters the detection area from a distance, the animation of the dog's movement from a distance is extracted from videos captured by other image acquisition devices. This animation is then superimposed onto the video captured by the perimeter security system. The perimeter security system performs perimeter detection on the superimposed video. If the perimeter security system triggers an alarm, and the alarm type is also "animal intrusion," then the perimeter security system is considered to be functioning normally. However, if the perimeter security system does not trigger an alarm, or triggers an alarm but the alarm type is not "animal intrusion," then the perimeter security system is considered to be malfunctioning.
[0106] The following is a detailed explanation of steps S10 to S50:
[0107] In step S10 above, the first video obtained by the perimeter security system from the perimeter detection area refers to the first video obtained by the image acquisition device in the perimeter security system from the perimeter detection area.
[0108] It is understandable that the objects that can trigger alarms in a perimeter security system are pre-set. For example, one or more of people, vehicles, and animals can be set as objects that can trigger alarms. For instance, suppose in a certain scenario, the perimeter security system needs to detect whether someone has illegally entered; in this case, people are set as objects that can trigger alarms. If the perimeter security system detects an animal entering, it will not trigger an alarm. In other words, in this application, an event that can trigger an alarm in a perimeter security system means that the perimeter security system will definitely trigger an alarm when it detects that type of event; that is, that type of event has the capability to trigger an alarm in the perimeter security system.
[0109] The statement that "no object that could trigger the perimeter security system alarm appears in the first video" means that among the objects included in the first video, there is no pre-defined object that could trigger the perimeter security system alarm. For example, assuming that the pre-defined object that could trigger the perimeter security system alarm is a person, if only animals appear in the first video, then the first video does not contain any object that could trigger the perimeter security system alarm.
[0110] In step S20 above, when the target animation is superimposed on the first video, the target animation is used as the foreground and the first video is used as the background.
[0111] Extracting the target animation from a third video can be done using any existing image segmentation tool, such as Adobe After Effects (a video post-production special effects software). Alternatively, the third video can be input into a pre-trained segmentation model, such as a deep learning-based instance segmentation model or a video object segmentation model. The model outputs a segmentation mask of the object, which is then used to extract the object and generate the final animation. This application does not limit the specific segmentation implementation method.
[0112] The process of training the segmentation model is as follows:
[0113] For the first sample object of each category, video frames containing the first sample object are first obtained from each third video. Each category contains at least a preset number (e.g., 50) of video frames at different locations. Then, a segmentation annotation tool (e.g., LabelImg, an image annotation tool) is used to annotate the first sample object in each video frame, generating a dataset containing the target ROI (Region of Interest, i.e., the region where the first sample object is located) and type. Then, the dataset is divided into a training set and a test set according to a preset ratio (8:2). The segmentation model is then trained using the training set based on the YOLO (a deep learning-based object detection algorithm) deep learning framework (e.g., YOLOv8).
[0114] Understandably, if the animation of the first sample object is randomly extracted from the third video, such as a person wandering left and right in the frame, the generated second video will contain a large amount of meaningless behavior, such as staff walking normally within the security zone. This data will interfere with the perimeter security system's ability to detect whether it is functioning properly. Therefore, when extracting the target animation, only the animation of the first sample object facing a preset direction will be extracted from the third video. This preset direction is consistent with the actual movement direction of the object in the alarm event that the user actually wants to detect. For example, assuming the image acquisition device capturing the first video is installed at the gate, and the gate is on the right side of the first video frame, and the user wants to detect whether an unauthorized intrusion has occurred, the preset movement direction could be from left to right.
[0115] In step S30 above, the determination result—whether the behavior of the first sample object in the second video can trigger an alarm in the perimeter security system—can be determined in advance using any method other than perimeter detection. For example, the determination can be made in advance based on the type of the first sample object and the protection type of the perimeter security system to determine whether the first sample object can trigger an alarm in the perimeter security system. In another possible implementation, the determination can also be made through self-checking rules pre-set for the perimeter security system. The specific determination process is detailed below and will not be repeated here.
[0116] It is understandable that the behavior of the first sample object is determined based on its posture. For example, if the first sample object is a person, postures such as walking, crawling, squatting, and climbing over a wall can all be considered as the behavior of the first sample object.
[0117] The judgment result indicates whether the second video can trigger an alarm in the perimeter security system, and also indicates the alarm type of the perimeter security system if the second video can trigger an alarm. In step S40, the second video is input into the perimeter security system, which analyzes the input second video in real time and uses its built-in algorithm to identify whether the events occurring in the second video can trigger an alarm.
[0118] Observing whether the perimeter detection triggers the perimeter security system alarm refers to observing whether the perimeter security system issues an alarm when the second video is input into the perimeter security system. The observation results are used to indicate whether the perimeter security system issues an alarm for the second video and the type of alarm.
[0119] In step S50, the judgment result and the observation result are inconsistent. It is possible that the judgment result indicates that the second video can trigger the perimeter security system alarm, but the observation result indicates that the perimeter security system did not issue an alarm for the second video. Alternatively, the judgment result indicates that the second video cannot trigger the perimeter security system alarm, but the observation result indicates that the perimeter security system issued an alarm for the second video. Or, both the judgment result and the observation result indicate that the perimeter security system issued an alarm for the second video, but the alarm types indicated by the observation result and the judgment result are different.
[0120] After introducing steps S10 to S50 above, the following describes the specific process of determining whether the behavior of the first sample object in the second video can trigger the perimeter security system alarm by using the self-check rules set in advance for the perimeter security system.
[0121] It is understandable that different types of objects, different movement types of objects, and different detection types correspond to different self-checking rules. For example, for an alarm event of unauthorized intrusion, the alarm will only be triggered if the detected object is a person and the direction of the detected object's movement matches unauthorized intrusion (e.g., the direction of movement is towards the door). Based on this, in one possible implementation, such as... Figure 2 The diagram shown is a second schematic representation of a perimeter security system detection method provided in this application embodiment. The method includes:
[0122] Step S10: Obtain the first video of the perimeter detection area captured by the perimeter security system;
[0123] Step S20: Overlay the target animation onto the first video to obtain the second video;
[0124] Step S301: Obtain multiple first self-check rules pre-set for the perimeter security system;
[0125] Step S302: Search for the target self-check rule among multiple first self-check rules;
[0126] Among them, the movement direction of the target self-check rule is the same as the preset direction;
[0127] Step S303: If the expected alarm tendency of the target self-inspection rule is to trigger an alarm, then the judgment result is determined to be that an alarm can be triggered.
[0128] Step S304: If the expected alarm tendency of the target self-check rule is not to alarm, then the judgment result is determined to be that the alarm cannot be triggered.
[0129] Step S40: Input the second video to the perimeter security system for perimeter detection, and observe whether the perimeter detection triggers an alarm in the perimeter security system to obtain the observation results;
[0130] Step S50: If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
[0131] Understandably, if the judgment result is consistent with the observation result, then the perimeter security system is considered to be functioning normally.
[0132] Steps S10-S20 and S40-S50 are described above and will not be repeated here. Steps S301-S304 are... Figure 1 The specific implementation steps of step S30.
[0133] In step S301, multiple first self-check rules are pre-set for object type and movement direction. Each first self-check rule includes: object type, movement direction, and expected alarm tendency, where expected alarm tendency indicates whether to alarm or not. Each first self-check rule can be stored in the form of a database or in other ways, such as in a table. For example, Table 1 shows a first self-check rule table provided in an embodiment of this application.
[0134] Table 1 First Self-Inspection Rules Table
[0135] In Table 1, each row represents a first self-check rule. For example, the first self-check rule represented by row number 1 is: the parameter name of the perimeter detection algorithm is "Target" and the value is "human", that is, the perimeter detection algorithm is used to detect people; the material index "1.(LtoR)" indicates that the object in the target animation is a person, and the person's movement direction is from left to right; receiving an alarm "Y" indicates that the expected alarm tendency is to be triggered when the event is detected.
[0136] Then, among multiple first self-check rules, the target self-check rule with the same type as the first sample object and whose movement direction is the same as the preset direction is searched. Taking Table 1 as an example, assuming the first sample object is a person and the preset direction is from far to near, i.e., FtoN, then the target self-check rule for the behavior in sequence number 2 can be determined from Table 1; as another example, assuming the first sample object is a vehicle and the preset direction is from left to right, i.e., LtoR, then the target self-check rule for the behavior in sequence number 3 can be determined from Table 1.
[0137] It is understood that the first self-check rule shown in Table 1 is only a few possible examples of the first self-check rule. The object type and motion direction in Table 1 are also only possible examples. In other possible examples, the object type and motion direction can be set by the user according to the user's needs and actual experience. That is, the first self-check rule can be set by the user according to the user's needs and actual experience. This application embodiment does not limit this.
[0138] By using the embodiments of this application, a target self-check rule can be determined based on the object type and movement direction of the first sample object by presetting a first self-check rule. This allows for the rapid and accurate determination of whether the behavior of the first sample object in the second video can trigger an alarm, thereby improving detection efficiency.
[0139] It is understandable that alarms are only a basic function of perimeter security systems. In some embodiments, perimeter security systems also include advanced functions. For example, the perimeter security system provides users with adjustable parameters (hereinafter referred to as advanced parameters) to adjust alarm conditions, alarm methods, etc. For instance, the perimeter security system provides a time range parameter, allowing users to configure a time period for the perimeter security system by changing the time range parameter; an alarm will only be triggered if an intrusion is detected within that time period. Another example is a displacement threshold parameter, allowing users to configure a displacement threshold for the perimeter security system by changing the time range parameter; the perimeter security system will only trigger an alarm if the intruding object moves a distance greater than the displacement threshold. Yet another example is a continuous alarm parameter, allowing users to enable or disable continuous alarms for the perimeter security system by changing the continuous alarm parameter. When continuous alarms are enabled, the perimeter security system will issue multiple alarms each time an intrusion is detected; when continuous alarms are disabled, the perimeter security system will only issue one alarm each time an intrusion is detected.
[0140] The perimeter security system testing method provided above can detect whether the perimeter security system can alarm normally. However, in some cases, users not only want to detect whether the perimeter security system can alarm normally, but also want to detect whether the changes to the aforementioned advanced parameters have taken effect.
[0141] Based on this, such as Figure 3 The diagram shown is a third schematic of the perimeter security system detection method provided in this application embodiment. The method includes the following steps:
[0142] Step S10: Obtain the first video of the perimeter detection area captured by the perimeter security system;
[0143] Step S20: Overlay the target animation onto the first video to obtain the second video;
[0144] Step S301a: Obtain multiple first self-test rules and multiple second self-test rules that are pre-set for the perimeter security system.
[0145] If the parameter represented by the first parameter identifier changes, proceed to steps S601 to S603; if the parameter represented by the parameter identifier does not change, proceed to step S302.
[0146] Step S601: Search for the target self-check rule among multiple second self-check rules;
[0147] Among them, the movement direction of the target self-check rule is the same as the preset direction.
[0148] Step S602: If the alarm conditions of the target self-inspection rule have been met, then the judgment result is determined to be able to trigger an alarm.
[0149] Step S603: If the alarm conditions of the target self-inspection rule are not met, the judgment result is determined to be that the alarm cannot be triggered.
[0150] Step S302: Search for the target self-check rule among multiple first self-check rules.
[0151] Step S303: If the expected alarm tendency of the target self-inspection rule is to trigger an alarm, then the judgment result is determined to be that an alarm can be triggered.
[0152] Step S304: If the expected alarm tendency of the target self-check rule is not to alarm, then the judgment result is determined to be that the alarm cannot be triggered.
[0153] Step S40: Input the second video to the perimeter security system for perimeter detection, and observe whether the perimeter detection triggers an alarm in the perimeter security system to obtain the observation results;
[0154] Step S50: If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
[0155] Understandably, if the judgment result is consistent with the observation result, then the perimeter security system is considered to be functioning normally.
[0156] Steps S10 to S20, S302 to S304, and S40 to S50 are described above and will not be repeated here.
[0157] In step S301a above, multiple second self-test rules are pre-set for object type, movement direction, and parameters used to implement alarm conditions in the perimeter security system. Each second self-test rule includes: object type, movement direction, first parameter identifier, and alarm conditions. The first parameter identifier is used to represent the parameter used to implement alarm conditions in the perimeter security system; that is, the parameter represented by the first parameter identifier is the aforementioned high-level parameter.
[0158] Understandably, a change in the parameter represented by the first parameter identifier indicates a change in a high-level parameter. When a high-level parameter changes, the user is more concerned with whether the change takes effect. Therefore, steps S602-S604 are executed to verify the effectiveness of the high-level parameter change. Conversely, if the parameter represented by the first parameter identifier does not change, it means the high-level parameter has not changed. In this case, the user is not concerned with whether the change takes effect, but rather with whether the perimeter security system can reliably perform its basic functions. Therefore, steps S302-S304 are executed to verify the basic functions of the perimeter security system.
[0159] Similar to the first self-test rules, the second self-test rules can be stored in the form of a database or in other ways, such as in the form of a table. For example, Table 2 shows the second self-test rule table provided in the embodiments of this application.
[0160] Table 2 Second Self-Inspection Rules Table
[0161] In Table 2, each row represents a second self-check rule. For example, in the second self-check rule represented by row number 1: the object type is 1, i.e., a person; the direction of movement is (L to R), i.e., from left to right; the first parameter is identified as "displacement filtering" and "3", which represents the aforementioned displacement filtering parameter with a value of 3; the alarm condition is: Y (displacement ≥ 3); N (located < 3), meaning an alarm is triggered only when the intruding object undergoes a displacement greater than 3 body lengths. Similarly, in the second self-check rule represented by row number 2: the object type is 1; the direction of movement is (Static), i.e., a stationary person; the first parameter is identified as "displacement filtering" and "0", which represents the aforementioned displacement filtering parameter with a value of 0; the alarm condition is: Y (any displacement), meaning an alarm will be triggered regardless of whether the intruding object has no displacement (i.e., is stationary).
[0162] Step S601 is similar to the aforementioned step S302, except that step S302 searches in the first self-check rule, while step S602 searches in the second self-check rule. Taking the aforementioned Table 2 as an example, for ease of description, the second self-check rule represented by the rows containing serial numbers 1 and 2 in the aforementioned Table 2 is respectively denoted as second self-check rule 1 and second self-check rule 2.
[0163] In step S602, the alarm conditions of the target self-test rule can be regarded as the alarm conditions represented by the modified advanced parameters. Therefore, when the alarm conditions are met, the perimeter security system should alarm, that is, the judgment result should be that the alarm can be triggered.
[0164] Similarly, in step S603, the judgment result should be that the alarm cannot be triggered when the alarm conditions are not met.
[0165] Understandably, in the second self-check rule, each self-check rule is assigned a unique identifier. To find the target self-check rule in the second self-check rule, one can either arbitrarily select any self-check rule in the second self-check rule as the target self-check rule, sort the self-check rules in the second self-check rule according to their identifiers and select the self-check rule with the highest priority as the target self-check rule, or determine the target self-check rule in other ways.
[0166] Select Figure 3 The example shown demonstrates the ability to formulate a judgment based on alarm conditions after changes to the advanced parameters used to adjust them. Therefore, when the judgment result differs from the observed result, it can be assumed that the alarm conditions have not adjusted with the change in advanced parameters; that is, the change in advanced parameters has not taken effect, thus indicating an anomaly in the perimeter security system. In other words, selecting… Figure 3 The example shown can automatically detect whether changes to advanced parameters used to adjust alarm conditions are effective, and detect anomalies when they are not effective, so as to remind users to take timely action.
[0167] Figure 3 The example shown verifies whether changes to the advanced parameters used to adjust alarm conditions take effect. As explained earlier regarding advanced parameters, there are also some advanced parameters used to adjust the alarm methods of the perimeter security system. To verify whether changes to these advanced parameters take effect, such as... Figure 4 As shown, this application also provides a perimeter security system detection method, including:
[0168] Step S10: Obtain the first video of the perimeter detection area captured by the perimeter security system;
[0169] Step S20: Overlay the target animation onto the first video to obtain the second video;
[0170] Step S301b: Obtain multiple first self-test rules and multiple third self-test rules that are pre-set for the perimeter security system.
[0171] If the parameter represented by the second parameter identifier changes, proceed to steps S701 to S702; if the parameter represented by the parameter identifier does not change, proceed to step S302.
[0172] Step S701: Search for the target self-test rule among multiple third self-test rules, and use the alarm method of the target self-test rule as the target alarm method.
[0173] If the alarm mode of the observation result is consistent with the judgment result, then the perimeter security system is determined to be normal; otherwise, proceed to step S702.
[0174] Step S702: Determine if the perimeter security system is malfunctioning.
[0175] Step S302: Search for the target self-check rule among multiple first self-check rules.
[0176] Step S303: If the expected alarm tendency of the target self-inspection rule is to trigger an alarm, then the judgment result is determined to be that an alarm can be triggered.
[0177] Step S304: If the expected alarm tendency of the target self-check rule is not to alarm, then the judgment result is determined to be that the alarm cannot be triggered.
[0178] Step S40: Input the second video to the perimeter security system for perimeter detection, and observe whether the perimeter detection triggers an alarm in the perimeter security system to obtain the observation results;
[0179] Step S50: If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
[0180] Understandably, if the judgment result is consistent with the observation result, then the perimeter security system is considered to be functioning normally.
[0181] Steps S10 to S20, S302 to S304, and S40 to S50 are described above and will not be repeated here.
[0182] In step S301b above, multiple third self-check rules are pre-set for object type, movement direction, and parameters used to implement alarm methods in the perimeter security system. Each third self-check rule includes: object type, movement direction, second parameter identifier, and alarm method. The second parameter identifier is used to represent the parameters used to implement alarm methods in the perimeter security system. Obviously, the parameters represented by the second parameter identifier are also the aforementioned high-level parameters.
[0183] Understandably, a change in the parameter represented by the second parameter identifier indicates a change in a high-level parameter. When a high-level parameter changes, the user is more concerned with whether the change takes effect. Therefore, steps S701-S702 are executed to verify the effectiveness of the high-level parameter change. Conversely, if the parameter represented by the second parameter identifier does not change, it means the high-level parameter has not changed. In this case, the user is not concerned with whether the change takes effect, but rather with whether the perimeter security system can reliably perform its basic functions. Therefore, steps S302-S304 are executed to verify the basic functions of the perimeter security system.
[0184] Similar to the first self-test rules, the third self-test rules can be stored in the form of a database or in other ways, such as in the form of a table. For example, Table 3 shows the second self-test rule table provided in the embodiments of this application.
[0185] Table 3 Third Self-Inspection Rules Table
[0186] In Table 3, each row represents a second self-check rule. For example, in the third self-check rule represented by row number 1: the object type is 1, i.e., personnel; the direction of movement is (L to R), i.e., from left to right; the first parameter is identified as "continuous alarm" "Open," which is the aforementioned continuous alarm parameter, and its value is "on"; the alarm mode is: Y multiple times, meaning multiple alarms will be issued each time an intrusion is detected. Similarly, in the third self-check rule represented by row number 2: the object type is 1; the direction of movement is (L to R); the second parameter is identified as "continuous alarm" "Close"; the alarm mode is: Y once, meaning one alarm will be issued each time an intrusion is detected.
[0187] Step S701 is similar to the aforementioned step S302, except that step S302 searches from the first self-check rule, while step S102 searches from the third candidate rule. Taking the aforementioned Table 3 as an example, for ease of description, the third self-check rule represented by the rows containing serial numbers 1 and 2 in the aforementioned Table 3 are respectively denoted as third self-check rule 1 and third self-check rule 2.
[0188] Assuming the continuous alarm parameter changes, the first sample object is of type "person" and the preset direction is from left to right. If the continuous alarm parameter is changed to "on", then the second self-test rule 1 becomes the target self-test rule. If the continuous alarm parameter is changed to "off", then the third self-test rule 2 becomes the target self-test rule.
[0189] In step S702, the alarm mode of the target self-test rule can be regarded as the alarm mode represented by the changed high-level parameters. Therefore, if the change of the high-level parameters has taken effect, the perimeter security system should alarm in this mode. Conversely, if the perimeter security system does not alarm, or does not alarm in this mode, it can be considered that the change of the high-level parameters has not taken effect.
[0190] Understandably, each self-check rule in the third self-check rule is assigned a unique identifier. To find the target self-check rule in the third self-check rule, one can either arbitrarily select any self-check rule in the third self-check rule as the target self-check rule, sort the self-check rules in the third self-check rule according to their identifiers and select the self-check rule with the highest priority as the target self-check rule, or determine the target self-check rule in other ways.
[0191] Select Figure 4 The example shown can automatically observe the alarm mode of the perimeter security alarm system after the advanced parameters used to adjust the alarm mode are changed. Therefore, if the perimeter security alarm system does not alarm, or the alarm mode is not as expected, it can be assumed that the alarm mode has not adjusted with the change of advanced parameters; that is, the change of advanced parameters has not taken effect, thus indicating an anomaly in the perimeter security system. In other words, selecting... Figure 4 The example shown can automatically detect whether changes to advanced parameters used to adjust alarm methods have taken effect, and if they have not, it can detect the anomaly and alert the user to take timely action.
[0192] See Figure 5 , Figure 5 The diagram shown is a fifth schematic representation of the perimeter security system detection method provided in this application, including:
[0193] Step S10: Obtain the first video of the perimeter detection area captured by the perimeter security system;
[0194] Step S20: Overlay the target animation onto the first video to obtain the second video;
[0195] Step S301c: Obtain multiple first self-test rules, multiple second self-test rules, and multiple third self-test rules that are pre-set for the perimeter security system.
[0196] If the parameter represented by the first parameter identifier changes, execute steps S601 to S603; if the parameter represented by the second parameter identifier changes, execute steps S701 to S702; if the parameter represented by the parameter identifier does not change, execute step S302.
[0197] Step S601: Search for the target self-check rule among multiple second self-check rules;
[0198] Step S602: If the alarm conditions of the target self-inspection rule have been met, then the judgment result is determined to be able to trigger an alarm.
[0199] Step S603: If the alarm conditions of the target self-inspection rule are not met, the judgment result is determined to be that the alarm cannot be triggered.
[0200] Step S701: Search for the target self-test rule among multiple third self-test rules, and use the alarm method of the target self-test rule as the target alarm method.
[0201] If the alarm mode of the observation result is consistent with the judgment result, then the perimeter security system is determined to be normal; otherwise, proceed to step S702.
[0202] Step S702: Determine if the perimeter security system is malfunctioning.
[0203] Step S302: Search for the target self-check rule among multiple first self-check rules.
[0204] Step S303: If the expected alarm tendency of the target self-inspection rule is to trigger an alarm, then the judgment result is determined to be that an alarm can be triggered.
[0205] Step S304: If the expected alarm tendency of the target self-check rule is not to alarm, then the judgment result is determined to be that the alarm cannot be triggered.
[0206] Step S40: Input the second video to the perimeter security system for perimeter detection, and observe whether the perimeter detection triggers an alarm in the perimeter security system to obtain the observation results;
[0207] Step S50: If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
[0208] Understandably, if the judgment result is consistent with the observation result, then the perimeter security system is considered to be functioning normally.
[0209] By using this embodiment, it is possible to automatically verify whether changes to the aforementioned two advanced parameters are effective, further improving the efficiency of perimeter security system detection.
[0210] In this example, the self-test rule table can be as follows:
[0211] Table 4. Fourth Self-Inspection Rule Table
[0212] For the meaning of Table 4, please refer to the relevant explanations in Tables 1 to 3 above, which will not be repeated here. Furthermore, the self-inspection rule table can also be shown as follows:
[0213] Table 5 Fourth Self-Inspection Rule Table
[0214] In the material index, (1-5) represent the shooting distance range. In this case, when selecting the target self-checking rule, it is necessary to satisfy not only that the object type of the target self-checking rule is the same as the type of the first sample object, and the movement direction of the target self-checking rule is the same as the preset direction, but also that the expected detection distance is within the shooting distance range of the target self-checking rule. The expected detection distance is the shooting distance of the first sample object when shooting the third video.
[0215] Furthermore, in this example, when overlaying the target animation onto the first video, the target animation is scaled according to the expected detection distance before being overlaid. This makes the resulting second video appear more natural and improves detection accuracy. The following sections will illustrate how scaling and overlaying work using three different examples, which will not be repeated here.
[0216] The verification of basic functions and advanced parameters has been explained above. As can be seen from the previous examples, the verification relies on overlaying the target animation onto the first video. The following text will provide an example of how to select the target animation and how to overlay the target animation onto the first video.
[0217] Regarding how to select the target animation:
[0218] In one possible embodiment, the target animation can be input by the user according to actual needs. In another possible embodiment, a material library containing a large number of animations can be maintained in advance, so that the user or the executing entity can automatically select animations from the material library as the target animation.
[0219] The following will explain the construction of this resource library:
[0220] In one possible embodiment, the process of building the resource library is as follows: Figure 6a As shown, it includes:
[0221] Step S91: For each type and direction combination, obtain at least one fourth video.
[0222] The fourth video is at least one video, including the third video, captured by other devices of the same type moving in that direction. For example, suppose there are five types: single pedestrian, multiple pedestrians, pedestrians in various poses, vehicles, and animals, and two directions: from left to right and from far to near. This results in 20 possible combinations of types and directions, such as single pedestrian - from left to right, multiple pedestrians - from far to near, etc. Taking the single pedestrian - from left to right combination as an example, the third video requires a single pedestrian to be present in the frame, and the direction of movement of this single pedestrian must be from left to right. If the third video is the video from 1 minute 05 seconds to 2 minutes 05 seconds in video A, then the fourth video is the video in video A that starts earlier than 1 minute 05 seconds and ends later than 2 minutes 05 seconds.
[0223] Furthermore, for each combination, only one fourth video can be captured, or multiple fourth videos can be captured. For example, for a combination involving a single pedestrian, videos of the pedestrian walking and stationary can be captured separately. For a combination involving pedestrians in multiple postures, videos of them in postures that are prone to being missed by the perimeter security system, such as crawling, crouching, or climbing over walls, can be captured separately. Similarly, for a combination involving vehicles, videos of the vehicles moving and stationary can be captured separately, and for a combination involving animals, videos of cats and dogs can be captured separately. For vehicles and animals, it is also possible not to capture videos of vehicles and animals in different postures separately, and it is also possible to capture only videos of vehicles moving or stationary, or only videos of animals moving or stationary, without capturing videos of vehicles moving and stationary, or animals moving and stationary.
[0224] Step S92: Use pixel-level image segmentation to extract the motion animation of objects from each fourth video and store it in the material library.
[0225] It can be done by training a pixel-level image segmentation model based on the YOLO deep learning framework (such as YOLOv8), and then using the image segmentation model to extract the animation of object motion from each fourth video.
[0226] To enrich the resource library, in another possible embodiment, the process of building the resource library can also be as follows: Figure 6b As shown, it includes:
[0227] Step S911: For each combination of type, direction, and distance, acquire at least one fourth video.
[0228] The fourth video is captured by another device filming an object of this type moving in this direction, and the object in the fourth video is filmed at this distance. For example, assuming the aforementioned five types and two directions are still included, and five distances are included: 30m, 75m, 105m, 150m, and 300m, then there are a total of 100 combinations of types, directions, and distances, such as a single pedestrian - from left to right - 105m, multiple pedestrians - from far to near - 30m, etc. Taking the combination of a single pedestrian - from left to right - 105m as an example, when filming the fourth video, it is required that there is a single pedestrian in the frame, and the direction of movement of this single pedestrian is from left to right, and the distance between this single pedestrian and the device filming the fourth video is 105m.
[0229] Step S92: Use pixel-level image segmentation to extract the motion animation of objects from each fourth video and store it in the material library.
[0230] The following will use a specific example to explain in detail the process of building a resource library:
[0231] In this example, there are the aforementioned five types, two directions, and five distances. Furthermore, for each combination of type, direction, and distance, multiple fourth videos are captured. A pixel-level image segmentation model is pre-trained based on the YOLO deep learning framework (such as YOLOv8), and this model is used to extract the animation of object motion from each fourth video.
[0232] In this example, the fourth video is in YUV420 format to facilitate image segmentation by the image segmentation model. Furthermore, to facilitate the subsequent overlay of the animation onto the first video, the extracted animation can be normalized using the following formula:
[0233]
[0234] in, The coordinates of the center point of the ROI region after normalization , These are the x and y coordinates of the center point before normalization. , These represent the pixel width and pixel height of the image in the fourth video, respectively. The ROI (Region of Interest) is the area in the image where the object is located, excluding the background. In one possible implementation, the ROI is obtained through target segmentation.
[0235] Furthermore, for the fourth video in which the object's movement direction is from left to right, the height of the object in each video frame is obtained, and the average pixel height is calculated accordingly.
[0236]
[0237] Obtain the width of the object in each video frame and calculate the average pixel width. :
[0238]
[0239] Obtain the normalized center point coordinates of objects in each video frame, and calculate the average normalized center point coordinate value. :
[0240]
[0241] in, Let be the pixel height of the object in the i-th video frame. Let be the pixel width of the object in the i-th video frame. Let M be the normalized center point coordinates of the object in the i-th video frame, and M be the total number of video frames.
[0242] In this example, the extracted animation, the pixel height Hi, width Wi, and normalized coordinates of the object in each video frame are included. and average pixel height Average pixel width Average normalized center point ordinate Stored in the media library.
[0243] The following example illustrates how to implement overlay when building a media library according to this example.
[0244] Example of overlay method 1 (hereinafter referred to as standard mode):
[0245] Manually set the target to run from the starting point on the monitoring screen. Based on the target distance, the system automatically selects and generates video frames for the target ROI region at the target distance.
[0246] When selecting footage that moves from left to right, the principle is as follows:
[0247] (A.1) The system includes a 15mm lens with a resolution of... Pixel size Sampling distance =30m, =75m, =105m, =150m, The target ROI area is located at 300m. Assume the current monitoring system has a focal length of Dmm and a pixel size of... camera's original resolution The equivalent distance from the target ROI region to the target at focal length D is:
[0248] n=1,2,3,4,5
[0249] (A.2) When the target distance is input Assuming exist and Between equivalent distances, among which Corresponding target height Width is y-axis ; Corresponding target height Width is y-axis ;
[0250] (a) then Position corresponding to target height ;
[0251] (b) then Position corresponding to target width ;
[0252] (c) then Position corresponding to the vertical coordinate ;
[0253] when Then use The target width, height, and ordinate, i.e. , , = ;
[0254] when Then use The target width, height, and ordinate, i.e. , , = .
[0255] (A.3) Under the current monitoring system, the target height corresponds to pixels in each frame: The target width for each frame corresponds to pixels. .in, and for The pixel height and width of the object in the i-th video frame. Current system camera resolution. Resolution when the target material was acquired It might be different; scaling is required when calculating the current system target pixel width and height. Additionally, it depends on the manually set target starting point. The center coordinates of each frame Convert to .
[0256] When selecting motion data that moves from far to near, the principle is as follows:
[0257] (B.1) The system includes a 15mm lens with a resolution of Pixel size Sampling distance =30m, =75m, =105m, =150m, =Motion footage from a distance of 300m towards the viewer. Assume the focal length of the current monitoring equipment is D, and the pixel size is... The equivalent distance of the acquired material at focal length D is:
[0258]
[0259] (B.2) When the target distance is input Find greater than or equal to Minimum equivalent distance And select the material corresponding to that distance. Simultaneously, the normalized ordinate of the first video frame of that material... As the starting point of the superimposed vertical coordinate.
[0260] (B.3) Target height per frame under distance: The target height per frame corresponds to the number of pixels: The target width for each frame corresponds to pixels: ,in, and for The pixel height and width of the object in the i-th video frame of the corresponding material. The center coordinates of each frame. Convert to .
[0261] Example of overlay method 2 (hereinafter referred to as advanced mode):
[0262] Advanced mode is an extended version of standard mode. It does not require specifying a specific distance; instead, the scaling ratio is set manually.
[0263] The specific steps are as follows:
[0264] (C.1) Selection For the distance to the target material, the movement direction can be selected from left to right or from far to near. After selection, the first frame of the target at that distance will be superimposed on the center of the monitoring screen.
[0265] (C.2) Manually drag the target ROI area image to the specified location on the monitoring screen. .
[0266] (C.3) Manually adjust the target size ratio to fit the actual scene, assuming the ratio is r (r can be adjusted between 0.1 and 10).
[0267] (C.4) After setting, the target pixel height of the selected target ROI region per frame The target pixel width of each frame The center coordinates of each frame Convert to .
[0268] Example of overlay method 3 (hereinafter referred to as the basic mode):
[0269] (3.1) Divide the surveillance image into 5 equal parts from far to near, and each area correspond Materials collected from a distance.
[0270] (3.2) Based on the area where the center point of the first valid detection area of the perimeter is located. Select the corresponding area Moving footage from left to right or from far to near. The starting point is the horizontal intersection of the center point of the detection area and the leftmost point of the image. .
[0271] (3.3) After setting, the target pixel height for each frame The target pixel width of each frame The center coordinates of each frame Convert to .
[0272] Regardless of the mode used, for a video frame sequence of a selected target ROI region, the height of each frame is... pixels, width Pixels. And the target height of each frame superimposed on the monitoring screen. pixels, width Pixels. The two may differ; to achieve overlay, each frame of data in the target ROI region's video frame needs to be scaled down to [pixel count]. Resolution. The target ROI region video frame format is YUV420, and scaling is performed directly based on this format. Includes:
[0273] (1) The Y luminance component can be scaled using a bilinear interpolation algorithm.
[0274] (2) The resolution of the UV chromaticity components is only 1 / 4 that of the Y luminance components. The U and V chromaticity components are scaled to [value missing] using bilinear interpolation. Resolution.
[0275] (3) Luminance component and chromaticity components Composite, forming a scaled-up version Video frame sequence.
[0276] After processing with the bilinear interpolation algorithm, target YUV video frame data matching the current monitoring system can be obtained, which can be used for direct overlay of subsequent video frames.
[0277] The preceding sections have provided examples of how to construct a media library and how to overlay the target animation onto a third video. The following section will explain the triggering timing of the perimeter security system detection method provided in this application:
[0278] In one possible embodiment, the user can preset the trigger time, and the perimeter security system detection method provided in this application will be automatically executed whenever the trigger time is reached. For example, if the user sets 8:00 AM and 8:00 PM every day as the trigger time, the perimeter security system detection method provided in this application will be automatically executed at 8:00 AM and 8:00 PM every day. This triggering method is referred to as automatic triggering below.
[0279] In another possible embodiment, the perimeter security system detection method provided in this application can be executed in response to a detection command input by the user; this triggering method is referred to as manual triggering below. In yet another possible embodiment, both automatic and manual triggering can be supported simultaneously. Furthermore, in addition to the aforementioned automatic and manual triggering, other triggering methods can also be supported in other possible embodiments, such as automatically executing the perimeter security system detection method provided in this application whenever the user changes advanced parameters.
[0280] In the aforementioned automatically triggered scenario, the executing entity selects the target animation from the resource library. When selecting the target animation, only animations whose objects are of the target type can be chosen. The target type is the type that can trigger an alarm in the perimeter security system. For example, if the perimeter security system is used to detect whether people or vehicles have entered the perimeter detection area, then people and vehicles are both target types, while animals are not. Conversely, if the perimeter security system is used to detect whether people or animals have entered the perimeter detection area, then people and animals are both target types, while vehicles are not.
[0281] Of course, in the aforementioned case of automatic triggering, when selecting the target animation, it can also be randomly selected from animations where the object is of the target type and animations where the object is not of the target type. This application does not impose any restrictions on this.
[0282] In the aforementioned manually triggered scenario, the executing entity can select the target animation from the resource library, and the selection method can be the same as in the automatically triggered scenario. Furthermore, in the aforementioned manually triggered scenario, the user can also manually select the target animation from the resource library.
[0283] Furthermore, users can not only select target animations from the resource library to test the perimeter security system using the aforementioned perimeter security system detection method, but they can also directly import videos that generate false alarms or misses to the perimeter security system for perimeter detection. If the imported video generates a false alarm and the perimeter detection triggers an alarm, it can be assumed that the perimeter security system still generates false alarms. Conversely, if the imported video generates a misses and the perimeter detection does not trigger an alarm, it can be assumed that the perimeter security system still generates misses.
[0284] The perimeter security system detection method provided in this application has been described in detail above. It is understood that the perimeter security system provided in this application can detect anomalies within the perimeter security system, and in one possible embodiment, after detecting an anomaly, the anomaly can be analyzed. Specifically:
[0285] (1) The target type of the overlaid video is the same as the target type of the perimeter detection area, but no alarm is triggered, resulting in a missed detection.
[0286] The occurrence of false negatives may be due to problems with the detection algorithm or parameter configuration. Based on the detection information from the algorithm library, we can analyze possible causes and provide modification suggestions:
[0287] (A.1) To check if the algorithm is running normally, you can use internal counting or heartbeat mechanisms. If an anomaly is detected, provide a conclusion that the algorithm is malfunctioning and suggest restarting the device or upgrading to a newer version of the program.
[0288] (A.2) Check if the frame rate of the video processed by the algorithm is normal, if the model used by the algorithm is complete, and if the algorithm has sufficient memory. If there are any abnormalities, provide the specific location of the abnormality. Suggestions such as upgrading to a newer version of the program or disabling other functions on the device.
[0289] (A.3) If the algorithm library is running normally, check the output information to determine if the target is being filtered out by the algorithm's internal filtering mechanism. For example, a large displacement filtering threshold or a high confidence level might cause the target to be filtered out. In such cases, suggestions such as adjusting the filtering threshold or resetting the confidence level can be provided.
[0290] (A.4) If the algorithm library is running normally, but the algorithm fails to detect or consistently classifies incorrectly, provide the reasons for the detection and classification failures, and suggest upgrading the new perimeter algorithm model program.
[0291] (2) The target type of the overlaid video is inconsistent with the target type of the perimeter detection area, but an alarm is triggered (e.g., the rule is configured to detect people, but an animal triggers an alarm), resulting in a false alarm.
[0292] False positives could be due to issues with the detection algorithm or parameter configuration. We will analyze the possible causes and provide modification suggestions based on the algorithm library's detection information:
[0293] (A.1) For algorithm detection and classification errors, it is recommended to increase confidence and decrease detection sensitivity for different error types.
[0294] (A.2) If the false alarm is caused by the target size being too small or too large, it is recommended to readjust the filter size.
[0295] (A.3) If the algorithm parameters are not configured properly, such as the displacement filtering threshold not being enabled, it is recommended to enable displacement filtering.
[0296] If the false positives are mostly random, small bounding boxes, it is advisable to disable background modeling detection and use only deep learning detection.
[0297] (3) When the self-test is automatically triggered by the system (such as upon power-on or by a timer), if an abnormality is detected, in addition to generating an analysis report, the system will immediately issue multi-level warnings:
[0298] (A.1) Overlay flashing characters on the monitoring preview screen to display the message "Perimeter detection operation is abnormal, please check the self-test report!".
[0299] (A.2) Link the on-site monitoring lights to flash as a reminder.
[0300] (A.3) Send an alert email to the system's configured mailbox.
[0301] like Figure 7 The diagram shown is an example of the perimeter security system configuration interface provided in this application embodiment. In this configuration interface, users can select the working mode as automatic or manual, choose the method of importing video (overlay or direct import of false alarm videos), select the movement direction of the first sample object as from left to right or from far to near, select the overlay mode (basic, standard, or advanced) when overlaying the target animation onto the first video, and select manual, timed, or other triggering methods to trigger the perimeter security system detection. Users can also select the scaling ratio and target distance (i.e., the expected detection distance) when overlaying the target animation onto the first video in this interface.
[0302] The interface also includes a sub-interface for displaying overlay effects. When overlaying the target animation onto the first video (i.e., the video frame), the user can also drag the position of the target animation within the first video in this sub-interface.
[0303] Additionally, in manual mode, users can manually select the type of the first sample object in the resource library, such as a person, vehicle, or animal. If the first sample object is a person, users can further specify whether it is a single person, multiple people, or people in various poses.
[0304] A second aspect of this application provides a perimeter security system detection device, such as... Figure 8 As shown, the device includes:
[0305] Video acquisition module 81 is used to acquire a first video obtained by the perimeter security system from the perimeter detection area, wherein no object that can trigger the alarm of the perimeter security system appears in the detection area set in the first video;
[0306] The video overlay module 82 is used to overlay the target animation onto the first video to obtain the second video. The target animation is an animation of the first sample object moving in a preset direction, which is extracted from the third video. The third video is captured by other devices outside the perimeter security system.
[0307] The result acquisition module 83 is used to acquire the judgment result of whether the behavior of the first sample object in the second video can trigger the alarm of the perimeter security system;
[0308] The perimeter detection module 84 is used to input the second video to the perimeter security system for perimeter detection, and to observe whether the perimeter detection triggers an alarm in the perimeter security system, and to obtain the observation results;
[0309] The anomaly determination module 85 is used to determine that the perimeter security system is abnormal if the judgment result is inconsistent with the observation result.
[0310] Using the embodiments of this application, the animation of the first sample moving in a preset direction is extracted from a third video captured by other devices outside the perimeter security system, and this animation is superimposed on the first video captured by the perimeter security system to obtain a second video; then, the judgment result of whether the behavior of the first sample object in the second video can trigger the perimeter security system alarm is obtained, and the second video is input to the perimeter security system for detection to determine whether the perimeter detection triggers the perimeter security system alarm; if the behavior of the first sample object can trigger the perimeter security system alarm, and the perimeter detection triggers the perimeter security system alarm, then it is considered that the perimeter security system has not experienced any abnormality; otherwise, it is considered that the perimeter security system has experienced an abnormality. In this way, during the deployment and operation of the perimeter security system, the method of this application can be used to verify whether the perimeter security system is working properly and whether there are any problems such as algorithm failure or functional degradation during operation, without waiting for real events to trigger alarms to verify the accuracy of the perimeter security system, and without investing a lot of manpower in manual simulation, thus reducing operation and maintenance costs and reducing the risk that the perimeter security system will fail to alarm due to algorithm failure or functional degradation. In this way, the reliability of the perimeter security system is improved while reducing operation and maintenance costs.
[0311] In one possible implementation, the result acquisition module includes:
[0312] The rule acquisition submodule is used to acquire multiple first self-check rules pre-set for the perimeter security system. Each first self-check rule includes: object type, movement direction and expected alarm tendency, and the expected alarm tendency is used to indicate whether to alarm or not.
[0313] The rule search submodule is used to search for a target self-check rule among the plurality of first self-check rules, wherein the object type of the target self-check rule is the same as the type of the first sample object, and the movement direction of the target self-check rule is the same as the preset direction;
[0314] The alarm judgment submodule is used to determine that if the expected alarm tendency of the target self-check rule is to trigger an alarm, the judgment result is that an alarm can be triggered; if the expected alarm tendency of the target self-check rule is not to trigger an alarm, the judgment result is that an alarm cannot be triggered.
[0315] In one possible implementation, the device further includes:
[0316] The first acquisition module is used to acquire multiple second self-test rules pre-set for the perimeter security system in response to a change in the parameter represented by the first parameter identifier. Each second self-test rule includes: object type, movement direction, first parameter identifier, and alarm condition. The first parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm condition.
[0317] The first search module is used to search for the target self-check rule among the plurality of second self-check rules;
[0318] The first judgment module is used to determine that if the alarm conditions of the target self-inspection rule are met, the judgment result is that an alarm can be triggered; if the alarm conditions of the target self-inspection rule are not met, the judgment result is that an alarm cannot be triggered.
[0319] In one possible implementation, the device further includes:
[0320] The second acquisition module is used to acquire multiple third self-check rules pre-set for the perimeter security system in response to a change in the parameter represented by the second parameter identifier. Each third self-check rule includes: object type, movement direction, second parameter identifier, and alarm mode. The second parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm mode.
[0321] The second search module is used to search for the target self-test rule among the multiple second self-test rules, and use the alarm method of the target self-test rule as the target alarm method;
[0322] The second judgment module is used to determine that the perimeter security system is abnormal if the observation result indicates that no alarm was triggered, or if an alarm was triggered in a non-target alarm manner.
[0323] In one possible implementation, the video overlay module includes:
[0324] The video scaling submodule is used to scale the target animation according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the third video is captured.
[0325] The video overlay submodule is used to overlay the scaled target animation onto the first video;
[0326] The first self-test rule also includes the shooting distance range;
[0327] The shooting distance range of the target self-inspection rule covers the expected detection distance.
[0328] In one possible implementation, the device further includes:
[0329] The animation acquisition module is used to acquire the target animation from the preset material library;
[0330] The resource library was pre-built in the following manner:
[0331] For each combination of type and direction, at least one video, including the third video, is acquired as a fourth video, wherein the fourth video is obtained by another device capturing the movement of the object of the type along the direction.
[0332] The motion animations of objects are extracted from each fourth video using pixel-level image segmentation and stored in the material library.
[0333] In one possible implementation, the video overlay module is specifically used for:
[0334] The target animation is scaled according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the second video is captured.
[0335] Overlay the scaled target animation onto the first video;
[0336] For each type and direction combination, at least one fourth video is obtained, including:
[0337] For each combination of type, direction, and distance, at least one fourth video is obtained, wherein the shooting distance of the object in the fourth video is the expected detection distance.
[0338] This application also provides an electronic device, such as... Figure 9 As shown, it includes:
[0339] Memory 91 is used to store computer programs;
[0340] When processor 92 executes the program stored in memory 91, it performs the following steps:
[0341] The first video obtained by the perimeter security system from the perimeter detection area is acquired, wherein no object that could trigger the alarm of the perimeter security system appears in the first video;
[0342] The target animation is superimposed on the first video to obtain the second video. The target animation is an animation of the first sample object moving in a preset direction extracted from the third video. The third video is captured by other devices outside the perimeter security system.
[0343] Obtain the judgment result of whether the behavior of the first sample object in the second video can trigger the alarm of the perimeter security system;
[0344] The second video is input to the perimeter security system for perimeter detection, and the perimeter detection is observed to determine whether it triggers an alarm in the perimeter security system, thus obtaining the observation results.
[0345] If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
[0346] Furthermore, the aforementioned electronic device may also include a communication bus and / or a communication interface, with the processor 92, the communication interface, and the memory 91 communicating with each other via the communication bus.
[0347] 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.
[0348] The communication interface is used for communication between the aforementioned electronic devices and other devices.
[0349] 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.
[0350] 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.
[0351] 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 perimeter security system detection methods.
[0352] 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 perimeter security system detection methods described above.
[0353] 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 solid-state drive (SSD), etc.
[0354] 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.
[0355] 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, embodiments of devices, electronic devices, computer-readable storage media, and computer program products are basically similar to the method embodiments, and therefore the descriptions are relatively simple; relevant parts can be referred to the descriptions of the method embodiments.
[0356] 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. A perimeter security system detection method, characterized by, The method includes: The first video obtained by the perimeter security system from the perimeter detection area is acquired, wherein no object that could trigger the alarm of the perimeter security system appears in the detection area set in the first video; The target animation is superimposed on the first video to obtain the second video. The target animation is an animation of the first sample object moving in a preset direction extracted from the third video. The third video is captured by other devices outside the perimeter security system. Obtain the judgment result of whether the behavior of the first sample object in the second video can trigger the alarm of the perimeter security system; The second video is input to the perimeter security system for perimeter detection, and the perimeter detection is observed to determine whether it triggers an alarm in the perimeter security system, thus obtaining the observation results. If the judgment result is inconsistent with the observation result, then the perimeter security system is determined to be abnormal.
2. The method of claim 1, wherein, The determination of whether the behavior of the first sample object in the second video can trigger the perimeter security system alarm includes: Acquire multiple first self-check rules pre-set for the perimeter security system. Each first self-check rule includes: object type, movement direction, and expected alarm tendency, wherein the expected alarm tendency is used to indicate whether to alarm or not. Search for a target self-check rule among the plurality of first self-check rules, wherein the object type of the target self-check rule is the same as the type of the first sample object, and the movement direction of the target self-check rule is the same as the preset direction; If the expected alarm tendency of the target self-check rule is to trigger an alarm, then the judgment result is determined to be that an alarm can be triggered. If the expected alarm tendency of the target self-check rule is not to trigger an alarm, then the judgment result is determined to be that an alarm cannot be triggered.
3. The method of claim 1, wherein, The method further includes: In response to a change in the parameter represented by the first parameter identifier, multiple second self-check rules pre-set for the perimeter security system are obtained. Each second self-check rule includes: object type, movement direction, first parameter identifier, and alarm condition, wherein the first parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm condition. Search for the target self-check rule among the plurality of second self-check rules; If the alarm conditions of the target self-inspection rule are met, the judgment result is determined to be that an alarm can be triggered. If the alarm conditions of the target self-inspection rule are not met, the judgment result is determined to be that the alarm cannot be triggered.
4. The method of claim 1, wherein, The method further includes: In response to a change in the parameter represented by the second parameter identifier, multiple third self-check rules pre-set for the perimeter security system are obtained. Each third self-check rule includes: object type, movement direction, second parameter identifier, and alarm mode. The second parameter identifier is used to represent the parameter in the perimeter security system used to implement the alarm mode. The target self-check rule is found among the multiple third self-check rules, and the alarm method of the target self-check rule is used as the target alarm method. If the observation results indicate that no alarm was triggered, or that an alarm was triggered in a non-target alarm manner, then the perimeter security system is determined to be abnormal.
5. The method of claim 2, wherein, The step of overlaying the target animation onto the first video to obtain the second video includes: The target animation is scaled according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the third video is captured. Overlay the scaled target animation onto the first video; The first self-test rule also includes the shooting distance range; The shooting distance range of the target self-inspection rule covers the expected detection distance.
6. The method of claim 1, wherein, The method further includes: Retrieve the target animation from the preset material library; The resource library was pre-built in the following manner: For each combination of type and direction, at least one video, including the third video, is acquired as a fourth video, wherein the fourth video is obtained by another device capturing the movement of the object of the type along the direction. The motion animation of objects in each fourth video is extracted using pixel-level image segmentation and stored in the material library.
7. The method of claim 6, wherein, The step of overlaying the target animation onto the first video to obtain the second video includes: The target animation is scaled according to the expected detection distance to obtain the scaled target animation; the expected detection distance is the shooting distance of the first sample object when the third video is captured. Overlay the scaled target animation onto the first video; For each type and direction combination, at least one fourth video is obtained, including: For each combination of type, direction, and distance, at least one fourth video is obtained, wherein the shooting distance of the object in the fourth video is the distance.
8. A perimeter security system detection apparatus, characterized by, The device includes: The video acquisition module is used to acquire a first video obtained by the perimeter security system from the perimeter detection area, wherein no object that can trigger the alarm of the perimeter security system appears in the detection area set in the first video; The video overlay module is used to overlay the target animation onto the first video to obtain the second video. The target animation is an animation of the first sample object moving in a preset direction, extracted from the third video. The third video is captured by other devices outside the perimeter security system. The result acquisition module is used to acquire the judgment result of whether the behavior of the first sample object in the second video can trigger the alarm of the perimeter security system; The perimeter detection module is used to input the second video to the perimeter security system for perimeter detection, and to observe whether the perimeter detection triggers an alarm in the perimeter security system, thereby obtaining the observation results; An anomaly determination module is used to determine that the perimeter security system is abnormal if the judgment result is inconsistent with the observation result.
9. An electronic device, comprising: include: Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the method described in any one of claims 1-7.
10. 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 method described in any one of claims 1-7.