Personnel border crossing monitoring method, device and equipment for scenic spot and medium

By applying the Yolov8 model and Botsort algorithm in park scenic spots, combined with the improved Kalman filter and re-identification technology, the problem of difficult monitoring of people's cross-border in the vast scenic spots is solved, and intelligent and efficient safety supervision is achieved.

CN120259976APending Publication Date: 2025-07-04SHANDONG ZHIYANG SHANGSHUI INFORMATION TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510381844.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-03-28
Publication Date
2025-07-04

AI Technical Summary

Technical Problem

In the vast park scenic area, relying on manual inspections to detect safety hazards and monitoring of key areas in a timely manner, the existing technology lacks effective intelligent supervision methods.

Method used

The Yolov8 model and Botsort algorithm built on Pytorch and Ultralytics are used to monitor personnel over-boundary monitoring methods, combined with improved Kalman filters and re-identification technology, image data is obtained through video surveillance, identify and track personnel positions, and use ray method and vector cross product to determine whether personnel are over-boundary, and broadcast alarms are performed.

Benefits of technology

It has improved the safety supervision efficiency of parks and scenic spots, timely discovered information about personnel crossing boundaries, saved labor costs, and achieved intelligent and efficient supervision.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120259976A_ABST
    Figure CN120259976A_ABST
Patent Text Reader

Abstract

The invention discloses a personnel border-crossing monitoring method, device and equipment for a scenic spot, and a medium. The method comprises the following steps: acquiring image data shot by a scenic spot monitoring and shooting device; inputting the image data into a pre-trained personnel border crossing monitoring model for identification; wherein the affiliated personnel border crossing monitoring model is associated with a Yolov8 model and a Botsort algorithm, wherein the Yolov8 model and the Botsort algorithm are established on the basis of Pytorch and Ulceratics; and outputting a personnel border crossing identification result, and carrying out broadcast alarm. By utilizing the method, the supervision capability of the park scenic area can be improved, the personnel border crossing information can be found in time, real-time alarm information display is provided for managers, and technical support is provided for intelligent and efficient operation management of the park scenic area.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of security monitoring technology, and particularly to a method, device, equipment and medium for monitoring personnel crossing boundaries in scenic areas. Background Art

[0002] With the increasing intensity of ecological environment protection, new parks and scenic areas have been continuously developed and put into use in recent years, and the problem of safety supervision in scenic areas has gradually emerged. The safety supervision in scenic areas is generally carried out by means of oral education by security personnel or manual patrol.

[0003] In large-scale park scenic areas, it is very difficult to detect dangerous information in time simply relying on personnel patrol, especially in relation to personnel safety and key area monitoring. In recent years, with the continuous development of artificial intelligence technology, the application of artificial intelligence technology in video monitoring has gradually become a hot topic. Artificial intelligence technology provides the information required for monitoring, and video monitoring equipment provides high-quality images and videos. The combination of the two provides technical support for intelligent management and monitoring. Therefore, developing a safety supervision plan for park scenic areas based on artificial intelligence is an urgent problem to be solved at present. Summary of the Invention

[0004] This application provides a method, device, equipment and medium for monitoring personnel crossing boundaries in scenic areas to solve the above problems. By applying video monitoring technology, the safety supervision efficiency of park scenic areas can be greatly improved, which not only ensures the safety of tourists, but also saves a large amount of labor costs, and solves the problems of intelligent and efficient supervision in park scenic areas.

[0005] On the one hand, this application provides a method for monitoring personnel crossing boundaries in scenic areas, and the method includes the following steps:

[0006] Obtain image data captured by the scenic area surveillance device;

[0007] Input the image data into a pre-trained personnel crossing boundary monitoring model for recognition; wherein, the personnel crossing boundary monitoring model is associated with a Yolov8 model and a Botsort algorithm built based on Pytorch and Ultralytics;

[0008] Output the personnel crossing boundary recognition result and conduct a broadcast alarm.

[0009] In an implementation manner of this application, the input of the Botsort algorithm is the personnel category, coordinate box, and confidence level output by the Yolov8 model. An improved Kalman filter and re-identification technology are used to associate the detection results with the historical trajectories, and camera motion compensation is added to the coordinate box prediction.

