CN112116529A - PTZ camera-based conversion method for GPS coordinates and pixel coordinates - Google Patents

PTZ camera-based conversion method for GPS coordinates and pixel coordinates Download PDF

Info

Publication number
CN112116529A
CN112116529A CN202011008170.6A CN202011008170A CN112116529A CN 112116529 A CN112116529 A CN 112116529A CN 202011008170 A CN202011008170 A CN 202011008170A CN 112116529 A CN112116529 A CN 112116529A
Authority
CN
China
Prior art keywords
camera
coordinate system
axis
pixel
coordinate
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202011008170.6A
Other languages
Chinese (zh)
Inventor
刘远超
吴宗林
姜世强
杨进
陈钦鸿
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhejiang Haoteng Electron Technology Co ltd
Original Assignee
Zhejiang Haoteng Electron Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Zhejiang Haoteng Electron Technology Co ltd filed Critical Zhejiang Haoteng Electron Technology Co ltd
Priority to CN202011008170.6A priority Critical patent/CN112116529A/en
Publication of CN112116529A publication Critical patent/CN112116529A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformation in the plane of the image
    • G06T3/60Rotation of a whole image or part thereof
    • G06T3/604Rotation of a whole image or part thereof using a CORDIC [COordinate Rotation Digital Compute] device
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01SRADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
    • G01S19/00Satellite radio beacon positioning systems; Determining position, velocity or attitude using signals transmitted by such systems
    • G01S19/38Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system
    • G01S19/39Determining a navigation solution using signals transmitted by a satellite radio beacon positioning system the satellite radio beacon positioning system transmitting time-stamped messages, e.g. GPS [Global Positioning System], GLONASS [Global Orbiting Navigation Satellite System] or GALILEO
    • G01S19/42Determining position
    • G01S19/48Determining position by combining or switching between position solutions derived from the satellite radio beacon positioning system and position solutions derived from a further system
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/80Analysis of captured images to determine intrinsic or extrinsic camera parameters, i.e. camera calibration

Abstract

The invention discloses a method for converting GPS coordinates and pixel coordinates based on a PTZ camera, which comprises the following steps: (1) establishing a pixel coordinate system, a camera coordinate system and a world coordinate system; (2) constructing a coordinate conversion model S from a world coordinate system to a camera coordinate system; (3) constructing a coordinate conversion model K from a camera coordinate system to a pixel coordinate system; (4) calculating the unknowns of the coordinate transformation model S
Figure DDA0002696674960000011
(5) Calculating an unknown quantity (f) of the coordinate transformation model Kx,fy) (ii) a (6) Mapping from the GPS coordinate point to the pixel coordinate point; (7) and mapping the pixel coordinate points to the GPS coordinate points.

Description

