Traffic camera parameter acquisition method, system, medium and electronic device

By acquiring two-dimensional and three-dimensional vehicle trajectories and calculating traffic camera parameters using optimization algorithms, the problem of time-consuming and labor-consuming manual measurement in the prior art is solved, and automated, low-cost parameter acquisition and regular updates are realized.

CN114677449BActive Publication Date: 2025-04-08霍静
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202210327317.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-03-30
Publication Date
2025-04-08
Estimated Expiration
2042-03-30

AI Technical Summary

Technical Problem

The existing traffic camera parameter measurement methods require manual unloading of the camera and performing laboratory calibration, which consumes a lot of resources and time, and cannot be promoted on a large scale, making it difficult to monitor and update camera parameters regularly.

Method used

By obtaining the two-dimensional vehicle trajectory and three-dimensional vehicle trajectory, the traffic camera parameters are calculated using an optimization algorithm, including sensor orientation, position and attitude angle, etc.

Benefits of technology

It realizes automated and low-cost traffic camera parameter acquisition, reduces manpower and resource consumption, and can regularly update camera parameters, which is suitable for the large-scale promotion of intelligent transportation systems.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114677449B_ABST
    Figure CN114677449B_ABST
Patent Text Reader

Abstract

The present invention provides a method, system, medium and electronic device for obtaining parameters of a traffic camera; the method comprises the following steps: obtaining a two-dimensional vehicle trajectory and a three-dimensional vehicle trajectory; calculating traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory; the present invention relates to solving parameters for a high-precision traffic camera through an optimization algorithm based on the two-dimensional vehicle trajectory detected by a camera and the three-dimensional geographic space "probe" vehicle trajectory measured by a high-precision RTK GPS device; the present invention takes the optimization target as the parameter function to be solved and optimized, and constructs an automatic camera parameter solver by calculating the corresponding mathematical function relationship.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of traffic cameras, and in particular relates to a method, system, medium and electronic equipment for obtaining traffic camera parameters. Background Art

[0002] With the widespread use of traffic cameras in multiple Intelligent Traffic System (ITS) applications, the demand for highly automated, low-cost systems that can accurately solve camera parameters has increased significantly.

[0003] The conventional camera parameter calibration method requires first uninstalling the traffic camera, and then sending the camera to the laboratory to measure the camera parameters with a "chessboard" calibration device. It is also necessary to manually measure the camera position, attitude angle and other parameters at each installation location. The installation and uninstallation costs of traffic cameras are extremely high. Uninstalling the camera and sending the camera to the laboratory for "chessboard" calibration will consume a lot of resources and time. Even for cameras that have been installed, to obtain the accurate values ​​of the camera's internal parameters, a large amount of manpower is still required to measure the position and attitude angle of the camera at each installation location, and a lot of time to manually select special points in the picture (the special points of each camera image data are different), which results in extremely high cost of using this method. At the same time, the camera parameters will change over time. Therefore, the method of manually measuring the camera parameters regularly cannot be promoted on a large scale, and it is difficult to monitor and update the camera parameters regularly (once a year). Summary of the invention

[0004] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a traffic camera parameter acquisition method, system, medium and electronic device to solve the problems of consuming manpower, resources and time in the existing manual measurement methods of traffic camera parameters.

[0005] To achieve the above-mentioned purpose and other related purposes, the present invention provides a method for obtaining traffic camera parameters, comprising the following steps: obtaining two-dimensional vehicle trajectories and three-dimensional vehicle trajectories; and calculating traffic camera parameters based on the two-dimensional vehicle trajectories and the three-dimensional vehicle trajectories.

[0006] In one embodiment of the present invention, the two-dimensional vehicle trajectory is image data; and the three-dimensional vehicle trajectory is GPS trajectory data.

[0007] In one embodiment of the present invention, the traffic camera parameters include: the azimuth of the projection of the sensor on the horizontal ground The polar angle θ between the sensor orientation and the horizontal plane, the geospatial latitude coordinate r of the sensor's centroid l , the geospatial longitude coordinate r of the sensor centroidp and the altitude or height r of the sensor's center of mass from the ground a The calculation formula for calculating the traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory is:

[0008]

[0009]

[0010]

[0011]

[0012]

[0013]

[0014]

[0015]

