A pedestrian zone intrusion recognition method and system based on zone expansion

CN120689905BActive Publication Date: 2026-11-24BEIJING GROWTH TRACK EDUCATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510793298.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2026-11-24
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

In the existing pedestrian intrusion detection system for dangerous areas, there is a discrepancy between the pedestrian detection frame and the actual pedestrian frame, leading to frequent alarms or the cancellation of alarms.

Method used

A buffer zone is set up around the dangerous area, and the pedestrian detection box is used to make graded judgments based on the center point of the lower bounding box. The alarm status is triggered, maintained, or deactivated based on the positional relationship between the dangerous area and the buffer zone.

Benefits of technology

It effectively avoids frequent alarms or alarm cancellations caused by detection errors, improves the accuracy and stability of identification, and adapts to complex scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120689905B_ABST
    Figure CN120689905B_ABST
Patent Text Reader

Abstract

This invention provides a method and system for pedestrian intrusion identification based on region expansion. The method includes: acquiring a video to be detected; extracting frames at a predetermined frame rate to obtain an image to be processed; obtaining a pedestrian detection box using a target detection algorithm; defining a danger zone R and offsetting it outward by a predetermined distance to form a buffer zone R2; determining whether the center point of the lower boundary of the pedestrian detection box is in the danger zone R; if it is in the danger zone R and no alarm is triggered, an alarm is triggered; if it is in the danger zone R and an alarm has been triggered, the state is maintained; if it is not in the danger zone R, the system proceeds to the buffer zone for further determination; further determining whether the center point is in the buffer zone R2; if it is in the buffer zone R and no alarm is triggered, the system remains without an alarm; if it is in the buffer zone R and an alarm has been triggered, the system remains with an alarm; if it is not in the buffer zone R and no alarm is triggered, the system remains without an alarm; if it is not in the buffer zone R and an alarm has been triggered, the alarm is deactivated. This method, through a hierarchical region determination mechanism, achieves dynamic identification and alarm control of pedestrian intrusion status, effectively improving the accuracy of area security monitoring.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of pedestrian intrusion identification in dangerous areas, and more particularly to a method and system for pedestrian area intrusion identification based on area expansion. Background Technology

[0002] In fields such as public safety, industrial monitoring, and intelligent transportation, real-time monitoring of whether pedestrians have intruded into specific dangerous areas has significant application value. Traditional area intrusion detection systems typically rely on sensor arrays, fence-type monitoring devices, or video analytics technology using fixed cameras. They achieve safety protection for dangerous areas by defining preset area boundaries and detecting whether pedestrians cross those boundaries in real time. With the development of computer vision technology, video image-based pedestrian detection and area intrusion detection methods have gradually become a research hotspot in this field due to their non-contact nature and flexible deployment.

[0003] Currently, pedestrian intrusion detection technology in dangerous areas generally includes the following steps: acquiring video, which can be obtained from real-time video streams or video file warehouses; extracting frames from the video at a certain frame rate to obtain a series of static images sorted by time; performing pedestrian detection on the images; and determining whether a pedestrian has entered the dangerous area based on the images.

[0004] The existing pedestrian intrusion detection system for dangerous areas has the following problems: the detection bounding box of the pedestrian detection will deviate from the actual pedestrian bounding box, causing frequent alarms and de-alarms when the pedestrian is near the edge of the dangerous area. Summary of the Invention

[0005] In view of this, the purpose of this invention is to provide a pedestrian area intrusion identification method and system based on area expansion to solve the above-mentioned technical problems.

[0006] To achieve the above objectives, in a first aspect, the present invention provides a method for pedestrian region intrusion identification based on region expansion, which includes the following steps: Step A: Obtain the video of pedestrian intrusion into the area to be detected. The video is obtained from a real-time video stream or a video file repository. Step B: Extract frames from the video at a predetermined frame rate to obtain the image to be processed; Step C: Perform pedestrian detection on the image to be processed, and use an object detection algorithm to obtain pedestrian detection boxes in the image to be processed; Step D: Define the danger zone as R, and offset the boundary of the danger zone R outward by a preset distance to form a buffer zone R2; Step E: Determine whether the center point of the lower bounding box of the pedestrian detection box is in the danger zone R; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is not in an alarm state, then trigger an alarm; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is in an alarm state, then maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, then proceed to step F. Step F: Determine whether the center point of the lower bounding box of the pedestrian detection box is within the buffer area R2; if the center point of the lower bounding box of the pedestrian detection box is within the buffer area R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is within the buffer area R2 and is in an alarm state, maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not within the buffer area R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is not within the buffer area R2 and is in an alarm state, deactivate the alarm.

