Method and device for determining the distance of a target object based on surveillance video

Through surveillance video image processing, combined with camera parameters and slope information, the distance of the target object is calculated, which solves the problems of high cost and unsuitability for slope scenes in the existing technology, and achieves low-cost, real-time target object distance determination, which is suitable for a wide range of applications. application.

CN118200479BActive Publication Date: 2024-10-22SUZHOU YIJI INTELLIGENT TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410204052.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-02-23
Publication Date
2024-10-22
Estimated Expiration
2044-02-23

AI Technical Summary

Technical Problem

In the existing technology, the method of determining the distance of a target object relative to a monitoring device in a monitoring scene is costly and unsuitable for scenes containing slopes, especially when real-time performance and wide application are required.

Method used

By acquiring the surveillance video image, the image position information of the target object is identified, and combined with the camera's photosensitive element size, field of view angle and installation height, the angle between the vertical projection line and the horizontal projection line of the target object relative to the camera is calculated, combined with the slope The slope and camera distance are used to determine the first and second axial distances of the target object.

Benefits of technology

It achieves low-cost, real-time determination of target object distance in scenes including slopes, is suitable for a wide range of applications, and has cost advantages and a wider application range than radar ranging.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118200479B_ABST
    Figure CN118200479B_ABST
Patent Text Reader

Abstract

The present application relates to a method, device, computer equipment, storage medium and computer program product for determining the distance of a target object based on a surveillance video. The method comprises: identifying the image position information of a target object in a surveillance video image of a target scene containing a slope, and determining the imaging position information of the target object in a photosensitive element; determining the vertical projection line angle and the horizontal projection line angle of the target object according to the field of view angle, vertical azimuth angle and imaging position information of the camera; determining the first axial distance of the target object relative to the camera according to the vertical projection line angle, the installation height of the camera, the slope of the slope, and the distance between the slope and the camera, and determining the second axial distance according to the first axial distance and the horizontal projection line angle. The present method can realize the determination of the distance of a target object relative to the camera in a surveillance scene containing a slope based on a surveillance video, and has the effects of low cost, strong real-time performance and wide application range.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of image processing technology, and in particular to a method, apparatus, computer equipment, storage medium and computer program product for determining the distance of a target object based on a surveillance video. Background Art

[0002] Video surveillance has been widely used in the security field due to its advantages of high reliability, strong timeliness, and easy viewing. In some scenarios, it is necessary to determine the distance of the target (such as a person, a car, etc.) in the monitoring scene relative to the monitoring equipment to achieve the geographic positioning of the target. In related technologies, the radar ranging method can be used to determine the distance of the target relative to the monitoring camera or other monitoring equipment, but the cost is relatively high. Summary of the invention

[0003] Based on this, it is necessary to provide a method, device, computer equipment, computer-readable storage medium and computer program product for determining the distance of a target object relative to a monitoring device (camera) based on a monitoring video to address the above-mentioned technical problems. The method is particularly suitable for monitoring scenarios involving slopes, and has low cost, strong real-time performance and a wide range of applications.

[0004] In a first aspect, the present application provides a method for determining the distance of a target object based on a surveillance video. The method comprises:

[0005] Acquire a surveillance video image of a target scene shot by a camera, identify a target object contained in the surveillance video image, and obtain image position information of the target object in the surveillance video image; the target scene contains a slope;

[0006] Determining imaging position information of the target object in the photosensitive element according to the image position information and size information of the photosensitive element of the camera;

[0007] According to the field of view angle, vertical azimuth angle of the camera and the imaging position information of the target object in the photosensitive element, the vertical projection line angle γ of the target object relative to the camera is determined. V Angle γ with the horizontal projection line H ;

[0008] According to the vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and determining the first axial distance L of the target object relative to the camera TX , and according to the first axial distance L TX The angle γ between the horizontal plane projection line and H , determine the second axial distance L of the target object relative to the cameraTY .

[0009] In one embodiment, the vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and determining the first axial distance L of the target object relative to the camera TX ,include:

[0010] Determine a matching first axial distance determination strategy according to the type of the slope; the type of the slope includes an upward slope and a downward slope;

