A method for quickly locating network camera positions based on plane maps
By building a three-dimensional scene in the GIS system, accessing network cameras and calculating reference object data, the problem of difficult positioning of monitoring equipment is solved, fast and accurate positioning of monitoring equipment is achieved, and the efficiency and accuracy of video monitoring are improved.
Patent Information
- Application Number
- CN202311491904.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-11-09
- Publication Date
- 2024-10-29
- Estimated Expiration
- 2043-11-09
AI Technical Summary
The existing technology lacks a method for quickly locating monitoring equipment, which makes it difficult to accurately locate monitoring equipment in a GIS system, affecting the efficiency and accuracy of video monitoring.
By building a three-dimensional scene on the GIS map, accessing the network camera, obtaining the camera's installation position, rotation angle value, coordinate data and angle value of the reference object, calculating the straight-line distance and angle from the camera to the reference object, and using these data to calculate the installation of the camera Position coordinates to achieve rapid positioning.
It is possible to quickly and accurately locate the installation location of monitoring equipment without going to the site, eliminating precision errors caused by inconsistent equipment coordinate systems and improving the accuracy of map guidance.
Smart Images

Figure CN117433510B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to a method for locating a network camera, and in particular to a method for quickly locating a network camera based on a plane map, belonging to the technical field of network camera positioning. Background Art
[0002] With the continuous development and growth of the Internet, cameras have been continuously networked and remote operation is very convenient. Therefore, cameras have been widely used and video surveillance has entered the fully digital network era.
[0003] Through the GIS system, the specific location of the monitoring equipment built at the front end can be marked on the map, so that users can watch videos directly on the map interface. When users want to find a monitoring device, they don’t need to search in the entire device list. They can directly click or search for the monitoring point they are interested in on the map to see the video they are interested in, which saves a lot of time and is more accurate and intuitive. The premise for achieving this goal is to accurately locate the monitoring equipment on the map. How to quickly locate the installation location of the monitoring equipment without going to the site. Summary of the invention
[0004] A brief overview of the present invention is provided below in order to provide a basic understanding of certain aspects of the present invention. It should be understood that this overview is not an exhaustive overview of the present invention. It is not intended to identify key or important parts of the present invention, nor is it intended to limit the scope of the present invention. Its purpose is merely to present certain concepts in a simplified form as a prelude to a more detailed description discussed later.
[0005] In view of this, in order to solve the technical problem of the lack of a method for quickly locating a monitoring device in the prior art, the present invention provides a method for quickly locating a network camera based on a plane map.
[0006] Solution 1: A method for quickly locating a network camera based on a plane map, comprising the following steps:
[0007] S1. Build a GIS map 3D scene, connect to the network camera, and record the camera installation position P;
[0008] S2. Get the camera rotation angle value;
[0009] S3. Obtaining coordinate data of the bottom corner point of the first reference object;
[0010] S4. Obtaining coordinate data of the bottom corner point of the second reference object;
[0011] S5. Obtain the angle value of the camera facing the bottom corner point of the first reference object and the bottom corner point of the second reference object;
[0012] S6. Obtain the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object;
[0013] S7. Obtain the angle value of the bottom corner point of the first reference object facing the camera and the bottom corner point of the second reference object;
[0014] S8. Obtain the angle value of the bottom corner point of the second reference object facing the camera and the bottom corner point of the first reference object;
[0015] S9. Obtain the straight-line distance from the camera to the bottom corner point of the first reference object and the bottom corner point of the second reference object;
[0016] S10. Obtain the coordinates of the camera point P according to the straight-line distance from the camera to the bottom corner of the first reference object, the straight-line distance from the camera to the bottom corner of the second reference object, and the straight-line distance from the bottom corner of the first reference object to the bottom corner of the second reference object to complete positioning.
[0017] Preferably, the camera rotation angle value is obtained by setting the angle between the camera and the north direction to 0°, rotating the camera, and obtaining the camera rotation amount by controlling the camera to align the center point of the video playback screen with the bottom corner point of the first reference object within the field of view, and recording the bottom corner point of the first reference object and the horizontal azimuth value of the camera. The angle between the bottom corner point of the first reference object and the horizontal azimuth value of the camera to the north direction is ∠P, and ∠P is the camera rotation angle value.
[0018] Preferably, the angle value of the camera facing the bottom corner point of the first reference object and the bottom corner point of the second reference object is obtained by subtracting the horizontal azimuth values obtained by S2 and S4 from the angle of due north to obtain the angle difference ∠C, that is, the difference between ∠P and ∠P′ is ∠C.
[0019] Preferably, the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object is calculated using the coordinate data (lonA, latA) of the bottom corner point of the first reference object and the coordinate data (lonB, latB) of the bottom corner point of the second reference object.
[0020] Preferably, the angle value of the bottom corner point of the first reference object facing the camera and the bottom corner point of the second reference object is obtained, and the method is: set the angle between point A and the north direction to 0°, make point A face the direction of the camera, obtain the horizontal direction value between point A and the camera, and the angle between point A and the square position value of the camera to the north direction is ∠A″; make point A face the direction of point B, obtain the horizontal direction value between point A and point B, and the angle between point A and point B to the north direction is ∠A′, ∠A″+∠A′, that is, the angle value ∠A of the bottom corner point of the first reference object facing the camera and point B.
[0021] Preferably, the straight-line distance from the camera to the bottom corner point of the first reference object and the bottom corner point of the second reference object is obtained by: Among them, a is the straight-line distance from the camera to the bottom corner point of the first reference object, b is the straight-line distance from the camera to the bottom corner point of the second reference object, and c is the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object.
[0022] Solution 2: An electronic device includes a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of a method for quickly locating a network camera based on a plan map as described in Solution 1 are implemented.
[0023] Solution three: A computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the method for quickly locating the position of a network camera based on a planar map as described in Solution one.
[0024] The beneficial effects of the present invention are as follows: the present invention can quickly locate the installation position of the monitoring equipment without going to the site, and can also eliminate the precision error caused by the different coordinate systems of the acquisition equipment and the system platform equipment, thereby improving the accuracy of the map-guided monitoring equipment. BRIEF DESCRIPTION OF THE DRAWINGS
[0025] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0026] Figure 1 A flowchart of a method for quickly locating a network camera based on a planar map;
[0027] Figure 2 Schematic diagram for obtaining the principles of ∠A, ∠B and ∠C. DETAILED DESCRIPTION
[0028] In order to make the technical solutions and advantages in the embodiments of the present application more clearly understood, the exemplary embodiments of the present application are further described in detail below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than an exhaustive list of all the embodiments. It should be noted that the embodiments in the present application and the features in the embodiments can be combined with each other without conflict.
[0029] Example 1, reference Figure 1-Figure 2 The present embodiment describes a method for quickly locating a network camera based on a plan map, comprising the following steps:
[0030] S1. Build a GIS map 3D scene, connect to the network camera, and record the camera installation position P;
[0031] The method of building a GIS map three-dimensional scene is: the web front end uses the Cesium engine to render and build the GIS map three-dimensional scene;
[0032] The method of accessing the network camera is: control access to the network camera based on a third-party SDK;
[0033] S2. Get the rotation angle of the camera, the method is: set the angle between the camera and the north direction to 0°, rotate the camera, and get the rotation of the camera, the method is: control the camera to align the center point of the video playback screen with the bottom corner point of the first reference object within the field of view, record the bottom corner point of the first reference object and the horizontal azimuth value of the camera, the angle between the bottom corner point of the first reference object and the horizontal azimuth value of the camera to the north direction is ∠P, ∠P is the rotation angle of the camera.
[0034] The horizontal azimuth value means: The azimuth value refers to the difference between the current camera and 0°; the horizontal circumference is 360°, so the true north is regarded as 0°;
[0035] Control the center point of the camera video playback screen based on the webrtc protocol. The browser calls webrtc-streamer.js to realize real-time video playback display.
[0036] S3. Obtaining coordinate data of the bottom corner point of the first reference object, the method is: marking the bottom corner point of the reference object as point A in the GIS map three-dimensional scene, and obtaining the coordinate data of point A (lonA, latA);
[0037] The method to obtain the coordinate data (lonA, latA) of point A is: based on viewer.scene.globe.pick(ray,scene) in Cesium API;
[0038] S4. Obtain the coordinate data of the bottom corner point of the second reference object by repeating S2 to obtain the horizontal azimuth value of the camera at the bottom corner point of the second reference object, the angle of the horizontal azimuth value of the camera at the bottom corner point of the second reference object to the true north direction is ∠P′, repeat S3 to obtain the coordinate data of point B (lonB, latB);
[0039] S5. The angle value of the camera facing the bottom corner of the first reference object and the bottom corner of the second reference object is obtained by subtracting the horizontal azimuth values obtained by S2 and S4 from the angle of the true north direction to obtain the angle difference ∠C, that is, the difference between ∠P and ∠P′ is ∠C. That is, by marking the action control of the camera twice, the azimuth difference of the two rotations is obtained, and the angle ∠C generated by the two rotations can be calculated.
[0040] S6. Obtain the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object by using the coordinate data of point A (lonA, latA) and the coordinate data of point B (lonB, latB) to calculate the straight-line distance from point A to point B.
[0041] S7. Obtain the angle value of the bottom corner point of the first reference object facing the camera and the bottom corner point of the second reference object, the method is: set the angle between point A and the north direction to 0°, make point A face the camera direction, obtain the horizontal direction value between point A and the camera, and the angle between point A and the camera's square position value to the north direction is ∠A″; make point A face the direction of point B, obtain the horizontal direction value between point A and point B, and the angle between point A and point B's horizontal position value to the north direction is ∠A′, ∠A″+∠A′ is the angle value ∠A of the bottom corner point of the first reference object facing the camera and point B.
[0042] S8. Obtain the angle between the bottom corner of the second reference object facing the camera and the bottom corner of the first reference object, using the method: ∠B = 180 - ∠A - ∠C;
[0043] S9. Obtain the straight-line distance from the camera to the bottom corner point of the first reference object and the bottom corner point of the second reference object by:
[0044] Among them, a is the straight-line distance from the camera to the bottom corner point of the first reference object, b is the straight-line distance from the camera to the bottom corner point of the second reference object, and c is the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object.
[0045] S10. Obtain the coordinates of the camera point P according to the straight-line distance from the camera to the bottom corner of the first reference object, the straight-line distance from the camera to the bottom corner of the second reference object, and the straight-line distance from the bottom corner of the first reference object to the bottom corner of the second reference object to complete positioning.
[0046] Convert the azimuth to radians. Radians are a measure of angles used in trigonometric calculations; radians = angle × π / 180.
[0047] Calculate the offset of point P relative to point A:
[0048] The offset x of point P = distance × sin (radians) = b × sin (P × π / 180);
[0049] The offset y of point P = distance × cos (radians) = b × cos (P × π / 180);
[0050] Where b is the straight-line distance from the camera to the bottom corner of the second reference object;
[0051] Use the sin and cos functions to calculate the offset on the y-axis and x-axis respectively, and the calculated coordinates are the coordinates of point P:
[0052] The coordinates of point P = the coordinates of point A + the offset;
[0053] The x coordinate of point P = the x coordinate of point A + offset x;
[0054] The y coordinate of point P = the y coordinate of point A + the offset y.
[0055] Embodiment 2: The computer device of the present invention may be a device including a processor and a memory, such as a single chip microcomputer including a central processing unit. Furthermore, the processor is used to implement the steps of the above-mentioned method for quickly locating the position of a network camera based on a plane map when executing the computer program stored in the memory.
[0056] The processor may be a central processing unit (CPU), other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0057] The memory may mainly include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function (such as a sound playback function, an image playback function, etc.), etc.; the data storage area may store data created according to the use of the mobile phone (such as audio data, a phone book, etc.), etc. In addition, the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as a hard disk, a memory, a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), at least one disk storage device, a flash memory device, or other volatile solid-state storage devices.
[0058] Embodiment 3, computer readable storage medium embodiment.
[0059] The computer-readable storage medium of the present invention can be any form of storage medium that can be read by the processor of a computer device, including but not limited to non-volatile memory, volatile memory, ferroelectric memory, etc. A computer program is stored on the computer-readable storage medium. When the processor of the computer device reads and executes the computer program stored in the memory, the steps of the above-mentioned method for predicting traffic congestion status can be implemented.
[0060] The computer program includes computer program code, which may be in source code form, object code form, executable file or some intermediate form, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc. It should be noted that the content contained in the computer readable medium may be appropriately increased or decreased according to the requirements of legislation and patent practice in the jurisdiction. For example, in some jurisdictions, according to legislation and patent practice, computer readable media do not include electric carrier signals and telecommunication signals.
[0061] Although the present invention has been described according to a limited number of embodiments, it will be apparent to those skilled in the art, with the benefit of the above description, that other embodiments may be envisioned within the scope of the invention thus described. In addition, it should be noted that the language used in this specification is selected primarily for readability and teaching purposes, rather than for explaining or defining the subject matter of the present invention. Therefore, many modifications and variations will be apparent to those skilled in the art without departing from the scope and spirit of the appended claims. The disclosure of the present invention is illustrative, not restrictive, with respect to the scope of the present invention, which is defined by the appended claims.
Claims
1. A method for quickly locating a network camera based on a plane map, characterized in that: The following steps are involved: S1. Build a GIS map 3D scene, connect to the network camera, and record the camera installation position P; S2. Obtain the camera rotation angle value, the method is: set the angle between the camera and the true north direction to 0°, rotate the camera, and obtain the camera rotation amount. The method for obtaining the camera rotation amount is: control the camera to align the center point of the video playback screen with the bottom corner point of the first reference object within the field of view, record the bottom corner point of the first reference object and the horizontal azimuth value of the camera, the angle between the bottom corner point of the first reference object and the horizontal azimuth value of the camera to the true north direction is ∠P, ∠P is the camera rotation angle value; S3. Obtain the coordinate data of the bottom corner point of the first reference object, mark the bottom corner point of the first reference object as point A in the GIS map three-dimensional scene, and obtain the coordinate data of point A (lonA, latA); S4. Obtain the coordinate data of the bottom corner point of the second reference object, repeat S2 to obtain the horizontal azimuth value of the camera at the bottom corner point of the second reference object, the angle of the horizontal azimuth value of the camera at the bottom corner point of the second reference object to the true north direction is ∠P´, repeat S3 to obtain the coordinate data of point B (lonB, latB); S5. Obtain the angle value of the camera facing the bottom corner point of the first reference object and the bottom corner point of the second reference object by subtracting the horizontal azimuth values obtained by S2 and S4 from the angle of the true north direction to obtain the angle difference ∠C, that is, the difference between ∠P and ∠P´ is ∠C; S6. Obtain the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object; S7. Obtain the angle value of the bottom corner point of the first reference object facing the camera and the bottom corner point of the second reference object; S8. Obtain the angle value of the bottom corner point of the second reference object facing the camera and the bottom corner point of the first reference object; S9. Obtain the straight-line distance from the camera to the bottom corner point of the first reference object and the bottom corner point of the second reference object; S10. Obtain the coordinates of the camera point P according to the straight-line distance from the camera to the bottom corner of the first reference object, the straight-line distance from the camera to the bottom corner of the second reference object, and the straight-line distance from the bottom corner of the first reference object to the bottom corner of the second reference object, complete the positioning, and convert the azimuth angle into radians. Radians are a measurement method of angles and are used for trigonometric function calculations; radians = angle × π / 180; Calculate the offset of point P relative to point A: The offset x of point P = distance × sin (radians) = b × sin (P × π / 180); The offset y of point P = distance × cos (radians) = b × cos (P × π / 180); Wherein, b is the straight-line distance from the camera to the bottom corner point of the first reference object; Use the sin and cos functions to calculate the offset on the y-axis and x-axis respectively, and the calculated coordinates are the coordinates of point P: The coordinates of point P = the coordinates of point A + offset; The x coordinate of point P = the x coordinate of point A + offset x; The y coordinate of point P = the y coordinate of point A + offset y; Wherein, S6 obtains the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object by using the coordinate data (lonA, latA) of the bottom corner point of the first reference object and the coordinate data (lonB, latB) of the bottom corner point of the second reference object to calculate the straight-line distance from the bottom corner point of the first reference object to the bottom corner point of the second reference object; S7 obtains the angle value of the bottom corner point of the first reference object facing the camera and the bottom corner point of the second reference object, the method is: set the angle between point A and the north direction to 0°, make point A face the camera direction, obtain the horizontal direction value between point A and the camera, and the angle between point A and the camera's square position value to the north direction is ∠A´´; make point A face the direction of point B, obtain the horizontal direction value between point A and point B, and the angle between point A and point B's horizontal position value to the north direction is ∠A´, ∠A´´+∠A´ is the angle value ∠A of the bottom corner point of the first reference object facing the camera and point B.
2. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the steps of the method for quickly locating the position of a network camera based on a planar map as described in claim 1 are implemented.
3. A computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the method for quickly locating a network camera based on a planar map as described in claim 1 is implemented.
Citation Information
Patent Citations
Positioning method and positioning device based on monocular vision, and terminal
CN110702115A
