Alarm method and device for area intrusion
By performing pedestrian detection and personnel classification on surveillance videos, and using homography matrix to map image coordinates to world coordinates, the problem of inaccurate judgment of alarm areas in the existing technology is solved, and higher alarm accuracy is achieved.
Patent Information
- Application Number
- CN202411921415.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-25
- Publication Date
- 2025-05-06
AI Technical Summary
The existing area breaks into the alarm system. Due to the deviation between the two-dimensional image coordinates of pedestrians and the real three-dimensional world coordinates in the surveillance video, it is impossible to accurately determine whether pedestrians are in the alarm area, which affects the accuracy of the alarm.
By detecting pedestrians and classifying surveillance videos, the pedestrian image coordinates are obtained, and the image coordinates are mapped into world coordinates using a pre-calculated homography matrix to determine whether the world coordinates are in the alarm area, thereby triggering an alarm.
Mapping image coordinates into world coordinates through projection transformation avoids error problems caused by projecting three-dimensional targets to two-dimensional planes, and improves the accuracy of area break-in alarms.
Smart Images

Figure CN119942707A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of intelligent monitoring technology, and in particular to a method and device for alarming area intrusion. Background Art
[0002] The regional intrusion alarm system is a security protection system that uses surveillance cameras to conduct real-time monitoring and intelligent analysis of a specific area, and immediately triggers an alarm when an illegal intrusion is detected. This system is widely used in various places that require high security monitoring, such as construction sites, manufacturing plants, port terminals, energy mining areas, public infrastructure maintenance areas, etc. As the core area of the convenience store, the cashier area undertakes many important functions such as commodity settlement, customer Q&A and promotional recommendations. In order to ensure the safety of funds, equipment and employees in the cashier area, convenience stores usually restrict customers from directly entering it in order to reduce potential theft, robbery or other security risks. When the regional intrusion alarm system detects that non-staff enters the cashier area, it will automatically trigger an alarm.
[0003] The regional intrusion alarm system involves an alarm area. In the prior art, the alarm area is usually defined in an image coordinate system. For example, an alarm area is manually delineated in a surveillance video, and the judgment of the intrusion behavior is also performed in the image coordinate system. When a non-staff member intrudes into the alarm area in the surveillance video, an alarm is automatically triggered.
[0004] However, the real physical world is a three-dimensional world. Due to the influence of the projection distortion of the surveillance camera, there will be a certain deviation between the location where the intrusion is detected (two-dimensional image coordinates) and the actual location where the behavior occurs (three-dimensional world coordinates), which affects the accuracy of subsequent judgment of whether the behavior is within the alarm area, resulting in the inability to accurately alarm for regional intrusions. Summary of the invention
[0005] The purpose of the embodiments of the present invention is to provide a method and device for area intrusion alarm to improve the accuracy of area intrusion alarm.
[0006] In order to achieve the above-mentioned purpose, an embodiment of the present invention provides a method for regional intrusion alarm, which includes: performing pedestrian detection on monitoring video; classifying pedestrians obtained by the pedestrian detection into customers or employees; if the pedestrian is classified as a customer, obtaining the image coordinates of the customer, and mapping the image coordinates into world coordinates based on a pre-calculated homography matrix; and determining whether the world coordinates of the customer are within the alarm area, and if so, issuing an alarm.
[0007] Optionally, the surveillance video is acquired through a camera, and the camera is calibrated with internal parameters before use to acquire internal parameters for correcting image frames of the surveillance video.
[0008] Optionally, the intrinsic parameters include camera parameters and distortion parameters, the camera parameters include principal points and focal lengths, and the distortion parameters include radial distortion parameters and tangential distortion parameters.
[0009] Optionally, the world coordinates are coordinates on a pre-established digital map, and the digital map is a map of the store floor.
[0010] Optionally, when establishing the digital map, the process further includes delineating and saving the alarm area on the digital map.
[0011] Optionally, the homography matrix is obtained through extrinsic parameter calibration and is used to map the image coordinates of the image into world coordinates.
[0012] Optionally, obtaining the image coordinates of the customer and mapping the image coordinates to world coordinates based on a pre-calculated homography matrix includes: obtaining the image coordinates of the customer in the image frame of the surveillance video from the result of the pedestrian detection; correcting the image frame based on the intrinsic parameters to obtain the corrected image coordinates of the customer; and mapping the corrected image coordinates to a world coordinate system through a pre-calculated homography matrix to obtain the world coordinates.
[0013] Optionally, the calculation method of the homography matrix includes: selecting no less than a preset number of points in the image frame of the surveillance video, and recording the corrected image coordinates and the world coordinates of the selected points; and based on the relationship between the corrected image coordinates and the world coordinates, using a singular value decomposition method to calculate the homography matrix; wherein, for any of the selected points, the relationship between its corrected image coordinates X1[x1,y1,z1] and world coordinates X2[x2,y2,z2] is:
[0014]
[0015] Wherein, H is the homography matrix.
[0016] Optionally, mapping the image coordinates to world coordinates based on a pre-calculated homography matrix includes: mapping the customer's corrected image coordinates X1[x1, y1, z1] based on the homography matrix to obtain:
[0017] x2=H 11 x1+H 12 y1+H 13 z1,
[0018] y2=H 21 x1+H 22 y1+H 23z1,
[0019] z2=H 31 x1+H 32 y1+H 33 z1;
[0020] Let H 33 =1, and normalization is performed to obtain:
[0021]
[0022] as well as
[0023] Take z2′=0 and obtain the world coordinates P0[x2′,y2′,0] of the customer.
[0024] Optionally, determining whether the world coordinates of the customer are within the alarm area includes: recording the world coordinate point of the customer as P0; recording the vertices of the convex polygon of the alarm area as P1, P2, P3, ..., P N ; Obtain the vectors of the lines connecting the customer's world coordinate point and the vertex in sequence Calculate the cross products between adjacent vectors in sequence And the directions of the cross products are counted. If the directions all point to the same direction, the world coordinates of the customer are located within the warning area; otherwise, the world coordinates of the customer are located outside the warning area.
[0025] On the other hand, the present invention provides a device for area intrusion alarm, which includes a memory and a processor, wherein the processor is used to run a program, wherein the program is used to execute any of the above-mentioned area intrusion alarm methods of the present application when it is run.
[0026] Through the above technical solution, the image coordinates of the customer detected in the surveillance video are projected and transformed, so that the image coordinates of the customer in the image coordinate system are mapped to the world coordinates, avoiding the error problem caused by projecting the three-dimensional target onto the two-dimensional plane, and the customer's location can be judged more accurately, thereby generating more accurate area intrusion alarm information.
[0027] Other features and advantages of the embodiments of the present invention will be described in detail in the subsequent detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0028] The accompanying drawings are used to provide a further understanding of the embodiments of the present invention and constitute a part of the specification. Together with the following specific implementations, they are used to explain the embodiments of the present invention, but do not constitute a limitation on the embodiments of the present invention. In the accompanying drawings:
[0029] Figure 1 It is a flow chart of a method for regional intrusion alarm provided by an embodiment of the present invention;
[0030] Figure 2 is a schematic diagram of the positional relationship between a customer and an alarm area provided by an embodiment of the present invention;
[0031] Figure 3 It is a schematic diagram of the structure of a device provided in an embodiment of the present invention.
[0032] Description of Reference Numerals
[0033] 101 processor 102 memory
[0034] 103 bus 10 device DETAILED DESCRIPTION
[0035] The specific implementation of the embodiment of the present invention is described in detail below in conjunction with the accompanying drawings. It should be understood that the specific implementation described here is only used to illustrate and explain the embodiment of the present invention, and is not used to limit the embodiment of the present invention.
[0036] Figure 1 FIG. 1 is a flow chart of a method for alarming an area intrusion provided by an embodiment of the present invention. Figure 1 As shown, the method includes the following steps S101-S104.
[0037] Step S101: perform pedestrian detection on the surveillance video.
[0038] Step S102: Classify the pedestrians detected by the pedestrian detection into customers or employees.
[0039] Step S103: If the pedestrian is classified as a customer, the image coordinates of the customer are obtained, and the image coordinates are mapped to world coordinates based on a pre-calculated homography matrix.
[0040] Step S104: determine whether the world coordinates of the customer are within the alarm area, and if so, issue an alarm.
[0041] Specifically, when pedestrian detection is performed in step S101, the detection result includes a confidence level. If the detection confidence level is less than 0.4, it is considered that the detection target does not belong to a pedestrian, and the result is filtered out to avoid interference caused by false detection. In step S103, the coordinates of the customer in the image coordinate system are obtained through pedestrian detection. The result of pedestrian detection includes a position rectangle of the pedestrian, which is used to represent the coordinates of the pedestrian in the image. After the position rectangle is detected, a point in the position rectangle is selected to represent the position of the customer. The coordinates of the point are the image coordinates of the pedestrian. When selecting a point representing the position of the customer, the position of the customer's feet can generally be used as the position of the customer, that is, the center point of the lower frame of the position rectangle can generally be selected. However, in some scenarios, the selected point needs to be adjusted according to the characteristics of the scene or the position of the camera. The present invention does not limit the selection of the point. In step S104, the alarm method can be a sound alarm, a visual alarm, or a physical interception of the customer. When the alarm is triggered, the staff can take appropriate measures in time to avoid property losses.
[0042] In one embodiment of the present invention, a pre-trained deep learning-based personnel classification model is used to classify pedestrians. Since employees in stores usually need to wear uniform clothing, which is obviously different from ordinary customers in appearance, a public pedestrian data set and a proprietary data set obtained from surveillance videos of the corresponding area are selected to form a training data set to train a personnel classification model. Using this personnel classification model to classify pedestrians can effectively improve the accuracy of personnel classification, thereby helping to improve the accuracy of alarms.
[0043] Ideally, when the customer is outside the alarm area, the alarm should not be triggered, and when the customer is inside the alarm area, the alarm should be triggered. However, in surveillance videos, after the three-dimensional image is projected into two dimensions, it may be misjudged and cause a false alarm. For example, if the customer is between the alarm area and the camera, the camera may misjudge the customer to be within the alarm area due to the viewing angle. Another example is that the customer has actually entered the alarm area, but in the image captured by the camera, the customer's image may not be within the alarm area, and the customer may be misjudged to be outside the alarm area.
[0044] The method proposed in the present invention maps the image coordinates of the customer in the image coordinate system to the world coordinates after projection transformation, thereby avoiding the error problem caused by projecting the three-dimensional target onto the two-dimensional plane, and can more accurately determine the customer's location, thereby generating more accurate alarm information.
[0045] Furthermore, the monitoring video is acquired through a camera, and the camera is calibrated with internal parameters before use to acquire internal parameters for correcting image frames of the monitoring video.
[0046] It is understandable that due to the focal length of the camera, objects of the same size will appear in different sizes in the image. In addition, due to the physical characteristics of the camera, distortion will occur during imaging, causing straight lines in the image to bend. Through intrinsic parameter calibration, deformation in the image can be identified and corrected, and a frame of video image can be transformed into a normal image without distortion, that is, straight lines and planes in the real world are also presented as straight lines and planes in the video image.
[0047] Furthermore, the intrinsic parameters include camera parameters and distortion parameters, the camera parameters include principal points and focal lengths, and the distortion parameters include radial distortion parameters and tangential distortion parameters.
[0048] In the specific implementation, firstly, 10 black and white checkerboard images at different angles are taken with a camera, and then the camera calibration toolbox of Matlab software is used to complete the camera calibration.
[0049] Among them, the principle of calibrating the principal point [px,py] and focal length [fx,fy] in the camera parameters is as follows:
[0050] For any point p, the coordinates when no distortion occurs are p(x, y). When the camera captures the point, it becomes p′(x′, y′) after the camera parameter transformation, where:
[0051]
[0052] Among them, [cx, cy] represents the center point of the transformed image.
[0053] At the same time, when the camera lens forms an image, there is lens distortion, of which the distortion caused by the lens shape is radial distortion, and the distortion caused by the lens installation not being parallel to the imaging plane is tangential distortion. When the image is radially distorted, the coordinates of point p further become p″(x″,y″), where:
[0054] x″=x′(1+k2×r 2 +k4×r 4 ),
[0055] y″=y′(1+k2×r 2 +k4×r 4 ),
[0056] Among them, [k2, k4] are radial distortion parameters.
[0057] When the image is tangentially distorted, the coordinates of point p further become p″′(x″′,y″′), where:
[0058] x″′=x″+tx×y″,
[0059] y″′=y″+ty×x″,
[0060] Among them, [tx,ty] is the tangential distortion parameter.
[0061] After the required intrinsic parameters are obtained through intrinsic parameter calibration, a frame of video image can be transformed into a normal image without distortion using the inverse transformation of the above formula, that is, straight lines and planes in the real world also appear as straight lines and planes in the video image.
[0062] Furthermore, the world coordinates are coordinates on a pre-established digital map, and the digital map is a map of the store floor.
[0063] When the scene to be monitored and alarmed is a store, a digital map of the corresponding store is established, and the coordinate system corresponding to the digital map is the world coordinate system. After the customer's image coordinates are mapped to the world coordinates, the coordinates of the customer and the store are in the same coordinate system, and the coordinates can be used to determine whether the customer is in the alarm area. When the scene to be monitored and alarmed is other scenes, such as construction sites, manufacturing plants, ports and docks, energy mining areas, and public infrastructure maintenance areas, digital maps of the corresponding scenes can be established. The use of digital maps of different scenes is the same as that of stores.
[0064] Furthermore, when establishing the digital map, the method further includes demarcating and saving the alarm area on the digital map.
[0065] The alarm area is a polygonal area, such as the cashier area in a store, which is generally a quadrilateral area. After the alarm area is delineated, the location of the alarm area can be saved as the coordinates of each vertex of the polygon corresponding to the alarm area, or the saving method can be selected according to the specific situation. When the alarm area changes, such as changing the location of the cashier area, you only need to update the coordinate points of the area corresponding to the cashier area without complex calibration of the image.
[0066] Furthermore, obtaining the image coordinates of the customer and mapping the image coordinates to world coordinates based on a pre-calculated homography matrix includes: obtaining the image coordinates of the customer in the image frame of the surveillance video from the result of the pedestrian detection; correcting the image frame based on the intrinsic parameters to obtain the corrected image coordinates of the customer; and mapping the corrected image coordinates to a world coordinate system through a pre-calculated homography matrix to obtain the world coordinates.
[0067] Before mapping the customer's image coordinates, the image is corrected based on the intrinsic parameters to eliminate the deformation caused by the intrinsic parameters of the camera itself, thereby improving the accuracy of the mapping.
[0068] Furthermore, the homography matrix is obtained by extrinsic parameter calibration and is used to map the image coordinates of the image to world coordinates. The calculation method of the homography matrix includes: selecting no less than a preset number of points in the image frame of the surveillance video, and recording the corrected image coordinates and the world coordinates of the selected points; and based on the relationship between the corrected image coordinates and the world coordinates, the singular value decomposition method is used to calculate the homography matrix; wherein, for any of the selected points, the relationship between its corrected image coordinates X1[x1,y1,z1] and world coordinates X2[x2,y2,z2] is:
[0069]
[0070] Wherein, H is the homography matrix.
[0071] The homography matrix describes the correspondence between two planes and contains 9 unknowns. One of them is the scale factor, which can be set to 1 by default. For example, the default value is H 3i If H is 1, then 8 unknowns need to be solved. After selecting a point in the image frame, a set of corresponding points in the image coordinates and world coordinates is obtained. Since each set of corresponding points contains 2 constraints, solving H requires at least 4 sets of corresponding points.
[0072] Since the image coordinates are in pixels and the world coordinates are in meters, there is actually no direct correspondence between the two, so they need to be normalized to eliminate the impact of the dimension. In the process of obtaining the homography matrix, z1=1 and z2=1 can be taken for normalization. In other embodiments of the present invention, other values can also be taken, and the values of the homography matrix obtained will also be enlarged or reduced accordingly, but they all satisfy the homography relationship. In addition, when the homography matrix is used for mapping, normalization will also be performed, so it does not affect the mapping result.
[0073] Further, mapping the image coordinates to world coordinates based on the pre-calculated homography matrix includes: mapping the customer's corrected image coordinates X1[x1, y1, z1] based on the homography matrix to obtain:
[0074] x2=H 11 x1+H 12 y1+H 13 z1,
[0075] y2=H 21 x1+H 22 y1+H 23 z1,
[0076] z2=H 31 x1+H 32 y1+H 33z1;
[0077] Let H 33 =1, and normalization is performed to obtain:
[0078]
[0079] as well as
[0080] Take z2′=0 and obtain the world coordinates P0[x2′,y2′,0] of the customer.
[0081] When performing normalization calculation, we also set H 33 =1, z1=1, and let x2 / z2, y2 / z2, z2 / z2, and get [x2′, y2′, z2′]. At this time, z2′ is 1, but in actual application, the default coordinates are ground coordinates, that is, z2′=0, so the final world coordinates of the customer are P0[x2′, y2′, 0].
[0082] Figure 2 is a schematic diagram of the positional relationship between a customer and an alarm area provided by an embodiment of the present invention, such as Figure 2 As shown, the cashier area is a designated alarm area. A geometric judgment method can be used to determine whether the world coordinates of the customer are within the alarm area, including: recording the world coordinate point of the customer as P0; recording the vertices of the convex polygon of the alarm area as P1, P2, P3, ..., P N ; Obtain the vectors of the lines connecting the customer's world coordinate point and the vertex in sequence Calculate the cross products between adjacent vectors in sequence And the directions of the cross products are counted. If the directions all point to the same direction, the world coordinates of the customer are located within the warning area; otherwise, the world coordinates of the customer are located outside the warning area.
[0083] It should be noted that the vertices of the convex polygon of the alarm area have been obtained and saved when the digital map is established. The calculation here only needs to call the vertex coordinates, and there is no need to search on the digital map. In most cases, various alarm areas are convex polygons, and the geometric judgment method can be used to quickly determine whether the customer has entered the alarm area. When the alarm area is not a convex polygon, other methods can be used to determine the relative position of the customer and the alarm area, such as first using the polygon triangulation method to decompose the non-convex polygon into several convex polygons (triangles), and then using the geometric judgment method to make a judgment, or using other existing methods to make a judgment, which will not be repeated here.
[0084] The embodiment of the present invention also provides a device for regional intrusion alarm, for example, Figure 3 As shown, the device includes a memory and a processor, and the processor is used to run a program, wherein the program is used to execute the area intrusion alarm method when it is run. The device in this article can be a server, a PC, a PAD, a mobile phone, etc.
[0085] The processor includes a kernel, which calls the corresponding program unit from the memory. One or more kernels can be set, and the area intrusion alarm can be realized by adjusting the kernel parameters.
[0086] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash RAM, and the memory includes at least one memory chip.
[0087] Those skilled in the art will appreciate that the embodiments of the present application may be provided as methods, systems, or computer program products. Therefore, the present application may adopt the form of a complete hardware embodiment, a complete software embodiment, or an embodiment in combination with software and hardware. Moreover, the present application may adopt the form of a computer program product implemented in one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that include computer-usable program code.
[0088] The present application is described with reference to the flowcharts and / or block diagrams of the methods, devices (systems), and computer program products according to the embodiments of the present application. It should be understood that each process and / or box in the flowchart and / or block diagram, as well as the combination of the processes and / or boxes in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to generate a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.
[0089] These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer readable memory produce an article of manufacture including an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.
[0090] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 A step that specifies a function in one or more boxes.
[0091] In a typical configuration, a computing device includes one or more processors (CPU), input / output interfaces, network interfaces, and memory.
[0092] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM) and / or non-volatile memory in the form of read-only memory (ROM) or flash RAM. The memory is an example of a computer-readable medium.
[0093] Computer readable media include permanent and non-permanent, removable and non-removable media that can be implemented by any method or technology to store information. Information can be computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disk read-only memory (CD-ROM), digital versatile disk (DVD) or other optical storage, magnetic cassettes, magnetic tape disk storage or other magnetic storage devices or any other non-transmission media that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include temporary computer readable media (transitory media), such as modulated data signals and carrier waves.
[0094] It should also be noted that the terms "include", "comprises" or any other variations thereof are intended to cover non-exclusive inclusion, so that a process, method, commodity or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, commodity or device. In the absence of more restrictions, the elements defined by the sentence "comprises a ..." do not exclude the existence of other identical elements in the process, method, commodity or device including the elements.
[0095] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included within the scope of the claims of the present application.
[0096] The acquisition, transmission, storage, use, and processing of data in the technical solution of this application comply with the relevant provisions of national laws and regulations.
[0097] It should be noted that in the embodiments of the present application, certain software, components, models and other existing solutions in the industry may be mentioned, and they should be regarded as exemplary. Their purpose is only to illustrate the feasibility of implementing the technical solution of the present application, but it does not mean that the applicant has or will necessarily use the solution.
Claims
1. A method for alarming an area intrusion, characterized in that: The method comprises: Perform pedestrian detection on surveillance videos; Classifying the pedestrians detected by the pedestrian detection into customers or employees; If the pedestrian is classified as a customer, obtaining the image coordinates of the customer, and mapping the image coordinates to world coordinates based on a pre-calculated homography matrix; and Determine whether the world coordinates of the customer are within the alarm area, and if so, issue an alarm.
2. The method according to claim 1, characterized in that The monitoring video is acquired through a camera. Before use, the camera performs internal parameter calibration to acquire internal parameters for correcting image frames of the monitoring video.
3. The method according to claim 2, characterized in that The intrinsic parameters include camera parameters and distortion parameters. The camera parameters include a principal point and a focal length. The distortion parameters include a radial distortion parameter and a tangential distortion parameter.
4. The method according to claim 1, characterized in that The world coordinates are coordinates on a pre-established digital map, and the digital map is a map of the store floor.
5. The method according to claim 4, characterized in that When establishing the digital map, the method further includes demarcating and saving the alarm area on the digital map.
6. The method according to claim 1, characterized in that The homography matrix is obtained by extrinsic parameter calibration and is used to map the image coordinates of the image into world coordinates.
7. The method according to claim 2, characterized in that Obtaining the image coordinates of the customer and mapping the image coordinates to world coordinates based on a pre-calculated homography matrix includes: Acquire the image coordinates of the customer in the image frame of the surveillance video from the result of the pedestrian detection; Based on the intrinsic parameters, correcting the image frame to obtain corrected image coordinates of the customer; and The corrected image coordinates are mapped to a world coordinate system through a pre-calculated homography matrix to obtain the world coordinates.
8. The method according to claim 7, characterized in that The calculation method of the homography matrix includes: Selecting no less than a preset number of points in the image frame of the surveillance video, and recording the corrected image coordinates and the world coordinates of the selected points; and Based on the relationship between the corrected image coordinates and the world coordinates, the homography matrix is calculated using a singular value decomposition method; Among them, for any of the selected points, the relationship between its corrected image coordinates X1[x1, y1, z1] and world coordinates X2[x2, y2, z2] is: Wherein, H is the homography matrix.
9. The method according to claim 8, characterized in that Mapping the image coordinates to world coordinates based on a pre-calculated homography matrix includes: The customer's corrected image coordinates X1[x1, y1, z1] are mapped based on the homography matrix to obtain: x2=H 11 x1+H 12 y1+H 13 z1, y2=H 21 x1+H 22 y1+H 23 z1, z2=H 31 x1+H 32 y1+H 33 z1; Let H 33 =1, and normalization is performed to obtain: as well as Take z2′=0 to obtain the world coordinates P0[x2′, y2′, 0] of the customer.
10. The method according to claim 6, characterized in that Determining whether the world coordinates of the customer are within the warning area includes: The world coordinate point of the customer is recorded as P0; The vertices of the convex polygon of the alarm area are recorded as P1, P2, P3, ..., P N ; Sequentially obtain the vectors of the lines connecting the customer's world coordinate point and the vertex Calculate the cross products between adjacent vectors in sequence as well as The directions of the cross products are counted. If the directions all point to the same direction, the world coordinates of the customer are within the warning area. Otherwise, the world coordinates of the customer are outside the warning area.
11. A device for regional intrusion alarm, the device comprising a memory and a processor, characterized in that: The processor is used to run a program, wherein the program, when run, is used to execute: the method according to any one of claims 1-10.