[0007] In some possible implementations, step D, which involves shifting the boundary of the danger zone R outward by a predetermined distance, specifically includes: D1. For each pedestrian detection box obtained in step C, record the height H of the pedestrian detection box; D2. Define the preset ratio k; D3. Calculate the offset distance d = H × k. Based on the offset distance d, offset the boundary of the danger zone R outward to generate the buffer zone R2.

[0008] In some possible implementations, determining whether a pedestrian is in a danger zone or a buffer zone in steps E and F specifically includes: E1. Cropping the image region corresponding to the pedestrian detection box to obtain the pedestrian sub-image; E2. Perform human body key point detection on the pedestrian sub-image and obtain the coordinates of foot key points; E3. Based on the coordinates of the foot key points, determine whether the pedestrian is in the danger zone R or the buffer zone R2.

[0009] In some possible implementations, the target detection algorithm used in step C includes the YOLO algorithm, the Faster R-CNN algorithm, or the Single Detector Target Detection (SSD) algorithm.

[0010] In some possible implementations, the human body key point detection includes the detection of lower limb key points such as the ankle, knee, or hip joints.

[0011] Secondly, a pedestrian intrusion detection system based on region expansion is provided, comprising: The video acquisition module is configured to acquire videos of pedestrian intrusion into the area to be detected, and the videos are acquired from real-time video streams or video file repositories. The image frame extraction module is configured to extract frames from the video at a predetermined frame rate to obtain the image to be processed. The pedestrian detection module is configured to perform pedestrian detection on the image to be processed, and to obtain pedestrian detection boxes in the image to be processed using a target detection algorithm. The area definition module is configured to define a dangerous area as R and offset the boundary of the dangerous area R outward by a preset distance to form a buffer area R2; The danger zone judgment and processing module is configured to: determine whether the center point of the lower bounding box of the pedestrian detection box is in the danger zone R; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is not in an alarm state, then trigger an alarm; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is in an alarm state, then maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, then trigger the buffer judgment and processing module to perform further processing. The buffer zone judgment processing module is configured to: when the danger zone judgment processing module determines that the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, further determine whether the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2; if the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2 and is in an alarm state, maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the buffer zone R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the buffer zone R2 and is in an alarm state, deactivate the alarm.

[0012] In some possible implementations, the region definition module includes: a detection box height recording unit, configured to record the height H of each pedestrian detection box obtained by the pedestrian detection module; a preset ratio definition unit, configured to define a preset ratio k; and a buffer generation unit, configured to calculate the offset distance d=H×k, and offset the boundary of the danger region R outward based on the offset distance d to generate a buffer region R2.

[0013] In some possible implementations, the danger zone determination processing module includes: a pedestrian sub-image cropping unit, configured to crop the image region corresponding to the pedestrian detection box to obtain a pedestrian sub-image; a key point detection unit, configured to perform human key point detection on the pedestrian sub-image to obtain the coordinates of the foot key points; and a region positioning unit, configured to determine whether the pedestrian is in the danger zone R based on the coordinates of the foot key points. The buffer judgment and processing module includes: a pedestrian sub-image cropping unit, configured to crop the image region corresponding to the pedestrian detection box to obtain a pedestrian sub-image; a key point detection unit, configured to perform human key point detection on the pedestrian sub-image and obtain the coordinates of the foot key points; and a region positioning unit, configured to determine whether the pedestrian is in the buffer region R2 based on the coordinates of the foot key points.

[0014] In some possible implementations, the pedestrian detection module employs target detection algorithms including the YOLO algorithm, the Faster R-CNN algorithm, or the Single Detector Target Detection (SSD) algorithm.

[0015] In some possible implementations, the key point detection unit is configured to detect the coordinates of key points of the lower limbs, such as the ankle, knee, or hip joints.

[0016] The above technical solution has the following beneficial effects: This invention effectively solves the problems of rigid alarm logic and inflexible state switching in existing technologies by setting up a buffer zone around the danger zone and constructing a hierarchical judgment mechanism. Specifically, by utilizing the transition characteristics of the buffer zone R2, it can dynamically adapt to the uncertainty of pedestrian movement and detection errors, avoiding misjudgments caused by excessively high requirements for precise boundary alignment. By associating the alarm state with the position of the pedestrian detection box center point in the danger zone and the buffer zone, a hierarchical response logic of "trigger, maintain, and deactivate" is established. This can not only promptly alarm when a pedestrian actually enters the danger zone, but also maintain reasonable state continuity when the pedestrian is in the buffer zone, avoiding frequent alarms or untimely deactivation caused by brief entry or detection delays, thus improving the accuracy, stability, and adaptability to complex scenarios of area intrusion identification. Attached Figure Description

