A region detection method and apparatus
By using the three-frame difference method and the same target tracking and matching regional detection method, the problems of complex equipment structure and large amount of computation in the existing technology are solved, realizing high real-time performance and accurate detection of multiple types of alarms, which is suitable for video surveillance in a wide range of scenarios.
Patent Information
- Application Number
- CN202311845570.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-28
- Publication Date
- 2025-12-30
- Estimated Expiration
- 2043-12-28
AI Technical Summary
Existing technologies for area detection based on infrared sensors are complex in structure, have limited coverage, and cannot record video in real time. Methods based on video artificial intelligence have high computational load, and the detection results are easily affected by interference factors, resulting in poor real-time performance.
The video frames are processed using the three-frame difference method to determine the contour region and coordinates of the moving target. Combined with target tracking and matching and alarm judgment, it can detect and judge various types of alarms. By constructing a multi-boundary intersection detection device, target tracking and matching are performed, the target queue is updated, and alarm monitoring and judgment are carried out.
It achieves high real-time performance and low computational cost in moving target detection, has strong anti-interference capabilities, can perform multi-type alarm judgments, and reduces the requirements for chip performance.
Smart Images

Figure CN117853997B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of area detection technology, and specifically relates to an area detection method and device. Background Technology
[0002] Area detection is a process based on video surveillance systems to perform real-time analysis of video streams, detect and analyze moving targets within multiple rectangular areas of interest, determine the direction of movement of the moving targets, and report events that meet alarm conditions in real time.
[0003] Existing technologies often employ infrared sensors to detect living targets with heat, or rely on artificial intelligence to detect specific target types, such as humans and vehicles.
[0004] Among them, area detection technology based on infrared sensors is usually complex in structure. The coverage of a single infrared sensor is limited, and the on-site installation and debugging of multiple sensors is difficult. In addition, there is no real-time video monitoring, so it is impossible to record the detected area intrusion target in real time and it is impossible to trace back.
[0005] Furthermore, region detection technologies based on video AI, such as those using AI or template matching to detect targets, typically only detect fixed types of targets, such as people and vehicles. Current methods for determining the position of moving targets based on pixel differences between consecutive video frames often suffer from unpredictable interference factors in the image, leading to abnormal detection results. These factors include variations in lighting, deformation of moving targets due to changes in viewing angle, and occlusion by moving objects in the scene. Additionally, AI or template matching methods are computationally intensive, demanding high-performance chips and exhibiting poor real-time performance. Summary of the Invention
[0006] One of the objectives of this invention is to provide a regional detection method that has high real-time frame difference performance, low computational load, and can achieve multiple types of alarms in a single calculation.
[0007] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0008] A region detection method for moving target detection and alarm, the region detection method comprising:
[0009] The three-frame difference method is used to process video frames to determine the contour region and coordinates of the moving target;
[0010] Based on the contour region and coordinates of the moving target, perform target tracking and matching, and update the target queue;
[0011] Alarm monitoring and judgment are performed on each moving target in the target queue, including:
[0012] If the coordinates of the moving target are within the detection area, the entry ratio of the moving target's outline area into the detection area is calculated. When the entry ratio reaches the threshold, it is determined whether the size of the moving target's outline meets the configuration requirements. If the outline size meets the configuration requirements, a motion detection alarm is generated.
[0013] Alternatively, if the coordinates of the moving target are within the detection area, the entry ratio of the moving target's outline area into the detection area is calculated. When the entry ratio reaches the threshold, it is determined whether the outline size of the moving target meets the configuration requirements. If the outline size meets the configuration requirements, the movement status of the moving target is calculated. If the movement status is "entering", an area intrusion alarm is generated.
[0014] Alternatively, the intrusion zone and non-intrusion zone can be divided according to the boundary line. If the coordinates of the moving target are within the intrusion zone, the entry ratio of the moving target's outline area into the intrusion zone is calculated. When the entry ratio reaches the threshold, it is determined whether the outline size of the moving target meets the configuration requirements. If the outline size meets the configuration requirements, the movement status of the moving target is calculated. If the movement status is "entering", a boundary crossing detection alarm is generated.
[0015] Several alternative methods are provided below, but they are not intended as additional limitations on the overall solution above. They are merely further additions or optimizations. Provided there are no technical or logical contradictions, each alternative method can be combined individually with respect to the overall solution above, or multiple alternative methods can be combined with each other.
[0016] Preferably, the step of processing video frames using the three-frame difference method to determine the contour region and coordinates of the moving target includes:
[0017] Take three consecutive video frames and calculate the frame difference between two adjacent video frames.
[0018] The frame difference results from the two frame difference calculations are ORed to obtain the preliminary contour region;
[0019] The initial contour region is sequentially subjected to median filtering, dilation, and connected component calculation to obtain the final contour region. The pixel coordinates of the outer rectangular bounding box of the contour region are taken as the coordinates of the moving target.
[0020] Preferably, the step of performing target tracking and matching based on the contour region and coordinates of the moving target, and updating the target queue, includes:
[0021] Traverse the moving targets in the original target queue and calculate the ratio of the width and height of the bounding box of the outline region of the traversed moving target and the currently detected moving target.
[0022] If the aspect ratio is less than the threshold, then it is determined whether the coordinate displacement is less than the threshold. If it is less than the threshold, it is matched as the same moving target; otherwise, it is matched as different moving targets. If the aspect ratio is greater than or equal to the threshold, it is matched as different moving targets.
[0023] If the currently detected moving target matches all moving targets in the original target queue as different moving targets, then the currently detected moving target will be added to the target queue as a new moving target.
[0024] Preferably, the calculation of the proportion of the moving target's contour region entering the detection region includes:
[0025] Construct a polygon for the contour region of the moving target and the shear detection region;
[0026] Divide the polygon into multiple triangles and calculate the area of each triangle to obtain the area of the polygon.
[0027] The ratio of the area of the polygon to the area of the outline region is taken as the entry ratio.
[0028] Preferably, the polygon of the contour region shearing detection region of the constructed moving target includes:
[0029] Initialize the vertex sequence, define the vertex traversal order of the detection region, and perform the following judgment for each vertex:
[0030] If the current vertex is inside the contour region and the previous vertex is also inside the contour region, then add the current vertex to the vertex sequence.
[0031] Alternatively, if the current vertex is inside the contour region and the previous vertex is outside the contour region, then add the intersection of the line segment formed by the current vertex and the previous vertex with the boundary of the contour region to the vertex sequence, and add the current vertex to the vertex sequence at the same time.
[0032] Alternatively, if the current vertex is outside the contour region and the previous vertex is inside the contour region, then only the intersection of the line segment formed by the current vertex and the previous vertex with the boundary of the contour region is added to the vertex sequence.
[0033] Alternatively, if the current vertex is outside the contour region and the previous vertex is also outside the contour region, then the vertex sequence is not updated.
[0034] After traversing each vertex, the final vertex sequence is used to form a polygon.
[0035] Preferably, the calculation of the movement state of the moving target includes:
[0036] Obtain the proportion of the contour region of a moving target entering the detection area / intrusion area after multiple consecutive calculations;
[0037] If the calculated entry ratio increases over multiple consecutive calculations, the target's movement status is "entering"; if the calculated entry ratio remains unchanged, the target's movement status is "stopping"; if the calculated entry ratio decreases over multiple consecutive calculations, the target's movement status is "exiting".
[0038] This invention provides a regional detection method that uses a three-frame differential method for moving target detection, which has low computational complexity, high real-time performance, strong anti-interference capabilities, and high accuracy. The alarm judgment is modularized and hierarchically calculated, allowing a single calculation to be used for judging multiple alarm types, with low computational complexity and high real-time performance.
[0039] The second objective of this invention is to provide a regional detection device with high real-time frame difference performance, low computational load, and the ability to achieve multiple types of alarms in a single calculation.
[0040] To achieve the above objectives, the technical solution adopted by the present invention is as follows: a region detection device, including a processor and a memory storing a plurality of computer instructions, wherein the computer instructions are executed by the processor to implement the steps of the region detection method. Attached Figure Description
[0041] Figure 1 This is a flowchart of the area detection method of the present invention;
[0042] Figure 2 This is a flowchart illustrating the calculation of the contour region of the moving target in this invention.
[0043] Figure 3 This is a flowchart illustrating the target tracking and matching process of the present invention;
[0044] Figure 4 This is a flowchart of the alarm monitoring process of the present invention;
[0045] Figure 5 This is a schematic diagram illustrating the proportional calculation process of the present invention. Detailed Implementation
[0046] 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.
[0047] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention pertains. The terminology used herein is for the purpose of describing particular embodiments only and is not intended to limit the invention.
[0048] To overcome the problems of poor real-time performance and accuracy of existing area detection technologies, this embodiment provides an area detection method for moving target detection and alarm. It aims to achieve full coverage detection of a large area using a single monitoring device. The device is easy to install and debug, and alarm events can be recorded by video recording.
[0049] like Figure 1 As shown, the area detection method in this embodiment includes the following steps:
[0050] Step 1: Use the three-frame difference method to process video frames and determine the outline region and coordinates of the moving target.
[0051] The purpose of area detection is primarily to detect moving targets within a detection area, analyze the movement information of the moving targets, and determine whether an alarm event has occurred. Moving target detection mainly uses frame differencing to separate the moving target from the complex background, thereby determining the region of the moving target.
[0052] The frame difference method analyzes video sequences that may contain moving targets frame by frame, calculates the difference between images of the same background at different times, and can reflect the outline region of a moving target in that background.
[0053] Because the three-frame difference method has a better detection effect on fast-moving targets compared to the two-frame difference method, it can avoid the "ghosting" phenomenon and is less affected by uncertain interference factors in the image, ultimately detecting a more complete moving target. Therefore, this embodiment uses the three-frame difference method to obtain the contour region and coordinates of the moving target. The processing steps are as follows: Figure 2 As shown, it includes:
[0054] 1) Frame difference calculation: Take three consecutive video frames, and calculate the frame difference between two adjacent video frames. When calculating the frame difference, calculate the difference between the corresponding pixel values of the two frames and take the absolute value.
[0055] 2) OR operation: Perform an OR operation on the corresponding pixel values in the frame difference results of the two frame difference calculations. The resulting non-zero pixel value region is the preliminary contour region, which is the changing foreground region. At this time, the contour region has many "holes" and incomplete boundaries, requiring subsequent connectivity analysis processing.
[0056] 3) Median filtering: Median filtering is applied to the preliminary contour region image. Median filtering filters out isolated noise pixels and produces a filtering effect on salt-and-pepper noise and impulse noise generated during image acquisition, thus preserving the edge characteristics of the image.
[0057] 4) Dilation: Dilation is performed on the median-filtered image. Dilation expands the boundaries outward and merges adjacent "holes" in the interpolation result, making the contour area more complete.
[0058] 5) Connected component calculation (e.g., Seed-Filling algorithm): Perform connected component calculation on the image after dilation operation, connect non-zero regions, so that adjacent target regions are connected into one, calculate the complete contour region, and prevent multiple contour regions from being calculated for a single moving target.
[0059] To facilitate subsequent calculations, when obtaining the coordinates of the moving target, this embodiment takes the pixel coordinates of the outer rectangular bounding box of the contour region as the coordinates of the moving target. Specifically, it can be the pixel coordinates of the center point of the outer rectangular bounding box or the world coordinates corresponding to the pixel coordinates of the center point of the outer rectangular bounding box.
[0060] Step 2: Perform target tracking and matching based on the contour area and coordinates of the moving target, and update the target queue.
[0061] To simultaneously detect, track, and issue alarms for multiple targets, and to avoid interference from multiple targets affecting detection accuracy, this embodiment performs same-target tracking and matching after obtaining the contour regions and coordinates of all moving targets. During matching, it determines whether the moving targets detected in consecutive frames are the same target based on changes in the contour regions and coordinates of the moving targets. The determination process is as follows: Figure 3 As shown, it includes:
[0062] 1) Traverse the moving targets in the historical frames, that is, the moving targets in the original target queue determined last time, and calculate the ratio of the width and height of the bounding box of the outline region of the traversed moving targets and the currently detected moving targets.
[0063] 2) If the aspect ratio is less than the threshold, then determine whether the coordinate displacement is less than the threshold. If it is less than the threshold, then match it as the same moving target; otherwise, match it as different moving targets. If the aspect ratio is greater than or equal to the threshold, then match it as different moving targets.
[0064] 3) If the currently detected moving target matches all moving targets in the original target queue as different moving targets, then the currently detected moving target is added to the target queue as a new moving target.
[0065] In this embodiment, when tracking targets, it first eliminates targets with dissimilar shapes by changing the aspect ratio, and then eliminates targets with similar shapes based on the magnitude of the coordinate displacement. When determining whether the coordinate displacement is less than a threshold, the threshold can be, for example, the distance a normal pedestrian walks within the detection time interval, the distance a normal pedestrian runs within the detection time interval, or the distance a normal vehicle travels within the detection time interval, etc.
[0066] Step 3: Perform alarm monitoring and judgment for each moving target in the target queue.
[0067] The system determines whether the movement of a moving target in the motion detection results meets the alarm criteria. The main judgment process involves: calculating whether the moving target is within the region of interest; calculating the percentage of the region the moving target occupies; calculating whether the size of the moving target is within a reasonable range; and determining whether the percentage of the area the moving target occupies reaches the alarm threshold. For example... Figure 4 As shown, the alarm types that can be implemented in this embodiment include:
[0068] If the coordinates of the moving target are within the detection area, the entry ratio of the moving target's outline area into the detection area is calculated. When the entry ratio reaches the threshold, it is determined whether the size of the moving target's outline meets the configuration requirements. If the outline size meets the configuration requirements, a motion detection alarm is generated.
[0069] Alternatively, if the coordinates of the moving target are within the detection area, the entry ratio of the moving target's outline area into the detection area is calculated. When the entry ratio reaches the threshold, it is determined whether the outline size of the moving target meets the configuration requirements. If the outline size meets the configuration requirements, the movement status of the moving target is calculated. If the movement status is "entering", an area intrusion alarm is generated.
[0070] Alternatively, the intrusion zone and non-intrusion zone can be divided according to the boundary line. If the coordinates of the moving target are within the intrusion zone, the entry ratio of the moving target's outline area into the intrusion zone is calculated. When the entry ratio reaches the threshold, it is determined whether the outline size of the moving target meets the configuration requirements. If the outline size meets the configuration requirements, the movement status of the moving target is calculated. If the movement status is "entering", a boundary crossing detection alarm is generated.
[0071] This embodiment can achieve multiple types of alarm monitoring based on a single moving target detection, which improves data utilization and broadens the detection scope. It is easy to understand that the above are the three alarm monitoring processes provided in this embodiment; in other embodiments, other alarm monitoring processes can be added based on these three.
[0072] The process of calculating the proportion of the moving target's contour region entering the detection area (or intrusion area) is as follows: Figure 5As shown, the entry ratio = area A / (area A + area B), where area A is the overlapping area of the contour region and the detection region (or intrusion region), and area A + area B is the area of the contour region.
[0073] In this embodiment, the calculation of the overlapping area between the contour region of the moving target and the detection region (or intrusion region) is divided into two steps. First, a polygon is constructed by cutting the contour region of the moving target and the detection region. Then, the polygon is divided into multiple triangles, and the area of each triangle is calculated to obtain the area of the polygon as the overlapping area.
[0074] This embodiment uses the Sutherland-Hodgman polygon clipping algorithm (Sutherland-Hodgman algorithm) to construct the clipped polygon. Each time, one edge of the contour region and its extension are used to clip all edges of the detection region. Both the contour region and the detection region are identified by vertex sequences. After the detection region is clipped by one edge of the contour region according to the clipping rules, a new vertex sequence is formed. The vertex sequence formed after clipping the detection region using all edges of the contour region is the overlapping region polygon. The rules for clipping the detection region using the contour region boundary and its extension are as follows:
[0075] If the current vertex Px is inside the contour region, and the previous vertex Py is also inside the contour region, then add the current vertex Px to the vertex sequence.
[0076] Alternatively, if the current vertex Px is inside the contour region and the previous vertex Py is outside the contour region, then add the intersection point Q of the line segment formed by the current vertex Px and the previous vertex Py and the boundary of the contour region to the vertex sequence, and at the same time add the current vertex Px to the vertex sequence.
[0077] Alternatively, if the current vertex Px is outside the contour region and the previous vertex Py is inside the contour region, then only the intersection point Q of the line segment formed by the current vertex Px and the previous vertex Py and the boundary of the contour region is added to the vertex sequence.
[0078] Alternatively, if the current vertex Px is outside the contour region and the previous vertex Py is also outside the contour region, then the vertex sequence is not updated.
[0079] After all the cutting is completed, the new sequence of vertices forms the overlapping region polygon. By dividing the polygon into multiple triangles, the overlapping area between the contour region and the detection region can be obtained.
[0080] To avoid false alarms, this embodiment sets a threshold; an intrusion assessment is only initiated when the entry rate reaches the threshold. Since the objects entering or intruding into the detection area are diverse in real-world environments, and the objects being detected can be specific (e.g., when monitoring for human intrusion, there's no need to process birds entering or intruding into the detection area), this embodiment proposes judging the size of the moving target's outline. If the outline size clearly does not match the target being detected, no monitoring or alarm is triggered, thereby reducing interference from the external environment and improving monitoring accuracy and rigor.
[0081] Furthermore, timely detection of intrusion actions is crucial for monitoring. Therefore, this embodiment focuses on monitoring intrusion actions, i.e., issuing an alarm only when the moving target's movement state is "entering," thus reducing the computational load for detection. Of course, other movement states can be set to trigger alarms in other embodiments. The calculation of the moving target's movement state in this embodiment includes the following steps:
[0082] The system obtains the entry ratio of the contour region of a moving target into the detection area / intrusion area calculated multiple times consecutively. If the entry ratio calculated multiple times consecutively shows an increasing trend, the moving target's movement status is "entering". If the entry ratio calculated multiple times consecutively remains unchanged, the moving target's movement status is "stopping". If the entry ratio calculated multiple times consecutively decreases, the moving target's movement status is "exiting".
[0083] Furthermore, to further improve accuracy when judging intrusion based on the movement status of a moving target, an entry area judgment can be added to the existing system that generates either a regional intrusion alarm or a boundary crossing alarm when the movement status is "entering." Specifically, if the movement status is "entering" and the entry area (i.e., the overlapping area between the outline region and the detection region) is greater than a threshold, a regional intrusion alarm is generated; or if the movement status is "entering" and the entry area is greater than a threshold, a boundary crossing alarm is generated. This judgment method combines the entry ratio and the entry area, achieving both judgment of the intrusion degree of the moving target in two separate instances and avoiding false alarms from two different perspectives, thus improving the accuracy of detection alarms.
[0084] The detection method in this embodiment has low computational load and low requirements for chip performance, and can detect video streams in real time; there are no restrictions on the types of intrusion targets for area detection, as long as they are moving targets, they can be detected normally.
[0085] In another embodiment, this application also provides a region detection device, including a processor and a memory storing a plurality of computer instructions, which, when executed by the processor, implement the steps of the region detection method.
[0086] For specific limitations on area detection devices, please refer to the limitations on area detection methods mentioned above, which will not be repeated here.
[0087] The memory and processor are electrically connected directly or indirectly to enable data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines. The memory stores a computer program that can run on the processor, which implements the area detection method in this embodiment of the invention by running the computer program stored in the memory.
[0088] The memory may be, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Programmable Read-Only Memory (PROM), Erasable Programmable Read-Only Memory (EPROM), Electrically Erasable Programmable Read-Only Memory (EEPROM), etc. The memory stores the program, and the processor executes the program upon receiving an execution instruction.
[0089] The processor may be an integrated circuit chip with data processing capabilities. The aforementioned processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc. It can implement or execute the methods, steps, and logic block diagrams disclosed in the embodiments of this invention. The general-purpose processor can be a microprocessor or any conventional processor.
[0090] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0091] The embodiments described above are merely illustrative of several implementations of the present invention, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of the invention. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of the present invention, and these modifications and improvements all fall within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the appended claims.
Claims
1. A method for detecting and alarming a moving target, comprising the steps of: The area detection method comprises: processing video frames by using a three-frame difference method to determine a contour area and coordinates of a moving target; performing target tracking matching according to the contour area and the coordinates of the moving target to update a target queue; judging each moving target in the target queue for alarm monitoring, comprising: if the coordinates of the moving target are in a detection area, calculating an entering proportion of the contour area of the moving target into the detection area, judging whether the contour size of the moving target meets configuration requirements when the entering proportion reaches a threshold value, and generating a moving detection alarm if the contour size meets the configuration requirements; or, if the coordinates of the moving target are in the detection area, calculating the entering proportion of the contour area of the moving target into the detection area, judging whether the contour size of the moving target meets configuration requirements when the entering proportion reaches a threshold value, calculating a moving state of the moving target if the contour size meets the configuration requirements, and generating a boundary intrusion alarm if the moving state is entering and the entering area is greater than a threshold value; or, dividing an intrusion area and a non-intrusion area according to a boundary line, calculating an entering proportion of the contour area of the moving target into the intrusion area if the coordinates of the moving target are in the intrusion area, judging whether the contour size of the moving target meets configuration requirements when the entering proportion reaches a threshold value, calculating a moving state of the moving target if the contour size meets the configuration requirements, and generating a boundary intrusion alarm if the moving state is entering and the entering area is greater than a threshold value.
2. The area detection method of claim 1, wherein, The processing of the video frames by using the three-frame difference method to determine the contour area and the coordinates of the moving target comprises: taking three continuous video frames, performing frame difference calculation on two adjacent video frames in the three video frames; performing OR operation on frame difference results of the two times of frame difference calculation to obtain a preliminary contour area; performing median filtering, dilation operation and connected domain calculation on the preliminary contour area in sequence to obtain a final contour area, and taking pixel coordinates of an outer rectangle bounding box of the contour area as the coordinates of the moving target.
3. The area detection method of claim 1, wherein, The target tracking matching according to the contour area and the coordinates of the moving target to update the target queue comprises: traversing the moving targets in an original target queue, calculating a width-height change ratio of an outer rectangle bounding box of the contour area of the traversed moving target and a currently detected moving target; if the width-height change ratio is less than a threshold value, judging whether the displacement of the coordinates is less than a threshold value, matching as the same moving target if the displacement is less than the threshold value, otherwise matching as different moving targets; if the width-height change ratio is greater than or equal to the threshold value, matching as different moving targets; if the currently detected moving target and the moving targets in the original target queue are all matched as different moving targets, adding the currently detected moving target as a new moving target to the target queue.
4. The area detection method of claim 1, wherein, The calculation of the entering proportion of the contour area of the moving target into the detection area comprises: constructing a polygon of the contour area of the moving target shearing the detection area; dividing the polygon into multiple triangles to calculate the area of each triangle to obtain the area of the polygon; taking the ratio of the area of the polygon to the area of the contour area as the entering proportion.
5. The area detection method of claim 4, wherein, The construction of the polygon of the contour area of the moving target shearing the detection area comprises: The vertex sequence is initialized, the vertex traversal order of the detection area is defined, and each vertex is traversed to make the following judgment: If the current vertex is inside the contour area and the previous vertex is also inside the contour area, the current vertex is added to the vertex sequence; Or, if the current vertex is inside the contour area and the previous vertex is outside the contour area, the intersection of the line segment formed by the current vertex and the previous vertex and the contour area boundary is added to the vertex sequence, and the current vertex is added to the vertex sequence; Or, if the current vertex is outside the contour area and the previous vertex is inside the contour area, only the intersection of the line segment formed by the current vertex and the previous vertex and the contour area boundary is added to the vertex sequence; Or, if the current vertex is outside the contour area and the previous vertex is also outside the contour area, the vertex sequence is not updated; After each vertex is traversed, the final vertex sequence is taken to form a polygon.
6. The area detection method of claim 1, wherein, The moving state of the moving target is calculated, including: The entering proportion of the contour area of the moving target into the detection area / intrusion area is obtained through continuous calculation; If the obtained entering proportions through continuous calculation show an increasing trend, the moving state of the moving target is entering; if the entering proportions through continuous calculation are unchanged, the moving state of the moving target is stopping; if the entering proportions through continuous calculation are decreasing, the moving state of the moving target is exiting.
7. An area detection apparatus comprising a processor and a memory having stored therein a plurality of computer instructions, wherein, The computer instructions are executed by the processor to implement the steps of the area detection method in any one of claims 1 to 6.
Citation Information
Patent Citations
Overlapping degree calculation method, electronic equipment and storage medium
CN115205772A
Map display method and device based on photoelectric holder
CN117407480A