[0011] According to the vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and the matching first axial distance determination strategy, to determine the first axial distance L0 of the target object relative to the camera TX .

[0012] In one embodiment, the first axial distance determination strategy matching the upward slope is to calculate the first axial distance L of the target object relative to the camera according to a first formula: TX ;

[0013] The first formula is:

[0014] In one embodiment, the first axial distance determination strategy matching the downward slope is to calculate the first axial distance L of the target object relative to the camera according to the second formula: TX ;

[0015] The second formula is:

[0016] In one embodiment, the method further comprises:

[0017] determining whether the target object is located on the slope;

[0018] In the case where the target object is located on the slope, the first axial distance determination strategy step of determining matching according to the type of the slope is performed.

[0019] In one embodiment, determining whether the target object is located on the slope includes:

[0020] If the vertical projection line angle γ V is greater than or equal to 90°, it is determined that the target object is located on the slope;

[0021] If the vertical projection line angle γ V If it is less than 90°, then calculate the vertical projection line angle γ V The tangent value of tanγ V and the camera installation height h c and when the product is greater than the distance L0 between the slope and the camera, it is determined that the target object is located on the slope.

[0022] In one embodiment, the method further comprises:

[0023] When the product is less than or equal to the distance L0 between the slope and the camera, the product is determined as the first axial distance L0 between the target object and the camera. TX .

[0024] In a second aspect, the present application also provides a device for determining the distance of a target object based on a surveillance video. The device comprises:

[0025] The recognition module is used to obtain a surveillance video image of a target scene shot by a camera, identify a target object contained in the surveillance video image, and obtain image position information of the target object in the surveillance video image; the target scene contains a slope;

[0026] A first determining module, configured to determine imaging position information of the target object in the photosensitive element according to the image position information and size information of the photosensitive element of the camera;

[0027] The second determination module is used to determine the vertical projection line angle γ of the target object relative to the camera according to the field of view angle, vertical azimuth angle of the camera and the imaging position information of the target object in the photosensitive element. V Angle γ with the horizontal projection line H ;

[0028] The third determination module is used to determine the vertical projection line angle γ according to the vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and determining the first axial distance L of the target object relative to the camera TX , and according to the first axial distance L TX The angle γ between the horizontal plane projection line and H , determine the second axial distance L of the target object relative to the camera TY .

[0029] In a third aspect, the present application further provides a computer device, wherein the computer device comprises 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 described in the first aspect are implemented.

[0030] In a fourth aspect, the present application further provides a computer-readable storage medium, wherein a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0031] In a fifth aspect, the present application further provides a computer program product, wherein the computer program product comprises a computer program, and when the computer program is executed by a processor, the steps of the method described in the first aspect are implemented.

[0032] The above method, device, computer equipment, storage medium and computer program product for determining the distance of a target object based on a surveillance video, by identifying the image position information of the target object in the surveillance video image, and then determining the imaging position information of the target object in the photosensitive element according to the image position information and the size information of the photosensitive element of the camera, and then determining the vertical projection line angle γ of the target object relative to the camera based on the field of view angle, vertical azimuth angle and the imaging position information of the camera. V Angle γ with the horizontal projection line H , so that the vertical projection line angle γ V , horizontal plane projection line angle γ H 、Camera installation height h c , the slope of the slope δ, the distance L0 between the slope and the camera, determine the first axial distance L of the target object relative to the camera TX and the second axial distance L TY Thus, it is possible to determine the distance of a target object in a monitoring scene containing a slope relative to a monitoring camera based on a monitoring video, which can be used to locate the geographic location of the target object. Compared with the radar ranging method, this method has lower cost and is highly real-time and has a wide range of applications. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A schematic diagram of a flow chart of a method for determining a distance of a target object based on a surveillance video in one embodiment;

[0034] Figure 2a This is a schematic diagram of an application scenario in an example;

[0035] Figure 2b is a schematic diagram of an imaging plane of a camera in an example;

[0036] Figures 3 to 5 is a schematic diagram of the vertical projection of the camera field of view, where Figure 3 is the angle between the upward slope and the vertical projection line γ V For scenes with an angle less than 90°, Figure 4 is the angle between the upward slope and the vertical projection line γ V For scenes with an angle greater than 90°, Figure 5 For the downhill slope scenario;