[0016]

[0017]

[0018]

[0019]

[0020]

[0021]

[0022]

[0023]

[0024]

[0025]

[0026]

[0027]

[0028]

[0029]

[0030]

[0031]

[0032]

[0033]

[0034]

[0035]

[0036]

[0037]

[0038]

[0039]

[0040]

[0041]

[0042]

[0043] A 3×3 =R T ×K -1 ;

[0044] B 3×1 =R T ×T 3×1 ;

[0045] Among them, L total represents the total loss; represents a local loss, wherein the local loss is calculated based on the reference point selected on the image data and the GPS track data; i represents each of the reference points; The Cartesian coordinates representing the transformed three-dimensional spatial position of the reference point i at time t; represents the coordinates of the shortest distance point between the transformed position of the reference point i and the selected line segment with index j; r mn Represents the matrix element of the sensor rotation matrix; R 3x3 represents the rotation matrix; the subscript "g" represents the coordinates in the global coordinate system; after using the translation vector, represents the coordinates in the global reference coordinate system; the subscript “l” represents the coordinates of the local sensor in the reference coordinate system; represents the local coordinates of the reference point i; u and v represent pixel coordinates in fractional form respectively; d represents pixel depth; w and h represent sensor size parameters width and height respectively; f represents focal length; represents the translation component; K and K -1 The matrices represent the intrinsic projection matrix and the corresponding inverse matrix of the traffic camera or sensor respectively; the G matrix represents the geographic coordinate conversion matrix; p represents the longitude coordinate; a represents the altitude coordinate; A and B represent the signs of the intermediate variable matrices.

[0046] In one embodiment of the present invention, the traffic camera parameters include at least any one of the following: internal parameters, external parameters and geospatial related parameters; wherein the internal parameters include at least focal length; the external parameters include at least three-dimensional position in geographic space; the geospatial related parameters include at least attitude angle.

[0047] The present invention provides a traffic camera parameter acquisition system, comprising: an acquisition module and a calculation module; the acquisition module is used to acquire two-dimensional vehicle trajectories and three-dimensional vehicle trajectories; the calculation module is used to calculate traffic camera parameters based on the two-dimensional vehicle trajectories and the three-dimensional vehicle trajectories.

[0048] The present invention provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the above-mentioned traffic camera parameter acquisition method is implemented.

[0049] The present invention provides an electronic device, comprising: a processor and a memory; the memory is used to store a computer program; the processor is used to execute the computer program stored in the memory, so that the electronic device executes the above-mentioned traffic camera parameter acquisition method.

[0050] The present invention provides a traffic camera parameter acquisition system, comprising: a traffic camera, an RTK device and the above-mentioned electronic device; the traffic camera is used to collect two-dimensional vehicle trajectories and send the two-dimensional vehicle trajectories to the electronic device; the RTK device is used to collect three-dimensional vehicle trajectories and send the three-dimensional vehicle trajectories to the electronic device.

[0051] As described above, the traffic camera parameter acquisition method, system, medium and electronic device of the present invention have the following beneficial effects:

[0052] (1) Compared with the prior art, the present invention is based on the two-dimensional vehicle trajectory detected by the camera and the three-dimensional geospatial "probe" vehicle trajectory measured by the high-precision RTK equipment, and solves the parameters for the high-precision traffic camera through the optimization algorithm.

[0053] (2) The present invention uses the optimization target as the parameter function that needs to be solved and optimized, and constructs an automatic camera parameter solver by calculating the corresponding mathematical function relationship. BRIEF DESCRIPTION OF THE DRAWINGS

[0054] Figure 1 Shown is a flow chart of a method for acquiring traffic camera parameters in one embodiment of the present invention.

[0055] Figure 2a to Figure 2e Schematic diagrams showing trajectories of five different routes of a probe vehicle of the present invention in an image in one embodiment.

[0056] Figure 3A and Figure 3B The schematic diagrams in one embodiment respectively show the comparison between the trajectory of the probe vehicle measured by the RTK GPS of the present invention and the trajectory of the probe vehicle transformed by the camera parameters obtained by solving the optimization algorithm.

[0057] Figure 4A and Figure 4B Schematic diagrams showing the positioning accuracy and the system error of the positioning accuracy of the optimization algorithm of the present invention in an embodiment.

[0058] Figure 5 Shown is a schematic structural diagram of a traffic camera parameter acquisition system in one embodiment of the present invention.

[0059] Figure 6 It is a schematic structural diagram of an electronic device of the present invention in one embodiment.

[0060] Figure 7 Shown is a structural schematic diagram of another embodiment of the traffic camera parameter acquisition system of the present invention. DETAILED DESCRIPTION

[0061] The following describes the embodiments of the present invention through specific embodiments, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the following embodiments and features in the embodiments can be combined with each other without conflict.

[0062] It should be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present invention. The illustrations only show components related to the present invention rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.

[0063] Compared with the prior art, the traffic camera parameter acquisition method, system, medium and electronic device of the present invention are related to solving parameters for high-precision traffic cameras through optimization algorithms based on two-dimensional vehicle trajectories detected by cameras and three-dimensional geographic space "probe" vehicle trajectories measured by high-precision RTK equipment; the present invention uses the optimization target as the parameter function that needs to be solved and optimized, and constructs an automatic camera parameter solver by calculating the corresponding mathematical function relationship.

[0064] The storage medium of the present invention stores a computer program, and when the computer program is executed by a processor, the following traffic camera parameter acquisition method is implemented. The storage medium includes: a read-only memory (ROM), a random access memory (RAM), a disk, a USB flash drive, a memory card, or an optical disk, etc., which can store program codes.

[0065] Any combination of one or more storage media may be used. The storage medium may be a computer-readable signal medium or a computer-readable storage medium. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection with one or more wires, a portable computer disk, a hard disk, a RAM, a ROM, an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this document, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in conjunction with an instruction execution system, device, or device.

[0066] Computer-readable signal media may include a data signal propagated in baseband or as part of a carrier wave, which carries a computer-readable program code. Such propagated data signals may take a variety of forms, including, but not limited to, electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than a computer-readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.

[0067] The program code embodied on the computer readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.

[0068] Computer program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages ​​such as Java, Smalltalk, C++, etc., and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0069] The present invention will be described below with reference to the flowcharts and / or block diagrams of the methods, devices (systems) and computer program products according to embodiments of the present invention. It should be understood that each box of the flowchart and / or block diagram and the combination of boxes in the flowchart and / or block diagram can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer or other programmable data processing device, thereby producing a machine so that these computer program instructions, when executed by the processor of the computer or other programmable data processing device, produce a device that implements the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0070] These computer program instructions may also be stored in a computer-readable medium, which enables a computer, other programmable data processing apparatus, or other device to operate in a specific manner, so that the instructions stored in the computer-readable medium produce an article of manufacture including instructions for implementing the functions / actions specified in one or more blocks in the flowchart and / or block diagram.

[0071] Computer program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device so that a series of operational steps are performed on the computer, other programmable data processing apparatus, or other device to produce a computer-implemented process, so that the instructions executed on the computer or other programmable device provide a process for implementing the functions / actions specified in one or more boxes in the flowchart and / or block diagram.

[0072] like Figure 1 As shown, in one embodiment, the traffic camera parameter acquisition method of the present invention is applied to an electronic device; specifically, the traffic camera parameter acquisition method includes the following steps:

[0073] Step S1, obtaining a two-dimensional vehicle trajectory and a three-dimensional vehicle trajectory.

[0074] Specifically, a traffic camera collects a two-dimensional vehicle trajectory and sends the two-dimensional vehicle trajectory to an electronic device; an RTK device collects a three-dimensional vehicle trajectory and sends the three-dimensional vehicle trajectory to the electronic device.

[0075] In one embodiment, the two-dimensional vehicle trajectory is image data; and the three-dimensional vehicle trajectory is GPS trajectory data.

[0076] Step S2: Calculate traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory.

[0077] In one embodiment, the traffic camera parameters include at least but are not limited to any one of the following: internal parameters, external parameters and geospatial related parameters; wherein the internal parameters include at least but are not limited to: focal length; the external parameters include at least but are not limited to: three-dimensional position in geographic space (including latitude, longitude, altitude, etc.); the geospatial related parameters include at least but are not limited to: attitude angle (including polar angle, azimuth, etc.).

[0078] It should be noted that the selected custom parameters for 2D to 3D transformation or mapping may be camera internal parameters, camera external parameters or any other geospatial related parameters, but it is necessary to ensure that the selected parameters have different rendering processes.

[0079] In one embodiment, the traffic camera parameters include the azimuth of the projection of the sensor direction on the horizontal ground. The polar angle θ between the sensor orientation and the horizontal plane, the geospatial latitude coordinate r of the sensor's centroid l (WGS84 coordinate system), the geospatial longitude coordinate of the sensor's centroid r p (WGS84 coordinate system) and the altitude or height r of the sensor's center of mass from the ground a .

[0080] It should be noted that when the projected direction points to the North Pole of the Earth, the azimuth is zero; when looking down, when rotating clockwise from the North Pole, is a positive value; when rotating counterclockwise from the North Pole, is a negative value, so the azimuth The range of the polar angle θ is -180° to 180°; when the sensor is horizontal, the polar angle θ is zero; when the sensor is pointing downward to the ground, the polar angle θ is positive; and when the sensor is pointing upward, the polar angle θ is negative, and the range of the polar angle θ is -90° to 90°;.

[0081] In one embodiment, the calculation formula for calculating the traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory is:

[0082]

[0083] Formula (1) is the formula of the total loss function; where L total represents the total loss; represents local loss, and the local loss is calculated based on the reference points selected on the image data and the GPS trajectory data; i represents each of the reference points.

[0084] If each segment of the GPS track is considered as a series of two coefficients Represents the line segment, where j represents the line segment index in the GPS trajectory, then we can get:

[0085]

[0086] in, The Cartesian coordinates representing the transformed three-dimensional spatial position of the reference point i at time t (time series data); The coordinates of the shortest distance point between the transformed position of the reference point i and the selected line segment with index j are calculated as follows:

[0087]

[0088]

[0089]

[0090] The internal parameters in the camera model and the external parameters of the camera can be used for calculation, as shown below:

[0091]

[0092]

[0093]

[0094] Among them, r mn Represents the matrix element of the sensor rotation matrix; R 3x3 represents the rotation matrix; after using the translation vector, Represents the coordinates in the global reference coordinate system (where the subscript g represents the coordinates in the global coordinate system, while l represents the coordinates in the local coordinate system), as shown below:

[0095]

[0096]

[0097]

[0098] Wherein, the subscript “l” represents the coordinate of the local sensor in the reference coordinate system, in which the z-axis points in the opposite direction of the sensor, the x-axis points to the right, and the y-axis points upward when facing the sensor; represents the local coordinates of the reference point i, calculated by the following formula:

[0099]

[0100]

[0101]

[0102] Among them, u and v represent the pixel coordinates in fractional form, with a value range of 0-1; (u=0, v=0) refers to the upper left corner of the image; (u=1, v=1) refers to the lower right corner of the image; d represents the pixel depth, which refers to the distance between the imaging object and the lens, in meters; w and h represent the sensor size parameters width and height, in millimeters; f represents the focal length, in millimeters.

[0103] Translational Component The sensor rotation matrix R can be used 3x3 and the sensor's position is calculated as follows:

[0104]

[0105]

[0106]

[0107] Optimize and solve parameters using the numerical optimization method Broyden-Fletcher-Goldfarb-Shanno (BFGS) θ、r l 、r p 、r a , the partial derivatives used are as follows:

[0108]

[0109]

[0110]

[0111]

[0112]

[0113] The matrix and vector projections can be calculated and then used to transform the 2D image coordinates to 3D geospatial coordinates: the R matrix (Rotation matrix) is used for rotation, the T vector is used for translation, and the G matrix represents the Mercator projection from xyz Cartesian coordinates to geospatial longitude and latitude coordinates. These matrices are calculated using the parameters solved from the above optimization procedure:

[0114] The calculation formula of the R (Rotation rotation matrix) matrix is ​​as follows:

[0115]

[0116] The calculation formulas for the three orthogonal components are as follows:

[0117]

[0118]

[0119]

[0120] The calculation formula of T vector is as follows:

[0121]

[0122] The calculation formula of G matrix (Geographic coordinate conversion matrix) is as follows:

[0123]

[0124] The transformation from two-dimensional image coordinates to three-dimensional geographic space coordinates can be expressed as:

[0125]

[0126] It is expressed in matrix notation as follows:

[0127]

[0128]

[0129]

[0130]

[0131] Among them, uv measurement value is provided by the sensor, l represents latitude coordinate latitude, p represents longitude coordinate phi, a represents altitude coordinate altitude, auxiliary matrix A and B (A and B only represent the symbols of intermediate variable matrix) can be calculated by the following formula:

[0132]

[0133]

[0134] in,

[0135] A 3×3 =R T ×K -1 (36)

[0136] B 3×1 =R T ×T 3×1 (37)

[0137] Among them, K and K -1 The matrices represent the intrinsic projection matrix and the corresponding inverse matrix of the traffic camera or sensor, respectively.

[0138] The method for obtaining traffic camera parameters of the present invention is further explained below through specific embodiments.

[0139] The performance of the solved camera parameters and the associated transformations was measured by comparing the RTK GPS trajectories with transformed trajectories based solely on detection and trace measurements using image data. Five routes were used to make the performance measurements statistically significant.

[0140] like Figure 2a to Figure 2e (5 “probe” vehicle routes used to measure the performance of camera parameters) shows that in an experiment at a traffic intersection, five different routes of the probe vehicle were recorded, showing the trajectory of the probe vehicle in the image (black thick line).

[0141] It should be noted that the "detection" head is automatically injected into a road network system. The probe car is equipped with a high-precision RTK GPS differential GPS and drives through the camera road network whose parameters need to be solved. The optimization algorithm calculates the difference between the trajectory data of the RTK GPS and the trajectory of the "probe" car in the high-position camera image data as the loss function to optimize the solution of the parameters of the calculation camera.

[0142] like Figure 3A and Figure 3BAs shown in the figure, the comparison between the probe car trajectory measured by RTK GPS and the probe car trajectory transformed by the camera parameters solved by the optimization algorithm is shown. The error between the probe car trajectory and the reference trajectory of RTKGPS is very small. Figure 3B The solved geographic location information of the probe car is displayed, including longitude and latitude coordinates (WGS-84).

[0143] like Figure 4A and Figure 4B As shown in the figure, the positioning accuracy of the optimization algorithm is shown respectively ( Figure 4A ) and the systematic error of positioning accuracy ( Figure 4B ), where the accuracy and systematic error of accuracy are measured in a 10×10 matrix in the image to observe the correlation between the accuracy of the algorithm and the position of the vehicle in the image.

[0144] Furthermore, a deep neural network is built using the above-mentioned traffic camera parameter acquisition method, and a "probe" vehicle equipped with RTK GPS is used to train the deep neural network, so that the deep neural network can predict the parameters of the camera based on the traffic camera parameter acquisition method; specifically, the video sequence of the traffic camera (corresponding to the above-mentioned "two-dimensional vehicle trajectory") and the GPS trajectory of the "probe" vehicle (corresponding to the above-mentioned "three-dimensional vehicle trajectory") are input into the deep neural network, so that the deep neural network outputs the traffic camera parameters.

[0145] It should be noted that the protection scope of the traffic camera parameter acquisition method described in the present invention is not limited to the execution order of the steps listed in this embodiment, and all solutions implemented by adding, reducing or replacing steps in the prior art based on the principles of the present invention are included in the protection scope of the present invention.

[0146] like Figure 5 As shown, in one embodiment, the traffic camera parameter acquisition system of the present invention includes an acquisition module 51 and a calculation module 52 .

[0147] The acquisition module 51 is used to acquire a two-dimensional vehicle trajectory and a three-dimensional vehicle trajectory.

[0148] The calculation module 52 is used to calculate traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory.

[0149] It should be noted that the working principle of the traffic camera parameter acquisition system of the present invention is the same as the working principle of the above-mentioned traffic camera parameter acquisition method, so it will not be repeated here.

[0150] It should be noted that it should be understood that the division of the various modules of the above system is only a division of logical functions. In actual implementation, they can be fully or partially integrated into one physical entity, or they can be physically separated. And these modules can all be implemented in the form of software called by processing elements; they can also be all implemented in the form of hardware; some modules can also be implemented in the form of software called by processing elements, and some modules can be implemented in the form of hardware. For example, the x module can be a separately established processing element, or it can be integrated in a certain chip of the above system for implementation. In addition, it can also be stored in the memory of the above system in the form of program code, and called and executed by a certain processing element of the above system. The implementation of other modules is similar. In addition, these modules can be fully or partially integrated together, or they can be implemented independently. The processing element described here can be an integrated circuit with signal processing capabilities. In the implementation process, each step of the above method or each module above can be completed by an integrated logic circuit of hardware in the processor element or instructions in the form of software.

