Target positioning method, device, computer readable storage medium and computer equipment

Calculate the target's latitude and longitude through the pixel coordinates and parameters of the camera video frame, and solves the problem of large errors in small-scale scenarios in the near-Earth and achieves high-precision target positioning, which is suitable for real-time monitoring and trajectory tracking of various scenarios. .

CN112114301BActive Publication Date: 2024-12-17FOSHAN SHUNDE GUANGQI ADVANCED EQUIP CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN201910532306.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-19
Publication Date
2024-12-17
Estimated Expiration
2039-06-19

AI Technical Summary

Technical Problem

The traditional target positioning method has a large positioning error in small-scale scenarios near-Earth, and cannot provide accurate target positioning. Especially when relying on GPS or Beidou positioning system, the error may reach tens of meters, which cannot meet the needs of small-scale scenarios near-Earth. Positioning requirements.

Method used

By obtaining the video frames captured by the camera, extracting the pixel coordinates of the target and the camera parameters, and calculating the latitude and longitude of the target in combination with geospatial and mathematical geometric principles, the precise positioning of the target is achieved. This method does not rely on traditional positioning systems and terminal devices, and directly converts pixel coordinates into spatial coordinates, improving positioning accuracy.

Benefits of technology

It greatly improves the accuracy of target positioning in small-scale scenarios near the ground, reduces the cost of positioning and trajectory tracking, is more applicable and wider, and is suitable for large supermarkets, unmanned supermarkets, stations, airports and other scenarios, and can be used in real-time. Accurately restore the activity process of the target personnel.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112114301B_ABST
    Figure CN112114301B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer-readable storage medium and computer equipment for target positioning, the method comprising: obtaining a video frame taken by a camera, and obtaining the pixel coordinates of the target from the video frame. Further obtaining the parameters of the camera and the parameters of the video frame, wherein the parameters of the video frame include the parameters in the video frame used to calculate the distance from the target to the camera. The longitude and latitude of the target are calculated according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, and the target is positioned according to the longitude and latitude of the target. The positioning error of the traditional positioning system in a small range near the ground is large. The present method does not rely on the traditional positioning system and terminal equipment, but uses the principles of geographic space and mathematical geometry to perform precise calculations based on the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, and converts the pixel coordinates of the target in the image into spatial coordinates, i.e., the longitude and latitude of the target to achieve positioning.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a target positioning method, device, computer-readable storage medium and computer equipment. Background Art

[0002] Most of the traditional target positioning methods are based on terminals with positioning functions to report the location of the target, so as to obtain the target location. And most of the current terminals rely on positioning systems such as GPS (Global Positioning System) or Beidou to achieve positioning, but the positioning errors of positioning systems such as GPS or Beidou in near-ground small-scale scenes are large, and sometimes there will be an error of tens of meters between the actual position and the positioned position. This error is too large for near-ground small-scale scenes (such as small areas within nearly 100 meters), and it cannot provide accurate target positioning and cannot meet the positioning requirements of near-ground small-scale scenes. Therefore, how to provide a target positioning method that can improve the accuracy of target positioning in near-ground small-scale scenes is a problem that needs to be solved urgently. Summary of the invention

[0003] Based on this, it is necessary to provide a target positioning method, apparatus, computer-readable storage medium and computer equipment.

[0004] A target positioning method, comprising:

[0005] Get the video frame captured by the camera;

[0006] Obtaining pixel coordinates of a target from the video frame;

[0007] Acquire parameters of the camera and parameters of the video frame, wherein the parameters of the video frame include parameters in the video frame used to calculate the distance from the target to the camera;

[0008] Calculating the longitude and latitude of the target according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame;

[0009] The target is located according to the latitude and longitude of the target.

[0010] In one embodiment, the target includes a target person, and obtaining pixel coordinates of the target from the video frame includes:

[0011] The pixel coordinates of the target person are obtained from the video frame through a convolutional neural network, and the pixel coordinates include horizontal pixel values ​​and vertical pixel values.

[0012] In one embodiment, the parameters of the camera include the installation parameters and the camera's own parameters. The installation parameters include the camera's latitude and longitude, altitude, azimuth, pitch angle, shooting distance, minimum shooting width, maximum shooting width and horizontal distance of the blind spot; the own parameters include field of view angle and resolution.

[0013] In one embodiment, calculating the longitude and latitude of the target according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame includes:

[0014] Calculating the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame;

[0015] Calculate the longitude and latitude of the intersection of the horizontal line where the target is located and the vertical section of the field of view in the video frame according to the distance from the target to the camera;

[0016] Calculate the distance between the target and the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera;

[0017] The longitude and latitude of the target are calculated according to the longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view.

[0018] In one embodiment, calculating the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame includes:

[0019] Acquire a valid area in the video frame according to a vertical proportion coefficient of an invalid area in the video frame;

[0020] Dividing the effective area in the video frame according to the vertical equal division coefficient of the video frame to obtain equal division areas;

[0021] Calculate the actual distance corresponding to a single pixel in the divided area according to the vertical division coefficient of the video frame;

[0022] Obtain the equally divided area where the target is located, calculate the distance from the target to the bottom of the video frame according to the actual distance corresponding to a single pixel in the equally divided area where the target is located, and add the distance from the target to the bottom of the video frame to the horizontal distance of the blind spot to obtain the distance from the target to the camera.

[0023] In one embodiment, the calculating the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame includes:

[0024] Acquire a valid area in the video frame according to a vertical proportion coefficient of an invalid area in the video frame;

[0025] Dividing the effective area in the video frame according to the vertical equal division coefficient of the video frame to obtain equal division areas;

[0026] Calculate the actual distance corresponding to a single pixel in the divided area according to the vertical division coefficient of the video frame;

[0027] Obtain the equally divided area where the target is located, calculate the distance from the target to the bottom of the video frame according to the actual distance corresponding to a single pixel in the equally divided area where the target is located, and add the distance from the target to the bottom of the video frame to the horizontal distance of the blind spot to obtain the distance from the target to the camera.

[0028] In one embodiment, the step of calculating the longitude and latitude of the intersection of a horizontal line where the target is located in a video frame and a vertical section of the field of view according to the horizontal distance from the target to the camera includes:

[0029] The longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view are calculated according to the horizontal distance from the target to the camera, the azimuth of the camera, and the longitude and latitude of the camera.

[0030] In one embodiment, the step of calculating the distance from the target to the intersection of a horizontal line where the target is located in a video frame and a vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera includes:

[0031] Calculate the total distance of the horizontal line where the target is located in the video frame according to the minimum shooting width of the camera, the horizontal distance of the blind area, and the distance from the target to the bottom of the video frame;

[0032] The horizontal distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated according to the total distance of the horizontal line where the target is located in the video frame, the resolution, and the horizontal pixel value of the target. Then, the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated according to the spatial relationship.

[0033] In one embodiment, the longitude and latitude of the target are calculated according to the longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view, including:

[0034] Draw a circle with the position of the camera as the center and the distance from the target to the camera in the video frame as the radius to obtain a first circle;

[0035] Draw a circle with the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the center and the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the radius to obtain a second circle;

[0036] Obtaining an intersection point between the first circle and the second circle, and calculating the longitude and latitude of the intersection point;

[0037] The longitude and latitude of the target are determined from the longitude and latitude of the intersection according to the pixel coordinates of the target.

[0038] A target positioning device, the device comprising:

[0039] A video frame acquisition module is used to acquire the video frames captured by the camera;

[0040] A target pixel coordinate acquisition module, used to acquire the pixel coordinates of the target from the video frame;

[0041] A parameter acquisition module, used to acquire parameters of the camera and parameters of the video frame, wherein the parameters of the video frame include parameters in the video frame used to calculate the distance from the target to the camera;

[0042] A target longitude and latitude calculation module, used to calculate the longitude and latitude of the target according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame;

[0043] The target positioning module is used to locate the target according to the longitude and latitude of the target.

[0044] A computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the method described above.

[0045] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.

[0046] The above-mentioned target positioning method, device, computer-readable storage medium and computer equipment obtain the video frame taken by the camera, and obtain the pixel coordinates of the target from the video frame. Further obtain the parameters of the camera and the parameters of the video frame, wherein the parameters of the video frame include the parameters in the video frame used to calculate the distance from the target to the camera. The longitude and latitude of the target are calculated according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, and the target is positioned according to the longitude and latitude of the target. The positioning error of the traditional positioning system in a small-scale scene near the ground is large. The present invention does not rely on the traditional positioning system and terminal equipment, but uses the geographic space and mathematical geometry principles to perform accurate calculations based on the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, and converts the pixel coordinates of the target in the image into spatial coordinates, that is, the longitude and latitude of the target to achieve positioning. Because the use of geographic space and mathematical geometry principles can be used for accurate calculations, the accuracy of target positioning in a small-scale scene near the ground is greatly improved. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] Figure 1 A diagram of an application environment of a target positioning method in an embodiment;

[0048] Figure 2 is a schematic flow chart of a target positioning method in one embodiment;

[0049] Figure 3 is a schematic diagram of a complete video frame in one embodiment;

[0050] Figure 4 is a schematic diagram of a camera field of view in one embodiment;

[0051] Figure 5 is a schematic diagram of a camera field of view at another viewing angle in one embodiment;

[0052] Figure 6 for Figure 2 A flow chart of a method for calculating the longitude and latitude of a target according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame;

[0053] Figure 7 for Figure 6 Schematic diagram of the process of calculating the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame;

[0054] Fig. 8A A schematic diagram of dividing a valid area in a video frame into equally divided areas according to an embodiment;

[0055] Figure 8B is a schematic diagram of a target appearing in a camera field of view at another viewing angle in one embodiment;

[0056] Fig. 9A for Figure 6 A flow chart of a method for calculating the distance between the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera;

[0057] Fig. 9B A schematic diagram of calculating the distance from a target to an intersection of a horizontal line where the target is located in a video frame and a vertical section of a field of view in one embodiment;

[0058] Fig.10 A schematic diagram of calculating the longitude and latitude of a target in one embodiment;

[0059] Fig.11 is a structural block diagram of a target positioning device in one embodiment;

[0060] Fig.12 FIG. 4 is a structural block diagram of a computer device in one embodiment. DETAILED DESCRIPTION

[0061] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0062] Figure 1 FIG. 1 is an application environment diagram of a target positioning method in an embodiment. Figure 1 , the target positioning method is applied to the target positioning system. The target positioning system includes a camera 110 and a server 120. The camera 110 and the server 120 are connected via a network. The camera 110 can specifically be a surveillance camera, and the camera 110 transmits the captured image or video to the server 120 via the network. The server 120 can be implemented as an independent server or a server cluster composed of multiple servers. The server 120 obtains the video frame captured by the camera 110; obtains the pixel coordinates of the target from the video frame; obtains the parameters of the camera 110 and the parameters of the video frame, wherein the parameters of the video frame include the parameters in the video frame for calculating the distance from the target to the camera; calculates the longitude and latitude of the target according to the pixel coordinates of the target, the parameters of the camera 110 and the parameters of the video frame; and locates the target according to the longitude and latitude of the target.

[0063] like Figure 2 As shown, in one embodiment, a target positioning method is provided. This embodiment mainly applies this method to the above Figure 1 The server 120 in FIG. Figure 2 , the target positioning method specifically includes the following steps:

[0064] S210, obtaining a video frame captured by a camera.

[0065] At present, cameras are generally installed in large supermarkets, unmanned supermarkets, stations, airports, tourist attractions and special security areas to monitor targets. The camera shoots a video of the scene being shot and transmits the shot video to the server in real time. The server can obtain the video frames in the video shot by the camera in real time. Video frames refer to the images in the video frame by frame. Of course, the camera here can also shoot images. If the camera shoots an image, the server directly obtains the shot image.

[0066] S230, obtaining pixel coordinates of the target from the video frame.