[0037] Figure 6 It is a schematic diagram of the horizontal plane projection of the camera field of view;

[0038] Figure 7 is a structural block diagram of a device for determining a distance of a target object based on a surveillance video in one embodiment;

[0039] Figure 8 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION

[0040] 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.

[0041] In one embodiment, Figure 1 As shown, a method for determining the distance of a target object based on a surveillance video is provided, and the method can be applied to computer devices such as servers and terminals. In this embodiment, the method includes the following steps:

[0042] Step 101: obtain a surveillance video image of a target scene shot by a camera, identify a target object contained in the surveillance video image, and obtain image position information of the target object in the surveillance video image.

[0043] The target scene includes a slope, which may be an upward slope or a downward slope (relative to the installation position of the camera), and the distance L0 between the slope and the camera, the slope gradient δ, and the type of the slope may be pre-calibrated. It is understandable that the camera may be installed on a flat ground at a certain distance from the slope, in which case L0 is greater than 0, or may be installed at the starting point of the slope or on the slope, in which case L0 is equal to 0.

[0044] like Figure 2a In the application scenario shown, there is a target object T on the upward slope in front of the camera O. At this time, T will be imaged at T' in the imaging plane of the camera's photosensitive element (for ease of display, the imaging plane is equivalent to the front of the camera center point, and the length of the line OC connecting the camera center point O and the imaging plane center point C is equal to the focal length). Figure 2b A front view of the imaging plane is shown.

[0045] The cameras usually used to shoot surveillance videos are installed at a certain height, that is, with an installation height of h. c , and the field of view can cover the target scene to be photographed. After installing and debugging the camera, the field of view of the camera can be determined (such as the vertical field of view angle α V , horizontal field of view angle α H etc.), vertical azimuth β V , the size information of the photosensitive element (the total height H and total width W of the photosensitive target surface, or the unit size dH, dW of the pixel and / or the number of pixels in each row and column) and other parameters. The vertical azimuth angle β of the camera V Refers to the angle between the central axis r of the camera (the central axis of the field of view, the optical axis of the lens) and the central vertical line of the camera (the line connecting the center point O of the camera and the ground projection O', which is perpendicular to the horizontal plane). If the camera is shooting horizontally, that is, the pitch angle of the camera is 0°, then the vertical azimuth angle is 90°; if it is shooting from above, the vertical azimuth angle is less than 90°; if it is shooting from below, the vertical azimuth angle is greater than 90°.

[0046] The camera can send the surveillance video image of the target scene to the server, and the server can use the pre-trained target detection model to identify the target object contained in the surveillance video image and obtain the image position information of the target object in the surveillance video image. For example, the pixel coordinates (u T ,v T ) as the image position information of the target object. The image position information can be used to determine the imaging position information of the target object in the photosensitive element.

[0047] It is understandable that the camera can be a single-lens camera or a multi-lens camera. If it is a multi-lens camera, the target can be identified based on the surveillance video image taken by each lens and the distance can be calculated separately. It is also possible to identify the target based on the fused image corresponding to the multi-lens camera (obtained by splicing and fusing the local images taken by each lens), and fit the single-lens virtual camera corresponding to the fused image, and calculate the distance of the target object relative to the camera based on the relevant parameters of the virtual camera (vertical field of view angle, horizontal field of view angle, vertical azimuth angle, size information of the photosensitive element, etc.).

[0048] Step 102: Determine the imaging position information of the target object in the photosensitive element according to the image position information and the size information of the photosensitive element of the camera.

[0049] In implementation, the server performs target recognition on the surveillance video image, and after obtaining the position of the target object T in the image, it can further determine its imaging position information in the photosensitive element based on the size information of the photosensitive element. The imaging position information can reflect the physical distance between the imaging position of the target object in the photosensitive element and the boundary or bisector of the photosensitive element (or imaging plane).

[0050] For example, the server can calculate the pixel coordinates (u T ,v T ) and the pixel unit height dH, pixel unit width dW, and total height H of the photosensitive element, calculate the distance between the imaging position T' of the target object and the left edge of the photosensitive element (which can be recorded as W T ) and the distance to the lower boundary of the photosensitive element (which can be recorded as H T ), where W T =dW×u T , H T =H-dH×v T .

[0051] Since the surveillance video image may be a compressed image, in order to accurately calculate the imaging position of the target object on the photosensitive element, the pixel coordinates can be normalized. For example, if the pixel resolution of the image is m*n, the pixel coordinates of the target object are (u T ,v T ), then the normalized coordinates (u′ T ,v′ T ), u′ T =u T / m,v′ T =v T / n, as the image position information of the target object, and then the H of the target object can be calculated based on the normalized coordinates and the total width W and total height H of the photosensitive element. T and W T , where W T =W×u′ T , H T =H×(1-v′ T ).

[0052] Step 103, based on the camera's field of view angle and vertical azimuth angle β V and the imaging position information of the target object in the photosensitive element to determine the vertical projection line angle γ of the target object relative to the camera V Angle γ with the horizontal projection line H .

[0053] The plane formed by the central axis r of the camera and the central vertical line OO' is perpendicular to the horizontal plane and can be called a vertical plane. The projection line of the vertical plane on the horizontal plane is in the same direction as the horizontal projection line r' of the central axis r. V Refers to the projection line OT of the spatial connection line between the camera center point O and the target object T on the aforementioned vertical plane V (That is, the projection point T of the camera center point O and the target object T on the vertical plane V The angle between the horizontal projection line and the central vertical line OO'. H Refers to the projection line O'T of the space connecting the camera center point O and the target object T on the horizontal plane H (That is, the ground projection O' of the camera center point and the projection point T of the target object T on the horizontal plane where O' is located H The angle between the line connecting the central axis r and the projection line r' of the central axis r on the horizontal plane.

[0054] In implementation, the vertical field of view angle α of the camera can be V and / or horizontal field of view angle α H , vertical azimuth β V The image position information of the target object in the photosensitive element, as well as the size information of the photosensitive element (such as total width W and total height H), calculate the vertical projection line angle γ V Angle γ with the horizontal projection line H .

[0055] like Figure 2a , Figure 3 , Figure 6 As shown, Figure 3 2 shows a schematic diagram of the vertical projection of the camera field of view, Figure 6 Schematic diagram of horizontal plane projection of camera field of view is shown. In the figure, O' is the ground projection of the center point of camera O, and the length of line segment OO' is equal to the installation height of camera O (the distance from the ground) h c The central axis r intersects the imaging plane at point C (the center point of the photosensitive element), and the length of the line segment OC is equal to the focal length. Points A' and B' are the center points of the upper and lower boundaries of the imaging plane, respectively, and points D' and E' are the center points of the left and right boundaries of the imaging plane, respectively. The angle between rays OA' and OB' is the vertical field angle α V , the angle between rays OD' and OE' is the horizontal field of view angle α H Tv is the projection of the target object T on the vertical plane, T H is the projection of the target object T on the horizontal plane. Figure 3 Point A in is the projection point of the intersection line of the lower boundary of the camera's field of view and the ground (on flat ground) on the vertical plane, and point B is the vertical projection point of the intersection line of the upper boundary of the camera's field of view and the ground (on the slope). Figure 6 Points A”, B”, D” and E” are the projections of the four boundary center points of the imaging plane on the horizontal plane, point C’ is the projection of the center point of the imaging plane on the horizontal plane, T” is the projection of the imaging point T’ of the target object in the imaging plane on the horizontal plane, T V ″ is the projection point T of the imaging point T' on the vertical plane V ’ is the horizontal projection of .

[0056] As shown in the figure, we can see that:

[0057]

[0058]

[0059]

[0060] like That is, the target object is located in the lower half of the image (that is, the imaging position of the target object is below the horizontal bisector of the imaging plane), then

[0061] like That is, the target object is located in the upper half of the image (that is, the imaging position of the target object is above the horizontal bisector of the imaging plane), then

[0062] like Then γ V =β V .

[0063] The vertical projection angle γ of the target object T relative to the camera can also be calculated according to other formulas: V , for example, we can deduce from the law of cosines:

[0064]

[0065] It follows that:

[0066]

[0067] Angle of horizontal projection line γ H It can be calculated according to the following formula:

[0068]

[0069]

[0070]

[0071] Among them, when the vertical azimuth angle β of the camera V =90°, we know

[0072] It can be understood that the imaging position information used in the above example is the distance W between the imaging position T' of the target object and the left edge of the photosensitive element. T And the distance H from the lower edge of the photosensitive element T In some other examples, the vertical projection line angle γ can also be calculated by using the distance between the imaging position T' of the target object and the right boundary of the photosensitive element (imaging plane), the distance between the upper boundary, the distance between the horizontal bisector of the imaging plane, or the distance between the vertical bisector of the imaging plane. V Angle γ with the horizontal projection line H .

[0073] Step 104: according to the vertical projection line angle γ V 、Camera installation height h c , the slope of the slope δ, the distance L0 between the slope and the camera, determine the first axial distance L of the target object relative to the camera TX , and according to the first axial distance L TX Angle γ with the horizontal projection line H , determine the second axial distance L of the target object relative to the camera TY .

[0074] In practice, in order to facilitate the positioning of the target object according to the distance of the target object relative to the camera, a coordinate system (such as a two-dimensional coordinate system, a three-dimensional coordinate system) can be established with the camera O as the origin, and then the distance of the target object relative to each axis of the camera can be determined respectively. As shown in FIG. 2, the three-dimensional coordinate system is established, wherein the X-axis and the Y-axis are parallel to the horizontal plane, the Z-axis is perpendicular to the horizontal plane, and the X-axis is in the same direction (parallel) as the horizontal projection line r' (projection line on the horizontal plane) of the central axis r of the camera O, and the Y-axis is perpendicular to the horizontal projection line r' of the central axis r of the camera O. The plane formed by the X-axis and the Z-axis is the vertical plane of the camera or a plane parallel to the vertical plane. It can be understood that when positioning a target located on the ground (flat or slope), the longitude and latitude information can be used as the geographical location information. Therefore, when establishing the camera coordinate system, only the two-dimensional coordinate system of the X-axis and the Y-axis can be used.

[0075] In this embodiment, the first axial direction refers to the X-axis direction, that is, the direction of the horizontal projection line of the central axis of the camera. The first axial distance L TX That is, the X coordinate of the target object in the camera coordinate system. The second axis refers to the Y axis direction, that is, the direction of the horizontal line perpendicular to the horizontal projection line of the camera center axis (parallel to the horizontal plane and perpendicular to the horizontal projection line of the center axis). The second axial distance L TYThat is, it corresponds to the Y coordinate of the target object in the camera coordinate system. The positive or negative sign of the Y coordinate of the target object can be determined according to the position (left or right) of the imaging position of the target object relative to the imaging plane or relative to the perpendicular bisector of the monitoring video image.

[0076] The server can determine a matching first axial distance calculation formula according to the type of slope (upward slope or downward slope), and then calculate the first axial distance L of the target object relative to the camera according to the matching first axial distance calculation formula. TX .

[0077] Specifically, when the slope is an upward slope (such as Figure 3 and Figure 4 The first axial distance L can be calculated according to the following formula: TX :

[0078]

[0079] In the case of a downward slope (such as Figure 5 The scene shown in the figure has a vertical projection line angle γ of the target object in this scene. V The first axial distance L can be calculated according to the following formula: TX :

[0080]

[0081] The derivation process of the first formula is as follows:

[0082] If the vertical projection line angle γ V Less than 90°, such as Figure 3 As shown, we can know:

[0083] O′M=h c ×tanγ V

[0084] PM=O′M-L0=h c ×tanγ V -L0

[0085] ∠MT V N=γ V

[0086] T V N=MN×cot∠MT V N=(PM-PN)×cotγ V

[0087] PN=T V N×cotδ=(PM-PN)×cotγ V ×cotδ

[0088] =PM×cotγ V ×cotδ-PN×cotγ V ×cotδ

[0089]

[0090]

[0091] If the vertical projection line angle γ V Greater than 90°, such as Figure 4 As shown, we can know:

[0092] ∠JOT V =γ V -90°

[0093] OG=L0+h c ×cotδ

[0094] T V J=GJ×tanδ=(OJ-OG)tanδ=OJ×tanδ-OG×tanδ

[0095] T V J=OJ×tan∠JOT V

[0096] OJ×tanδ-OG×tanδ=OJ×tan∠JOT V

[0097]

[0098] If the vertical projection line angle γ V is equal to 90°, then cotγ V =0, It can be seen that the first formula can be applied to the entire scene of the upward slope, and the formula is applicable regardless of whether the camera is shooting upward, downward or horizontally, that is, it does not limit the size of the vertical azimuth angle of the camera. Therefore, the formula has a wide range of applicability and is universal. The formula is simple, which can improve calculation efficiency and reduce calculation consumption.

[0099] The derivation process of the second formula is as follows: Figure 5 As shown, we can know:

[0100] O′M=h c ×tanγ V

[0101] PM=O′M-L0=h c ×tanγ V -L0

[0102] ∠MT V N=γV

[0103] T V N=MN×cot∠MT V N=(PN-PM)×cotγ V =PN×cotγ V -PM×cotγ V

[0104] T V N=PN×tanδ

[0105] PN×cotγ V -PM×cotγ V =PN×tanδ

[0106]

[0107]

[0108] It can be understood that if the field of view of the camera does not cover the flat ground between the slope and the camera, that is, the detected target object may only be located on the slope, then the vertical projection line angle γ can be directly used to calculate the target object. V 、Camera installation height h c , the slope of the slope δ, the distance L0 between the slope and the camera, determine the first axial distance L of the target object relative to the camera TX .

[0109] In some embodiments, if the camera's field of view also covers the flat ground between the slope and the camera, and the target object may also appear on the flat ground, it is possible to first determine whether the target object is located on the slope. For example, it is possible to determine whether the target object is located on the slope based on the user's annotations, or based on the vertical projection line angle γ V 、Camera installation height h c and the distance L0 between the slope and the camera to determine whether the target object is located on the slope. Specifically, if the vertical projection line angle γ V is greater than or equal to 90°, it can be determined that the target object is located on the slope; if the vertical projection line angle γ V If it is less than 90°, the vertical projection line angle γ can be calculated V The tangent value of tanγ V and the camera installation height h c The product of (h c ×tanγ V ), compare the product with the distance L0 between the slope and the camera, and determine whether the target object is located on the slope based on the comparison result. c ×tanγ VIf the distance L is greater than the distance L0, it can be determined that the target object is located on the slope, and the first axial distance L can be calculated using the first formula or the second formula. TX If the product h c ×tanγ V is less than or equal to the distance L0 between the slope and the camera, that is, the target object is located on the flat ground between the camera and the slope. In this case, the product h can be directly c ×tanγ V Determined as the first axial distance L of the target object relative to the camera TX .

[0110] Then, the server can be based on the first axial distance L TX Angle γ with the horizontal projection line H , calculate the second axial distance L of the target object relative to the camera TY , the calculation formula can be shown as follows:

[0111] L TY =L TX ×tanγ H

[0112] like Figure 6 As shown, we can know that: L TY =T H N=O′N×tanγ H =L TX ×tanγ H .

[0113] Thus, the first axial distance L of the target object T relative to the camera can be obtained: TX and the second axial distance L TY , so that the X coordinate and Y coordinate of the target object T in the camera coordinate system can be obtained (X T ,Y T ), where X T =L TX , Y T =L TY (When the imaging position of the target object T is in the right half of the image) or Y T =-L TY (When the imaging position of the target object T is in the left half of the image). Then, according to the geographical location of the camera (such as longitude and latitude information), the coordinates (X T ,Y T ) is converted into longitude and latitude information to obtain the geographic location of the target object. The conversion process can adopt existing methods, which will not be repeated here.

[0114] Optionally, the first axial distance L of the target object T relative to the camera may be used. TX, Camera installation height and vertical projection line angle γ V , calculate the vertical distance L of the target object T relative to the camera O TZ , we can get the Z coordinate Z T Specifically, the vertical distance can be calculated using the following formula: L TZ =|L TX ×cotγ V |. It can be seen that when γ V =90°, Z T =L TZ = 0, indicating that the target object T is at the same height as the camera O; when γ V <90°, Z T =L TZ >0, indicating that the position of the target object T is lower than the camera; when γ V >90°, Z T =-L TZ <0, indicating that the position of the target object T is higher than the camera. Thus, the coordinates (X T ,Y T ,Z T ) in order to more accurately locate the geographic spatial position of the target object, and to calculate the straight-line distance between the target object T and the camera based on the coordinates.

[0115] The above-mentioned method for determining the distance of the target object based on the surveillance video can realize the determination of the distance and position of the target object in the surveillance scene containing the slope relative to the camera based on the surveillance video through simple calculation, and then the geographic location of the target object can be determined based on the geographic location of the camera and the various axial distances of the target object relative to the camera, thereby realizing the geographic positioning of the target object. Compared with radar ranging or other positioning methods, this method has the effects of low cost, strong real-time performance and wide application range.

[0116] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these 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 steps or stages in other steps.

[0117] Based on the same inventive concept, the embodiment of the present application also provides a device for determining the distance of a target object based on a surveillance video for implementing the method for determining the distance of a target object based on a surveillance video involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations of one or more embodiments of the device for determining the distance of a target object based on a surveillance video provided below can refer to the limitations of the method for determining the distance of a target object based on a surveillance video above, and will not be repeated here.

[0118] In one embodiment, Figure 7 As shown, a device 700 for determining the distance of a target object based on a surveillance video is provided, comprising: an identification module 701, a first determination module 702, a second determination module 703 and a third determination module 704, wherein:

[0119] The identification module 701 is used to obtain a surveillance video image of a target scene shot by a camera, identify a target object contained in the surveillance video image, and obtain image position information of the target object in the surveillance video image; the target scene includes a slope.

[0120] The first determination module 702 is used to determine the imaging position information of the target object in the photosensitive element according to the image position information and the size information of the photosensitive element of the camera.

[0121] The second determination module 703 is used to determine the vertical projection line angle γ of the target object relative to the camera according to the field of view angle, vertical azimuth angle of the camera and the imaging position information of the target object in the photosensitive element. V Angle γ with the horizontal projection line H .

[0122] The third determining module 704 is used to determine the vertical projection line angle γ according to the vertical projection line angle γ. V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and determining the first axial distance L of the target object relative to the camera TX , and according to the first axial distance L TX The angle γ between the horizontal plane projection line and H , determine the second axial distance L of the target object relative to the camera TY .

[0123] In one embodiment, the third determination module 704 is specifically used to: determine the matching first axial distance determination strategy according to the type of the slope; the type of the slope includes an upward slope and a downward slope; according to the vertical projection line angle γ V, the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and the matching first axial distance determination strategy, to determine the first axial distance L0 of the target object relative to the camera TX .

[0124] In one embodiment, the first axial distance determination strategy matching the upward slope is to calculate the first axial distance L of the target object relative to the camera according to a first formula: TX ;

[0125] The first formula is:

[0126] In one embodiment, the first axial distance determination strategy matching the downward slope is to calculate the first axial distance L of the target object relative to the camera according to the second formula: TX ;

[0127] The second formula is:

[0128] In one embodiment, the third determination module 704 is further used to: determine whether the target object is located on the slope; and if the target object is located on the slope, execute the first axial distance determination strategy step of determining a match according to the type of the slope.

[0129] In one embodiment, the third determining module 704 is further configured to: if the vertical projection line angle γ V is greater than or equal to 90°, it is determined that the target object is located on the slope; if the vertical projection line angle γ V If it is less than 90°, then calculate the vertical projection line angle γ V The tangent value of tanγ V and the camera installation height h c and when the product is greater than the distance L0 between the slope and the camera, it is determined that the target object is located on the slope.

[0130] In one embodiment, the device further comprises a fourth determining module, configured to determine the product as a first axial distance L of the target object relative to the camera when the product is less than or equal to the distance L0 between the slope and the camera. TX .

[0131] Each module in the above-mentioned device for determining the distance of a target object based on surveillance video can be implemented in whole or in part by software, hardware, or a combination thereof. Each of the above-mentioned modules can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each of the above modules.

[0132] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 8 As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store data required or generated for executing the above-mentioned method for determining the distance of a target object based on a surveillance video. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for determining the distance of a target object based on a surveillance video is implemented.

[0133] Those skilled in the art will understand that Figure 8 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.

[0134] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.

[0135] In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the steps in the above-mentioned method embodiments are implemented.

[0136] In one embodiment, a computer program product is provided, including a computer program, which implements the steps in the above method embodiments when executed by a processor.

[0137] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties.

[0138] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.

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

[0140] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be construed as limiting the scope of the present application. It should be noted that, for a person of ordinary skill in the art, several modifications 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 method for determining the distance of a target object based on a surveillance video, characterized in that: The method comprises: Acquire a surveillance video image of a target scene shot by a camera, identify a target object contained in the surveillance video image, and obtain image position information of the target object in the surveillance video image; the target scene contains a slope; Determining imaging position information of the target object in the photosensitive element according to the image position information and size information of the photosensitive element of the camera; According to the field of view angle, vertical azimuth angle of the camera and the imaging position information of the target object in the photosensitive element, the vertical projection line angle γ of the target object relative to the camera is determined. V Angle γ with the horizontal projection line H ; According to the vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and determining the first axial distance L of the target object relative to the camera TX , and according to the first axial distance L TX The angle γ between the horizontal plane projection line and H , determine the second axial distance L of the target object relative to the camera TY .

2. The method according to claim 1, characterized in that: The vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and determining the first axial distance L of the target object relative to the camera TX ,include: Determine a matching first axial distance determination strategy according to the type of the slope; the type of the slope includes an upward slope and a downward slope; According to the vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and the matching first axial distance determination strategy, to determine the first axial distance L0 of the target object relative to the camera TX .

3. The method according to claim 2, characterized in that The first axial distance determination strategy matching the upward slope is to calculate the first axial distance L of the target object relative to the camera according to the first formula TX ; The first formula is:

4. The method according to claim 2, characterized in that: The first axial distance determination strategy matching the downward slope is to calculate the first axial distance L of the target object relative to the camera according to the second formula TX ; The second formula is:

5. The method according to claim 2, characterized in that: The method further comprises: determining whether the target object is located on the slope; In the case where the target object is located on the slope, the first axial distance determination strategy step of determining matching according to the type of the slope is performed.

6. The method according to claim 5, characterized in that The determining whether the target object is located on the slope includes: If the vertical projection line angle γ V is greater than or equal to 90°, it is determined that the target object is located on the slope; If the vertical projection line angle γ V If it is less than 90°, then calculate the vertical projection line angle γ V The tangent value of tanγ V and the camera installation height h c and when the product is greater than the distance L0 between the slope and the camera, it is determined that the target object is located on the slope.

7. The method according to claim 6, characterized in that The method further comprises: When the product is less than or equal to the distance L0 between the slope and the camera, the product is determined as the first axial distance L0 between the target object and the camera. TX .

8. A device for determining the distance of a target object based on a surveillance video, characterized in that: The device comprises: The recognition module is used to obtain a surveillance video image of a target scene shot by a camera, identify a target object contained in the surveillance video image, and obtain image position information of the target object in the surveillance video image; the target scene contains a slope; A first determining module, configured to determine imaging position information of the target object in the photosensitive element according to the image position information and size information of the photosensitive element of the camera; The second determination module is used to determine the vertical projection line angle γ of the target object relative to the camera according to the field of view angle, vertical azimuth angle of the camera and the imaging position information of the target object in the photosensitive element. V Angle γ with the horizontal projection line H ; The third determination module is used to determine the vertical projection line angle γ according to the vertical projection line angle γ V , the installation height of the camera h c , the slope δ of the slope, the distance L0 between the slope and the camera, and determining the first axial distance L of the target object relative to the camera TX , and according to the first axial distance L TX The angle γ between the horizontal plane projection line and H , determine the second axial distance L of the target object relative to the camera TY .

9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.