Regional protection method and device
By identifying the type and size of the monitoring target in the video display area of the camera, and obtaining the distance between the monitoring target and the camera based on the target to be calibrated, an alarm is generated, the problem of infinite expansion of depth information in the traditional method is solved, and the accuracy of the alarm is improved.
Patent Information
- Application Number
- CN202211351883.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-31
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2042-10-31
AI Technical Summary
Traditional area protection methods identify intrusion targets on two-dimensional images, resulting in infinite expansion of depth information, reducing the accuracy of alarms, and causing unnecessary misjudgment and misjudgment.
By demarcating a protection area in the video display area of the camera, the type and size of the monitoring target are identified, and the distance between the monitoring target and the camera is obtained based on the target to be calibrated. If the distance is less than the set distance threshold, an alarm is generated.
By adding information in depth dimensions, the three-dimensional alarm range of areas that actually need protection is limited, the accuracy of alarms is improved, and unnecessary misjudgment and misjudgment are avoided.
Smart Images

Figure CN115810246B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to a method and device for protecting a region. Background Art
[0002] Currently, it is a common practice for industry insiders to ensure the safety of protected areas by analyzing whether there are specific targets intruding into the protected areas designated in the camera video, thereby generating an alarm for the specific targets that have intruded into the protected areas.
[0003] This method is to determine the protection area by drawing a rectangular frame in the visible range of the video, and identify whether there is a specific target intruding on the two-dimensional image of the protection area. However, in fact, the area to be protected is a three-dimensional environment. Identifying the intruding target only in the two-dimensional layer is equivalent to including all depths of the protection area in the alarm range. This will infinitely expand the alarm range, reduce the accuracy of the alarm, and cause unnecessary misjudgments and wrong judgments. Summary of the invention
[0004] The embodiments of the present application provide a method and device for protecting an area, which are used to solve the technical problem that the traditional solution includes all depths of the protection area into the alarm range, infinitely expands the alarm range, reduces the accuracy of the alarm, and causes unnecessary misjudgments and wrong judgments.
[0005] In a first aspect, an embodiment of the present application provides a method for protecting a region, including:
[0006] Define a protection area in the camera's video display area;
[0007] If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated;
[0008] If the distance between the monitoring target and the camera is less than a distance threshold, an alarm is generated according to the monitoring target.
[0009] In one embodiment, before obtaining the distance between the monitoring target and the camera according to the target to be calibrated, the method includes:
[0010] Identify the type and size of the monitoring target in the video display area of the camera; the size of the monitoring target is the size of the identification frame of the monitoring target.
[0011] In one embodiment, before identifying the type and size of the monitoring target in the video display area of the camera, the method includes:
[0012] Identify the calibration type, calibration distance and calibration size of multiple targets to be calibrated in the video display area of the camera; the calibration distance is the distance between the target to be calibrated and the camera, and the calibration size is the identification frame size of the target to be calibrated.
[0013] In one embodiment, if the monitoring target in the video display area of the camera falls into the protection area, it includes:
[0014] If the center coordinates of the identification frame of the monitored target in the video display area of the camera fall into the protection area.
[0015] In one embodiment, obtaining the distance between the monitoring target and the camera according to the target to be calibrated includes:
[0016] Match the type of the monitoring target among multiple calibration types, and obtain the distance between the monitoring target and the camera according to the adapted calibration distance, the adapted calibration size and the size of the monitoring target; the adapted calibration distance is the calibration distance corresponding to the successfully matched calibration type, and the adapted calibration size is the calibration size corresponding to the successfully matched calibration type.
[0017] In one embodiment, obtaining the distance between the monitoring target and the camera according to the adapted calibration distance, the adapted calibration size, and the size of the monitoring target includes:
[0018] Calculate the area of the recognition frame corresponding to the target to be calibrated according to the adapted calibration size to obtain the first recognition frame area;
[0019] Calculate the area of the identification frame corresponding to the monitoring target according to the size of the monitoring target to obtain the area of the second identification frame;
[0020] The distance between the monitoring target and the camera is obtained according to the proportional relationship between the area of the first identification frame and the area of the second identification frame, and the adapted calibration distance.
[0021] In one embodiment, the monitoring targets include dynamic targets and static targets;
[0022] The targets to be calibrated include dynamic targets and static targets.
[0023] In a second aspect, an embodiment of the present application provides a region protection device, including:
[0024] The protection area demarcation module is used to: demarcate the protection area in the video display area of the camera;
[0025] A distance calculation module, used for: if the monitoring target in the video display area of the camera falls into the protection area, obtaining the distance between the monitoring target and the camera according to the target to be calibrated;
[0026] The alarm generating module is used to: if the distance between the monitoring target and the camera is less than a distance threshold, generate an alarm according to the monitoring target.
[0027] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory storing a computer program, wherein the processor implements the steps of the area protection method described in the first aspect when executing the program.
[0028] In a fourth aspect, an embodiment of the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of the region protection method described in the first aspect.
[0029] The area protection method and device provided by the present application define a protection area in the video display area of the camera. If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated. If the distance between the monitoring target and the camera is less than the distance threshold, an alarm is generated according to the monitoring target. The present application increases the depth range of the protection area by setting a distance threshold. When the monitoring target falls into the protection area and is within the depth range, an alarm is generated according to the monitoring target. The present application completely defines the three-dimensional alarm range of the area that actually needs to be protected by adding information of the depth dimension, so that it can more accurately determine whether the monitoring target has an impact on the area that actually needs to be protected, thereby improving the accuracy of the alarm and avoiding unnecessary misjudgments and wrong judgments. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] In order to more clearly illustrate the technical solutions in the present application or the prior art, a brief introduction will be given below to the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0031] Figure 1 This is one of the flow charts of the regional protection method provided in the embodiment of the present application;
[0032] Figure 2 is a three-dimensional schematic diagram of a protection area in the area protection method provided in an embodiment of the present application;
[0033] Figure 3 This is the second flow chart of the regional protection method provided in the embodiment of the present application;
[0034] Figure 4 A schematic diagram of the structure of a regional protection device provided in an embodiment of the present application;
[0035] Figure 5 It is a schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0036] In order to make the purpose, technical solutions and advantages of this application clearer, the technical solutions in this application will be clearly and completely described below in conjunction with the drawings in the embodiments of this application. Obviously, the described embodiments are part of the embodiments of this application, not all of them. Based on the embodiments in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0037] Figure 1 This is one of the flow charts of the regional protection method provided in the embodiment of the present application;
[0038] Figure 2 is a three-dimensional schematic diagram of a protection area in the area protection method provided in an embodiment of the present application;
[0039] Reference Figure 1-2 , the embodiment of the present application provides a method for protecting a region, which may include:
[0040] 101. Define a protection area in the video display area of the camera;
[0041] 102. If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated;
[0042] 103. If the distance between the monitoring target and the camera is less than the distance threshold, an alarm is generated according to the monitoring target.
[0043] In step 101, the protection area is defined as a two-dimensional space area, such as Figure 2 As shown in the solid rectangle, this two-dimensional space area can be demarcated using electronic fence technology.
[0044] In step 102, the distance between the monitoring target and the camera is the depth information of the monitoring target, that is, Figure 2 Information about the positive or negative direction of the Z axis.
[0045] Multi-target tracking technology can be used to track the monitoring target, so as to determine whether the monitoring target falls into the protection area.
[0046] Multi-target tracking technology is one of the basic and important research directions in the field of computer vision. It can be widely used in traffic management, security monitoring, autonomous driving, robotics, sports event broadcasting, etc. Multi-target tracking technology can be classified according to the following situations:
[0047] 1. According to the number of targets to be tracked, target tracking tasks can be divided into single target tracking and multi-target tracking;
[0048] 2. According to the background status, it can be divided into target tracking under static background and target tracking under dynamic background;
[0049] 3. According to the number of cameras, it can be divided into single-camera tracking and multi-camera tracking;
[0050] 4. According to the task calculation type, it can be divided into online tracking and offline tracking.
[0051] In this implementation, there are no restrictions on the number of monitored targets, background status, number of cameras, and task calculation type. The most suitable target tracking method can be selected according to actual conditions as long as a good target tracking effect can be achieved.
[0052] In step 103, the distance threshold is the limit of the protection area in the positive and / or reverse direction of the Z axis, such as Figure 2 Shown by the dashed line.
[0053] The area protection method provided in this embodiment demarcates a protection area in the video display area of the camera. If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained based on the target to be calibrated. If the distance between the monitoring target and the camera is less than the distance threshold, an alarm is generated based on the monitoring target. This embodiment sets a distance threshold, that is, increases the depth range of the protection area. When the monitoring target falls into the protection area and is within the depth range, an alarm is generated based on the monitoring target. This embodiment completely defines the three-dimensional alarm range of the area that actually needs to be protected by adding information in the depth dimension, so that it can more accurately determine whether the monitoring target has an impact on the area that actually needs to be protected, thereby improving the accuracy of the alarm and avoiding unnecessary misjudgments and wrong judgments.
[0054] In one embodiment, before obtaining the distance between the monitoring target and the camera according to the target to be calibrated, the following steps may be included:
[0055] Identify the type and size of the monitoring target in the video display area of the camera; the size of the monitoring target is the identification frame size of the monitoring target.
[0056] When a monitoring target is identified, the monitoring target is framed in an identification frame, and the size and orientation of the identification frame change as the monitoring target moves.
[0057] The monitoring target can be a static target or a dynamic target, which is not limited here. The identification of the monitoring target is performed in real time. If the monitoring target is a static target, the size of its identification box is unchanged. If the monitoring target is a dynamic target, the size of its identification box changes dynamically.
[0058] The identification frame of the monitoring target can be a rectangular frame, a circular frame, or an identification frame of other shapes, which is not limited here. In this embodiment, the identification frame of the monitoring target is a rectangular frame, and the size of the monitoring target is the length and width of the identification frame.
[0059] The types of monitored targets include people, cars, bicycles, etc., which are not limited here.
[0060] This embodiment can obtain basic attribute information of the monitoring target by identifying the type and size of the monitoring target in the video display area of the camera, so as to facilitate subsequent calculation of depth information based on the attribute information.
[0061] In one embodiment, before identifying the type and size of the monitoring target in the video display area of the camera, the method may include:
[0062] Identify the calibration type, calibration distance and calibration size of multiple targets to be calibrated in the video display area of the camera;
[0063] The calibration distance is the distance between the target to be calibrated and the camera, and the calibration size is the size of the recognition frame of the target to be calibrated.
[0064] When multiple targets to be calibrated are identified, each target to be calibrated will be framed in an identification frame, and the size and orientation of each identification frame will change as the corresponding framed target to be calibrated moves.
[0065] The target to be calibrated can be a static target or a dynamic target, which is not limited here. The identification of the target to be calibrated is performed in real time. If the target to be calibrated is a static target, its calibration size and calibration distance are unchanged. If the target to be calibrated is a dynamic target, its calibration size and calibration distance are dynamically changed.
[0066] The identification box of the target to be calibrated can be a rectangular box, a circular box, or an identification box of other shapes, which is not limited here. In this embodiment, the identification box of the target to be calibrated is a rectangular box, and the calibration size is the length and width of the identification box.
[0067] The calibration types include people, cars, bicycles, etc., which are not limited here.
[0068] In this example, all dynamic and static targets in the video display area of the camera are identified, and the calibration type, calibration distance and calibration size of each target are obtained.
[0069] Furthermore, a calibration table can be made according to the calibration type, calibration distance and calibration size of each target to facilitate subsequent matching with the monitoring target.
[0070] This embodiment identifies the calibration type, calibration distance and calibration size of all dynamic targets and static targets in the video display area of the camera, and makes a calibration table to facilitate subsequent rapid matching with the monitored targets, and then calculate the depth information, avoiding the identification and calculation of the distance every time a suspicious target is monitored, thereby improving the efficiency of the depth information calculation.
[0071] In one embodiment, if the monitoring target in the video display area of the camera falls into the protection area, the following may be included:
[0072] If the center coordinates of the identification frame of the monitored target in the video display area of the camera fall into the protection area.
[0073] This embodiment determines whether the monitored target falls into the protection area by whether the center coordinates of the identification frame of the monitored target fall into the protection area. This can determine whether the monitored target falls into the protection area in a quantifiable manner, which facilitates data analysis and processing.
[0074] Figure 3 This is the second flow chart of the regional protection method provided in the embodiment of the present application; Figure 3 In one embodiment, obtaining the distance between the monitoring target and the camera according to the target to be calibrated may include:
[0075] 301. Matching the type of monitoring target among multiple calibration types;
[0076] 302. Calculate the area of the recognition frame corresponding to the target to be calibrated according to the adapted calibration size to obtain the area of the first recognition frame;
[0077] 303. Calculate the area of the recognition frame corresponding to the monitoring target according to the size of the monitoring target to obtain the area of the second recognition frame;
[0078] 304. Obtain the distance between the monitoring target and the camera according to the proportional relationship between the area of the first identification frame and the area of the second identification frame and the adapted calibration distance.
[0079] The adapted calibration distance is the calibration distance corresponding to the successfully matched calibration type, and the adapted calibration size is the calibration size corresponding to the successfully matched calibration type.
[0080] In step 301, the type of the monitoring target is matched among multiple calibration types, that is, whether there is a calibration type consistent with the type of the monitoring target among the multiple calibration types, and if so, the match is successful.
[0081] In step 302, if the identification box of the target to be calibrated is a rectangle, the area of the identification box is calculated according to the length and width of the identification box. If the identification box of the target to be calibrated is a circle, the area of the identification box is calculated according to the radius of the identification box. The same is true for other shapes. In this embodiment, the identification box of the target to be calibrated is a rectangle.
[0082] In step 303, if the recognition frame of the monitored target is a rectangle, the area of the recognition frame is calculated according to the length and width of the recognition frame, and if the recognition frame of the monitored target is a circle, the area of the recognition frame is calculated according to the radius of the recognition frame, and the same is true for other shapes. In this embodiment, the recognition frame of the monitored target is a rectangle.
[0083] In step 304, since there is a specific relationship between the size of the identification frame of each target and the distance from the target to the camera regardless of whether the target is moving, the distance from the target to the camera can be associated with the size of the identification frame. At the same time, the change trend of the recognition frame size of the same type of target is also the same. Therefore, according to the type of the monitored target, a consistent type can be found in the types that have been calibrated in advance, so as to obtain a target to be calibrated that is consistent with the type of the monitored target. The change trend of the recognition frame size of the target to be calibrated (i.e., the adapted calibration size) is the same as that of the recognition frame size of the monitored target, that is, there is a proportional relationship between the adapted calibration size and the recognition frame size of the monitored target, that is, there is a proportional relationship between the first recognition frame area and the second recognition frame area. Since there is a specific relationship between the size of the target's recognition frame and the distance from the target to the camera, that is, there is a specific relationship between the target's recognition frame area and the distance from the target to the camera, therefore, there is a specific relationship between the first recognition frame area and the distance from the corresponding target to be calibrated to the camera (i.e., the adapted calibration distance), and there is a specific relationship between the second recognition frame area and the distance from the corresponding monitored target to the camera. Therefore, a specific coefficient can be obtained according to the proportional relationship between the first recognition frame area and the second recognition frame area, and the distance between the monitored target and the camera is obtained by using the specific coefficient and the adapted calibration distance for correlation calculation.
[0084] This embodiment obtains the distance between the monitoring target and the camera according to the proportional relationship between the area of the first identification frame and the area of the second identification frame, and adapts the calibration distance. The distance between the monitoring target and the camera can be obtained based on a simple mathematical relationship, which is efficient and convenient.
[0085] The following is a description of a region protection device provided in an embodiment of the present application. The region protection device described below and the region protection method described above can be referenced to each other.
[0086] Figure 4 This is a schematic diagram of the structure of the regional protection device provided in the embodiment of the present application. Figure 4 , an embodiment of the present application provides a regional protection device, which may include:
[0087] The protection area demarcation module 401 is used to: demarcate a protection area in the video display area of the camera;
[0088] The distance calculation module 402 is used to: if the monitoring target in the video display area of the camera falls into the protection area, obtain the distance between the monitoring target and the camera according to the target to be calibrated;
[0089] The alarm generating module 403 is used to generate an alarm according to the monitoring target if the distance between the monitoring target and the camera is less than a distance threshold.
[0090] The area protection device provided in this embodiment demarcates a protection area in the video display area of the camera. If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated. If the distance between the monitoring target and the camera is less than the distance threshold, an alarm is generated according to the monitoring target. This embodiment sets a distance threshold, that is, increases the depth range of the protection area. When the monitoring target falls into the protection area and is within the depth range, an alarm is generated according to the monitoring target. This embodiment completely defines the three-dimensional alarm range of the area that actually needs to be protected by adding information of the depth dimension, so that it can more accurately determine whether the monitoring target has an impact on the area that actually needs to be protected, thereby improving the accuracy of the alarm and avoiding unnecessary misjudgments and wrong judgments.
[0091] In one embodiment, a monitoring target identification module (not shown in the figure) is further included, which is used to:
[0092] Identify the type and size of the monitoring target in the video display area of the camera; the size of the monitoring target is the size of the identification frame of the monitoring target.
[0093] In one embodiment, a calibration module (not shown) is further included, which is used to:
[0094] Identify the calibration type, calibration distance and calibration size of multiple targets to be calibrated in the video display area of the camera; the calibration distance is the distance between the target to be calibrated and the camera, and the calibration size is the identification frame size of the target to be calibrated.
[0095] In one embodiment, if the monitoring target in the video display area of the camera falls into the protection area in the distance calculation module 402, it includes:
[0096] If the center coordinates of the identification frame of the monitored target in the video display area of the camera fall into the protection area.
[0097] In one embodiment, the distance calculation module 402 is specifically used for:
[0098] Match the type of the monitoring target among multiple calibration types, and obtain the distance between the monitoring target and the camera according to the adapted calibration distance, the adapted calibration size and the size of the monitoring target; the adapted calibration distance is the calibration distance corresponding to the successfully matched calibration type, and the adapted calibration size is the calibration size corresponding to the successfully matched calibration type.
[0099] In one embodiment, the distance calculation module 402 is specifically used for:
[0100] Calculate the area of the recognition frame corresponding to the target to be calibrated according to the adapted calibration size to obtain the first recognition frame area;
[0101] Calculate the area of the identification frame corresponding to the monitoring target according to the size of the monitoring target to obtain the area of the second identification frame;
[0102] The distance between the monitoring target and the camera is obtained according to the proportional relationship between the area of the first identification frame and the area of the second identification frame, and the adapted calibration distance.
[0103] In one embodiment, the monitoring targets in the area protection device include dynamic targets and static targets;
[0104] The targets to be calibrated include dynamic targets and static targets.
[0105] Figure 5 An example of a physical structure diagram of an electronic device is shown in FIG. Figure 5 As shown, the electronic device may include: a processor 510, a communication interface 520, a memory 530 and a communication bus 540, wherein the processor 510, the communication interface 520 and the memory 530 communicate with each other through the communication bus 540. The processor 510 may call a computer program in the memory 530 to execute the steps of the area protection method, for example, including:
[0106] Define a protection area in the camera's video display area;
[0107] If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated;
[0108] If the distance between the monitoring target and the camera is less than a distance threshold, an alarm is generated according to the monitoring target.
[0109] In addition, the logic instructions in the above-mentioned memory 530 can be implemented in the form of a software functional unit and can be stored in a computer-readable storage medium when it is sold or used as an independent product. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art, and the computer software product is stored in a storage medium, including several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0110] On the other hand, an embodiment of the present application further provides a computer program product, the computer program product including a computer program, the computer program can be stored on a non-transitory computer-readable storage medium, and when the computer program is executed by a processor, the computer can perform the steps of the regional protection method provided in the above embodiments, for example, including:
[0111] Define a protection area in the camera's video display area;
[0112] If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated;
[0113] If the distance between the monitoring target and the camera is less than a distance threshold, an alarm is generated according to the monitoring target.
[0114] On the other hand, an embodiment of the present application further provides a processor-readable storage medium, wherein the processor-readable storage medium stores a computer program, wherein the computer program is used to enable the processor to execute the steps of the methods provided in the above embodiments, for example, including:
[0115] Define a protection area in the camera's video display area;
[0116] If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated;
[0117] If the distance between the monitoring target and the camera is less than a distance threshold, an alarm is generated according to the monitoring target.
[0118] The processor-readable storage medium can be any available medium or data storage device that can be accessed by the processor, including but not limited to magnetic storage (such as floppy disks, hard disks, magnetic tapes, magneto-optical disks (MO), etc.), optical storage (such as CD, DVD, BD, HVD, etc.), and semiconductor storage (such as ROM, EPROM, EEPROM, non-volatile memory (NANDFLASH), solid-state drive (SSD)), etc.
[0119] The device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative labor.
[0120] Through the description of the above implementation methods, those skilled in the art can clearly understand that each implementation method can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solution is essentially or the part that contributes to the prior art can be embodied in the form of a software product, and the computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, a disk, an optical disk, etc., including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to execute the methods described in each embodiment or some parts of the embodiments.
[0121] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present application, rather than to limit it. Although the present application has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that they can still modify the technical solutions described in the aforementioned embodiments, or make equivalent replacements for some of the technical features therein. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application.
Claims
1. A method for protecting a region, characterized in that: include: Define a protection area in the camera's video display area; If the monitoring target in the video display area of the camera falls into the protection area, the distance between the monitoring target and the camera is obtained according to the target to be calibrated; If the distance between the monitoring target and the camera is less than a distance threshold, an alarm is generated according to the monitoring target; Before obtaining the distance between the monitoring target and the camera according to the target to be calibrated, the method includes: Identify the calibration type, calibration distance and calibration size of multiple targets to be calibrated in the video display area of the camera; the calibration distance is the distance between the target to be calibrated and the camera, and the calibration size is the identification frame size of the target to be calibrated; The obtaining the distance between the monitoring target and the camera according to the target to be calibrated includes: Matching the type of the monitoring target among the multiple calibration types, and obtaining the distance between the monitoring target and the camera according to the adapted calibration distance, the adapted calibration size and the size of the monitoring target; the adapted calibration distance is the calibration distance corresponding to the successfully matched calibration type, and the adapted calibration size is the calibration size corresponding to the successfully matched calibration type; The obtaining the distance between the monitoring target and the camera according to the adapted calibration distance, the adapted calibration size, and the size of the monitoring target includes: Calculate the area of the recognition frame corresponding to the target to be calibrated according to the adapted calibration size to obtain the first recognition frame area; Calculate the area of the identification frame corresponding to the monitoring target according to the size of the monitoring target to obtain the area of the second identification frame; The distance between the monitoring target and the camera is obtained according to the proportional relationship between the area of the first identification frame and the area of the second identification frame, and the adapted calibration distance.
2. The area protection method according to claim 1, characterized in that: Before obtaining the distance between the monitoring target and the camera according to the target to be calibrated, the method includes: Identify the type and size of the monitoring target in the video display area of the camera; the size of the monitoring target is the size of the identification frame of the monitoring target.
3. The area protection method according to claim 1, characterized in that: If the monitoring target in the video display area of the camera falls into the protection area, it includes: If the center coordinates of the identification frame of the monitored target in the video display area of the camera fall into the protection area.
4. The area protection method according to claim 1, characterized in that: The monitoring targets include dynamic targets and static targets; The targets to be calibrated include dynamic targets and static targets.
5. A regional protection device, characterized in that: include: The protection area demarcation module is used to: demarcate the protection area in the video display area of the camera; A distance calculation module, used for: if the monitoring target in the video display area of the camera falls into the protection area, obtaining the distance between the monitoring target and the camera according to the target to be calibrated; An alarm generating module is used to: generate an alarm according to the monitoring target if the distance between the monitoring target and the camera is less than a distance threshold; Before obtaining the distance between the monitoring target and the camera according to the target to be calibrated, the method includes: Identify the calibration type, calibration distance and calibration size of multiple targets to be calibrated in the video display area of the camera; the calibration distance is the distance between the target to be calibrated and the camera, and the calibration size is the identification frame size of the target to be calibrated; The obtaining the distance between the monitoring target and the camera according to the target to be calibrated includes: Matching the type of the monitoring target among the multiple calibration types, and obtaining the distance between the monitoring target and the camera according to the adapted calibration distance, the adapted calibration size and the size of the monitoring target; the adapted calibration distance is the calibration distance corresponding to the successfully matched calibration type, and the adapted calibration size is the calibration size corresponding to the successfully matched calibration type; The obtaining the distance between the monitoring target and the camera according to the adapted calibration distance, the adapted calibration size, and the size of the monitoring target includes: Calculate the area of the recognition frame corresponding to the target to be calibrated according to the adapted calibration size to obtain the first recognition frame area; Calculate the area of the identification frame corresponding to the monitoring target according to the size of the monitoring target to obtain the area of the second identification frame; The distance between the monitoring target and the camera is obtained according to the proportional relationship between the area of the first identification frame and the area of the second identification frame, and the adapted calibration distance.
6. An electronic device comprising a processor and a memory storing a computer program, characterized in that: When the processor executes the computer program, the steps of the area protection method according to any one of claims 1 to 4 are implemented.
7. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the area protection method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Stereoscopic vision system and application thereof to real time monitoring of three-dimensional safety warning area
CN102650514A
Method and device for generating information
CN108834066A