[0067] The video frame contains multiple targets. Once the target is determined, the server can extract the pixel coordinates of the target from the video frame. For example, when the camera has about 800,000 pixels, the resolution of the acquired video frame is generally 1024×768, which means that the video frame consists of 1024 dots horizontally and 768 dots vertically. The resolution information can be directly obtained from the acquired video frame. The 800,000 pixels here are just an example. The pixels of the camera can range from hundreds of thousands to millions or even tens of millions. With the advancement of technology, higher pixel values ​​can be achieved.

[0068] Specifically, when obtaining the pixel coordinates of the target from the video frame, first obtain the target frame where the target is located; then obtain the pixel position of the target's sole corresponding to the target frame. When the pixel position of the target's sole corresponding to the target frame appears at the 512th horizontal pixel and the 384th vertical pixel, the pixel coordinates (512, 384) of the target's sole can be used as the pixel coordinates (X t ,Y t ), and finally get the pixel coordinates of the target (X t ,Y t ) is (512,384).

[0069] S250, obtaining parameters of the camera and parameters of the video frame, wherein the parameters of the video frame include parameters in the video frame used to calculate the distance from the target to the camera.

[0070] The camera parameters include the camera's installation parameters and its own parameters. Among them, the camera's own parameters include the camera's field of view and resolution (when the camera's pixels are about 800,000 pixels, the camera's resolution is 1024×768). These two parameters are the camera's inherent parameters. When the camera is installed and fixed, the camera's installation parameters are also fixed. The camera's installation parameters include the camera's latitude and longitude, altitude, azimuth, pitch angle, shooting distance length, minimum shooting width, maximum shooting width, and horizontal distance of the blind spot, etc. The above are not exhaustive.

[0071] The parameters of the video frame include parameters used to calculate the distance from the target to the camera in the video frame. Specifically, the parameters of the video frame include the vertical proportion coefficient of the invalid area in the video frame and the vertical division coefficient of the video frame. Among them, the vertical proportion coefficient of the invalid area in the video frame refers to the proportion of the invalid area in the obtained video frame to the total area of ​​the video frame in the vertical direction. Since the video frame of the camera includes the imaging effect under the effective shooting distance and the imaging effect under the invalid shooting distance, the area within the effective shooting distance is called the effective shooting area, and the area outside the effective shooting distance is called the invalid shooting area. The camera can focus and image clearly for the effective area range. Although the camera can shoot the invalid shooting area, the imaging effect of the invalid shooting area is not clear enough and cannot be identified, which is inconvenient for subsequent calculation. Therefore, by analyzing a large number of video frames shot by cameras with the same installation parameters and their own parameters, it is concluded that the proportion of the invalid shooting area at the top of the video frame in the vertical direction to the total area of ​​the video frame is f1. Therefore, the proportion of the effective area of ​​the video frame to the total area of ​​the video frame is 1-f1.

[0072] Among them, after the effective shooting area in the video frame is divided according to the vertical division coefficient of the video frame, the actual distance of each video frame area is equal. The actual distance of each video frame area is equal, which means that the distance corresponding to each video frame area in the actual space is equal. For example, if the vertical division coefficient of the video frame is f2:f3:f4, then after the effective area of ​​the video frame is divided according to the vertical division coefficient, the equal division area in the actual space is obtained.

[0073] S270, calculating the longitude and latitude of the target according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame.

[0074] In the above steps, the pixel coordinates of the target are obtained as (X t ,Y t ), obtain the installation parameters and the camera's own parameters, and then obtain the vertical proportion coefficient f1 of the invalid area in the video frame and the vertical division coefficients f2:f3:f4 of the video frame. Then, based on these data, the geographic space and mathematical geometry principles can be used for accurate calculation to obtain the longitude and latitude of the target.

[0075] S290, positioning the target according to the longitude and latitude of the target.

[0076] Among them, longitude and latitude are the collective names of longitude and latitude. Longitude and latitude form a coordinate system, called a geographic coordinate system. Longitude and latitude are a spherical coordinate system that uses a two-dimensional sphere to define the position on the surface of the earth, and can uniquely represent any position on the earth. Therefore, after obtaining the longitude and latitude of the target, the target can be accurately located according to the longitude and latitude of the target. Specifically, in the WGS84 coordinate system, 1 degree is approximately equal to 111194.872221777 meters. . In the embodiment of the present application, the main purpose is to locate the target in a small-scale scene near the ground (for example, a scene within a range of nearly 100 meters) captured by the camera, so the calculated longitude and latitude need to retain at least 6 decimal places (such as 32.485236°) to ensure the accuracy of the positioning, and generally retain 7-9 decimal places to achieve more accurate positioning.

[0077] In the embodiment of the present application, a video frame captured by a camera is obtained, and the pixel coordinates of the target are obtained from the video frame. The parameters of the camera and the parameters of the video frame are further obtained, wherein the parameters of the video frame include parameters in the video frame for calculating the distance from the target to the camera. The longitude and latitude of the target are calculated according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, and the target is positioned according to the longitude and latitude of the target. The positioning error of the traditional positioning system in a small-scale scene near the ground is large. The present method does not rely on the traditional positioning system and terminal equipment, but uses the geographic space and mathematical geometry principles to perform accurate calculations based on the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, and converts the pixel coordinates of the target in the image into spatial coordinates, that is, the longitude and latitude of the target to achieve positioning. Because the use of geographic space and mathematical geometry principles can be used for accurate calculation, the accuracy of target positioning in a small-scale scene near the ground is greatly improved. And it does not rely on the traditional positioning system and terminal equipment, which reduces the cost of positioning and tracking the trajectory of the target. At the same time, it can solve the positioning problem when the target does not carry a terminal, so it is more applicable and wider.

[0078] The embodiments of the present application can be widely used in scenarios with special requirements for the real-time location information of target pedestrians, such as large supermarkets, unmanned supermarkets, stations, airports, tourist attractions, pedestrian streets and areas with special security requirements, etc., and can also track the trajectory of specific target personnel in the scene, and count the regional flow of people in the scene, etc. Further provide data sources for monitoring systems and tracking systems in the security field, as well as commercial data mining systems, etc. In the security scene, special targets that endanger personal or public safety are supervised, and early detection and prevention are carried out in advance, so as to minimize the possibility of sudden accidents and improve social security. And the scene can be restored, and the process of the target person's activities can be restored in real time and accurately, and the potential behavioral motivations can be excavated through relevant analysis. At the same time, authentic and reliable evidence can be provided to further reveal the essence of the matter. In the commercial field, in addition to real-time monitoring and tracking of shoppers, the activity trajectory and scope of the target person's shopping can also be used to reasonably configure the layout of goods.

[0079] In one embodiment, S230, obtaining pixel coordinates of a target from a video frame includes: the target includes a target person, and the pixel coordinates of the target person are obtained from the video frame through a convolutional neural network, and the pixel coordinates include horizontal pixel values ​​and vertical pixel values.

[0080] Specifically, the video frame contains multiple targets, and the target may refer to a target object, a target animal, or a target person in the shooting scene. When the target is a target person, the pixel coordinates of the target person are obtained from the video frame through a convolutional neural network. The pixel coordinates include horizontal pixel values ​​and vertical pixel values. Figure 3 As shown in the figure, it is a schematic diagram of a complete video frame captured by a camera, and the resolution of the video frame is (px,py). For example, the facial target frame of the target person can be obtained from the video frame through a convolutional neural network. If the pixel coordinates of the upper left corner and the lower right corner of the facial target frame are (X1,Y1) and (X2,Y2) respectively, then the horizontal pixel value of the target person is X t =(X1+X2) / 2, the vertical pixel value of the target person is Y t=Y1+(Y2-Y1)×a. Wherein, a is the ratio of the character's face to the character's total height, and the ratio is different in different scenes (scenes with different camera installation heights and pitch angles). The ratio of the character's face to the character's total height in a certain scene (with the same camera installation height and pitch angle) is obtained by pre-shooting a large number of images of different characters in the same scene, or the same character in different positions, and calculating the ratio of the character's face in a large number of images to the character's total height. Then, the calculated ratio of the object's face to the character's total height is averaged to obtain a. For example, in the embodiment of the present application, a is obtained to be 5. Of course, a can also be calculated to be 6 or 7 or 7.5, but generally the value of a is between 5-7.5.

[0081] For example, the human target box of the target person can be obtained from the video frame through a convolutional neural network, such as Figure 3 As shown in the figure, the resolution of the video frame is (px,py). If the pixel coordinates of the two endpoints of the upper left corner and the lower right corner of the human target box are (X1,Y1) and (X2,Y2) respectively, then the horizontal pixel value of the target person is X t =(X1+X2) / 2, the vertical pixel value of the target person is Y t =Y2.

[0082] In the embodiment of the present application, the facial target frame or human target frame of the target person is obtained from the video frame through the convolutional neural network, and then the pixel coordinates of the target person are calculated respectively from the pixel coordinates of the two endpoints of the upper left corner and the lower right corner of the facial target frame or the human target frame of the target person. Because the facial target frame or the human target frame of the target person can be accurately obtained through the convolutional neural network, the accuracy of using the pixel coordinates of the two endpoints of the upper left corner and the lower right corner of the facial target frame or the human target frame of the target person to calculate the pixel coordinates of the target person is improved.

[0083] In one embodiment, the parameters of the camera include the installation parameters and its own parameters. The installation parameters include the latitude and longitude, altitude, azimuth, pitch angle, shooting distance, minimum shooting width, maximum shooting width and horizontal distance of the blind spot of the camera; its own parameters include field of view angle and resolution, and the parameters of the video frame include the vertical proportion coefficient of the invalid area in the video frame and the vertical division coefficient of the video frame.

[0084] Specifically, Figure 4 and Figure 5 , which is a schematic diagram of the camera field of view at two different viewing angles. Figure 4The vertical section of the field of view is shown, and the camera and point M are both on the vertical section of the field of view. Get the longitude lon, latitude lat, and azimuth of the camera. ∠BAD is the pitch angle tilt, CE in the figure represents the shooting distance length, HI represents the minimum shooting width minwide, FG represents the maximum shooting width maxwide, and the horizontal distance of the blind area blind.

[0085] Get the field of view and resolution of the camera, where the field of view refers to ∠CAE, and the resolution is the number of pixels in the captured image. For example, a resolution of 160×128 means that the number of pixels in the horizontal direction is 160 and the number of pixels in the vertical direction is 128. In the embodiment of the present application, the camera's own parameters can be directly obtained, while the camera's installation parameters need to be calculated accordingly based on the installation information, and when the installation information is different, the corresponding camera installation parameters are also different. Therefore, after the camera is installed, obtain the camera's installation parameters and its own parameters so that the longitude and latitude of the target in the captured video frame can be calculated later to achieve accurate positioning of the target.

[0086] Among them, the vertical proportion coefficient of the invalid area in the video frame refers to the proportion of the invalid area in the obtained video frame to the total area of ​​the video frame in the vertical direction. Since the video frame of the camera includes the imaging effect at the effective shooting distance and the imaging effect at the invalid shooting distance, the area within the effective shooting distance is called the effective shooting area, and the area outside the effective shooting distance is called the invalid shooting area. The camera can focus and image clearly for the range of the effective area. Although the camera can shoot the invalid shooting area, the imaging effect of the invalid shooting area is not clear enough and cannot be identified, which is inconvenient for subsequent calculations. Therefore, by analyzing a large number of video frames shot by cameras with the same installation parameters and their own parameters, it is concluded that the proportion of the invalid shooting area at the top of the video frame in the vertical direction to the total area of ​​the video frame is f1. Therefore, the proportion of the effective area of ​​the video frame to the total area of ​​the video frame is 1-f1.

[0087] Among them, after the effective shooting area in the video frame is divided according to the vertical division coefficient of the video frame, the actual distance of each video frame area is equal. The equal actual distance of each video frame area means that the distance corresponding to each video frame area in the actual space is equal. For example, if the vertical division coefficient of the video frame is f2:f3:f4, then after the effective area of ​​the video frame is divided according to the vertical division coefficient, the equal-divided areas in the actual space are obtained. With the parameters of the video frame including the vertical proportion coefficient of the invalid area in the video frame and the vertical division coefficient of the video frame, the distance from the target to the camera can be calculated in combination with other parameters.

[0088] In one embodiment, Figure 6 As shown, S270, calculating the longitude and latitude of the target according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, including:

[0089] S272, calculating the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame.

[0090] Specifically, the valid area in the video frame is obtained according to the vertical proportion coefficient of the invalid area in the video frame, and the valid area in the video frame is divided according to the vertical division coefficient of the video frame to obtain the equal-divided area. Then, the actual distance corresponding to a single pixel in the equal-divided area is calculated according to the vertical division coefficient of the video frame. The equal-divided area where the target is located is further obtained, and the distance Dt from the target to the bottom of the video frame is calculated according to the actual distance corresponding to a single pixel in the equal-divided area where the target is located. The distance from the target to the bottom of the video frame plus the horizontal distance of the blind area is added to obtain the distance D from the target to the camera.

[0091] S274, calculating the longitude and latitude of the intersection point M of the horizontal line where the target is located and the vertical section of the field of view in the video frame according to the distance D from the target to the camera.

[0092] The longitude and latitude of the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view are calculated according to the distance D from the target to the camera, the azimuth angle of the camera, and the longitude and latitude of the camera. The horizontal line where the target is located refers to the line formed by the points on the video frame with the same vertical pixel value as the target. Figure 4 What is shown is the vertical section of the field of view, and the camera and point M are both on this vertical section of the field of view.

[0093] S276, calculating the distance Lmt from the target to the intersection M of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera.

[0094] The total distance Lxt of the horizontal line where the target is located in the video frame is calculated according to the minimum shooting width of the camera, the horizontal distance of the blind area, and the distance from the target to the bottom of the video frame.

[0095] Then, the horizontal distance Lmx from the target to the intersection M of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated according to the total distance of the horizontal line where the target is located in the video frame, the resolution, and the horizontal pixel value of the target. Then, the distance Lmt from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated according to the spatial relationship.

[0096] S278, calculate the longitude and latitude T of the target according to the longitude and latitude of the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the distance Lmt from the target to the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view.

[0097] One method is to draw a circle with the camera position as the center and the total distance D from the target to the camera in the video frame as the radius to obtain the first circle. lon ,M lat ) as the center, and draw a circle with the distance Lmt from the target to the intersection M of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the radius to obtain a second circle. Obtain the intersection of the first circle and the second circle, calculate the longitude and latitude of the intersection, and determine the longitude and latitude of the target from the longitude and latitude of the intersection according to the pixel coordinates of the target.

[0098] In the embodiment of the present application, specifically, first calculate the distance D from the target to the camera; then calculate the longitude and latitude of the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view based on the distance D from the target to the camera; calculate the distance Lmt from the target to the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view; finally, calculate the longitude and latitude T of the target based on the longitude and latitude of the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the distance Lmt from the target to the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view. The embodiment of the present application can be applied to the positioning of target pedestrians in large supermarkets, unmanned supermarkets, stations, airports, tourist attractions and special security areas, and can also be applied to the trajectory tracking of the same target pedestrian. And the positioning of target pedestrians in the video stream supports large concurrent scenarios, can obtain the location information of target pedestrians in real time, and can adapt to the real-time positioning and trajectory tracking of massive target pedestrians.

[0099] In one embodiment, Figure 7 As shown, S272, calculating the distance D from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame, including:

[0100] S272a, obtaining a valid area in the video frame according to a vertical proportion coefficient of an invalid area in the video frame.

[0101] Among them, the vertical ratio of the invalid area in the video frame is f1, so the ratio of the valid area of ​​the video frame to the total area of ​​the video frame is 1-f1. Then the maximum vertical pixel value P in the valid area of ​​the video frame is obtained. y =(1-f1)×py. The resolution of the video frame is (px,py).

[0102] S272b, dividing the valid area in the video frame according to the vertical equal division coefficient of the video frame to obtain equal division areas.

[0103] Due to the depth of field of the video frame, it cannot be directly converted in geometric ratio. It is necessary to divide the effective area of ​​the video frame into three parts according to the vertical division coefficient of the video frame. Of course, the effective area of ​​the video frame can also be divided into other numbers of parts according to other vertical division coefficients of the video frame. For example, if the vertical division coefficient of the video frame is a ratio of four values, the effective area of ​​the video frame is divided into four parts accordingly according to the vertical division coefficient of the video frame. Fig. 8A As shown, the effective area of ​​the video frame is divided into three parts from top to bottom (or from far to near) according to the ratio of f2:f3:f4, and each part is an equally divided area in the actual space.

[0104] S272c, calculating the actual distance corresponding to a single pixel in each equally divided area according to the vertical equally divided coefficient of the video frame.

[0105] After the effective area of ​​the video frame is divided into three parts from top to bottom (or from far to near) in the ratio of f2:f3:f4, the actual distance corresponding to a single pixel in each equally divided area is calculated respectively.

[0106] Given the shooting distance length of the video frame where the target person is located, the actual distance represented by each pixel in each equally divided area can be obtained along the vertical pixel direction, that is:

[0107] d1=length / 3 / (f2×P y ),

[0108] d2=length / 3 / (f3×P y ),

[0109] d3=length / 3 / (f4×P y ).

[0110] S272d, obtain the equally divided area where the target is located, calculate the distance Dt from the target to the bottom of the video frame based on the equally divided area where the target is located and the actual distance corresponding to a single pixel in each equally divided area, and add the distance from the target to the bottom of the video frame to the horizontal distance of the blind spot to obtain the distance D from the target to the camera.

[0111] According to the pixel coordinates of the target (X t ,Y t ) Determine the equally divided area to which the target belongs. After the equally divided area to which the target belongs is obtained, calculate the distance Mt between the target and the top of the effective area of ​​the video frame, then the actual distance Dt of the target person from the bottom of the video frame = length - Mt.

[0112] like Fig. 8A As shown in the figure, if the pixel coordinates of the target (X t ,Y t) is located in the top third of the effective area of ​​the video frame, then Mt = d1 × Y t ;

[0113] If the pixel coordinates of the target (X t ,Y t ) is located in the middle one-third of the effective area of ​​the video frame, then Mt=length / 3+(Y t -f2 / (f2+f3+f4)×P y )×d2;

[0114] If the pixel coordinates of the target (X t ,Y t ) is located in the bottom one-third of the effective area of ​​the video frame, then Mt = 2×length / 3+(Y t -(f2+f3) / (f2+f3+f4)×P y )×d3.

[0115] Through the blind area distance blind and the distance Dt between the target person and the bottom of the video frame, the distance from the target to the camera can be calculated as: D=blind+Dt.

[0116] In the embodiment of the present application, the effective area in the video frame is first calculated, and then the effective area in the video frame is divided according to the vertical division coefficient of the video frame to obtain the equal-division area in the actual space, and then the actual distance corresponding to a single pixel in the equal-division area is calculated; finally, the equal-division area where the target is located is determined according to the pixel coordinates of the target, and the distance Dt from the target to the bottom of the video frame is calculated from the actual distance corresponding to a single pixel in the area, and then the distance D from the target to the bottom of the video frame plus the horizontal distance of the blind area is obtained. Thus, the distance D from the target to the camera is finally obtained from the pixel coordinates of the target.

[0117] In one embodiment, S274, calculating the longitude and latitude of the center point M of the horizontal line where the target is located in the video frame according to the distance D from the target to the camera includes:

[0118] The longitude and latitude of the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view are calculated according to the distance D from the target to the camera, the azimuth angle of the camera, and the longitude and latitude of the camera.

[0119] like Figure 8BAs shown in the figure, it is a schematic diagram of the target appearing in the camera field of view from another perspective. The distance D between the target and the camera, as well as the azimuth, longitude lon and latitude lat of the camera have been obtained above. Since point M and the target point are on the same horizontal line in the video frame, the distance from point M to the camera is also D. Using the principles of spatial geography and mathematical geometry, the longitude and latitude (M) of point M are calculated. lat ,M lon ) are as follows:

[0120] M lat =lat+sin(azimuth×π / 180)×r.

[0121] M lon =lon+cos(azimuth×π / 180)×r.

[0122] Where r = D / 111194.872221777, the unit is degree. In the WGS84 coordinate system, 1 degree is approximately equal to 111194.872221777 meters.

[0123] In the embodiment of the present application, since the target point and point M are on the same horizontal line in the video frame, that is, the vertical pixel value from point M to the bottom of the video frame is equal to the vertical pixel value from the target to the bottom of the video frame in the video frame, that is, the distance from point M and the target point to the camera is also equal, both D. Using the principles of spatial geography and mathematical geometry, the longitude and latitude of the point (M lat ,M lon ), and then calculate the longitude and latitude of the target based on the longitude and latitude of this point.

[0124] In one embodiment, Fig. 9A As shown, S276, calculating the distance Lmt from the target to the intersection M of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera, includes:

[0125] S276a, calculating the total distance Lxt of the horizontal line where the target is located in the video frame according to the minimum shooting width of the camera, the horizontal distance of the blind area, and the distance Dt from the target to the bottom of the video frame.

[0126] The minimum shooting width minwidth of the camera has been obtained above. Using the knowledge of similar triangles, the total distance Lxt of the horizontal line where the target is located in the video frame can be obtained. The specific formula is:

[0127] According to minwidth / Lxt=blind / (blind+Dt), we can obtain Lxt=minwidth×(blind+Dt) / blind.

[0128] The total distance of the horizontal line where the target is located in the video frame. At the same time, the total distance Lxt of the horizontal line where the target is located in the video frame is also the center point M (M lat ,M lon ) is the distance from the horizontal line.

[0129] S276b, calculates the horizontal distance Lmx from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view based on the total distance Lxt of the horizontal line where the target is located in the video frame, the resolution, and the horizontal pixel value of the target, and then calculates the distance Lmt from the target to the intersection M of the horizontal line where the target is located in the video frame and the vertical section of the field of view based on the spatial relationship.

[0130] After obtaining the total distance Lxt of the horizontal line where the target is located in the video frame, according to the video frame resolution pixel (P x ,P y ), the horizontal pixel value of the target X t According to the geometric principle, the horizontal distance Lmx between the target point and the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view can be calculated.

[0131] Lmx=Lxt / P x ×|(X t -P x / 2)|.

[0132] like Fig. 9B As shown, the distance Lmt from the target to the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated based on the spatial relationship.

[0133] In an embodiment of the present application, spatial geography and mathematical geometry principles are used to calculate the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view, so as to subsequently calculate the longitude and latitude of the target's location.

[0134] In one embodiment, Fig.10 As shown, S278, according to the longitude and latitude of the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the horizontal distance Lmx from the target to the intersection point of the horizontal line where the target is located in the video frame and the vertical section of the field of view, the longitude and latitude T of the target are calculated, including:

[0135] The first circle is obtained by taking the latitude and longitude of the camera as the center and the distance D from the target to the camera in the video frame as the radius;

[0136] The second circle is obtained by taking the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the center of the circle and taking the distance Lmt from the target to the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the radius;

[0137] Get the intersection of the first circle and the second circle, and calculate the longitude and latitude of the intersection;

[0138] The longitude and latitude of the intersection point corresponding to the target are determined from the longitude and latitude of the intersection point according to the pixel coordinates of the target.

[0139] Specifically, the large circle in the figure is the first circle, which is a circle with the latitude and longitude of the camera (lon, lat) as the center and the distance D from the target in the video frame to the camera as the radius. The small circle in the figure is the second circle, which is the intersection point M (M lon ,M lat ) as the center of the circle, with the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view (M lon ,M lat ) with a distance Lmt as the radius. The big circle and the small circle have two intersection points. The longitude and latitude corresponding to these two intersection points are represented in the figure as (T lat ,T lon ) and (T lon ',T lat '), one of the two intersection points is the point corresponding to the target. The video frame is displayed as a vertical line in a bird's-eye view. The horizontal pixel of the top point of the vertical line corresponding to the video frame is 0, and the horizontal pixel of the bottom point of the vertical line corresponding to the video frame is px. The edge of the field of view in the figure refers to the edge of the field of view angle. The calculation process of the latitude and longitude of the target is as follows:

[0140]

[0141]

[0142] or:

[0143]

[0144]

[0145] Among them, r1=D / L, r2=Lmt / L, L=111194.872221777, the unit is meter / degree. L means that 1 degree in the WGS84 coordinate system is approximately equal to 111194.872221777 meters.

[0146] After calculating the two sets of longitude and latitude, the longitude and latitude of the intersection corresponding to the target are determined from the longitude and latitude of the intersection according to the pixel coordinates of the target. Specifically, the up-down (or left-right) relationship of the two intersections can be judged by the coordinate values ​​of the two sets of longitude and latitude. The larger the longitude value, the closer the intersection is to the right, and the larger the latitude value, the closer the intersection is to the top. After obtaining the corresponding relationship between the two sets of longitude and latitude and the two intersections, the video frame is divided into two based on the position of the camera facing the target direction. The target T1 that appears on the left side of the video frame corresponds to the upper intersection, that is, the horizontal pixel coordinates of the target are between (0, px / 2), the target appears on the left side of the video frame and corresponds to the upper intersection, and then the longitude and latitude of the target are obtained. The target T2 that appears on the right side of the video frame corresponds to the lower intersection. That is, the horizontal pixel coordinates of the target are between (px / 2, px), the target appears on the right side of the video frame and corresponds to the lower intersection, and then the longitude and latitude of the target are obtained.

[0147] In the embodiment of the present application, a circle is drawn with the latitude and longitude of the camera as the center and the distance D from the target to the camera as the radius, with the intersection point M (M) of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the center. lon ,M lat ) as the center of the circle, and draw a circle with the distance Lmt from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the radius. Calculate the longitude and latitude of the intersection of the two circles, and then select an intersection as the target point according to the size of the longitude and latitude of the two intersections and the pixel coordinates of the target in the video frame. The longitude and latitude of the intersection is the longitude and latitude of the target. This calculation method has higher accuracy and a simpler calculation process, which improves the efficiency of the calculation.

[0148] Traditional positioning systems have large positioning errors in small-scale scenes near the ground. This method does not rely on traditional positioning systems and terminal devices, but uses geographic space and mathematical geometry principles to perform precise calculations based on the pixel coordinates of the target, the parameters of the camera, and the parameters of the video frame, and converts the pixel coordinates of the target in the image into spatial coordinates, that is, the longitude and latitude of the target to achieve positioning. Because the use of geographic space and mathematical geometry principles can perform precise calculations, the accuracy of target positioning in small-scale scenes near the ground is greatly improved.

[0149] It should be understood that the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, but these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless there is a clear description in this article, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these sub-steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0150] In one embodiment, Fig.11 As shown, a target positioning device 1100 is provided, comprising:

[0151] The video frame acquisition module 1102 is used to acquire the video frame captured by the camera;

[0152] The target pixel coordinate acquisition module 1104 is used to acquire the pixel coordinates of the target from the video frame;

[0153] A parameter acquisition module 1106 is used to acquire parameters of the camera and parameters of the video frame, wherein the parameters of the video frame include parameters in the video frame used to calculate the distance from the target to the camera;

[0154] The target longitude and latitude calculation module 1108 is used to calculate the longitude and latitude of the target according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame;

[0155] The target positioning module 1110 is used to locate the target according to the longitude and latitude of the target.

[0156] In one embodiment, the target pixel coordinate acquisition module 1104 is also used for targets including target persons, and obtains the pixel coordinates of the target person from the video frame through a convolutional neural network, where the pixel coordinates include horizontal pixel values ​​and vertical pixel values.

[0157] In one embodiment, the target latitude and longitude calculation module 1108 includes:

[0158] A target-to-camera distance calculation unit, used to calculate the distance D from the target to the camera based on the pixel coordinates of the target, the camera parameters and the video frame parameters;

[0159] The latitude and longitude calculation unit of the intersection point is used to calculate the longitude and latitude of the intersection point of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the distance D from the target to the camera;

[0160] A distance calculation unit from the target to the intersection point is used to calculate the distance Lmt from the target to the intersection point of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera;

[0161] The target latitude and longitude calculation unit is used to calculate the target's latitude and longitude T according to the latitude and longitude M of the intersection of the target's horizontal line and the vertical section of the field of view in the video frame and the distance Lmt from the target to the intersection of the target's horizontal line and the vertical section of the field of view in the video frame.

[0162] In one embodiment, the target-to-camera distance calculation unit is further used to obtain a valid area in the video frame according to a vertical proportion coefficient of an invalid area in the video frame;

[0163] Divide the effective area in the video frame according to the vertical division coefficient of the video frame to obtain equal division areas;

[0164] Calculate the actual distance corresponding to a single pixel in the divided area according to the vertical division coefficient of the video frame;

[0165] Get the equally divided area where the target is located, calculate the distance Dt from the target to the bottom of the video frame according to the actual distance corresponding to a single pixel in the equally divided area where the target is located, and add the distance from the target to the bottom of the video frame to the horizontal distance of the blind spot to get the distance D from the target to the camera.

[0166] In one embodiment, the intersection longitude and latitude calculation unit is also used to calculate the longitude and latitude of the intersection M of the horizontal line where the target is located in the video frame and the vertical section of the field of view based on the distance D from the target to the camera, the azimuth of the camera, and the longitude and latitude of the camera.

[0167] In one embodiment, the target-to-intersection distance calculation unit is further used to calculate the total distance Lxt of the horizontal line where the target is located in the video frame according to the minimum shooting width of the camera, the horizontal distance of the blind area, and the distance Dt from the target to the bottom of the video frame;