PTZ camera-based conversion method for GPS coordinates and pixel coordinates
Technical Field
The invention relates to the field of computer vision, in particular to a method for converting GPS coordinates and pixel coordinates based on a PTZ camera.
Background
In recent years, with the gradual construction of the skynet project, traffic major roads, public security checkpoints, public gathering places, hotels, schools, fields and the like can be monitored through cameras. And a PTZ camera head is typically deployed therein. The pan-tilt can control the PTZ camera to perform omnidirectional (left-right/up-down) movement, zoom and zoom. In the case where the camera pose of the PTZ camera is known, the GPS coordinates of the target point and the pixel coordinates on the video screen are uniquely determined. Therefore, the PTZ camera is deployed, and the possibility is provided for the application of the conversion method technology of the GPS coordinates and the pixel coordinates. For example, the conversion method of the GPS coordinates and the pixel coordinates can visualize the GPS information of the territory of the national and local bureau into the video image and provide the territory following function. In addition, the method also allows for mapping of the plot on a video image and conversion to GPS information.
The coordinate transformation methods currently associated with the present invention are: the invention patent (application number: CN201811366347.2, name: a method, system and device for converting ground coordinates and wide-angle camera picture coordinates) discloses a method for converting ground coordinates and wide-angle camera picture coordinates, but does not consider and calculate the initial vertical deflection angle of a camera, so that the conversion of the camera has larger errors and the calibration steps of the camera are complicated; the same disadvantages exist in the invention patent (application number: CN201811366346.8, name: a coordinate conversion method and system of ground coordinates and PTZ cameras).
Disclosure of Invention
In order to overcome the defects in the prior art and realize quick camera calibration and good coordinate conversion precision, the invention provides a method for converting a GPS coordinate and a pixel coordinate based on a PTZ camera.
In order to realize the invention, the technical scheme is as follows:
a method for converting GPS coordinates and pixel coordinates based on a PTZ camera is characterized by comprising the following steps:
step 1) establishing a pixel coordinate system, a camera coordinate system and a world coordinate system;
step 2) constructing a coordinate conversion model S from a world coordinate system to a camera coordinate system;
step 3) constructing a coordinate conversion model K from a camera coordinate system to a pixel coordinate system;
step 4) calculating the unknown quantity of the coordinate transformation model S
Figure BDA0002696674940000011
Step 5) calculating the unknown quantity (f) of the coordinate transformation model Kx,fy);
Step 6) mapping from the GPS coordinate point to the pixel coordinate point;
and 7) mapping the pixel coordinate point to the GPS coordinate point.
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (1), the pixel coordinate system takes the upper left corner of an image as an origin, the horizontal right direction is a U axis, and the vertical downward direction is a V axis.
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (1), the camera coordinate system takes the optical center of the camera as an origin O, an X axis and a Y axis are respectively parallel to a U axis and a V axis of the pixel coordinate system, the Z axis is the optical axis direction of the camera, and a right-hand rectangular coordinate system is established.
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (1), a right-hand rectangular coordinate system is established by taking a coordinate point with the longitude and the latitude of the GPS as 0 as an origin, taking the ascending direction from longitude to east as an X axis and taking the ascending direction from latitude to north as a Y axis.
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (2), a coordinate conversion model S for constructing a world coordinate system to a camera coordinate system is a formula (1) and a formula (2);
Figure BDA0002696674940000021
Figure BDA0002696674940000022
wherein x isc、ycAnd zcX, Y and the value of the target point on the Z-axis on the camera coordinate system, respectively; x is the number ofwAnd ywAre the values of the target point on the X and Y axes, X, respectively, of the world coordinate system0、y0And h are the values of the camera on the X, Y and Z axes, θ, respectively, of the world coordinate system0And
Figure BDA0002696674940000023
initial vertical and horizontal deflection angles, theta and theta, respectively, of the camera
Figure BDA0002696674940000024
The vertical deflection angle and the horizontal deflection angle of the camera can be obtained directly through a PTZ camera; r (.) is a matrix operation function; symbol T represents matrix transposition; in addition to this, the present invention is,
Figure BDA0002696674940000025
is an unknown quantity, (x)0,y0) In known amounts.
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (3), a coordinate conversion model K for constructing the camera coordinate system to the pixel coordinate system is a formula (3) and a formula (4);
[u v 1]T=Q*[xc/zc yc/zc 1]T (3)
Figure BDA0002696674940000026
wherein Q is a parameter matrix in the camera, U and V are values of a U axis and a V axis of a target point on a pixel coordinate system, omega is a zoom multiple of the current camera, gamma is a distortion coefficient of the camera, and (U and V are values of the target point on the pixel coordinate system respectively0,v0) Is the optical center point of the camera,fxAnd fyRespectively normalizing focal lengths of the camera on a U axis and a V axis on a pixel coordinate system, wherein the normalized focal lengths are unknowns; the camera zoom factor ω can be obtained directly from the PTZ camera.
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (4), the unknown quantity of the coordinate conversion model S is calculated
Figure BDA0002696674940000027
Comprises the following steps:
4.1 setting the gamma of the parameter matrix Q in the camera to be 0, u0=(W-1)/2,v0(H-1)/2; wherein W and H are the image resolution width and height, respectively;
4.2 for a target point dataset at the optical center of the camera
Figure BDA0002696674940000031
Equation (5) can be obtained by substituting equation (1);
Figure BDA0002696674940000032
wherein X is Xw-x0,Y=yw-y0;xwAnd ywThe values of the target point on the X axis and the Y axis of the world coordinate system respectively; u and V are the coordinates of the target point on the U axis and the V axis of the pixel coordinate system respectively; theta, theta,
Figure BDA0002696674940000033
And omega is the vertical deflection angle, the horizontal deflection angle and the zoom multiple of the camera where the target is located respectively;
4.3 further simplification of equation (5) yields information on θ0And
Figure BDA0002696674940000034
relation (6);
Figure BDA0002696674940000035
wherein the content of the first and second substances,
Figure BDA0002696674940000036
4.4 calibrating by controlling the PTZ camera through the holder to obtain the data sets of different target points at the optical center of the camera
Figure BDA0002696674940000037
And when i is an odd number, the condition (x) is satisfiedwi-x0)/(ywi-y0)=(xw(i+1)-x0)/(yw(i+1)-y0) (ii) a Wherein n is the number of target points, and the value of n is an even number which is more than or equal to 2; x is the number ofwiAnd ywiThe values of the ith target point on the X axis and the Y axis of the world coordinate system respectively; u. ofiAnd viCoordinates of the ith target point on a U axis and a V axis on a pixel coordinate system are respectively; thetai
Figure BDA0002696674940000038
And ωiRespectively setting the vertical deflection angle, the horizontal deflection angle and the zoom multiple of a camera where the ith target is positioned;
4.5 satisfying a pair (x)wi-x0)/(ywi-y0)=(xw(i+1)-x0)/(yw(i+1)-y0) Target point of condition
Figure BDA0002696674940000039
Substituting equation (6) and simplifying, the factor θ can be obtained0Equation (7);
F*sinθ0+G*cosθ0=0 (7)
wherein F ═ a1-a2,G=b1-b2;a1And a2The values of the variables a, b obtained by substituting two points into the formula (6), respectively1And b2Values of the variable b obtained by substituting two points into the formula (6) respectively;
4.6 according toEquation (7) can be solved for the unknown quantity θ0Taking a value close to pi; will calculate the obtained theta0Substituting the relation (6) to obtain the unknown quantity
Figure BDA00026966749400000310
Further determine theta0And
Figure BDA00026966749400000311
substituting into equation (5) to obtain the unknown quantity h;
4.7 for multiple sets of data
Figure BDA00026966749400000312
According to steps 4.1 to 4.6, a plurality of corresponding solution sets can be calculated
Figure BDA00026966749400000313
The final camera height h and initial vertical deflection angle theta can be obtained according to the expressions (8), (9), (10), (11) and (12)0And an initial horizontal deflection angle
Figure BDA00026966749400000314
Figure BDA00026966749400000315
Figure BDA0002696674940000041
Figure BDA0002696674940000042
Figure BDA0002696674940000043
Figure BDA0002696674940000044
Where k is the solution set { hjSize of 1,2, … k; h isjCollecting the jth solution for the solution; theta0jFor the jth solution in the solution set, θ01Collecting the 1 st solution for the solution;
Figure BDA0002696674940000045
for the jth solution in the solution set,
Figure BDA0002696674940000046
the 1 st solution is collected for this solution.
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (5), the unknown quantity (f) of the coordinate conversion model K is calculatedx,fy) Comprises the following steps:
5.1 for a target Point data set
Figure BDA0002696674940000047
Firstly, carrying out scaling multiple conversion according to a formula (13);
Figure BDA0002696674940000048
5.2 converting the zoom multiple into a target point data set
Figure BDA0002696674940000049
Substituting equation (3), and obtaining equation (14) through solution;
Figure BDA00026966749400000410
wherein (x)c,yc,zc) Can be obtained by calculation according to the formula (1);
5.3, calibrating by controlling the PTZ camera through the holder to obtain data sets of different target points
Figure BDA00026966749400000411
Wherein m is not less than 2 and ui≠u0Or vi≠v0(ii) a m is the number of target points;
5.4 for a target Point data set
Figure BDA00026966749400000412
Substituting into formula (14), and calculating to obtain camera internal parameter unknown quantity (f) by least square methodx,fy)。
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (6), mapping from a GPS coordinate point to a pixel coordinate point is carried out, namely, when the GPS coordinate point (x) of a target point is knownw,yw0), attitude information of camera
Figure BDA00026966749400000413
Camera zoom factor ω and
Figure BDA00026966749400000414
and (f)x,fy) Then, the pixel coordinates (u, v) of the target point on the camera image can be calculated by the formula (1) and the formula (3).
The method for converting the GPS coordinates and the pixel coordinates based on the PTZ camera is characterized in that in the step (7), the mapping from the pixel coordinate point to the GPS coordinate point comprises the following steps:
7.1 when the pixel coordinates (u, v) of the target point on the image and the attitude information of the camera are known
Figure BDA00026966749400000415
Camera zoom factor ω and
Figure BDA0002696674940000051
and (f)x,fy) When the data are substituted into the formula (1) and the formula (3), the formula (15) can be obtained;
Figure BDA0002696674940000052
wherein, the function R () is a calculation formula (2);
7.2 knowing that the left side of the equation for equation (12) is a calculable value, set to [ L M N]TThen equation (15) can be converted to equation (16);
Figure BDA0002696674940000053
7.3 solving equation (16), the GPS coordinate point of the point can be solved as (x)w=x0-h*L/N,yw=y0-h*M/N,0)。
Compared with the prior art, the invention has the main beneficial effects that:
the PTZ camera is controlled by the holder to obtain the target point data set so as to calculate the unknown number in the coordinate conversion formula
Figure BDA0002696674940000054
And (f)x,fy) And the camera calibration process is simple. And the initial deflection angle of the camera due to problems of installation and the like is considered, so that the coordinate conversion is more accurate. The invention has wide application range, for example, the conversion method can visualize the land parcel GPS information of the national and local bureau into the video image and provide the land parcel following function. In addition, the method also allows for mapping of the plot on a video image and conversion to GPS information.
Drawings
FIG. 1 is a flow chart of the steps of the method of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail with reference to the accompanying drawings and examples. It should be understood that the detailed description and specific examples, while indicating the scope of the invention, are intended for purposes of illustration only and are not intended to limit the scope of the invention.
Fig. 1 is a flowchart of a method for converting GPS coordinates and pixel coordinates based on a PTZ camera according to the present invention. As shown in fig. 1, the method for converting GPS coordinates and pixel coordinates based on a PTZ camera provided in this embodiment includes the following steps:
s1, establishing a pixel coordinate system, a camera coordinate system and a world coordinate system;
specifically, the pixel coordinate system takes the upper left corner of the image as an origin, the horizontal right direction is a U axis, and the vertical downward direction is a V axis; the camera coordinate system takes the optical center of a camera as an origin O, an X axis and a Y axis are respectively parallel to a U axis and a V axis of a pixel coordinate system, a Z axis is the direction of an optical axis of the camera, and a right-hand rectangular coordinate system is established; the world coordinate system is a right-hand rectangular coordinate system established by taking a coordinate point with the longitude and the latitude of the GPS as 0 as an origin, taking the ascending direction from longitude to east as an X axis and taking the ascending direction from latitude to north as a Y axis.
S2, constructing a coordinate conversion model S from a world coordinate system to a camera coordinate system;
specifically, a coordinate conversion model S from a world coordinate system to a camera coordinate system is constructed into a formula (1) and a formula (2);
Figure BDA0002696674940000061
Figure BDA0002696674940000062
wherein x isc、ycAnd zcX, Y and the value of the target point on the Z-axis on the camera coordinate system, respectively; x is the number ofwAnd ywAre the values of the target point on the X and Y axes, X, respectively, of the world coordinate system0、y0And h are the values of the camera on the X, Y and Z axes, θ, respectively, of the world coordinate system0And
Figure BDA0002696674940000063
initial vertical and horizontal deflection angles, theta and theta, respectively, of the camera
Figure BDA0002696674940000064
The vertical deflection angle and the horizontal deflection angle of the camera can be directly obtained by the PTZ cameraObtaining; r (.) is a matrix operation function; symbol T represents matrix transposition; in addition to this, the present invention is,
Figure BDA0002696674940000065
is an unknown quantity, (x)0,y0) In known amounts.
S3, constructing a coordinate conversion model K from a camera coordinate system to a pixel coordinate system;
specifically, a coordinate conversion model K from a camera coordinate system to a pixel coordinate system is constructed as formula (3) and formula (4);
[u v 1]T=Q*[xc/zc yc/zc 1]T (3)
Figure BDA0002696674940000066
wherein Q is a parameter matrix in the camera, U and V are values of a U axis and a V axis of a target point on a pixel coordinate system, omega is a zoom multiple of the current camera, gamma is a distortion coefficient of the camera, and (U and V are values of the target point on the pixel coordinate system respectively0,v0) Is the optical center point of the camera, fxAnd fyRespectively normalizing focal lengths of the camera on a U axis and a V axis on a pixel coordinate system, wherein the normalized focal lengths are unknowns; the camera zoom factor ω can be obtained directly from the PTZ camera.
S4, calculating the unknown quantity of the coordinate transformation model S
Figure BDA0002696674940000067
Specifically, the method comprises the following steps:
s4.1, setting gamma to be 0 and u in a parameter matrix Q in the camera0=(W-1)/2,v0(H-1)/2; wherein W and H are the image resolution width and height, respectively;
s4.2 for a target point dataset at the optical center of the camera
Figure BDA0002696674940000068
Equation (5) can be obtained by substituting equation (1);
Figure BDA0002696674940000069
wherein X is Xw-x0,Y=yw-y0;xwAnd ywThe values of the target point on the X axis and the Y axis of the world coordinate system respectively; u and V are the coordinates of the target point on the U axis and the V axis of the pixel coordinate system respectively; theta, theta,
Figure BDA00026966749400000610
And omega is the vertical deflection angle, the horizontal deflection angle and the zoom multiple of the camera where the target is located respectively;
s4.3 further simplification of equation (5) yields information on θ0And
Figure BDA0002696674940000071
relation (6);
Figure BDA0002696674940000072
wherein the content of the first and second substances,
Figure BDA0002696674940000073
s4.4, calibrating by controlling the PTZ camera through the holder to obtain data sets of different target points in the optical center of the camera
Figure BDA0002696674940000074
And when i is an odd number, the condition (x) is satisfiedwi-x0)/(ywi-y0)=(xw(i+1)-x0)/(yw(i+1)-y0) (ii) a Wherein n is the number of target points, and the value of n is an even number which is more than or equal to 2; x is the number ofwiAnd ywiThe values of the ith target point on the X axis and the Y axis of the world coordinate system respectively; u. ofiAnd viCoordinates of the ith target point on a U axis and a V axis on a pixel coordinate system are respectively; thetai
Figure BDA0002696674940000075
And ωiRespectively setting the vertical deflection angle, the horizontal deflection angle and the zoom multiple of a camera where the ith target is positioned;
s4.5 satisfying a pair (x)wi-x0)/(ywi-y0)=(xw(i+1)-x0)/(yw(i+1)-y0) Target point of condition
Figure BDA0002696674940000076
Substituting equation (6) and simplifying, the factor θ can be obtained0Equation (7);
F*sinθ0+G*cosθ0=0 (7)
wherein F ═ a1-a2,G=b1-b2;a1And a2The values of the variables a, b obtained by substituting two points into the formula (6), respectively1And b2Values of the variable b obtained by substituting two points into the formula (6) respectively;
s4.6-from equation (7) one can solve for the unknown quantity θ0Taking a value close to pi; will calculate the obtained theta0Substituting the relation (6) to obtain the unknown quantity
Figure BDA0002696674940000077
Further determine theta0And
Figure BDA0002696674940000078
substituting into equation (5) to obtain the unknown quantity h;
s4.7 for multiple sets of data
Figure BDA0002696674940000079
According to steps 4.1 to 4.6, a plurality of corresponding solution sets can be calculated
Figure BDA00026966749400000716
The final camera height h and initial vertical deflection angle theta can be obtained according to the expressions (8), (9), (10), (11) and (12)0And initial horizontal deflectionCorner
Figure BDA00026966749400000710
Figure BDA00026966749400000711
Figure BDA00026966749400000712
Figure BDA00026966749400000713
Figure BDA00026966749400000714
Figure BDA00026966749400000715
Where k is the solution set { hjSize of 1,2, … k; h isjCollecting the jth solution for the solution; theta0jFor the jth solution in the solution set, θ01Collecting the 1 st solution for the solution;
Figure BDA0002696674940000081
for the jth solution in the solution set,
Figure BDA0002696674940000082
the 1 st solution is collected for this solution.
S5, calculating the unknown quantity (f) of the coordinate transformation model Kx,fy);
Specifically, the method comprises the following steps:
s5.1 for a target Point data set
Figure BDA0002696674940000083
Firstly, carrying out scaling multiple conversion according to a formula (13);
Figure BDA0002696674940000084
s5.2, converting the zoom multiple into a target point data set
Figure BDA0002696674940000085
Substituting equation (3), and obtaining equation (14) through solution;
Figure BDA0002696674940000086
wherein (x)c,yc,zc) Can be obtained by calculation according to the formula (1);
s5.3, calibrating by controlling the PTZ camera through the holder to obtain data sets of different target points
Figure BDA0002696674940000087
Wherein m is not less than 2 and ui≠u0Or vi≠v0(ii) a m is the number of target points;
s5.4 for a target Point data set
Figure BDA0002696674940000088
Substituting into formula (14), and calculating to obtain camera internal parameter unknown quantity (f) by least square methodx,fy)。
S6, mapping the GPS coordinate point to the pixel coordinate point;
specifically, mapping of GPS coordinate points to pixel coordinate points is performed such that when the GPS coordinate point (x) of the target point is knownw,yw0), attitude information of camera
Figure BDA0002696674940000089
Camera zoom factor ω and
Figure BDA00026966749400000810
and (f)x,fy) Can be represented by the formula(1) And (3) calculating to obtain the pixel coordinates (u, v) of the target point on the camera image.
S7, mapping the pixel coordinate point to the GPS coordinate point;
specifically, the method comprises the following steps:
s7.1 when the pixel coordinates (u, v) of the target point on the image and the attitude information of the camera are known
Figure BDA00026966749400000811
Camera zoom factor ω and
Figure BDA00026966749400000812
and (f)x,fy) Then, the above data can be substituted into formula (1) and formula (3), and formula (15) can be obtained;
Figure BDA00026966749400000813
wherein, the function R (-) is a calculation formula (2);
s7.2 knowing that the left side of the equation of equation (12) is a calculable value, set to [ L M N]TThen equation (15) can be converted to equation (16);
Figure BDA0002696674940000091
s7.3, solving equation (16) to obtain the GPS coordinate point of the point as (x)w=x0-h*L/N,yw=y0-h*M/N,0)。
The above-mentioned embodiments are intended to illustrate the technical solutions and advantages of the present invention, and it should be understood that the above-mentioned embodiments are only the most preferred embodiments of the present invention, and are not intended to limit the present invention, and any modifications, additions, equivalents, etc. made within the scope of the principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for converting GPS coordinates and pixel coordinates based on a PTZ camera is characterized by comprising the following steps:
1) establishing a pixel coordinate system, a camera coordinate system and a world coordinate system;
2) constructing a coordinate conversion model S from a world coordinate system to a camera coordinate system;
3) constructing a coordinate conversion model K from a camera coordinate system to a pixel coordinate system;
4) calculating the unknowns of the coordinate transformation model S
Figure FDA0002696674930000011
5) Calculating an unknown quantity (f) of the coordinate transformation model Kx,fy);
6) Mapping from the GPS coordinate point to the pixel coordinate point;
7) and mapping the pixel coordinate points to the GPS coordinate points.
2. The method as claimed in claim 1, wherein in step (1), the pixel coordinate system is based on the upper left corner of the image, the horizontal right direction is the U axis, and the vertical downward direction is the V axis.
3. The method as claimed in claim 1, wherein in step (1), the camera coordinate system is based on the optical center of the camera as an origin O, the X-axis and the Y-axis are parallel to the U-axis and the V-axis of the pixel coordinate system, respectively, and the Z-axis is the optical axis direction of the camera, so as to establish a right-handed rectangular coordinate system.
4. The method as claimed in claim 1, wherein in step (1), the world coordinate system is a right-handed rectangular coordinate system established with a coordinate point with a longitude and latitude of GPS being 0 as an origin, an ascending direction of longitude to east as an X-axis, and a ascending direction of latitude to north as a Y-axis.
5. The method for converting GPS coordinates and pixel coordinates based on a PTZ camera as claimed in claim 1, wherein in step (2), the coordinate conversion model S for constructing the world coordinate system to the camera coordinate system is formula (1) and formula (2):
Figure FDA0002696674930000012
Figure FDA0002696674930000013
wherein x isc、ycAnd zcX, Y and the value of the target point on the Z-axis on the camera coordinate system, respectively; x is the number ofwAnd ywAre the values of the target point on the X and Y axes, X, respectively, of the world coordinate system0、y0And h are the values of the camera on the X, Y and Z axes, θ, respectively, of the world coordinate system0And
Figure FDA0002696674930000014
initial vertical and horizontal deflection angles, theta and theta, respectively, of the camera
Figure FDA0002696674930000015
The vertical deflection angle and the horizontal deflection angle of the camera are respectively obtained by directly obtaining through a PTZ camera; r (.) is a matrix operation function; symbol T represents matrix transposition; in addition to this, the present invention is,
Figure FDA0002696674930000016
is an unknown quantity, (x)0,y0) In known amounts.
6. The PTZ camera-based conversion method of GPS coordinates and pixel coordinates, as claimed in claim 5, wherein in the step (3), the coordinate conversion model K for constructing the camera coordinate system to the pixel coordinate system is formula (3) and formula (4):
[u v 1]T=Q*[xc/zc yc/zc 1]T (3)
Figure FDA0002696674930000017
wherein Q is a parameter matrix in the camera, U and V are values of a U axis and a V axis of a target point on a pixel coordinate system, omega is a zoom multiple of the current camera, gamma is a distortion coefficient of the camera, and (U and V are values of the target point on the pixel coordinate system respectively0,v0) Is the optical center point of the camera, fxAnd fyRespectively normalizing focal lengths of the camera on a U axis and a V axis on a pixel coordinate system, wherein the normalized focal lengths are unknowns; the camera zoom factor ω can be obtained directly from the PTZ camera.
7. The PTZ camera-based GPS coordinate to pixel coordinate conversion method as claimed in claim 6, wherein in the step (4), the unknown quantity of the coordinate conversion model S is calculated
Figure FDA0002696674930000021
Comprises the following steps:
4.1 setting the gamma of the parameter matrix Q in the camera to be 0, u0=(W-1)/2,v0(H-1)/2; wherein W and H are the image resolution width and height, respectively;
4.2 for a target point dataset at the optical center of the camera
Figure FDA0002696674930000022
Substituting formula (1) to obtain equation (5);
Figure FDA0002696674930000023
wherein X is Xw-x0,Y=yw-y0;xwAnd ywThe values of the target point on the X axis and the Y axis of the world coordinate system respectively; u and V are the target point on the U axis and the V axis of the pixel coordinate system respectivelyThe coordinates of (a); theta, theta,
Figure FDA0002696674930000024
And omega is the vertical deflection angle, the horizontal deflection angle and the zoom multiple of the camera where the target is located respectively;
4.3 further simplification of equation (5) yields information about θ0And
Figure FDA0002696674930000025
relation (6);
Figure FDA0002696674930000026
wherein the content of the first and second substances,
Figure FDA0002696674930000027
4.4 calibrating by controlling the PTZ camera through the holder to obtain the data sets of different target points at the optical center of the camera
Figure FDA0002696674930000028
Figure FDA0002696674930000029
And when i is an odd number, the condition (x) is satisfiedwi-x0)/(ywi-y0)=(xw(i+1)-x0)/(yw(i+1)-y0) (ii) a Wherein n is the number of target points, and the value of n is an even number which is more than or equal to 2; x is the number ofwiAnd ywiThe values of the ith target point on the X axis and the Y axis of the world coordinate system respectively; u. ofiAnd viCoordinates of the ith target point on a U axis and a V axis on a pixel coordinate system are respectively; thetai
Figure FDA00026966749300000210
And ωiRespectively the vertical deflection angle, the horizontal deflection angle and the zoom factor of the camera where the ith target is positioned;
4.5 satisfying a pair (x)wi-x0)/(ywi-y0)=(xw(i+1)-x0)/(yw(i+1)-y0) Target point of condition
Figure FDA00026966749300000211
Figure FDA00026966749300000212
Substituting into equation (6) and simplifying to obtain the factor theta0Equation (7);
F*sinθ0+G*cosθ0=0 (7)
wherein F ═ a1-a2,G=b1-b2;a1And a2The values of the variables a, b obtained by substituting two points into the formula (6), respectively1And b2Values of the variable b obtained by substituting two points into the formula (6) respectively;
4.6 solving for the unknown quantity θ according to equation (7)0Taking a value close to pi; will calculate the obtained theta0Substituting into relation (6) to obtain unknown quantity
Figure FDA00026966749300000213
Further determine theta0And
Figure FDA00026966749300000214
substituting into equation (5) to obtain the unknown quantity h;
4.7 for multiple sets of data
Figure FDA00026966749300000215
According to the steps 4.1 to 4.6, a plurality of corresponding solution sets are obtained through calculation
Figure FDA00026966749300000216
The final camera height h and initial vertical deflection angle theta can be obtained according to the expressions (8), (9), (10), (11) and (12)0And an initial horizontal deflection angle
Figure FDA00026966749300000217
Figure FDA00026966749300000218
Figure FDA0002696674930000031
Figure FDA0002696674930000032
Figure FDA0002696674930000033
Figure FDA0002696674930000034
Where k is the solution set { hjSize of 1,2, … k; h isjCollecting the jth solution for the solution; theta0jFor the jth solution in the solution set, θ01Collecting the 1 st solution for the solution;
Figure FDA0002696674930000035
for the jth solution in the solution set,
Figure FDA0002696674930000036
the 1 st solution is collected for this solution.
8. The PTZ camera-based conversion method of GPS coordinates and pixel coordinates as claimed in claim 7, wherein in the step (5), the unknown quantity (f) of the coordinate conversion model K is calculatedx,fy) Comprises the following steps:
5.1 for a target Point data set
Figure FDA0002696674930000037
Firstly, carrying out scaling multiple conversion according to a formula (13);
Figure FDA0002696674930000038
5.2 converting the zoom multiple into a target point data set
Figure FDA0002696674930000039
Substituting equation (3), and obtaining equation (14) through solution;
Figure FDA00026966749300000310
wherein (x)c,yc,zc) Calculating according to the formula (1);
5.3, calibrating by controlling the PTZ camera through the holder to obtain data sets of different target points
Figure FDA00026966749300000311
Wherein m is not less than 2 and ui≠u0Or vi≠v0(ii) a m is the number of target points;
5.4 for a target Point data set
Figure FDA00026966749300000312
Substituting into formula (14), and calculating to obtain camera internal parameter unknown quantity (f) by least square methodx,fy)。
9. The PTZ camera-based conversion method of GPS coordinates and pixel coordinates as claimed in claim 8, wherein in step (6), mapping of GPS coordinate points to pixel coordinate points is performed such that, when known, the GPS coordinate points are mapped to pixel coordinate pointsGPS coordinate point (x) of target pointw,yw0), attitude information of camera
Figure FDA00026966749300000313
Camera zoom factor ω and
Figure FDA00026966749300000314
and (f)x,fy) And (3) calculating to obtain pixel coordinates (u, v) of the target point on the camera image through the formula (1) and the formula (3).
10. The PTZ camera-based conversion method of GPS coordinates and pixel coordinates as claimed in claim 9, wherein the step (7) of mapping the set of pixel coordinate points to the GPS coordinate points comprises the steps of:
7.1 when the pixel coordinates (u, v) of the target point on the image and the attitude information of the camera are known
Figure FDA00026966749300000315
Camera zoom factor ω and
Figure FDA00026966749300000316
and (f)x,fy) When the data are substituted into the formula (1) and the formula (3), the formula (15) can be obtained;
Figure FDA00026966749300000317
wherein, the function R (-) is a calculation formula (2);
7.2 knowing that the left side of the equation for equation (12) is a calculable value, set to [ L M N]TThen equation (15) can be converted to equation (16);
Figure FDA0002696674930000041
7.3 solving equation (16) to obtain the pointHas a GPS coordinate point of (x)w=x0-h*L/N,yw=y0-h*M/N,0)。
CN202011008170.6A 2020-09-23 2020-09-23 PTZ camera-based conversion method for GPS coordinates and pixel coordinates Pending CN112116529A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011008170.6A CN112116529A (en) 2020-09-23 2020-09-23 PTZ camera-based conversion method for GPS coordinates and pixel coordinates

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011008170.6A CN112116529A (en) 2020-09-23 2020-09-23 PTZ camera-based conversion method for GPS coordinates and pixel coordinates