[0010] In an implementation manner of this application, the method further includes:

[0011] Define the monitoring area of the scenic spot in the scenic spot map; wherein, the monitoring area includes: water area, protection area and dangerous area;

[0012] Mark the coordinate points corresponding to each monitoring area in the image data captured by the monitoring and shooting device;

[0013] Use the Labelme tool to annotate the image data, the category is people, and after the annotation is completed, divide the training set and the validation set according to the ratio for the training of the Yolov8 model.

[0014] In an implementation manner of the present application, the method further includes:

[0015] Obtain the input Rtsp video stream using a camera and define the corresponding output video stream address;

[0016] Use Pyav to build and read the Rtsp video stream, decode each frame of the image and push the image to the specified Rtsp address;

[0017] Integrate the personnel crossing monitoring model into the Rtsp video stream reading function to complete the detection function of the video stream. By detecting and tracking each frame of the image, obtain the upper left coordinate, lower right coordinate, category and tracking ID of the personnel.

[0018] In an implementation manner of the present application, the process of identifying personnel crossing includes: judging the crossing situation of the tracked personnel coordinates in the linear or polygonal area according to the defined monitoring area, specifically:

[0019] Convert the personnel coordinates of two adjacent frames into the personnel center point coordinates. For the linear area, use the center point coordinates and the endpoints of the line to calculate the vector cross product, and judge whether the vector cross products are all positive or negative. If the signs are the same, the personnel are on the same side. If they are different, the personnel are on different sides, that is, it is judged that the personnel cross the boundary;

[0020] For the polygonal area, use the ray method to judge the position relationship between the center point and the polygon. The ray method is to use the center point as the endpoint of the ray and extend it infinitely. Record the number of intersections of the ray and each side of the polygon, and finally count the number of intersections. If it is an even number, the center point is outside the polygon, and it can be judged that there is no personnel crossing. If it is an odd number, the center point is inside the polygon, and it can be judged that the personnel cross the boundary.

[0021] In an implementation manner of the present application, for the judgment of the linear area, single-segment line and multi-segment line areas are supported. The judgment principle is whether the signs of the vector cross products of the center point coordinates and the endpoints of the line are the same. If the signs are all positive or negative, it means that the point is on the same side of the line, otherwise it is on both sides of the line. The calculation formula of the vector cross product is as follows,

[0022] Pi A = (x A - x p , y A - y p )

[0023] P i B = (x B - x p , y B - y p )

[0024]

[0025] where A and B represent the coordinates of the center points of the person in the previous frame and the current frame, P i , P i+1 are the endpoints of the line, P i A, P i B, P i P i+1 is the vector from point P i to point A, the vector from point P i to point B, and the vector from point P i to point P i+1 , P i A × P i P i+1 , P i B × P i P i+1 are the cross products of vectors P i A and P i B with vector P i P i+1 , x i , y i are the coordinates of the corresponding points.

[0026] In an implementation manner of this application, for the judgment of a polygon region, the judgment method is to calculate the number of intersection points between a ray with the center point coordinates as the endpoint and the polygon. If the number is even, the point is outside; if the number is odd, the point is inside. The direction of the ray is generally selected to be horizontal or vertical. Use the two endpoints of each side of the polygon to construct a line segment equation, and solve whether there is a solution between the ray and the line segment equation. If there is a solution, there is an intersection point; if there is no solution, there is no intersection point. Judge whether the final number is even or odd by accumulating the number of intersection points. For special cases such as the center point being at the endpoint or on the side of the polygon, substitute the center point into the line segment equation for judgment. If the solution of the equation is equal to the y value of the center point coordinates, it is considered that the point is on the side of the polygon and is not judged as inside; the formula is as follows:

[0027] y ray = y

[0028] y = m(x - x1) + y1

[0029]

[0030] Among them, y ray is a horizontal ray, y is the ordinate of the center point. The latter two formulas are equations composed of polygon line segments. x1, y1, x2, and y2 are the abscissas and ordinates of the two endpoints of the line segment, and m is the slope of the straight-line equation.

[0031] This application also provides a personnel out-of-bounds monitoring device for scenic areas, and the device includes:

[0032] A monitoring and shooting module for acquiring image data captured by a scenic area monitoring and shooting device;

[0033] A model recognition module for inputting the image data into a pre-trained personnel out-of-bounds monitoring model for recognition; among them, the personnel out-of-bounds monitoring model is associated with a Yolov8 model and a Botsort algorithm built based on Pytorch and Ultralytics;

[0034] An alarm output module for outputting the personnel out-of-bounds recognition result and performing a broadcast alarm.

[0035] This application also provides a personnel out-of-bounds monitoring device for scenic areas, and the device includes:

[0036] At least one processor; and,

[0037] A memory communicatively connected to the at least one processor; among them,

[0038] The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can complete the aforementioned personnel out-of-bounds monitoring method for scenic areas.

[0039] This application also provides a non-volatile computer storage medium for personnel out-of-bounds monitoring in scenic areas, storing computer-executable instructions, and the computer-executable instructions are executed by a processor to implement the aforementioned personnel out-of-bounds monitoring method for scenic areas.

[0040] A method, device, equipment and medium for monitoring personnel crossing the boundary in a scenic area provided by this application use the collected personnel image data to label a personnel recognition data set for training the Yolov8 model, obtain the personnel recognition model with the optimal accuracy, use Botsort as the tracking model, continuously identify and track personnel by inputting the Rtsp video stream, output the coordinate frame, category and tracking Id of the personnel, and use the obtained coordinate frame and the defined linear and polygonal regions to determine whether the personnel cross the boundary. It can improve the supervision ability of the park scenic area, timely discover the information of personnel crossing the boundary, provide real-time alarm information display for the management personnel, and provide technical support for the intelligent and efficient operation management of the park scenic area. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings described herein are used to provide a further understanding of this application and form a part of this application. The illustrative embodiments of this application and their descriptions are used to explain this application and do not constitute an improper limitation to this application. In the drawings:

[0042] Figure 1 It is a flowchart of a method for monitoring personnel crossing the boundary in a scenic area provided by an embodiment of this application;

[0043] Figure 2 It is a composition diagram of a device for monitoring personnel crossing the boundary in a scenic area provided by an embodiment of this application;

[0044] Figure 3 It is a schematic diagram of a device for monitoring personnel crossing the boundary in a scenic area provided by an embodiment of this application. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0045] To make the purpose, technical solution and advantages of this application clearer, the technical solution of this application will be clearly and completely described below in conjunction with the specific embodiments of this application and the corresponding drawings. Obviously, the described embodiments are only a part of the embodiments of this application, rather than all the embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of this application.

[0046] An embodiment of this application provides a method, device, equipment and medium for monitoring personnel crossing the boundary in a scenic area. The technical solution proposed in the embodiment of this application will be described in detail below with reference to the drawings.

[0047] Figure 1 It is a flowchart of a method for monitoring personnel crossing the boundary in a scenic area provided by an embodiment of this application. As Figure 1 shown, the method mainly includes the following steps:

[0048] Step 101, obtain the image data captured by the surveillance device in the scenic area.

[0049] In the embodiment of the present application, according to the monitoring plan of the park scenic area, captured images are obtained by using cameras in the covered area, and monitoring areas are drawn in the images, which can be divided into linear and polygonal shapes, and the corresponding coordinates are recorded.

[0050] Furthermore, the corresponding Rtsp video stream is obtained by using the camera, image data is obtained by frame extraction, the images with people in the images are retained, and people annotation is completed using the annotation tool Labelme, and it is divided into a training set and a validation set according to the ratio of 9:1.

[0051] It should be noted that in this embodiment, the frame extraction tool uses FFmpeg. By specifying the input Rtsp video stream and the output image address, each frame of the video can be saved as image data.

[0052] The Yolov8 model is trained using the training set and the validation set, and the optimal person recognition model in terms of accuracy is obtained through continuous iteration. The Yolov8 model in this embodiment uses the model provided by the Ultralytics library. The backbone network of this model uses the improved CSPDarknet53, introduces the C2f network structure to replace the original C3 network. The backbone network is mainly composed of Conv and C2f networks. The input layer is two Conv convolutional networks. The first stage is the C2f and Conv network structures. The subsequent three stages repeat the network structure of the first stage, but the last stage is replaced by the SPPF network instead of the Conv network. After each stage, the size of the feature map is halved and the number of channels increases. In each stage, the C2f network outputs the corresponding feature map. The feature maps of the subsequent three stages are respectively denoted as P3, P4, and P5.

[0053] Then, P3, P4, and P5 are input into the multi-scale feature fusion network. This network completes the upsampling and fusion of different feature maps. This part of the network is composed of three types of networks: Upsample, C2f, and Concat. First, P5 is upsampled and fused with P4 to obtain P6, and P6 is fused with P3 through the same operation to obtain P7. P7 is fused with P6 through Conv and then passed through the C2f network to obtain the feature map P8. P8 is fused with P5 through the same operation and then passed through the C2f network to obtain the feature map P9.

[0054] The obtained P7, P8, and P9 feature maps are respectively input into the final detection network. The three-resolution feature maps respectively obtain the predicted coordinates and categories, and the final prediction results are obtained through coordinate conversion, threshold filtering, and non-maximum suppression.

[0055] Among them, the loss function of Yolov8 uses cross-entropy loss and bounding box regression loss. Among them, the bounding box regression loss combines two methods of CIou and Distribution Focal Loss to improve the localization accuracy of the model. The formula is as follows:

[0056] BCE(p, y) = -y log(p) - (1 - y) log(1 - p)

[0057] In the formula, it is the cross - entropy loss, p is the predicted confidence, and y is the true label category.

[0058]

[0059] The formula is the Distribution Focal Loss. q(t) is the distribution predicted by the model, p(t) is the true distribution, and t is the coordinates of the bounding box.

[0060]

[0061] The formula is the CIou loss, ρ 2 (b, b gt ) is the square of the Euclidean distance between the centers of the predicted box and the true box. c 2 is the square of the length of the diagonal of the smallest circumscribed rectangle containing the predicted box and the true box. θ and θ gt are the arctangent values of the aspect ratios of the predicted box and the true box respectively. α is the dynamic weight used to balance the contributions of scale invariance and aspect ratio consistency.

[0062] The tracking algorithm adopted in this embodiment is Botsort. This method takes the output of the object detection model as input, and uses an improved Kalman filter and re - identification technology to associate the detection results and historical trajectories, improving the accuracy of object tracking. And camera motion compensation is added to the coordinate box prediction to solve the problem of inaccurate coordinate box prediction in the motion state. Among them, the Kalman filter combines the dynamic model of the system and the observation data to estimate the state of the system while reducing the influence of noise, and mainly completes the estimation of the system through two states of prediction and update. The formulas of the state equation and the observation equation are as follows,

[0063] x k = F k x k-1 + B k u k + w k

[0064] Among them, x k is the state vector. The aspect ratio in the improved state vector is the width and height. F k is the state transition matrix, B k is the control input matrix, u k is the control input vector, w k is the process noise, usually assumed to be Gaussian white noise with a mean of zero.

[0065] zk = H k x k + v k

[0066] where z k is the observation vector, H k is the observation matrix, v k is the observation noise, which is usually assumed to be Gaussian white noise with zero mean.

[0067] Through the obtained personnel out-of-bounds monitoring model, use the Pyav library to receive the Rtsp video stream, read the image of each frame after reading, input the image into the personnel recognition model YOLOv8 to obtain the personnel recognition result, and input the coordinate box, category, and confidence of the recognition result into the tracking model, and the tracking model can perform real-time tracking of personnel.

[0068] Use the obtained personnel tracking information to obtain the personnel ID and coordinate box, convert the coordinate box into the center coordinates of the personnel, and after inputting the Rtsp video stream, the real-time personnel ID and center coordinates can be obtained, and use the real-time coordinate information to make personnel out-of-bounds judgments for linear and polygonal regions respectively.

[0069] In this embodiment, the coordinate box obtained by the tracking model is the upper left corner coordinate and the lower right corner coordinate, and the formula for converting it into the center point coordinate is as follows,

[0070] x c = (x1 + x2) / 2

[0071] y c = (y1 + y2) / 2

[0072] where x c and y c are the center coordinates of the personnel, and x i and y i are the upper left corner and lower right corner coordinates of the coordinate box.

[0073] Step 102: Input the image data into a pre-trained personnel out-of-bounds monitoring model for recognition.

[0074] In the embodiment of the present application, from the obtained continuous real-time personnel ID and center coordinates, for the linear region, use the endpoints and center coordinates of each segment of the linear region to calculate the vector cross product in a loop. If the signs of all vector cross products are positive or negative, it is determined that the personnel have not crossed the boundary, otherwise it is determined that the personnel have crossed the boundary. For the polygonal region, use the ray method to determine whether the center point is inside the polygon, and make an exception judgment for the center point on the side of the polygon.

[0075] In this embodiment, the judgment of the linear region supports single-segment lines and multi-segment line regions. The judgment principle is whether the cross product signs of the central point coordinates and the vector of the line endpoints are the same. If the signs are both positive or negative, it means the point is on the same side of the line; otherwise, it is on both sides of the line. The calculation formula of the vector cross product is as follows:

[0076] P i A = (x A - x p , y A - y p )

[0077] P i B = (x B - x p , y B - y p )

[0078]

[0079] where A and B represent the central point coordinates of the person in the previous frame and the current frame, P i , P i+1 are the endpoints of the line, P i A, P i B, P i P i+1 are the vectors from point P i to point A, from point P i to point B, and from point P i to point P i+1 , P i A × P i P i+1 , P i B × P i P i+1 are the cross products of vectors P i A and P i B with vector P i P i+1 respectively, and x i , y i are the coordinates of the corresponding points.

[0080] For the judgment of a polygonal area, the judgment method is to calculate the number of intersection points between a ray with the center point coordinates as the endpoint and the polygon. If the number is even, the point is outside; if the number is odd, the point is inside. Generally, the ray direction is selected to be horizontal or vertical. Use the two endpoints of each side of the polygon to construct a line segment equation, and solve whether there is a solution between the ray and the line segment equation. If there is a solution, there is an intersection point; if there is no solution, there is no intersection point. Determine whether the final number is even or odd by accumulating the number of intersection points. For special cases where the center point is at the endpoint or on the side of the polygon, substitute the center point into the line segment equation for judgment. If the solution of the equation is equal to the y value of the center point coordinates, it is considered that the point is on the side of the polygon and is not judged as inside.

[0081] y ray = y

[0082] y = m(x - x1) + y1

[0083]

[0084] where y ray is a horizontal ray, y is the ordinate of the center point, the latter two formulas are the equations composed of polygon line segments, x1, y1, x2, y2 are the abscissas and ordinates of the two endpoints of the line segment, and m is the slope of the straight line equation.

[0085] Step 103: Output the result of personnel out-of-bounds identification and perform broadcast warning.

[0086] In the embodiment of the present application, after obtaining the out-of-bounds information, the coordinates and categories of the out-of-bounds personnel are drawn into the video frame. According to the pre-defined Rtsp address, the Pyav library will push each frame of the image to the Rtsp address for real-time display, and save the image with the drawn out-of-bounds personnel for subsequent viewing by security personnel.

[0087] The above is a method for monitoring personnel out-of-bounds in a scenic area provided by the embodiment of the present application. Based on the same inventive concept, the embodiment of the present application also provides a device for monitoring personnel out-of-bounds in a scenic area. Figure 2 It is a composition diagram of a device for monitoring personnel out-of-bounds in a scenic area provided by the embodiment of the present application. As Figure 2 shown, the device mainly includes: a monitoring and shooting module 201, which is used to obtain the image data captured by the scenic area monitoring and shooting device;

[0088] A model recognition module 202, which is used to input the image data into a pre-trained personnel out-of-bounds monitoring model for recognition; among them, the personnel out-of-bounds monitoring model is associated with a Yolov8 model and a Botsort algorithm built based on Pytorch and Ultralytics;

[0089] An alarm output module 203, which is used to output the result of personnel out-of-bounds identification and perform broadcast warning.

[0090] The above is a personnel crossing boundary monitoring device for scenic areas provided by an embodiment of the present application. Based on the same inventive concept, an embodiment of the present application also provides a personnel crossing boundary monitoring device for scenic areas. Figure 3 It is a schematic diagram of a personnel crossing boundary monitoring device for scenic areas provided by an embodiment of the present application. As Figure 3 shown, the device mainly includes: at least one processor 301; and a memory 302 communicatively connected to the at least one processor; wherein, the memory 302 stores instructions executable by the at least one processor 301, and the instructions are executed by the at least one processor 301 to enable the at least one processor 301 to complete the aforementioned personnel crossing boundary monitoring method for scenic areas.

[0091] In addition, an embodiment of the present application also provides a non-volatile computer storage medium for personnel crossing boundary monitoring in scenic areas, storing computer-executable instructions, and the computer-executable instructions are executed by a processor to be used for implementing the aforementioned personnel crossing boundary monitoring method for scenic areas.

[0092] The present invention is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (devices), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, and the combination of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to the processors of general-purpose computers, special-purpose computers, embedded processors, or other programmable data processing devices to generate a machine, such that the instructions executed by the processors of the computer or other programmable data processing devices generate a device for implementing the functions specified in one Figure 1 process or multiple processes and / or one Figure 1 block or multiple blocks.

[0093] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, such that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device implements the functions specified in one Figure 1 process or multiple processes and / or one Figure 1 block or multiple blocks.

[0094] These computer program instructions can also be loaded onto a computer or other programmable data processing device, such that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process, and thus the instructions executed on the computer or other programmable device provide for implementing the functions specified in one Figure 1 process or multiple processes and / or one Figure 1Steps of the functions specified in one or more boxes.

[0095] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and memory.

[0096] Each embodiment in this application is described in a progressive manner. For the same or similar parts among the embodiments, reference can be made to each other. Each embodiment focuses on the differences from other embodiments. In particular, for the device embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiments.

[0097] It should also be noted that the term "comprising", "including" or any other variant thereof is intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements not only includes those elements, but also includes other elements not explicitly listed, or further includes elements inherent to such process, method, commodity or device. Without more limitations, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, commodity or device including the said element.

[0098] The above description is only for the embodiments of this application and is not used to limit this application. For those skilled in the art, various changes and modifications can be made to this application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of this application shall be included within the scope of the claims of this application.

Claims

1. A method for monitoring personnel crossing boundaries in a scenic area, characterized in that, The method includes the following steps: Obtain the image data captured by the scenic area surveillance camera; Input the image data into a pre-trained personnel out-of-bounds monitoring model for identification; wherein, the personnel out-of-bounds monitoring model is associated with a Yolov8 model and a Botsort algorithm built based on Pytorch and Ultralytics; Output the personnel out-of-bounds identification result and perform a broadcast alarm.

2. The personnel out-of-bounds monitoring method for scenic spots according to claim 1, wherein, The input of the Botsort algorithm is the personnel category, coordinate box, and confidence level output by the Yolov8 model. An improved Kalman filter and re-identification technology are used to associate the detection results and historical trajectories, and camera motion compensation is added to the coordinate box prediction.

3. The personnel out-of-bounds monitoring method for scenic spots according to claim 1, wherein The method further includes: Define the monitoring area of the scenic area in the scenic area map; wherein, the monitoring area includes: water area, protected area, and dangerous area; Mark the coordinate points corresponding to each monitoring area in the image data captured by the surveillance camera; Use the Labelme tool to annotate the image data with the category of personnel. After annotation, divide the training set and validation set according to a ratio for the training of the Yolov8 model.

4. A method for monitoring personnel crossing the boundary in a scenic area according to claim 1, characterized in that, The method further includes: Obtain the input Rtsp video stream using a camera and define the corresponding output video stream address; Use Pyav to build and read the Rtsp video stream, decode each frame of the image, and push the image to the specified Rtsp address; Integrate the personnel out-of-bounds monitoring model into the Rtsp video stream reading function to complete the video stream detection function. By performing detection and tracking on each frame of the image, obtain the upper left coordinate, lower right coordinate, category, and tracking ID of the personnel.