[0168] The horizontal distance Lmx from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated based on the total distance Lxt of the horizontal line where the target is located in the video frame, the resolution, and the horizontal pixel value of the target. Then, the distance Lmt from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated based on the spatial relationship.

[0169] In one embodiment, the target longitude and latitude calculation unit is further used to draw a circle with the longitude and latitude of the camera as the center and a radius of the distance D between the target and the camera in the video frame to obtain a first circle;

[0170] A second circle is obtained by taking the intersection point M of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the center of the circle and taking the distance Lmt from the target to the intersection point of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the radius;

[0171] Get the intersection of the first circle and the second circle, and calculate the longitude and latitude of the intersection;

[0172] The longitude and latitude of the intersection point corresponding to the target are determined from the longitude and latitude of the intersection point according to the pixel coordinates of the target.

[0173] Fig.12 The internal structure diagram of a computer device in one embodiment is shown. The computer device may specifically be Figure 1 The server 120 in FIG. Fig.12 As shown, the computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the memory includes a non-volatile storage medium and an internal memory. The non-volatile storage medium of the computer device stores an operating system and may also store a computer program. When the computer program is executed by the processor, the processor can implement the above-mentioned target positioning method. The internal memory may also store a computer program. When the computer program is executed by the processor, the processor can execute the above-mentioned target positioning method.

[0174] Those skilled in the art will understand that Fig.12 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.

[0175] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the target positioning method described above. The steps of the target positioning method here may be the steps of the target positioning method in each of the above embodiments.

[0176] In one embodiment, a computer readable storage medium is provided, which stores a computer program, and when the computer program is executed by a processor, the processor executes the steps of the target positioning method described above. The steps of the target positioning method here can be the steps of the target positioning method in each of the above embodiments.

[0177] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiments can be completed by instructing the relevant hardware through a computer program, and the program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in the present application can include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).

[0178] The technical features of the above-described embodiments may be arbitrarily combined. To make the description concise, not all possible combinations of the technical features in the above-described embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0179] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.

Claims

1. A target positioning method, comprising: Get the video frame captured by the camera; Obtaining pixel coordinates of a target from the video frame; Acquire parameters of the camera and parameters of the video frame, wherein the parameters of the video frame include parameters in the video frame used to calculate the distance from the target to the camera; Calculating the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame; Calculate the longitude and latitude of the intersection of the horizontal line where the target is located and the vertical section of the field of view in the video frame according to the distance from the target to the camera; Calculate the distance between the target and the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera; Calculate the longitude and latitude of the target according to the longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view; The target is located according to the latitude and longitude of the target.

2. The method according to claim 1, characterized in that Said targets include target persons; The pixel coordinates include a horizontal pixel value and a vertical pixel value.

3. The method according to claim 2, characterized in that The parameters of the camera include the installation parameters and its own parameters. The installation parameters include the latitude and longitude, altitude, azimuth, pitch angle, shooting distance, minimum shooting width, maximum shooting width and horizontal distance of the blind spot of the camera; the own parameters include the field of view angle and resolution, and the parameters of the video frame include the vertical proportion coefficient of the invalid area in the video frame and the vertical division coefficient of the video frame.

4. The method according to claim 3, characterized in that The calculating the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame includes: Acquire a valid area in the video frame according to a vertical proportion coefficient of an invalid area in the video frame; Dividing the effective area in the video frame according to the vertical equal division coefficient of the video frame to obtain equal division areas; Calculate the actual distance corresponding to a single pixel in the divided area according to the vertical division coefficient of the video frame; Obtain the equally divided area where the target is located, calculate the distance from the target to the bottom of the video frame according to the actual distance corresponding to a single pixel in the equally divided area where the target is located, and add the distance from the target to the bottom of the video frame to the horizontal distance of the blind spot to obtain the distance from the target to the camera.

5. The method according to claim 1, characterized in that The step of calculating the longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the distance from the target to the camera includes: The longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view are calculated according to the distance from the target to the camera, the azimuth of the camera, and the longitude and latitude of the camera.

6. The method according to claim 3, characterized in that: The step of calculating the distance from the target to the intersection of a horizontal line where the target is located in a video frame and a vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera includes: Calculate the total distance of the horizontal line where the target is located in the video frame according to the minimum shooting width of the camera, the horizontal distance of the blind area, and the distance from the target to the bottom of the video frame; The horizontal distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated according to the total distance of the horizontal line where the target is located in the video frame, the resolution, and the horizontal pixel value of the target. Then, the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view is calculated according to the spatial relationship.

7. The method according to claim 1, characterized in that Calculating the longitude and latitude of the target according to the longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view includes: Draw a circle with the position of the camera as the center and the distance from the target to the camera in the video frame as the radius to obtain a first circle; Draw a circle with the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the center and the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view as the radius to obtain a second circle; Obtaining an intersection point between the first circle and the second circle, and calculating the longitude and latitude of the intersection point; The longitude and latitude of the target are determined from the longitude and latitude of the intersection according to the pixel coordinates of the target.

8. A target positioning device, characterized in that: The device comprises: A video frame acquisition module is used to acquire the video frames captured by the camera; A target pixel coordinate acquisition module, used to acquire the pixel coordinates of the target from the video frame; A parameter acquisition module, used to acquire parameters of the camera and parameters of the video frame, wherein the parameters of the video frame include parameters in the video frame used to calculate the distance from the target to the camera; A target latitude and longitude calculation module, used to calculate the distance from the target to the camera according to the pixel coordinates of the target, the parameters of the camera and the parameters of the video frame; calculate the longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the distance from the target to the camera; calculate the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view according to the pixel coordinates of the target and the parameters of the camera; calculate the longitude and latitude of the target according to the longitude and latitude of the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view and the distance from the target to the intersection of the horizontal line where the target is located in the video frame and the vertical section of the field of view; The target positioning module is used to locate the target according to the longitude and latitude of the target.

9. A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor is caused to perform the steps of the method according to any one of claims 1 to 7.

10. A computer device comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the method according to any one of claims 1 to 7.