[0017] To more clearly illustrate the technical solutions in the embodiments of the present invention 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 the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1This is a flowchart of a pedestrian region intrusion identification method based on region expansion according to an embodiment of the present invention; Figure 2 This is a flowchart illustrating the formation of the buffer region R2 according to an embodiment of the present invention; Figure 3 This is a flowchart illustrating how to determine whether a pedestrian is in a danger zone or a buffer zone, according to an embodiment of the present invention. Figure 4 This is a schematic diagram of the pedestrian detection box and the center point of the lower bounding box of the pedestrian detection box in an embodiment of the present invention; Figure 5 This is a pedestrian detection box and a visual reference diagram of the intrusion detection area obtained after step C in this embodiment of the invention; Figure 6 This is a schematic diagram of the dangerous area and buffer area according to an embodiment of the present invention; Figure 7 This is a schematic diagram showing that the center points of the lower bounding boxes of the three pedestrian detection boxes in an embodiment of the present invention are at different positions; Figure 8 This is a functional block diagram of a pedestrian area intrusion recognition system based on area expansion according to an embodiment of the present invention; Figure 9 This is a functional block diagram of an electronic device according to an embodiment of the present invention. Detailed Implementation

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

[0020] Example 1 like Figure 1 As shown, this embodiment of the invention addresses the above-mentioned problems by providing a pedestrian region intrusion identification method based on region expansion. This pedestrian region intrusion identification method based on region expansion includes the following steps: Step A: Obtain the video of the pedestrian intrusion area to be detected. This can be obtained from a real-time video stream or from a video file repository.

[0021] Step B: Extract frames from the video at a certain frame rate.

[0022] Step C: Perform pedestrian detection on the image obtained by frame extraction; specifically, use a target detection algorithm to identify pedestrians to obtain the pedestrian detection results in the image, which are the pedestrian detection boxes in the image.

[0023] Step D: Define the danger zone as R, and offset the boundary of R outward by a certain distance to form a new buffer zone R2.

[0024] Step E: Determine whether the center point of the lower bounding box of the pedestrian detection box is within the danger zone R. If it is within the danger zone R and not in an alarm state, then trigger an alarm; if it is within the danger zone R and in an alarm state, then maintain the alarm state. If it is not within the danger zone R, proceed to step F.

[0025] Step F: Determine whether the center point of the lower bounding box of the pedestrian detection box is within the new buffer area R2. If it is within the new area R2 and is not in an alarm state, maintain the non-alarm state and do not trigger an alarm; if it is within the new buffer area R2 and is in an alarm state, maintain the alarm state; if it is not within the new buffer area R2 and is not in an alarm state, maintain the non-alarm state and do not trigger an alarm; if it is not within the new buffer area R2 and is in an alarm state, deactivate the alarm.

[0026] This technical solution achieves precise control and intelligent switching of alarm states by setting up a dual judgment mechanism of dangerous area R and buffer area R2, combined with dynamic position judgment of the center point of the lower boundary of the pedestrian detection box. Its advantages are: The hierarchical processing logic of direct judgment of the dangerous area and auxiliary judgment of the buffer effectively avoids false alarms caused by pedestrian position fluctuations in traditional single-area detection; using the center point of the lower boundary box as the position judgment benchmark accurately reflects the actual standing position of the pedestrian, which is more in line with the needs of actual scenarios compared to the overall position judgment of the traditional detection box; the introduction of an alarm state memory mechanism maintains the original alarm state unchanged within the buffer area R2, preventing system disturbances caused by frequent alarm starts and stops, and ensuring continuous monitoring of targets that have left the dangerous area; through area expansion and multi-condition combination judgment, the accuracy of pedestrian intrusion recognition and system response time are improved while reducing computational complexity.

[0027] like Figure 2 As shown, a preferred implementation of step D further includes the following steps: D1. For each detection box in the pedestrian detection results of step C, record the height H. H can be the maximum value, arithmetic mean, or weighted average of the heights of multiple detection boxes.