5. A method for monitoring personnel crossing the boundary in a scenic area according to any one of claims 1 or 3, characterized in that, The process of identifying personnel out-of-bounds includes: judging the out-of-bounds situation of the tracked personnel coordinates in a linear or polygonal area according to the specified monitoring area. Specifically: Convert the personnel coordinates of two adjacent frames into the personnel center point coordinates. For a linear area, use the center point coordinates and the endpoints of the line to calculate the vector cross product, and judge whether the vector cross products are all positive or negative. If the signs are the same, the personnel are on the same side; if different, the personnel are on different sides, that is, judge that the personnel have crossed the boundary; For a polygonal area, use the ray method to judge the position relationship between the center point and the polygon. The ray method is to use the center point as the endpoint of the ray and extend it infinitely. Record the number of intersection points of the ray and each side of the polygon, and finally count the number of intersection points. If it is an even number, the center point is outside the polygon, and it can be judged that there is no personnel out-of-bounds; if it is an odd number, the center point is inside the polygon, and it can be judged that the personnel have out-of-bounds.

6. The personnel cross - boundary monitoring method for scenic spots according to claim 5, characterized in that, For the judgment of a linear area, single-segment line and multi-segment line areas are supported. The judgment principle is whether the signs of the vector cross products of the center point coordinates and the endpoints of the line are the same. The same positive or negative signs indicate that the point is on the same side of the line, otherwise on both sides of the line. The calculation formula of the vector cross product is as follows, P i A = (x A - x p , y A - y p ) P i B = (x B - x p , y B - y p ) Among them, A and B represent the coordinates of the center points of the personnel in the previous frame and the current frame, P i , P i+1 are the endpoints of the line, P i A, P i B, P i P i+1 is the vector from point P i to point A, the vector from point P i to point B, and the vector from point P i to point P i+1 . P i A×P i P i+1 , P i B×P i P i+1 are the cross products of the vectors P i A and P i B with the vector P i P i+1 . x i , y i are the coordinates of the corresponding points.

7. A method for monitoring personnel crossing boundaries in a scenic area according to claim 5, characterized in that, For the judgment of a polygonal region, the judgment method is to calculate the number of intersection points between the ray with the center point coordinates as the endpoint and the polygon. If the number is even, the point is outside; if the number is odd, the point is inside. The ray direction is generally selected to be horizontal or vertical. Use the two endpoints of each side of the polygon to construct a line segment equation, and solve whether there is a solution between the ray and the line segment equation. If there is a solution, there is an intersection point; if there is no solution, there is no intersection point. Determine whether the final number is even or odd by accumulating the number of intersection points. For the center point on the endpoint or side of the polygon, substitute the center point into the line segment equation for judgment. If the solution of the equation is equal to the y value of the center point coordinates, the point is considered to be on the polygon side and is not judged as inside; the formula is as follows: y ray = y y = m(x - x1) + y1 Among them, y ray is the horizontal ray, y is the ordinate of the center point. The latter two formulas are the equations formed by the polygon line segments. x1, y1, x2, and y2 are the abscissas and ordinates of the two endpoints of the line segment, and m is the slope of the straight line equation.

8. A personnel overstep monitoring device for scenic spots, characterized in that The device includes: A surveillance and shooting module, configured to obtain image data captured by a scenic area surveillance and shooting device; A model recognition module, configured to input the image data into a pre-trained personnel out-of-bounds monitoring model for recognition; wherein, the personnel out-of-bounds monitoring model is associated with a Yolov8 model and a Botsort algorithm built based on Pytorch and Ultralytics; An alarm output module, configured to output the personnel out-of-bounds recognition result and perform a broadcast alarm.

9. A personnel overstep monitoring device for scenic spots, characterized in that, The device 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, and the instructions are executed by the at least one processor so that the at least one processor can complete a method for monitoring personnel out-of-bounds in a scenic area according to any one of claims 1-7.

10. A non-volatile computer storage medium for personnel boundary-crossing monitoring in a scenic area, storing computer-executable instructions, characterized in that, The computer-executable instructions are executed by the processor to implement a method for monitoring personnel out-of-bounds in a scenic area according to any one of claims 1-7.