Publications (1)

Publication Number Publication Date
CN112116529A true CN112116529A (en) 2020-12-22

Family

ID=73801687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011008170.6A Pending CN112116529A (en) 2020-09-23 2020-09-23 PTZ camera-based conversion method for GPS coordinates and pixel coordinates

Country Status (1)

Country Link
CN (1) CN112116529A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112734855A (en) * 2020-12-31 2021-04-30 网络通信与安全紫金山实验室 Space beam pointing method, system and storage medium
CN115375779A (en) * 2022-10-27 2022-11-22 智广海联(天津)大数据技术有限公司 Method and system for marking AR (augmented reality) real scene of camera
CN115546304A (en) * 2022-11-24 2022-12-30 海纳云物联科技有限公司 Method and device for detecting and positioning three-dimensional coordinate system based on camera
CN116228888A (en) * 2023-04-21 2023-06-06 智广海联(天津)大数据技术有限公司 Conversion method and system for geographic coordinates and PTZ camera coordinates

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103971375A (en) * 2014-05-22 2014-08-06 中国人民解放军国防科学技术大学 Panoramic gaze camera space calibration method based on image splicing
WO2019196313A1 (en) * 2018-04-10 2019-10-17 平安科技(深圳)有限公司 Robot walking obstacle detection method and apparatus, computer device, and storage medium
WO2020062434A1 (en) * 2018-09-30 2020-04-02 初速度(苏州)科技有限公司 Static calibration method for external parameters of camera
CN111199560A (en) * 2019-12-31 2020-05-26 海能达通信股份有限公司 Video monitoring positioning method and video monitoring system
CN111523465A (en) * 2020-04-23 2020-08-11 中船重工鹏力(南京)大气海洋信息系统有限公司 Ship identity recognition system based on camera calibration and deep learning algorithm
CN111611989A (en) * 2020-05-22 2020-09-01 四川智动木牛智能科技有限公司 Multi-target accurate positioning identification method based on autonomous robot

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103971375A (en) * 2014-05-22 2014-08-06 中国人民解放军国防科学技术大学 Panoramic gaze camera space calibration method based on image splicing
WO2019196313A1 (en) * 2018-04-10 2019-10-17 平安科技(深圳)有限公司 Robot walking obstacle detection method and apparatus, computer device, and storage medium
WO2020062434A1 (en) * 2018-09-30 2020-04-02 初速度(苏州)科技有限公司 Static calibration method for external parameters of camera
CN111199560A (en) * 2019-12-31 2020-05-26 海能达通信股份有限公司 Video monitoring positioning method and video monitoring system
CN111523465A (en) * 2020-04-23 2020-08-11 中船重工鹏力(南京)大气海洋信息系统有限公司 Ship identity recognition system based on camera calibration and deep learning algorithm
CN111611989A (en) * 2020-05-22 2020-09-01 四川智动木牛智能科技有限公司 Multi-target accurate positioning identification method based on autonomous robot

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
张永举;顾旭波;张健;王兵;郭玲;: "结构光与双目视觉相结合的三维测量", 计算机与现代化, no. 02 *
李丹: "面向三维激光扫描的无变形纹理映射技术研究", 中国优秀硕士学位论文全文数据库信息科技辑, no. 11 *
李铀;宋利;王嘉;: "基于图像拼接的双摄像机系统自动标定方法", 电视技术, no. 04 *
闫珊;姚立波;杨志晖;: "基于智能相机的工业机器人引导与抓取", 常州信息职业技术学院学报, no. 03 *

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112734855A (en) * 2020-12-31 2021-04-30 网络通信与安全紫金山实验室 Space beam pointing method, system and storage medium
CN112734855B (en) * 2020-12-31 2024-04-16 网络通信与安全紫金山实验室 Space beam pointing method, system and storage medium
CN115375779A (en) * 2022-10-27 2022-11-22 智广海联(天津)大数据技术有限公司 Method and system for marking AR (augmented reality) real scene of camera
CN115546304A (en) * 2022-11-24 2022-12-30 海纳云物联科技有限公司 Method and device for detecting and positioning three-dimensional coordinate system based on camera
CN115546304B (en) * 2022-11-24 2023-04-11 海纳云物联科技有限公司 Method and device for detecting and positioning three-dimensional coordinate system based on camera
CN116228888A (en) * 2023-04-21 2023-06-06 智广海联(天津)大数据技术有限公司 Conversion method and system for geographic coordinates and PTZ camera coordinates
CN116228888B (en) * 2023-04-21 2023-08-22 智广海联(天津)大数据技术有限公司 Conversion method and system for geographic coordinates and PTZ camera coordinates