[0028] In the dynamic safety coverage scheme of step D1, the system can determine the offset based on the pedestrian closest to the camera (i.e., the one with the largest detection box height H_max). This design ensures that the buffer R2 can cover pedestrians in all potentially dangerous locations in the scene, effectively eliminating the risk of insufficient buffer coverage caused by the small H value of distant pedestrians. From the perspective of computational logic rationality, by uniformly generating the buffer area based on H_max, the system logic confusion caused by generating dynamic R2 areas separately for multiple pedestrians is avoided, while reducing real-time computation and improving system operating efficiency. In monitoring scenarios with depth variations, this scheme can also achieve perspective distortion compensation. H_max corresponds to the actual physical height of the nearest pedestrian, and the offset calculated based on this height can effectively offset the distance judgment error caused by the perspective projection of the camera.

[0029] In step D1, when multiple pedestrian detection boxes exist with different heights, a weighted average scheme can be used to calculate the final height H. Specifically, weights are assigned based on the confidence level (i.e., target detection score) and location information (e.g., distance from the danger zone R) of the detection boxes, and a weighted average H_weighted is calculated. This scheme has two technical advantages: First, confidence weighting allows high-confidence detection boxes (more likely to be real pedestrians) to have a greater impact on offset calculation, thereby reducing abnormal height interference caused by false detections and improving the stability of buffer generation. Second, location weighting assigns higher weights to pedestrians closer to the danger zone R, as they are more important for safety warnings. This allows the buffer to be appropriately expanded in key areas (e.g., near danger boundaries), enhancing the protection against high-risk targets. In this way, the system can effectively filter noise and dynamically optimize the buffer shape in multi-pedestrian scenarios, improving detection accuracy and warning reliability in complex environments.

[0030] D2. Define a preset ratio, typically 0.2~0.4, preferably 0.3. A preset ratio k of 0.2~0.4 adapts to human stride, compensates for camera perspective distortion, and matches human safety awareness distance, dynamically matching the buffer zone width with the actual intrusion risk. This improves multi-scenario detection robustness and early warning timeliness without complex calibration.

[0031] D3. Multiply the height H by the preset ratio to obtain the distance by which the boundary of the danger zone R is offset outward, and the offset results in a new zone R2.

[0032] In some embodiments, the specific implementation of defining the hazardous area R in step D can take different approaches depending on the scenario requirements, mainly including the following categories: Manual annotation (suitable for fixed scenarios) allows users to directly define the boundaries of hazardous areas through a graphical user interface. Users can click on polygon vertices sequentially in the monitoring screen or the first frame of a video to form closed regions (e.g., restricted areas on construction sites, prohibited areas in shopping malls); alternatively, they can select preset shapes such as rectangles or circles, adjusting their position and size to define areas (e.g., a circular hazardous area with a radius of 5 meters around equipment). After annotation, the system stores the vertex coordinates or shape parameters as configuration data for subsequent detection and judgment.

[0033] Automatic generation methods (suitable for structured scenarios) utilize algorithms to automatically identify hazardous areas based on scene semantic information. For example, semantic segmentation models (such as identifying dangerous elements like flames and water) can be used to automatically extract the contours of corresponding areas; or depth maps of the scene can be obtained using depth cameras, and areas with height differences exceeding safety thresholds (such as stair edges and high platforms) can be designated as hazardous areas; or static obstacles (such as machines and vehicles) can be identified using object detection algorithms, and a preset safety distance can be extended around them to form hazardous areas.

[0034] The hybrid definition method (combining manual and automatic methods) involves the user initially labeling the danger zone, and the system dynamically adjusting the boundaries based on the real-time scene during operation. For example, when the background model detects obstacle movement, it automatically expands or shrinks the danger zone; or it fine-tunes the zone boundaries based on environmental factors such as lighting and pedestrian density.

[0035] In addition, the hazardous area R can be time-dynamic, for example, different hazardous area ranges can be set for weekdays and weekends; in three-dimensional scenes (such as automated warehouses and high-altitude operation areas), three-dimensional spaces can be defined as hazardous areas; and the accuracy of area definition can be automatically enhanced by combining scene semantic information (such as "No Entry" signs) to ensure that the detection logic conforms to actual business rules.

[0036] like Figure 3 As shown, in some embodiments, determining whether a pedestrian is in a danger zone or a buffer zone in steps E and F specifically includes: E1, cropping the image region corresponding to the pedestrian detection box to obtain a pedestrian sub-image; E2, performing human key point detection on the pedestrian sub-image to obtain the coordinates of the foot key points; E3, determining whether the pedestrian is in a danger zone R or a buffer zone R2 based on the coordinates of the foot key points.

[0037] Specifically, the cropping of the image region corresponding to the pedestrian detection box in step E1 can be achieved using the following method: After obtaining the coordinates of the pedestrian detection box (the coordinates of the top-left corner (x, y), width w, and height h), a computer vision library (such as OpenCV or Pillow) can be used to directly crop the original image. Taking OpenCV as an example, cropping can be achieved using the statement image[y:y+h, x:x+w], where image is the image to be processed. This method is simple and efficient, accurately extracting the image region enclosed by the pedestrian detection box, providing high-quality input data for subsequent human keypoint detection.

[0038] Specifically, in step E2, human keypoint detection is performed on the pedestrian sub-image, which can be implemented using a deep learning-based human keypoint detection algorithm. Algorithms that can be used include OpenPose, AlphaPose, and HRNet. Taking HRNet (High-Resolution Network) as an example, this algorithm accurately locates human keypoints by maintaining high-resolution feature maps and can simultaneously detect multiple keypoints on the human body (such as ankles, knees, and hip joints). In practical applications, a pre-trained HRNet model can be used. The cropped pedestrian sub-image is input into the model, and the model outputs the coordinates of foot keypoints (such as ankles). This method has high detection accuracy and can meet the subsequent requirement of determining whether a pedestrian has entered a dangerous area based on foot keypoints.

[0039] In some embodiments, the target detection algorithm used in step C includes the YOLO algorithm, the Faster R-CNN algorithm, or the Single Detector Target Detection (SSD) algorithm.

[0040] Specifically, pedestrian detection in step C can be achieved through the following methods: First, select a suitable object detection algorithm. This includes single-stage deep learning-based detectors (e.g., YOLO series, SSD) or two-stage detectors (e.g., Faster R-CNN), or algorithms specifically optimized for pedestrian detection (e.g., pedestrian detection models in CenterNet and Detectron2). Taking YOLOv8 as an example, detection can be completed through the following steps: Use a pre-trained YOLOv8 model (e.g., yolov8n.pt), trained on the COCO dataset (containing pedestrian categories). Adjust the extracted frames to the model input size (e.g., 640×640 pixels) and normalize them. Input the processed image into the model, and the model outputs detection results containing bounding box coordinates (x, y, w, h), confidence scores (e.g., >0.5), and class labels (e.g., person). Remove overlapping and redundant detection boxes using non-maximum suppression (NMS) to obtain the accurate detection box for each pedestrian. Map the pedestrian detection box coordinates back to the original image size to obtain the pedestrian's position in the original image.

[0041] In some embodiments, the human body key point detection includes the detection of lower limb key points such as the ankle joint, knee joint, or hip joint.

[0042] like Figure 4 As shown, the rectangle represents the pedestrian detection box, and the red dot is the center point of the lower bounding box of the pedestrian detection box.

[0043] like Figure 5 As shown, the pedestrian detection bounding box and the visual reference of the detected intrusion area obtained after step C are shown. Figure 5 .exist Figure 5 In the diagram, label 51 corresponds to multiple pedestrian detection boxes whose lower bounding box center point is inside the danger zone R, label 52 corresponds to multiple pedestrian detection boxes whose lower bounding box center point is inside the buffer zone R2, and label 53 corresponds to multiple pedestrian detection boxes whose lower bounding box center point is outside the buffer zone R2.

[0044] like Figure 6 As shown, in step D, the inner polygon is the danger zone R. The boundary of R is shifted outward by a certain distance to form a new buffer zone R2.

[0045] like Figure 7 As shown in one example, in steps E and F, the center point of the lower bounding box of the pedestrian detection box is in the danger zone R (corresponding to the rightmost pedestrian numbered 30), in the new buffer zone R2 (corresponding to the middle pedestrian numbered 20), and not in zone R2 (corresponding to the leftmost pedestrian numbered 30).

[0046] Using the center point of the lower bounding box of the pedestrian detection bounding box as the judgment benchmark has the following advantages: the center point of the lower bounding box corresponds to the position of a person's feet, and the key to whether a pedestrian has entered the danger zone lies in whether their feet have crossed the boundary. Compared to the overall center point of the detection box (which may be located at the waist) or random key points, the center point of the lower boundary more directly reflects the position of the pedestrian in contact with the ground, avoiding false alarms caused by the pedestrian's upper body tilting or arm swinging. For example, when a pedestrian bends down to pick something up, their upper body may temporarily enter the danger zone, but their feet are still in the safe zone. In this case, judging by the center point of the lower boundary can avoid false alarms. In densely populated scenes, the mutual compression between pedestrians may cause the detection boxes to overlap or deform. Judging by the center point of the lower boundary can effectively filter out false alarms caused by fluctuations in the detection box. For example, when two people walk side by side, the detection boxes may temporarily merge, but the center point of the lower boundary remains within the safe zone, thus avoiding false alarms.

[0047] This invention, by setting a larger area offset outward from the danger zone to serve as a buffer, avoids frequent alarm and alarm cancellation. The advantage of this embodiment is that, compared to other methods for identifying pedestrian intrusion into danger zones, this method avoids frequent alarm and alarm cancellation when pedestrians are near the edge of the danger zone.

[0048] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the above-described division of functional units and modules is merely an example. In practical applications, the above functions can be assigned to different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiments can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit. Furthermore, the specific names of the functional units and modules are only for easy differentiation and are not intended to limit the scope of protection of this invention. The specific working process of the units and modules in the above system can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.

[0049] Example 2 like Figure 8 As shown, a pedestrian intrusion detection system based on region expansion includes: The video acquisition module is configured to acquire videos of pedestrian intrusion into the area to be detected, and the videos are acquired from real-time video streams or video file repositories. The image frame extraction module is configured to extract frames from the video at a predetermined frame rate to obtain the image to be processed. The pedestrian detection module is configured to perform pedestrian detection on the image to be processed, and to obtain pedestrian detection boxes in the image to be processed using a target detection algorithm. The area definition module is configured to define a dangerous area as R and offset the boundary of the dangerous area R outward by a preset distance to form a buffer area R2; The danger zone judgment and processing module is configured to: determine whether the center point of the lower bounding box of the pedestrian detection box is in the danger zone R; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is not in an alarm state, then trigger an alarm; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is in an alarm state, then maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, then trigger the buffer judgment and processing module to perform further processing. The buffer zone judgment processing module is configured to: when the danger zone judgment processing module determines that the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, further determine whether the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2; if the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2 and is in an alarm state, maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the buffer zone R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the buffer zone R2 and is in an alarm state, deactivate the alarm.

[0050] In some embodiments, the region definition module includes: a detection box height recording unit, configured to record the height H of each pedestrian detection box obtained by the pedestrian detection module; a preset ratio definition unit, configured to define a preset ratio k; and a buffer generation unit, configured to calculate an offset distance d=H×k, and offset the boundary of the danger region R outward based on the offset distance d to generate a buffer region R2.

[0051] In some embodiments, the danger zone determination processing module includes: a pedestrian sub-image cropping unit, configured to crop the image region corresponding to the pedestrian detection box to obtain a pedestrian sub-image; a key point detection unit, configured to perform human key point detection on the pedestrian sub-image to obtain the coordinates of foot key points; and a region positioning unit, configured to determine whether the pedestrian is in the danger zone R based on the coordinates of the foot key points. The buffer judgment and processing module includes: a pedestrian sub-image cropping unit, configured to crop the image region corresponding to the pedestrian detection box to obtain a pedestrian sub-image; a key point detection unit, configured to perform human key point detection on the pedestrian sub-image and obtain the coordinates of the foot key points; and a region positioning unit, configured to determine whether the pedestrian is in the buffer region R2 based on the coordinates of the foot key points.

[0052] In some embodiments, the target detection algorithm used by the pedestrian detection module includes the YOLO algorithm, the Faster R-CNN algorithm, or the Single Detector Target Detection Algorithm (SSD).

[0053] In some embodiments, the key point detection unit is configured to detect the coordinates of key points of the lower limbs such as the ankle, knee, or hip joints.

[0054] Example 3 See Figure 9 This application also provides an electronic device 600, which includes: At least one processor; and, A memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which, when executed by the at least one processor, enable the at least one processor to perform the pedestrian region intrusion identification method based on region expansion in the foregoing method embodiments.

[0055] This application also provides a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute the pedestrian region intrusion identification method based on region expansion in the foregoing method embodiments.

[0056] This application also provides a computer program product, which includes a computing program stored on a non-transitory computer-readable storage medium. The computer program includes program instructions that, when executed by a computer, cause the computer to perform the pedestrian region intrusion identification method based on region expansion in the aforementioned method embodiments.

[0057] The following is for reference. Figure 9 The diagram illustrates a structural schematic of an electronic device 900 suitable for implementing embodiments of this application. The electronic device 900 in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 9The electronic device 900 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of this application.

[0058] like Figure 9 As shown, the electronic device 900 may include a processing unit (e.g., a central processing unit, a graphics processor, etc.) 901, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 902 or a program loaded from a storage device 908 into a random access memory (RAM) 903. The RAM 903 also stores various programs and data required for the operation of the electronic device 900. The processing unit 901, ROM 902, and RAM 903 are interconnected via a bus 904. An input / output (I / O) interface 905 is also connected to the bus 904.

[0059] Typically, the following devices can be connected to I / O interface 905: input devices 906 including, for example, touchscreens, touchpads, keys, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 907 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 908 including, for example, magnetic tapes, hard disks, etc.; and communication devices 909. Communication device 909 allows electronic device 900 to communicate wirelessly or wiredly with other devices to exchange data. Although an electronic device 900 with various devices is shown in the figure, it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed alternatively.

[0060] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device 909, or installed from a storage device 908, or installed from a ROM 902. When the computer program is executed by a processing device 901, it performs the functions defined in the methods of the embodiments of this application.

[0061] It should be noted that the computer-readable medium described above in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. Computer-readable storage media can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM). The computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can also be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof. The aforementioned computer-readable medium can be included in the aforementioned electronic device; or it can exist independently and not assembled into the electronic device.

[0062] Computer program code for performing the operations of this disclosure can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, and conventional procedural programming languages ​​such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0063] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.

[0064] The units described in the embodiments of this application can be implemented in software or hardware. It should be understood that the names of units are not intended to limit the unit itself, and various parts of this disclosure can be implemented in hardware, software, firmware, or a combination thereof.

[0065] The above description is merely a specific embodiment of this disclosure, but the scope of protection of this disclosure is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this disclosure should be included within the scope of protection of this disclosure. Therefore, the scope of protection of this disclosure should be determined by the scope of the claims.

Claims

1. A method for pedestrian region intrusion identification based on region expansion, characterized in that, Includes the following steps: Step A: Obtain video footage of pedestrian intrusion into the area to be detected; Step B: Extract frames from the video at a predetermined frame rate to obtain the image to be processed; Step C: Perform pedestrian detection on the image to be processed, and use an object detection algorithm to obtain pedestrian detection boxes in the image to be processed; Step D: Define the danger zone as R, and offset the boundary of the danger zone R outward by a preset distance to form a buffer zone R2; wherein, the danger zone R can be defined in any of the following ways: Users can directly define the boundaries of dangerous areas through a graphical user interface; The semantic segmentation model identifies hazardous elements and automatically extracts the outlines of corresponding hazardous areas. Using a depth camera to obtain a scene depth map, areas with height differences exceeding a safety threshold are designated as danger zones. Static obstacles are identified using a target detection algorithm, and a danger zone is formed by extending a preset safe distance around them. First, the user marks the initial danger zone, and during the operation, the boundary is dynamically adjusted according to the real-time scene. This includes automatically expanding or shrinking the danger zone range when the background model detects the movement of obstacles, or fine-tuning the zone boundary according to environmental factors including lighting and pedestrian density. Set different danger zones for weekdays and weekends; Define a three-dimensional space as a danger zone in a three-dimensional scene; Define hazardous areas by combining scene semantic information; Step E: Determine whether the center point of the lower bounding box of the pedestrian detection box is in the danger zone R; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is not in an alarm state, then trigger an alarm; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is in an alarm state, then maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, then proceed to step F. Step F: Determine whether the center point of the lower bounding box of the pedestrian detection box is within the buffer area R2; if the center point of the lower bounding box of the pedestrian detection box is within the buffer area R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is within the buffer area R2 and is in an alarm state, maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not within the buffer area R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is not within the buffer area R2 and is in an alarm state, deactivate the alarm. Step D, which involves shifting the boundary of the danger zone R outward by a predetermined distance to form a buffer zone R2, specifically includes: D1. For each pedestrian detection box obtained in step C, record the height H of the pedestrian detection box; when there are multiple pedestrian detection boxes with different heights, determine the offset based on the pedestrian closest to the camera, or assign weights according to the confidence level of each detection box and the distance between each detection box and the danger zone R, and calculate the weighted average H_weighted as the final height H; D2. Define a preset ratio k, where k takes a value of 0.2 to 0.4; D3. Calculate the offset distance d = H × k, and offset the boundary of the danger zone R outward based on the offset distance d to generate a buffer zone R2.

2. The pedestrian region intrusion identification method based on region expansion according to claim 1, characterized in that, The determination of whether a pedestrian is in danger zone R or buffer zone R2 in steps E and F specifically includes: E1. Cropping the image region corresponding to the pedestrian detection box to obtain the pedestrian sub-image; E2. Perform human body key point detection on the pedestrian sub-image and obtain the coordinates of foot key points; E3. Based on the coordinates of the foot key points, determine whether the pedestrian is in the danger zone R or the buffer zone R2.

3. The pedestrian region intrusion identification method based on region expansion according to claim 1, characterized in that, The target detection algorithm used in step C includes the YOLO algorithm, the Faster R-CNN algorithm, or the Single Detector Target Detection Algorithm (SSD).

4. The pedestrian region intrusion identification method based on region expansion according to claim 2, characterized in that, The human body key point detection includes the detection of the ankle joint, knee joint, or hip joint.

5. A pedestrian intrusion detection system based on region expansion, characterized in that, include: The video acquisition module is configured to acquire videos of pedestrian intrusions into areas that need to be detected. The image frame extraction module is configured to extract frames from the video at a predetermined frame rate to obtain the image to be processed. The pedestrian detection module is configured to perform pedestrian detection on the image to be processed, and to obtain pedestrian detection boxes in the image to be processed using a target detection algorithm. The region definition module is configured to define a dangerous region as R and offset the boundary of the dangerous region R outward by a preset distance to form a buffer region R2. The methods for defining the dangerous region R include any of the following: direct delineation of the dangerous region boundary by the user through a graphical interface; automatic extraction of the corresponding dangerous region contour by identifying dangerous elements through a semantic segmentation model; delineation of areas with height differences exceeding a safety threshold as dangerous regions using a depth camera to obtain a scene depth map; identification of static obstacles using a target detection algorithm and expansion of the dangerous region around them by a preset safety distance; initial labeling of the dangerous region by the user, with dynamic adjustment of the boundary based on the real-time scene during operation, including automatically expanding or shrinking the dangerous region range when background modeling detects obstacle movement, or fine-tuning the region boundary based on environmental factors including lighting and pedestrian density; setting different dangerous region ranges for weekdays and weekends; defining a three-dimensional space as a dangerous region in a 3D scene; and defining dangerous regions by combining scene semantic information. The danger zone judgment and processing module is configured to: determine whether the center point of the lower bounding box of the pedestrian detection box is in the danger zone R; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is not in an alarm state, then trigger an alarm; if the center point of the lower bounding box of the pedestrian detection box is in the danger zone R and is in an alarm state, then maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, then trigger the buffer judgment and processing module to perform further processing. The buffer zone judgment processing module is configured to: when the danger zone judgment processing module determines that the center point of the lower bounding box of the pedestrian detection box is not in the danger zone R, further determine whether the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2; if the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is in the buffer zone R2 and is in an alarm state, maintain the alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the buffer zone R2 and is not in an alarm state, maintain the non-alarm state; if the center point of the lower bounding box of the pedestrian detection box is not in the buffer zone R2 and is in an alarm state, deactivate the alarm. The region definition module includes: a detection box height recording unit, configured to record the height H of each pedestrian detection box obtained by the pedestrian detection module; when there are multiple pedestrian detection boxes with different heights, the offset is determined based on the pedestrian closest to the camera, or a weighted average H_weighted is calculated as the final height H based on the confidence level of each detection box and the distance between each detection box and the danger zone R; a preset ratio definition unit, configured to define a preset ratio k, where k takes the value of 0.2 to 0.4; and a buffer generation unit, configured to calculate the offset distance d = H × k, and offset the boundary of the danger zone R outward based on the offset distance d to generate a buffer zone R2.

6. The pedestrian area intrusion identification system according to claim 5, characterized in that, The danger zone judgment and processing module includes: a pedestrian sub-image cropping unit, configured to crop the image area corresponding to the pedestrian detection box to obtain a pedestrian sub-image; a key point detection unit, configured to perform human key point detection on the pedestrian sub-image to obtain the coordinates of the foot key points; and a region positioning unit, configured to determine whether the pedestrian is in the danger zone R based on the coordinates of the foot key points. The buffer judgment and processing module includes: a pedestrian sub-image cropping unit, configured to crop the image region corresponding to the pedestrian detection box to obtain a pedestrian sub-image; a key point detection unit, configured to perform human key point detection on the pedestrian sub-image and obtain the coordinates of the foot key points; and a region positioning unit, configured to determine whether the pedestrian is in the buffer region R2 based on the coordinates of the foot key points.

7. The pedestrian area intrusion identification system according to claim 5, characterized in that, The pedestrian detection module employs target detection algorithms including YOLO, Faster R-CNN, or the Single Detector Target Detection (SSD) algorithm.

8. The pedestrian area intrusion identification system according to claim 6, characterized in that, The key point detection unit is configured to detect the coordinates of the ankle, knee, or hip joints.

Citation Information

Patent Citations

  • Image-based alarm method and device, electronic equipment and storage medium

    CN115358996A

  • Video-based human body dangerous behavior analysis method

    CN116259002A