[0151] For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as one or more application specific integrated circuits (ASICs), or one or more digital signal processors (DSPs), or one or more field programmable gate arrays (FPGAs). For another example, when a module is implemented in the form of a processing element scheduling program code, the processing element may be a general-purpose processor, such as a central processing unit (CPU) or other processors that can call program code. For another example, these modules may be integrated together and implemented in the form of a system-on-a-chip (SOC).

[0152] like Figure 6 As shown, the electronic device of the present invention includes a processor 61 and a memory 62 .

[0153] The memory 62 is used to store computer programs; preferably, the memory 62 includes: ROM, RAM, disk, USB flash drive, memory card or CD, etc., which can store program codes.

[0154] The processor 61 is connected to the memory 62 and is used to execute the computer program stored in the memory 62 so that the electronic device executes the above-mentioned traffic camera parameter acquisition method.

[0155] Preferably, the processor 61 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.

[0156] like Figure 7 As shown, in one embodiment, the traffic camera parameter acquisition system of the present invention includes a traffic camera 71, an RTK device 72 and the above-mentioned electronic device 73.

[0157] Specifically, the traffic camera 71 is used to collect two-dimensional vehicle trajectories and send the two-dimensional vehicle trajectories to the electronic device 73; the RTK device 72 is used to collect three-dimensional vehicle trajectories and send the three-dimensional vehicle trajectories to the electronic device 73.

[0158] It should be noted that the working principle of the traffic camera parameter acquisition system is the same as the working principle of the above-mentioned traffic camera parameter acquisition method, so it will not be repeated here.

[0159] It should be noted that the traffic camera parameter acquisition system of the present invention can implement the traffic camera parameter acquisition method of the present invention, but the implementation device of the traffic camera parameter acquisition method of the present invention includes but is not limited to the traffic camera parameter acquisition structure listed in this embodiment, and all structural deformations and replacements of the prior art made according to the principles of the present invention are included in the protection scope of the present invention.

[0160] In summary, compared with the prior art, the traffic camera parameter acquisition method, system, medium and electronic device of the present invention are related to solving parameters for high-precision traffic cameras through optimization algorithms based on the two-dimensional vehicle trajectory detected by the camera and the three-dimensional geographic space "probe" vehicle trajectory measured by high-precision RTK equipment; the present invention uses the optimization target as the parameter function that needs to be solved and optimized, and constructs an automatic camera parameter solver by calculating the corresponding mathematical function relationship; therefore, the present invention effectively overcomes the various shortcomings of the prior art and has a high industrial utilization value.

[0161] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.

Claims

1. A method for obtaining traffic camera parameters, characterized in that: The following steps are involved: Acquire a two-dimensional vehicle trajectory and a three-dimensional vehicle trajectory; the two-dimensional vehicle trajectory is image data; The three-dimensional vehicle trajectory is GPS trajectory data; calculating traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory; The traffic camera parameters include: the azimuth of the projection of the sensor on the horizontal ground The polar angle θ between the sensor orientation and the horizontal plane, the geospatial latitude coordinate r of the sensor's centroid l , the geospatial longitude coordinate r of the sensor centroid p and the altitude or height r of the sensor's center of mass from the ground a The calculation formula for calculating the traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory is: A 3×3 =R T ×K -1 ; B 3×1 =R T ×T 3×1 ; Among them, L total represents the total loss; represents a local loss, wherein the local loss is calculated based on the reference point selected on the image data and the GPS track data; i represents each of the reference points; The Cartesian coordinates representing the transformed three-dimensional spatial position of the reference point i at time t; represents the coordinates of the shortest distance point between the transformed position of the reference point i and the selected line segment with index j; r mn Represents the matrix element of the sensor rotation matrix; R 3x3 represents the rotation matrix; the subscript "g" represents the coordinates in the global coordinate system; after using the translation vector, represents the coordinates in the global reference coordinate system; the subscript "l" represents the coordinates of the local sensor in the reference coordinate system; represents the local coordinates of the reference point i; u and v represent pixel coordinates in fractional form respectively; d represents pixel depth; w and h represent sensor size parameters width and height respectively; f represents focal length; represents the translation component; K and K -1 The matrices represent the intrinsic projection matrix and the corresponding inverse matrix of the traffic camera or sensor respectively; the G matrix represents the geographic coordinate conversion matrix; p represents the longitude coordinate; a represents the altitude coordinate; A and B represent the symbols of the intermediate variable matrix; represents the zero-order coefficient of line segment j; represents the first-order coefficient of line segment j; u i and v i Respectively represent the pixel coordinates of the i-th reference point corresponding to the pixel point on the image; d i represents the pixel depth of the i-th reference point; Represents two-dimensional image coordinates; Represents three-dimensional geospatial coordinates.

2. The method for obtaining traffic camera parameters according to claim 1, characterized in that: The traffic camera parameters include at least any one of the following: internal parameters, external parameters and geospatial related parameters; wherein the internal parameters include at least focal length; the external parameters include at least three-dimensional position in geographic space; the geospatial related parameters include at least attitude angle.

3. A traffic camera parameter acquisition system, characterized in that: include: Acquisition module and calculation module; The acquisition module is used to acquire two-dimensional vehicle trajectories and three-dimensional vehicle trajectories; The two-dimensional vehicle trajectory is image data; The three-dimensional vehicle trajectory is GPS trajectory data; The calculation module is used to calculate traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory; The traffic camera parameters include: the azimuth of the projection of the sensor on the horizontal ground The polar angle θ between the sensor orientation and the horizontal plane, the geospatial latitude coordinate r of the sensor's centroid l , the geospatial longitude coordinate r of the sensor centroid p and the altitude or height r of the sensor's center of mass from the ground a The calculation formula for calculating the traffic camera parameters based on the two-dimensional vehicle trajectory and the three-dimensional vehicle trajectory is: A 3×3 =R T ×K -1 ; B 3×1 =R T ×T 3×1 ; Among them, L total represents the total loss; represents a local loss, wherein the local loss is calculated based on the reference point selected on the image data and the GPS track data; i represents each of the reference points; The Cartesian coordinates representing the transformed three-dimensional spatial position of the reference point i at time t; represents the coordinates of the shortest distance point between the transformed position of the reference point i and the selected line segment with index j; r mn Represents the matrix element of the sensor rotation matrix; R 3x3 represents the rotation matrix; the subscript "g" represents the coordinates in the global coordinate system; after using the translation vector, represents the coordinates in the global reference coordinate system; the subscript "l" represents the coordinates of the local sensor in the reference coordinate system; represents the local coordinates of the reference point i; u and v represent pixel coordinates in fractional form respectively; d represents pixel depth; w and h represent sensor size parameters width and height respectively; f represents focal length; represents the translation component; K and K -1 The matrices represent the intrinsic projection matrix and the corresponding inverse matrix of the traffic camera or sensor respectively; the G matrix represents the geographic coordinate conversion matrix; p represents the longitude coordinate; a represents the altitude coordinate; A and B represent the symbols of the intermediate variable matrix; represents the zero-order coefficient of line segment j; represents the first-order coefficient of line segment j; u i and v i Respectively represent the pixel coordinates of the i-th reference point corresponding to the pixel point on the image; d i represents the pixel depth of the i-th reference point; Represents two-dimensional image coordinates; Represents three-dimensional geospatial coordinates.

4. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the traffic camera parameter acquisition method described in any one of claims 1 to 2 is implemented.

5. An electronic device, characterized in that: include: Processor and memory; The memory is used to store computer programs; The processor is used to execute the computer program stored in the memory so that the electronic device executes the traffic camera parameter acquisition method according to any one of claims 1 to 2.

6. A traffic camera parameter acquisition system, characterized in that: include: Traffic cameras, RTK equipment and the electronic equipment described in claim 5; The traffic camera is used to collect two-dimensional vehicle trajectories and to send the two-dimensional vehicle trajectories to the electronic device; The RTK device is used to collect the three-dimensional vehicle trajectory and to send the three-dimensional vehicle trajectory to the electronic device.