Similar Documents

Publication Publication Date Title
CN112116529A (en) PTZ camera-based conversion method for GPS coordinates and pixel coordinates
CN112894832B (en) Three-dimensional modeling method, three-dimensional modeling device, electronic equipment and storage medium
CN110148169B (en) Vehicle target three-dimensional information acquisition method based on PTZ (pan/tilt/zoom) pan-tilt camera
CN110363158B (en) Millimeter wave radar and visual cooperative target detection and identification method based on neural network
WO2020062434A1 (en) Static calibration method for external parameters of camera
WO2020107931A1 (en) Pose information determination method and apparatus, and visual point cloud construction method and apparatus
CN109523471A (en) A kind of conversion method, system and the device of ground coordinate and wide angle cameras picture coordinate
CN110706273B (en) Real-time collapse area measurement method based on unmanned aerial vehicle
CN111914049A (en) Method for mapping longitude and latitude coordinates and image coordinates
CN113029128A (en) Visual navigation method and related device, mobile terminal and storage medium
CN112348775A (en) Vehicle-mounted all-round-looking-based pavement pool detection system and method
CN106643735A (en) Indoor positioning method and device and mobile terminal
CN113569647B (en) AIS-based ship high-precision coordinate mapping method
CN112200875B (en) Method and system for cross-coupling error compensation and image matching correction of non-metrology camera
CN112446915A (en) Picture-establishing method and device based on image group
CN111710002B (en) Camera external parameter calibration method based on Optitrack system
CN116309851B (en) Position and orientation calibration method for intelligent park monitoring camera
CN116228888B (en) Conversion method and system for geographic coordinates and PTZ camera coordinates
CN107705272A (en) A kind of high-precision geometric correction method of aerial image
JPH09153131A (en) Method and device for processing picture information and picture information integrating system
CN110503604A (en) It is a kind of based on high-precision POS aviation face battle array image just penetrate joining method in real time
CN113658271A (en) Obstacle space coordinate edge calculation method based on road side monocular vision
CN110706260A (en) Method for detecting moving target in large scene by combining positioning information
CN110298788A (en) A kind of full-view image joining method and system based on vehicle-mounted fisheye camera
CN116612184B (en) Unmanned aerial vehicle camera pose accurate estimation method based on monitoring scene

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination