CN115100026B - Label coordinate conversion method, device, equipment and storage medium based on target object - Google Patents

Label coordinate conversion method, device, equipment and storage medium based on target object Download PDF

Info

Publication number
CN115100026B
CN115100026B CN202210676775.5A CN202210676775A CN115100026B CN 115100026 B CN115100026 B CN 115100026B CN 202210676775 A CN202210676775 A CN 202210676775A CN 115100026 B CN115100026 B CN 115100026B
Authority
CN
China
Prior art keywords
parameter
horizontal
vertical
correction
angle
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.)
Active
Application number
CN202210676775.5A
Other languages
Chinese (zh)
Other versions
CN115100026A (en
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.)
PCI Technology Group Co Ltd
Original Assignee
PCI Technology Group 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 PCI Technology Group Co Ltd filed Critical PCI Technology Group Co Ltd
Priority to CN202210676775.5A priority Critical patent/CN115100026B/en
Publication of CN115100026A publication Critical patent/CN115100026A/en
Application granted granted Critical
Publication of CN115100026B publication Critical patent/CN115100026B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • G06T3/04
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/70Determining position or orientation of objects or cameras

Abstract

The embodiment of the application discloses a label coordinate conversion method, device and equipment based on a target object and a storage medium. According to the technical scheme provided by the embodiment of the application, the first shooting parameters of the camera and the picture parameters are obtained in the first picture; determining pixel coordinates of a tag of a target object in the first picture based on the first shooting parameters, picture parameters and a pre-constructed spherical coordinate system; determining a first horizontal correction parameter and a first vertical correction parameter based on the pixel coordinates and the picture parameters; and introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates. According to the technical scheme provided by the embodiment of the application, the problem that deviation exists in label coordinate conversion can be solved, and the label coordinate conversion accuracy of the target object is improved.

Description

Label coordinate conversion method, device, equipment and storage medium based on target object
Technical Field
The embodiment of the application relates to the technical field of image processing, in particular to a label coordinate conversion method, device and equipment based on a target object and a storage medium.
Background
With the rapid development of photography, video monitoring has become a particularly important ring in people's life. In the existing video monitoring management system, in order to facilitate management of elements in each frame of video, a user is more inclined to tag picture elements with tags.
At present, label marking is carried out in a picture output by a fixed camera, but many cameras in the prior art are rotatable and variable in size, after the camera rotates or zooms, some parameters of the output picture are changed, and the previously marked label is not corresponding to elements in a new picture, so that the positioning of the label needs to be recalculated to change the label position to realize label following.
The existing label positioning calculation is to convert the two-dimensional coordinates of the label in the picture into three-dimensional coordinates, and convert the three-dimensional coordinates of the label into new two-dimensional coordinates after the camera rotates or zooms, so as to obtain the new positioning of the label in the video picture. However, since the frame captured by the camera is not a standard rectangle, the frame captured by the camera is a wide-angle frame after wide-angle distortion, and the frame output is a rectangle frame obtained by correcting the wide-angle frame, a mode of directly converting the three-dimensional coordinates of the tag into two-dimensional coordinates is adopted, so that a certain deviation exists in the obtained tag positioning result, and the tag following effect is poor.
Disclosure of Invention
The embodiment of the application provides a label coordinate conversion method, device and equipment based on a target object and a storage medium, which can solve the problem that deviation exists in label coordinate conversion and improve the label coordinate conversion accuracy of the target object.
In a first aspect, an embodiment of the present application provides a tag coordinate conversion method based on a target object, including:
in a first picture, acquiring a first shooting parameter of a camera and a picture parameter;
determining pixel coordinates of a tag of a target object in the first picture based on the first shooting parameters, picture parameters and a pre-constructed spherical coordinate system;
determining a first horizontal correction parameter and a first vertical correction parameter based on the pixel coordinates and the picture parameters;
and introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates.
Further, after the deviation rectifying spherical coordinates are obtained, the method further includes:
if the tag positioning triggering event is monitored, acquiring a second shooting parameter of a second picture shot by the camera;
determining a second horizontal correction parameter and a second vertical correction parameter according to the second shooting parameter, the picture parameter and the correction sphere coordinates;
And based on the picture parameters, introducing the second horizontal correction parameters and the second vertical correction parameters, and performing pixel coordinate conversion on the correction ball coordinates to obtain a label positioning result.
Further, the picture parameters include a horizontal resolution and a vertical resolution;
the determining a first horizontal correction parameter and a first vertical correction parameter based on the pixel coordinates and the picture parameters includes:
obtaining the first horizontal deviation correcting parameter based on the ratio of the horizontal distance between the pixel coordinates and the picture center point to half of the horizontal resolution;
and obtaining the first vertical deviation correction parameter based on the ratio of the vertical distance between the pixel coordinates and the picture center point to half of the vertical resolution.
Further, the introducing the first horizontal correction parameter and the first vertical correction parameter, performing spherical coordinate transformation on the pixel coordinate to obtain a correction spherical coordinate, includes:
correcting the first shooting parameter based on the first horizontal correction parameter and the first vertical correction parameter to obtain a corrected shooting parameter;
performing three-dimensional coordinate conversion on the pixel coordinates according to the corrected shooting parameters to obtain three-dimensional coordinates;
And performing spherical coordinate conversion according to the three-dimensional coordinates to obtain the deviation correcting spherical coordinates.
Further, the first shooting parameters include a first horizontal angle of view, a first vertical angle of view, a first horizontal angle of rotation, and a first vertical angle of rotation;
the correcting the first shooting parameter based on the first horizontal correction parameter and the first vertical correction parameter to obtain a corrected shooting parameter includes:
correcting the first horizontal angle of view based on the first horizontal correction parameter to obtain a horizontal correction shooting parameter;
correcting the first vertical field angle based on the first vertical correction parameter to obtain a vertical correction shooting parameter;
the three-dimensional coordinate conversion is performed on the pixel coordinates according to the corrected shooting parameters to obtain three-dimensional coordinates, and the method comprises the following steps:
and performing three-dimensional coordinate conversion according to the horizontal correction shooting parameter, the vertical correction shooting parameter, the first horizontal rotation angle and the first vertical rotation angle to obtain three-dimensional coordinates.
Further, the second shooting parameters comprise a second horizontal field angle, a second vertical field angle, a second horizontal rotation angle and a second vertical rotation angle;
the determining a second horizontal correction parameter and a second vertical correction parameter according to the second shooting parameter and the correction sphere coordinates includes:
Performing trigonometric function operation on the deviation correcting ball coordinates, the second horizontal rotation angle and the second vertical rotation angle to obtain corrected angle parameters;
and obtaining a second horizontal correction parameter and a second vertical correction parameter according to the ratio of the correction angle parameter to the second horizontal angle of view and the second vertical angle of view.
Further, the correction angle parameters comprise a horizontal correction tangent value and a vertical correction tangent value;
obtaining a second horizontal correction parameter and a second vertical correction parameter according to the ratio of the correction angle parameter to the second horizontal angle of view and the second vertical angle of view, including:
obtaining the second horizontal correction parameter according to the ratio of the horizontal correction tangent value to half of the tangent value of the second horizontal field angle;
and obtaining the second vertical correction parameter according to the ratio of the vertical correction tangent to half of the tangent of the second vertical field angle.
Further, the picture parameters include a horizontal resolution and a vertical resolution;
the step of introducing the second horizontal correction parameter and the second vertical correction parameter based on the picture parameter, and performing pixel coordinate conversion on the correction sphere coordinates to obtain a label positioning result, comprises the following steps:
Multiplying the second horizontal correction parameter by half of the horizontal resolution of the picture parameter to obtain a horizontal correction value, and obtaining an abscissa of a label positioning result based on the sum of the horizontal correction value and half of the horizontal resolution of the picture parameter;
multiplying the second vertical correction parameter by half of the vertical resolution of the picture parameter to obtain a vertical correction value, and obtaining an ordinate of a label positioning result based on the sum of the vertical correction value and half of the vertical resolution of the picture parameter;
and obtaining the label positioning result coordinate based on the abscissa and the ordinate of the label positioning result.
In a second aspect, an embodiment of the present application provides a tag coordinate conversion apparatus based on a target object, including:
a parameter obtaining unit, configured to obtain, in a first frame, a first shooting parameter of a camera, and a frame parameter;
a pixel coordinate acquiring unit, configured to determine a pixel coordinate of a tag of a target object in the first picture based on the first shooting parameter, the picture parameter, and a spherical coordinate system that is constructed in advance;
the correction parameter acquisition unit is used for determining a first horizontal correction parameter and a first vertical correction parameter based on the pixel coordinates and the picture parameters;
And the deviation rectifying spherical coordinate acquisition unit is used for introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates.
Further, the device also comprises a label positioning result obtaining unit;
the parameter obtaining unit is further configured to obtain a second shooting parameter of the camera shooting a second picture if the tag positioning triggering event is monitored;
the correction parameter obtaining unit is further configured to determine a second horizontal correction parameter and a second vertical correction parameter according to the second shooting parameter, the picture parameter and the correction sphere coordinate;
the label positioning result obtaining unit is used for introducing the second horizontal deviation correcting parameter and the second vertical deviation correcting parameter based on the picture parameter, and performing pixel coordinate conversion on the deviation correcting spherical coordinates to obtain a label positioning result.
Further, the picture parameters include a horizontal resolution and a vertical resolution;
the correction parameter obtaining unit is further configured to obtain the first horizontal correction parameter based on a ratio of the horizontal distance between the pixel coordinate and the center point of the picture to half of the horizontal resolution;
And obtaining the first vertical deviation correction parameter based on the ratio of the vertical distance between the pixel coordinates and the picture center point to half of the vertical resolution.
Further, the correcting spherical coordinate acquiring unit is further configured to correct the first shooting parameter based on the first horizontal correcting parameter and the first vertical correcting parameter, so as to obtain a corrected shooting parameter;
performing three-dimensional coordinate conversion on the pixel coordinates according to the corrected shooting parameters to obtain three-dimensional coordinates;
and performing spherical coordinate conversion according to the three-dimensional coordinates to obtain the deviation correcting spherical coordinates.
Further, the first shooting parameters include a first horizontal angle of view, a first vertical angle of view, a first horizontal angle of rotation, and a first vertical angle of rotation;
the device also comprises a corrected shooting parameter acquisition unit;
the corrected shooting parameter obtaining unit is used for correcting the first horizontal angle of view based on the first horizontal correction parameter to obtain a horizontal corrected shooting parameter;
correcting the first vertical field angle based on the first vertical correction parameter to obtain a vertical correction shooting parameter;
the correcting ball coordinate obtaining unit is further used for performing three-dimensional coordinate conversion according to the horizontal correction shooting parameter, the vertical correction shooting parameter, the first horizontal rotation angle and the first vertical rotation angle to obtain three-dimensional coordinates.
Further, the second shooting parameters comprise a second horizontal field angle, a second vertical field angle, a second horizontal rotation angle and a second vertical rotation angle;
the correction parameter obtaining unit is further configured to perform trigonometric function operation on the correction spherical coordinates, the second horizontal rotation angle and the second vertical rotation angle to obtain correction angle parameters;
and obtaining a second horizontal correction parameter and a second vertical correction parameter according to the ratio of the correction angle parameter to the second horizontal angle of view and the second vertical angle of view.
Further, the correction angle parameters comprise a horizontal correction tangent value and a vertical correction tangent value;
the correction parameter obtaining unit is further configured to obtain the second horizontal correction parameter according to a ratio of the horizontal correction tangent value to a half of the tangent value of the second horizontal field angle;
and obtaining the second vertical correction parameter according to the ratio of the vertical correction tangent to half of the tangent of the second vertical field angle.
Further, the picture parameters include a horizontal resolution and a vertical resolution;
the label positioning result obtaining unit is further configured to multiply the second horizontal correction parameter with half of the horizontal resolution of the frame parameter to obtain a horizontal correction value, and obtain an abscissa of the label positioning result based on a sum of the horizontal correction value and half of the horizontal resolution of the frame parameter;
Multiplying the second vertical correction parameter by half of the vertical resolution of the picture parameter to obtain a vertical correction value, and obtaining an ordinate of a label positioning result based on the sum of the vertical correction value and half of the vertical resolution of the picture parameter;
and obtaining the label positioning result coordinate based on the abscissa and the ordinate of the label positioning result.
In a third aspect, an embodiment of the present application provides a tag coordinate conversion apparatus based on a target object, including:
a memory and one or more processors;
the memory is used for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the target object based tag coordinate conversion method as described in the first aspect.
In a fourth aspect, embodiments of the present application provide a storage medium storing computer-executable instructions, which when executed by a computer processor, are for performing the target object based label coordinate conversion method of the first aspect.
According to the method, the first shooting parameters of the camera and the picture parameters are obtained in the first picture, the pixel coordinates of the labels of the target objects in the first picture are determined based on the first shooting parameters and the picture parameters and a pre-constructed spherical coordinate system, the first horizontal deviation correcting parameters and the first vertical deviation correcting parameters are determined based on the pixel coordinates and the picture parameters, the first horizontal deviation correcting parameters and the first vertical deviation correcting parameters are introduced, spherical coordinate conversion is conducted on the pixel coordinates, and deviation correcting spherical coordinates are obtained. By adopting the technical means, the first horizontal deviation correcting parameter and the first vertical deviation correcting parameter can be introduced to carry out spherical coordinate conversion on the pixel coordinates to obtain deviation correcting spherical coordinates, so that deviation caused by wide-angle deformation correction when the target object label coordinates are converted into three-dimensional spherical coordinates from the pixel coordinates is reduced, label coordinate conversion accuracy of the target object is improved, and then the following effect of the label is improved.
Drawings
Fig. 1 is a flowchart of a label coordinate conversion method based on a target object according to an embodiment of the present application;
FIG. 2 is a schematic view of the field angle provided by an embodiment of the present application;
FIG. 3 is a schematic view of a spherical coordinate system according to an embodiment of the present application;
FIG. 4 is a schematic diagram of tag coordinates provided in an embodiment of the present application;
FIG. 5 is a flowchart of another label coordinate conversion method based on a target object according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of a tag coordinate conversion apparatus based on a target object according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a tag coordinate conversion apparatus based on a target object according to an embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the present application more apparent, the following detailed description of specific embodiments thereof is given with reference to the accompanying drawings. It is to be understood that the specific embodiments described herein are merely illustrative of the application and not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the matters related to the present application are shown in the accompanying drawings. Before discussing exemplary embodiments in more detail, it should be mentioned that some exemplary embodiments are described as processes or methods depicted as flowcharts. Although a flowchart depicts operations (or steps) as a sequential process, many of the operations can be performed in parallel, concurrently, or at the same time. Furthermore, the order of the operations may be rearranged. The process may be terminated when its operations are completed, but may have additional steps not included in the figures. The processes may correspond to methods, functions, procedures, subroutines, and the like.
According to the label coordinate conversion method, device, equipment and storage medium based on the target object, when the label coordinate is converted, the first horizontal deviation correction parameter and the first vertical deviation correction parameter are introduced to convert the spherical coordinate of the pixel coordinate to obtain the deviation correction spherical coordinate, so that deviation caused by wide-angle deformation correction when the label coordinate of the target object is converted into the three-dimensional spherical coordinate from the pixel coordinate is reduced, the label coordinate conversion accuracy of the target object is improved, and the following effect of the label is improved. Compared with the traditional label coordinate conversion mode, the influence caused by wide-angle deformation correction is not considered, the image captured by the camera is a wide-angle image obtained through wide-angle deformation, the output image is a rectangular image obtained by correcting the wide-angle image, and the two-dimensional coordinate of the label is directly converted into the three-dimensional coordinate, or the three-dimensional coordinate of the label is directly converted into the two-dimensional coordinate, so that a certain deviation exists in the label positioning result after conversion, and the label following effect is poor. Based on the above, the label coordinate conversion method based on the target object in the embodiment of the application is provided to solve the problem that the existing label coordinate conversion has deviation.
Fig. 1 is a flowchart of a tag coordinate conversion method based on a target object according to an embodiment of the present application, where the tag coordinate conversion method based on a target object provided in the present embodiment may be executed by a tag coordinate conversion apparatus based on a target object, where the tag coordinate conversion apparatus based on a target object may be implemented by software and/or hardware, and the tag coordinate conversion apparatus based on a target object may be configured by two or more physical entities or may be configured by one physical entity. In general, the tag coordinate conversion apparatus based on the target object may be a terminal apparatus such as a computer apparatus or the like.
The following description will be made taking a computer device as an example of a main body for performing a tag coordinate conversion method based on a target object. Referring to fig. 1, the tag coordinate conversion method based on the target object specifically includes:
s101, in a first picture, acquiring a first shooting parameter of a camera and a picture parameter.
Before the coordinate conversion of the target object, the label needs to be acquired, and the label is generally formed by labeling the target object in a picture output by a camera. Then, before the label coordinate conversion of the target object is performed, the corresponding picture parameters are acquired first. Therefore, a first screen before the target object tag coordinate conversion is acquired, and in the first screen, a first shooting parameter of a camera shooting the first screen and a screen parameter of the first screen are acquired based on the parameter content of the first screen. The first picture may be a certain frame picture in the video or may be a photo picture. Wherein the camera taking the first picture may be a ball type camera or a rotatable hole type camera. The first shooting parameters comprise a first horizontal view angle, a first vertical view angle, a first horizontal rotation angle, a first vertical rotation angle, a first focal length and the like. Wherein the picture parameters of the first picture include a horizontal resolution and a vertical resolution. By acquiring the first shooting parameters of the camera and the picture parameters in the first picture, necessary parameters are provided for coordinate acquisition of the tag and coordinate conversion of the tag.
Fig. 2 is a schematic view of the angle of view provided in the embodiment of the present application, referring to fig. 2, the angle of view is an included angle formed by two edge lines of the maximum range of the lens, where the lens of the optical instrument is taken as the vertex, and the object image of the measured object can pass through the lens, and the angle of view can be represented by Fov. In the case of a camera, since its photosurface is rectangular, the angle of view is divided into a horizontal angle of view, which may be denoted by hFov, and a vertical angle of view, which may be denoted by vFov. As shown in fig. 2, the lens of the camera is taken as the vertex Q, the light sensitive surface is taken as a rectangle ABCD, and the horizontal angle of view is +. AQB, and the vertical angle of view is +.bqc.
S102, determining pixel coordinates of a tag of a target object in the first picture based on the first shooting parameters, the picture parameters and a pre-constructed spherical coordinate system.
When the coordinate conversion is performed based on the label of the target object, a corresponding pre-constructed spherical coordinate system and a corresponding two-dimensional coordinate system are required. Fig. 3 is a schematic diagram of a spherical coordinate system provided in an embodiment of the present application, and referring to fig. 3, when a spherical coordinate system is pre-constructed, an X axis, a Y axis, and a Z axis are established to intersect at an origin O by using a camera as the origin O, so as to construct the spherical coordinate system. Assuming that there is a P point in the spherical coordinate system, the radial distance between the origin O and the P point is r, the angle between the origin O-P point line OP and the positive Z axis is zenith angle (pitch angle) θ, and the angle between the origin 0-P point line OP' and the positive X axis is azimuth angle (yaw angle) Φ, in the spherical coordinate system as described in fig. 3, the spherical coordinates (r, θ, Φ) are used to represent the three-dimensional orthogonal coordinates of the position of one point P in the three-dimensional space in the spherical coordinate system.
Fig. 4 is a schematic diagram of tag coordinates provided in the embodiment of the present application, referring to fig. 4, and based on a first shooting parameter, when the rotation angle of the camera is 0, the direction of the camera lens facing the photosurface is an X-axis, the vertical direction is a Z-axis, and a spherical coordinate system is pre-constructed. Wherein the first screen is generated based on the photosensitive surface correspondence. And establishing a two-dimensional pixel coordinate system by using a rectangular view field plane of the light sensitive surface, and establishing a corresponding two-dimensional pixel coordinate system according to the horizontal resolution and the vertical resolution in the picture parameters, wherein the label P point of the target object is positioned in the rectangular plane of the light sensitive surface, so that the pixel coordinate of the label P point can be obtained. As shown in fig. 4, assuming that the field-of-view plane of the photosurface is rectangular ABCD, based on the first photographing parameter, when the camera rotation angle is 0, a two-dimensional pixel coordinate system is constructed with C point as the origin, CB as the X axis, and CD as the Y axis, where the length of CB is the pixel length of the horizontal resolution and the length of CD is the pixel length of the vertical resolution. According to the two-dimensional pixel coordinate system, the pixel coordinate of the tag P point of the target object in the two-dimensional pixel coordinate system can be obtained.
S103, determining a first horizontal deviation rectifying parameter and a first vertical deviation rectifying parameter based on the pixel coordinates and the picture parameters.
In an embodiment, based on the fact that the frame captured by the camera is not a standard rectangle, the frame captured by the camera is a wide-angle frame after wide-angle deformation, and the frame output by the camera is a rectangle frame obtained after the wide-angle frame is corrected, therefore, when the coordinate conversion of the label is performed, the pixel coordinate cannot be directly converted into the three-dimensional coordinate, the conversion deviation caused by the wide-angle deformation and the correction needs to be corrected, and therefore, the corresponding correction parameters need to be acquired before the coordinate conversion is performed. And obtaining a first horizontal deviation correcting parameter based on the ratio of the horizontal distance between the pixel coordinates and the picture center point to half of the horizontal resolution. And obtaining a first vertical deviation correcting parameter based on the ratio of the vertical distance between the pixel coordinates and the picture center point to half of the vertical resolution. The first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter are determined based on the pixel coordinates and the picture parameters, so that a wide-angle picture shot by the camera can be restored when the pixel coordinates are converted into three-dimensional coordinates subsequently, and the coordinate conversion is more accurate.
In an embodiment, referring to fig. 4, in a two-dimensional pixel coordinate system constructed by using a rectangular ABCD as a field-of-view plane of the photosurface, a center point of a picture is an F point, a horizontal resolution may be represented by width, a vertical resolution may be represented by height, a half of the horizontal resolution may be represented by half width, and a half of the vertical resolution may be represented by half height, where half width=width/2, half height=height/2; therefore, the pixel coordinate of the F point can be obtained as F (halfWidth, halfwight). According to the ratio of the horizontal distance (x 1-halfwith) between the label pixel coordinates P (x 1, y 1) and the F point to half of the horizontal resolution (halfwith), a first horizontal deviation correcting parameter xRadio1, namely xRadio 1= (x 1-halfwith)/halfwith is obtained. Similarly, according to the ratio of the vertical distance (y 1-halfHeigh) between the pixel coordinates P (x 1, y 1) of the label and the F point to half of the vertical resolution (halfHeigh), a first vertical correction parameter yRaio 1, namely yRaio 1= (y 1-halfHeight)/halfHeigh, is obtained. The corresponding first horizontal deviation correcting parameter and first vertical deviation correcting parameter are obtained by obtaining the ratio of the horizontal distance and the vertical distance of the pixel coordinates to the F point of the picture center point, and when the pixel coordinates are converted into three-dimensional coordinates, the wide-angle picture shot by the camera can be restored, so that the coordinate conversion is more accurate.
S104, introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates.
In one embodiment, in order to correct the conversion deviation caused by the wide-angle distortion and correction, the corresponding first horizontal correction parameter and first vertical correction parameter are determined by the above step S103 before the coordinate conversion is performed. After the first horizontal correction parameter and the first vertical correction parameter are determined, the corresponding first horizontal correction parameter and first vertical correction parameter can be introduced in the process of performing spherical coordinate conversion on the pixel coordinates, so that the correction spherical coordinates obtained after coordinate conversion more accord with the label spherical coordinates of the wide-angle picture before correction, and the accuracy of label coordinate conversion is improved.
In one embodiment, a specific implementation of performing spherical coordinate conversion on pixel coordinates is provided. And correcting the first shooting parameter based on the first horizontal deviation correcting parameter and the first vertical deviation correcting parameter determined in the step S103, so as to obtain a corrected shooting parameter. The corrected shooting parameters comprise horizontal corrected shooting parameters and vertical corrected shooting parameters, and the corrected shooting parameters can be obtained by the following mode, wherein the first shooting parameters comprise a first horizontal view angle, a first vertical view angle, a first horizontal rotation angle and a first vertical rotation angle. And correcting the first horizontal angle of view in the first shooting parameters based on the first horizontal correction parameters to obtain horizontal correction shooting parameters. And similarly, correcting the first vertical field angle in the first shooting parameters based on the first vertical correction parameters to obtain vertical correction shooting parameters. And after the corrected shooting parameters are obtained, carrying out three-dimensional coordinate conversion on the pixel coordinates according to the corrected shooting parameters to obtain three-dimensional coordinates, and then carrying out spherical coordinate conversion based on the three-dimensional coordinates to obtain the deviation correcting spherical coordinates. The three-dimensional coordinates can be obtained by performing three-dimensional coordinate conversion according to the horizontal correction shooting parameter, the vertical correction shooting parameter, the first horizontal rotation angle and the first vertical rotation angle in the following specific embodiments, and the three-dimensional coordinates are obtained. After the three-dimensional coordinates are obtained, the r value of the spherical coordinates can be obtained according to the distance between the center point F of the rectangular ABCD and the spherical coordinate origin point E of the view field plane of the light sensing surface, and then the corresponding theta value and phi value of the spherical coordinates are obtained by performing spherical coordinate conversion according to the three-dimensional coordinates, so that the corresponding deviation correcting spherical coordinates (r, theta, phi) are obtained.
In an embodiment, referring to fig. 4, according to the field plane rectangle ABCD of the point E of the camera lens and the photosurface, a first horizontal angle of view in the first shooting parameter may be obtained and may be represented by hFov1, i.e., angle ceb=hfov 1, so as to obtain angle FEH which is half of the first horizontal angle of view, i.e., angle feh=halfhfov 1, where halfhFov 1=hfov 1/2. According to the rectangular ABCD of the field plane of the camera lens E point and the light sensing surface, a first vertical angle of view in the first shooting parameter may be obtained as +.bea, the first vertical angle of view may be represented by vFov1, that is +.bea=vfov 1, so that +.fei=halfvfov 1, where halfvFov 1=vfov 1/2, a first horizontal rotation angle in the first shooting parameter may be represented by pan1, and a first vertical rotation angle may be represented by tilt 1. Wherein the first horizontal rotation angle pan1 and the first vertical rotation angle tilt1 represent horizontal angles and vertical angles rotated when the camera rotation angle relative to the camera at the time of photographing the first picture is 0. Based on the above step S103, a first horizontal correction parameter xRadio1 and a first vertical correction parameter yRadio1 are obtained, and the first horizontal angle of view in the first shooting parameter is corrected by multiplying the first horizontal correction parameter xRadio1 by the tangent value tan (halfhFov 1) of half of the first horizontal angle of view in the first shooting parameter, so as to obtain a horizontal correction shooting parameter xtan1, i.e., xtan1=xradio1×tan (halfhFov 1). The first vertical correction parameter yRadio1 is multiplied by a tangent tan (halfvFov 1) of half of the first vertical field angle in the first photographing parameter, and the first vertical field angle in the first photographing parameter is corrected, to obtain a vertical correction photographing parameter ytan1, that is, ytan 1=yradio 1×tan (halfvFov 1).
In an embodiment, the horizontal correction shooting parameter xtan1 and the vertical correction shooting parameter ytan1 obtained by the calculation are provided to a specific implementation manner of performing three-dimensional coordinate conversion on the pixel coordinates according to the horizontal correction shooting parameter and the vertical correction shooting parameter to obtain three-dimensional coordinates. At this time, the angle corresponding to the spherical coordinates of the picture center point F in the first picture is the rotation angle of the camera, the corresponding angle is the first horizontal rotation angle pan1 and the first vertical rotation angle tilt1, the sine value and the cosine value of the rotation angle of the corresponding F point are calculated, the sine value of the first horizontal rotation angle pan1 is sinPhi 1=sin (pan 1), wherein sinPhi1 is the calculated intermediate value, and the sine value of the first horizontal rotation angle pan1 is represented. Similarly, the cosine value of the first horizontal rotation angle pan1 is cosPhi 1=cos (pan 1), where cosPhi1 is a calculated intermediate value representing the cosine value of the first horizontal rotation angle pan 1. Similarly, the sine value of the first vertical rotation angle tilt1 is obtained as sinTheta 1=sin (tilt 1), wherein sinTheta1 is a calculated intermediate value, and represents the sine value of the first vertical rotation angle tilt 1. Similarly, the cosine value of the first vertical rotation angle tilt1 is cosTheta 1=cos (tilt 1), where cosTheta1 is a calculated intermediate value representing the cosine value of the first vertical rotation angle tilt 1. Assuming that the distance between the P point of the tag and the original point E is 1, introducing a horizontal correction shooting parameter xtan1 and a vertical correction shooting parameter ytan1, calculating the three-dimensional coordinate of the P point of the tag under a three-dimensional coordinate system according to a trigonometric function formula, and obtaining the three-dimensional coordinate of the P point as P (xCoord, yCoord, zCoord), wherein xCoord=cosTheta1×sinPhi1+xta1×cosPhi 1-xta1×sinPhi1, yCoord=cosTheta1×cosPhi1-xtan1×sinPhi 1-zCoord 1+sinT1×cosPhi 1.
In an embodiment, after the three-dimensional coordinates P (xCoord, yCoord, zCoord) of the P point are obtained according to the above implementation process, a specific implementation manner of converting the spherical coordinates based on the three-dimensional coordinates is provided to obtain the rectifying spherical coordinates. The distance r1 from the center point F to the origin point E of the field-of-view plane rectangle ABCD of the photosurface is calculated from the three-dimensional coordinates of point P, where r1=sqrt (xcoord×xcoord+ycoord+zcoord×zcoord), where sqrt stands for square root. So that the zenith angle (pitch angle) θ1 of the P-point and the azimuth angle (yaw angle) Φ1 can be obtained according to the distance r1, wherein Φ1=atan (xCoord/yCoord), θ1=asin (zCoord/r), wherein atan represents an arctangent function, and atan (xCoord/yCoord) represents an arctangent value of (xCoord/yCoord); the asin represents the arcsine function, and the asin (zCoord/r) represents the arcsine value of the solution (zCoord/r). Since the calculation process is obtained assuming that the distance between the point P and the origin E is 1, the spherical coordinates of the point P (1, θ1, Φ1) can be obtained. In practical application, the difference distance R between the P point and the origin E can be calculated according to the above embodiment to obtain the spherical coordinate of the P point as P (R, θ1, Φ1).
It should be noted that, all the above calculation of the related angles are radian units, and if the obtained shooting parameters of the camera are angle units, the shooting parameters need to be converted into radian units for corresponding calculation.
In the above, the first shooting parameter of the camera and the picture parameter are obtained in the first picture, the pixel coordinates of the tag of the target object in the first picture are determined based on the first shooting parameter and the picture parameter and the pre-constructed spherical coordinate system, the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter are determined based on the pixel coordinates and the picture parameter, the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter are introduced, and the spherical coordinate conversion is performed on the pixel coordinates to obtain the deviation rectifying spherical coordinates. By adopting the technical means, the first horizontal deviation correcting parameter and the first vertical deviation correcting parameter can be introduced to carry out spherical coordinate conversion on the pixel coordinates to obtain deviation correcting spherical coordinates, so that deviation caused by wide-angle deformation correction when the target object label coordinates are converted into three-dimensional spherical coordinates from the pixel coordinates is reduced, label coordinate conversion accuracy of the target object is improved, and then the following effect of the label is improved.
On the other hand, referring to fig. 5, another label coordinate conversion method based on the target object according to the embodiment of the present application is provided. The label coordinate conversion method based on the target object is correspondingly executed by the server, and after the deviation rectifying spherical coordinates are obtained, the flow of the label coordinate conversion method based on the target object comprises the following steps:
S201, if a tag positioning trigger event is monitored, acquiring a second shooting parameter of a second picture shot by the camera.
After the correction spherical coordinates are obtained in the steps S101-S104, if the camera rotates or zooms, the pixel coordinates of the target object of the label mark corresponding to the image obtained by shooting are different from the pixel coordinates of the first image, so that the pixel coordinates of the label corresponding to the target in the second image need to be obtained, and the label is moved from the pixel coordinates of the first image to the pixel coordinates of the label in the second image, so as to update the position of the label, and realize the following of the label. After the deviation correcting spherical coordinates are obtained, whether the camera rotates or zooms and other label positioning triggering events are monitored in real time, if the camera rotates or zooms and other label positioning triggering events are monitored, a second picture shot after the camera rotates or zooms is obtained, and the corresponding shooting parameters are changed based on the second picture, so that the corresponding second shooting parameters can be obtained by obtaining the second picture shot by the camera. The second shooting parameters comprise a second horizontal view angle, a second vertical view angle, a second horizontal rotation angle, a second vertical rotation angle and a second focal length. By acquiring the second shooting parameters in the second picture, necessary parameters are provided for the acquisition of the coordinates of the tag and the coordinate conversion of the tag.
S202, determining a second horizontal correction parameter and a second vertical correction parameter according to the second shooting parameter, the picture parameter and the correction sphere coordinates.
In an embodiment, based on the fact that the frame captured by the camera is not a standard rectangle, the frame captured by the camera is a wide-angle frame after wide-angle deformation, and the frame output by the camera is a rectangle frame obtained after the wide-angle frame is corrected, therefore, when the coordinate conversion of the label is performed, the three-dimensional correction spherical coordinates cannot be directly converted into two-dimensional pixel coordinates, the conversion deviation caused by the wide-angle deformation and the correction needs to be corrected, and therefore, the corresponding correction parameters need to be acquired before the coordinate conversion is performed. The correction angle parameter can be obtained by performing trigonometric function operation on the correction ball coordinate and a second horizontal rotation angle and a second vertical rotation angle in the second shooting parameter; and according to the ratio of the correction angle parameter to the second horizontal angle of view and the second vertical angle of view in the second shooting parameter, the second horizontal correction parameter and the second vertical correction parameter are obtained, and the function of correcting the wide-angle picture shot by the camera to obtain a rectangular picture of the second picture can be achieved before the correction spherical coordinates are converted into pixel coordinates subsequently, so that the coordinate conversion is more accurate.
In an embodiment, the correction angle parameter includes a horizontal correction tangent value and a vertical correction tangent value, and the second horizontal correction parameter may be obtained by according to a ratio of the horizontal correction tangent value in the correction angle parameter to a half of the tangent value of the second horizontal angle of view in the second photographing parameter. Similarly, the second vertical correction parameter may be obtained by determining a ratio of the vertical correction tangent value in the correction angle parameter to half of the tangent value of the second vertical field angle in the second photographing parameter.
In an embodiment, referring to fig. 4, a label positioning trigger event such as rotation or zooming of the camera is monitored under the condition that the resolution of the picture is not changed, so as to obtain second shooting parameters according to the obtained second picture, namely, a second horizontal angle of view hFov2, a second vertical angle of view vFov2, a second horizontal angle of rotation pan2 and a second vertical angle of rotation tilt2. And according to the deviation correcting spherical coordinates P (1, theta 1, phi 1), performing trigonometric function operation on the deviation correcting spherical coordinates and a second horizontal rotation angle and a second vertical rotation angle in the second shooting parameters to obtain corrected angle parameters. The specific trigonometric function operation is as follows: m=cos (θ1) ×sin (Φ1), n=cos (θ1) ×cos (Φ1), o=sin (θ1), sinphi2=sin (pan 2), cosphi2=cos (pan 2), sinTheta 2=sin (tilt 2), cosTheta 2=cos (tilt 2); wherein m, n, o, sinPhi, cosPhi2, sinTheta2 and cosTheta2 are all calculated intermediate values, which are set for the convenience of the calculation process. Similarly, intermediate values t1 to t6 of the calculation process are obtained, wherein t1=cosphi 2×o; t2= -sinTheta2 x sinPhi2 x o-cosTheta2 x m; t3=sintheta 2×m-cosTheta2×sinphi2×o; t4= -sinPhi2 x o; t5= -sinTheta2 x cosPhi2 x o-cosTheta2 x n; t6=sintheta 2×n-cosTheta2×cosphi2×o; thus, the horizontal correction tangent value xtan2 and the vertical correction tangent value ytan2 in the correction angle parameter can be obtained, wherein xtan 2= (t3×t5-t2×t6)/(t1×t5-t2×t4); ytan2= (t3×t4-t1×t6)/(t2×t4-t1×t5). Bringing the intermediate values t1 to t6 of the above calculation process into the corresponding xtan2= (t3×t5-t2×t6)/(t1×t5-t2×t4); ytan 2= (t3×t4-t1×t6)/(t2×t4-t1×t5), the horizontal correction tangent value xtan2 and the vertical correction tangent value ytan2 in the corresponding correction angle parameters can be obtained. Thus, the second horizontal correction parameter xRadio2, that is, xradio2=xta2/tan (halfhFov 2), is obtained by correcting the ratio of the tangent value xtan2 of the horizontal correction angle parameter to half the tangent value tan (halfhFov 2) of the second horizontal angle of view of the second photographing parameter. Similarly, the second vertical correction parameter yRadio2, that is, yradio2=yta2/tan (halfvFov 2) can be obtained by determining a ratio of the vertical correction tangent ytan2 in the correction angle parameter to half tan (halfvFov 2) of the second vertical field angle in the second photographing parameter.
And S203, introducing the second horizontal correction parameter and the second vertical correction parameter based on the picture parameter, and performing pixel coordinate conversion on the correction spherical coordinates to obtain a label positioning result.
In one embodiment, in order to correct the conversion deviation caused by the wide-angle distortion and correction, the corresponding second horizontal correction parameter and second vertical correction parameter are determined by the above step S202 before the coordinate conversion is performed. After the second horizontal deviation correcting parameter and the second vertical deviation correcting parameter are determined, the corresponding second horizontal deviation correcting parameter and the second vertical deviation correcting parameter can be introduced in the process of carrying out pixel coordinate conversion on the deviation correcting spherical coordinates, so that the label positioning result obtained after coordinate conversion is more in line with the pixel coordinates output after the correction of the wide-angle picture shot by the camera, and the accuracy of label coordinate conversion is improved.
In one embodiment, a specific implementation of pixel coordinate conversion for the coordinates of the deviation correcting ball is provided. And (2) introducing the second horizontal correction parameter and the second vertical correction parameter obtained in the step (S202), carrying out pixel coordinate conversion on the spherical coordinates by combining the picture parameters, obtaining a horizontal correction value by multiplying the second horizontal correction parameter by half of the horizontal resolution in the picture parameters, and obtaining the abscissa of the label positioning result based on the sum of the horizontal correction value and half of the horizontal resolution of the picture parameters. Similarly, the vertical correction value can be obtained by multiplying the second vertical correction parameter by half of the vertical resolution of the frame parameter, and the ordinate of the label positioning result can be obtained based on the sum of the vertical correction value and half of the vertical resolution of the frame parameter. And obtaining the label positioning result coordinates based on the abscissa and the ordinate of the label positioning result.
In an embodiment, based on the second horizontal deviation correcting parameter xRadio2 and the second vertical deviation correcting parameter yRadio2, the abscissa x2 of the label positioning result is obtained according to the above embodiment, where x2=xradio2×halfwith+halfwith, and the ordinate y2=yradio2×halfwight+halfwight of the label positioning result is obtained, so as to obtain the label positioning result P (x 2, y 2). Therefore, after the camera rotates or zooms, the new pixel coordinate corresponding to the label of the target object is P (x 2, y 2), and when the second screen is output, the label position of the target object is moved to P (x 2, y 2), thereby realizing label following.
It should be noted that, all the above calculation of the related angles are radian units, and if the obtained shooting parameters of the camera are angle units, the shooting parameters need to be converted into radian units for corresponding calculation.
When the label positioning triggering event is monitored, the second shooting parameters of the second picture shot by the camera are obtained, the second horizontal deviation correcting parameters and the second vertical deviation correcting parameters are determined according to the second shooting parameters, the picture parameters and the deviation correcting spherical coordinates, the second horizontal deviation correcting parameters and the second vertical deviation correcting parameters are introduced based on the picture parameters, and the pixel coordinate conversion is carried out on the deviation correcting spherical coordinates, so that the label positioning result is obtained. By adopting the technical means, the label positioning result can be obtained by carrying out pixel coordinate conversion on the deviation correcting spherical coordinates by introducing the second horizontal deviation correcting parameter and the second vertical deviation correcting parameter, so that the deviation caused by wide-angle deformation correction when the label coordinates of the target object are converted from the three-dimensional spherical coordinates to the two-dimensional pixel coordinates is reduced, the label coordinate conversion accuracy of the target object is improved, and the following effect of the label is further improved.
On the basis of the above embodiments, fig. 6 is a schematic structural diagram of a tag coordinate conversion apparatus based on a target object according to an embodiment of the present application. Referring to fig. 6, the tag coordinate conversion apparatus based on a target object provided in this embodiment specifically includes: a parameter acquisition unit 21, a pixel coordinate acquisition unit 22, a correction parameter acquisition unit 23, and a correction sphere coordinate acquisition unit 24.
Wherein, the parameter obtaining unit 21 is configured to obtain, in a first frame, a first shooting parameter of the camera, and a frame parameter;
a pixel coordinate acquiring unit 22, configured to determine pixel coordinates of a tag of a target object in the first screen based on the first shooting parameter and the screen parameter, and a spherical coordinate system constructed in advance;
a correction parameter obtaining unit 23, configured to determine a first horizontal correction parameter and a first vertical correction parameter based on the pixel coordinates and the picture parameter;
and the deviation rectifying spherical coordinate obtaining unit 24 is used for introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates.
Further, the device also comprises a label positioning result obtaining unit;
The parameter obtaining unit 21 is further configured to obtain a second shooting parameter of the camera to shoot a second picture if the tag positioning triggering event is monitored;
the correction parameter obtaining unit 23 is further configured to determine a second horizontal correction parameter and a second vertical correction parameter according to the second shooting parameter, the picture parameter, and the correction sphere coordinate;
the label positioning result obtaining unit is used for introducing the second horizontal deviation correcting parameter and the second vertical deviation correcting parameter based on the picture parameter, and performing pixel coordinate conversion on the deviation correcting spherical coordinates to obtain a label positioning result.
Further, the picture parameters include a horizontal resolution and a vertical resolution;
the correction parameter obtaining unit 23 is further configured to obtain the first horizontal correction parameter based on a ratio of the horizontal distance between the pixel coordinate and the center point of the frame to half of the horizontal resolution;
and obtaining the first vertical deviation correction parameter based on the ratio of the vertical distance between the pixel coordinates and the picture center point to half of the vertical resolution.
Further, the deviation correcting spherical coordinate obtaining unit 24 is further configured to correct the first shooting parameter based on the first horizontal deviation correcting parameter and the first vertical deviation correcting parameter, so as to obtain a corrected shooting parameter;
Performing three-dimensional coordinate conversion on the pixel coordinates according to the corrected shooting parameters to obtain three-dimensional coordinates;
and performing spherical coordinate conversion according to the three-dimensional coordinates to obtain the deviation correcting spherical coordinates.
Further, the first shooting parameters include a first horizontal angle of view, a first vertical angle of view, a first horizontal angle of rotation, and a first vertical angle of rotation;
the device also comprises a corrected shooting parameter acquisition unit;
the corrected shooting parameter obtaining unit is used for correcting the first horizontal angle of view based on the first horizontal correction parameter to obtain a horizontal corrected shooting parameter;
correcting the first vertical field angle based on the first vertical correction parameter to obtain a vertical correction shooting parameter;
the correcting spherical coordinate obtaining unit 24 is further configured to perform three-dimensional coordinate conversion according to the horizontal correction shooting parameter, the vertical correction shooting parameter, the first horizontal rotation angle, and the first vertical rotation angle, so as to obtain a three-dimensional coordinate.
Further, the second shooting parameters comprise a second horizontal field angle, a second vertical field angle, a second horizontal rotation angle and a second vertical rotation angle;
the correction parameter obtaining unit 23 is further configured to perform trigonometric function operation on the correction spherical coordinates, the second horizontal rotation angle and the second vertical rotation angle to obtain correction angle parameters;
And obtaining a second horizontal correction parameter and a second vertical correction parameter according to the ratio of the correction angle parameter to the second horizontal angle of view and the second vertical angle of view.
Further, the correction angle parameters comprise a horizontal correction tangent value and a vertical correction tangent value;
the correction parameter obtaining unit 23 is further configured to obtain the second horizontal correction parameter according to a ratio of the horizontal correction tangent value to a half of the tangent value of the second horizontal angle of view;
and obtaining the second vertical correction parameter according to the ratio of the vertical correction tangent to half of the tangent of the second vertical field angle.
Further, the picture parameters include a horizontal resolution and a vertical resolution;
the label positioning result obtaining unit is further configured to multiply the second horizontal correction parameter with half of the horizontal resolution of the frame parameter to obtain a horizontal correction value, and obtain an abscissa of the label positioning result based on a sum of the horizontal correction value and half of the horizontal resolution of the frame parameter;
multiplying the second vertical correction parameter by half of the vertical resolution of the picture parameter to obtain a vertical correction value, and obtaining an ordinate of a label positioning result based on the sum of the vertical correction value and half of the vertical resolution of the picture parameter;
And obtaining the label positioning result coordinate based on the abscissa and the ordinate of the label positioning result.
In the above, the first shooting parameter of the camera and the picture parameter are obtained in the first picture, the pixel coordinates of the tag of the target object in the first picture are determined based on the first shooting parameter and the picture parameter and the pre-constructed spherical coordinate system, the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter are determined based on the pixel coordinates and the picture parameter, the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter are introduced, and the spherical coordinate conversion is performed on the pixel coordinates to obtain the deviation rectifying spherical coordinates. By adopting the technical means, the first horizontal deviation correcting parameter and the first vertical deviation correcting parameter can be introduced to carry out spherical coordinate conversion on the pixel coordinates to obtain deviation correcting spherical coordinates, so that deviation caused by wide-angle deformation correction when the target object label coordinates are converted into three-dimensional spherical coordinates from the pixel coordinates is reduced, label coordinate conversion accuracy of the target object is improved, and then the following effect of the label is improved.
The tag coordinate conversion device based on the target object provided by the embodiment of the application can be used for executing the tag coordinate conversion method based on the target object provided by the embodiment, and has corresponding functions and beneficial effects.
An embodiment of the present application provides a tag coordinate conversion apparatus based on a target object, referring to fig. 7, including: processor 31, memory 32, communication module 33, input device 34 and output device 35. The number of processors in the target object based tag coordinate conversion apparatus may be one or more, and the number of memories in the target object based tag coordinate conversion apparatus may be one or more. The processor, memory, communication module, input device and output device of the target object based tag coordinate conversion apparatus may be connected by a bus or other means.
The memory 32 is used as a computer readable storage medium for storing a software program, a computer executable program, and a module, and is a program instruction/module corresponding to the tag coordinate conversion method based on a target object according to any embodiment of the present application (for example, a parameter obtaining unit, a pixel coordinate obtaining unit, a correction parameter obtaining unit, and a correction ball coordinate obtaining unit in the tag coordinate conversion apparatus based on a target object). The memory may mainly include a memory program area and a memory data area, wherein the memory program area may store an operating system, at least one application program required for a function; the storage data area may store data created according to the use of the device, etc. In addition, the memory may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some examples, the memory may further include memory remotely located with respect to the processor, the remote memory being connectable to the device through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The communication module 33 is used for data transmission.
The processor 31 executes various functional applications of the device and data processing by running software programs, instructions and modules stored in the memory, i.e., implements the above-described target object-based tag coordinate conversion method.
The input means 34 may be used to receive entered numeric or character information and to generate key signal inputs related to user settings and function control of the device. The output means 35 may comprise a display device such as a display screen.
The label coordinate conversion device based on the target object provided by the embodiment can be used for executing the label coordinate conversion method based on the target object provided by the embodiment, and has corresponding functions and beneficial effects.
The present embodiments also provide a storage medium storing computer-executable instructions, which when executed by a computer processor, are for performing a target object-based tag coordinate conversion method, the target object-based tag coordinate conversion method comprising: in a first picture, acquiring a first shooting parameter of a camera and a picture parameter; determining pixel coordinates of a tag of a target object in the first picture based on the first shooting parameters, picture parameters and a pre-constructed spherical coordinate system; determining a first horizontal correction parameter and a first vertical correction parameter based on the pixel coordinates and the picture parameters; and introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates.
Storage media-any of various types of memory devices or storage devices. The term "storage medium" is intended to include: mounting media such as CD-ROM, floppy disk or tape devices; computer system memory or random access memory such as DRAM, DDR RAM, SRAM, EDO RAM, lanbas (Rambus) RAM, etc.; nonvolatile memory such as flash memory, magnetic media (e.g., hard disk or optical storage); registers or other similar types of memory elements, etc. The storage medium may also include other types of memory or combinations thereof. In addition, the storage medium may be located in a first computer system in which the program is executed, or may be located in a second, different computer system connected to the first computer system through a network such as the internet. The second computer system may provide program instructions to the first computer for execution. The term "storage medium" may include two or more storage media residing in different locations (e.g., in different computer systems connected by a network). The storage medium may store program instructions (e.g., embodied as a computer program) executable by one or more processors.
Of course, the storage medium storing the computer executable instructions provided in the embodiments of the present application is not limited to the label coordinate conversion method based on the target object as described above, and may also perform the relevant operations in the label coordinate conversion method based on the target object provided in any embodiment of the present application.
The tag coordinate conversion apparatus, the storage medium, and the tag coordinate conversion apparatus based on a target object provided in the foregoing embodiments may perform the tag coordinate conversion method based on a target object provided in any embodiment of the present application, and technical details not described in detail in the foregoing embodiments may be referred to the tag coordinate conversion method based on a target object provided in any embodiment of the present application.
The foregoing description is only of the preferred embodiments of the present application and the technical principles employed. The present application is not limited to the specific embodiments described herein, but is capable of numerous obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the present application. Therefore, while the present application has been described in connection with the above embodiments, the present application is not limited to the above embodiments, but may include many other equivalent embodiments without departing from the spirit of the present application, and the scope of the present application is determined by the scope of the claims.

Claims (9)

1. A label coordinate conversion method based on a target object, comprising:
in a first picture, acquiring a first shooting parameter of a camera and a picture parameter;
determining pixel coordinates of a tag of a target object in the first picture based on the first shooting parameters, picture parameters and a pre-constructed spherical coordinate system, wherein the picture parameters comprise horizontal resolution and vertical resolution;
obtaining a first horizontal deviation correcting parameter based on the ratio of the horizontal distance between the pixel coordinates and the picture center point to half of the horizontal resolution;
obtaining a first vertical deviation correcting parameter based on the ratio of the vertical distance between the pixel coordinates and the picture center point to half of the vertical resolution;
and introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates.
2. The method for converting tag coordinates based on a target object according to claim 1, wherein after obtaining the rectifying spherical coordinates, the method further comprises:
if the tag positioning triggering event is monitored, acquiring second shooting parameters of a second picture shot by the camera, wherein the second shooting parameters comprise a second horizontal view angle, a second vertical view angle, a second horizontal rotation angle and a second vertical rotation angle;
Performing trigonometric function operation on the deviation correcting ball coordinates, the second horizontal rotation angle and the second vertical rotation angle to obtain corrected angle parameters;
obtaining a second horizontal correction parameter and a second vertical correction parameter according to the ratio of the correction angle parameter to the second horizontal angle of view and the second vertical angle of view;
and based on the picture parameters, introducing the second horizontal correction parameters and the second vertical correction parameters, and performing pixel coordinate conversion on the correction ball coordinates to obtain a label positioning result.
3. The method for converting label coordinates based on a target object according to claim 1, wherein the introducing the first horizontal deviation correcting parameter and the first vertical deviation correcting parameter, performing spherical coordinate conversion on the pixel coordinates to obtain deviation correcting spherical coordinates, includes:
correcting the first shooting parameter based on the first horizontal correction parameter and the first vertical correction parameter to obtain a corrected shooting parameter;
performing three-dimensional coordinate conversion on the pixel coordinates according to the corrected shooting parameters to obtain three-dimensional coordinates;
and performing spherical coordinate conversion according to the three-dimensional coordinates to obtain the deviation correcting spherical coordinates.
4. The target object based tag coordinate conversion method of claim 3, wherein the first photographing parameters include a first horizontal angle of view, a first vertical angle of view, a first horizontal angle of rotation, and a first vertical angle of rotation;
the correcting the first shooting parameter based on the first horizontal correction parameter and the first vertical correction parameter to obtain a corrected shooting parameter includes:
correcting the first horizontal angle of view based on the first horizontal correction parameter to obtain a horizontal correction shooting parameter;
correcting the first vertical field angle based on the first vertical correction parameter to obtain a vertical correction shooting parameter;
the three-dimensional coordinate conversion is performed on the pixel coordinates according to the corrected shooting parameters to obtain three-dimensional coordinates, and the method comprises the following steps:
and performing three-dimensional coordinate conversion according to the horizontal correction shooting parameter, the vertical correction shooting parameter, the first horizontal rotation angle and the first vertical rotation angle to obtain three-dimensional coordinates.
5. The target object-based label coordinate conversion method according to claim 2, wherein the correction angle parameter includes a horizontal correction tangent value and a vertical correction tangent value;
Obtaining a second horizontal correction parameter and a second vertical correction parameter according to the ratio of the correction angle parameter to the second horizontal angle of view and the second vertical angle of view, including:
obtaining the second horizontal correction parameter according to the ratio of the horizontal correction tangent value to half of the tangent value of the second horizontal field angle;
and obtaining the second vertical correction parameter according to the ratio of the vertical correction tangent to half of the tangent of the second vertical field angle.
6. The tag coordinate conversion method based on the target object according to claim 2, wherein the picture parameters include a horizontal resolution and a vertical resolution;
the step of introducing the second horizontal correction parameter and the second vertical correction parameter based on the picture parameter, and performing pixel coordinate conversion on the correction sphere coordinates to obtain a label positioning result, comprises the following steps:
multiplying the second horizontal correction parameter by half of the horizontal resolution of the picture parameter to obtain a horizontal correction value, and obtaining an abscissa of a label positioning result based on the sum of the horizontal correction value and half of the horizontal resolution of the picture parameter;
multiplying the second vertical correction parameter by half of the vertical resolution of the picture parameter to obtain a vertical correction value, and obtaining an ordinate of a label positioning result based on the sum of the vertical correction value and half of the vertical resolution of the picture parameter;
And obtaining the label positioning result coordinate based on the abscissa and the ordinate of the label positioning result.
7. A tag coordinate conversion apparatus based on a target object, comprising:
a parameter obtaining unit, configured to obtain, in a first frame, a first shooting parameter of a camera, and a frame parameter;
a pixel coordinate acquiring unit, configured to determine pixel coordinates of a tag of a target object in the first picture based on the first shooting parameter, a picture parameter, and a spherical coordinate system that is constructed in advance, where the picture parameter includes a horizontal resolution and a vertical resolution;
the correction parameter acquisition unit is used for acquiring a first horizontal correction parameter based on the ratio of the horizontal distance between the pixel coordinates and the picture center point to half of the horizontal resolution;
obtaining a first vertical deviation correcting parameter based on the ratio of the vertical distance between the pixel coordinates and the picture center point to half of the vertical resolution;
and the deviation rectifying spherical coordinate acquisition unit is used for introducing the first horizontal deviation rectifying parameter and the first vertical deviation rectifying parameter, and performing spherical coordinate conversion on the pixel coordinates to obtain deviation rectifying spherical coordinates.
8. A tag coordinate conversion apparatus based on a target object, comprising:
A memory and one or more processors;
the memory is used for storing one or more programs;
the one or more programs, when executed by the one or more processors, cause the one or more processors to implement the target object based label coordinate conversion method of any of claims 1-6.
9. A storage medium storing computer executable instructions which, when executed by a processor, are adapted to perform the target object based label coordinate conversion method of any one of claims 1-6.
CN202210676775.5A 2022-06-15 2022-06-15 Label coordinate conversion method, device, equipment and storage medium based on target object Active CN115100026B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210676775.5A CN115100026B (en) 2022-06-15 2022-06-15 Label coordinate conversion method, device, equipment and storage medium based on target object

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210676775.5A CN115100026B (en) 2022-06-15 2022-06-15 Label coordinate conversion method, device, equipment and storage medium based on target object

Publications (2)

Publication Number Publication Date
CN115100026A CN115100026A (en) 2022-09-23
CN115100026B true CN115100026B (en) 2023-07-14

Family

ID=83291794

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210676775.5A Active CN115100026B (en) 2022-06-15 2022-06-15 Label coordinate conversion method, device, equipment and storage medium based on target object

Country Status (1)

Country Link
CN (1) CN115100026B (en)

Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577002A (en) * 2009-06-16 2009-11-11 天津理工大学 Calibration method of fish-eye lens imaging system applied to target detection
JP2013003970A (en) * 2011-06-20 2013-01-07 Nippon Telegr & Teleph Corp <Ntt> Object coordinate system conversion device, object coordinate system conversion method and object coordinate system conversion program
CN104081433A (en) * 2011-12-22 2014-10-01 派尔高公司 Transformation between image and map coordinates
JP2016200557A (en) * 2015-04-14 2016-12-01 国立大学法人東京工業大学 Calibration device, distance measurement apparatus and calibration method
CN107105218A (en) * 2017-05-05 2017-08-29 珠海全志科技股份有限公司 A kind of visual field picture image generation method and device
JP2018038087A (en) * 2012-03-09 2018-03-08 株式会社リコー Image capturing apparatus, image capturing system, image processing method, information processing apparatus, and program
CN109155056A (en) * 2016-05-24 2019-01-04 高通股份有限公司 Flake with the lens distortion correction for 360 degree of videos is presented
CN109523471A (en) * 2018-11-16 2019-03-26 厦门博聪信息技术有限公司 A kind of conversion method, system and the device of ground coordinate and wide angle cameras picture coordinate
CN111199560A (en) * 2019-12-31 2020-05-26 海能达通信股份有限公司 Video monitoring positioning method and video monitoring system
WO2020114235A1 (en) * 2018-12-05 2020-06-11 杭州海康威视数字技术股份有限公司 Conversion method for pt coordinates and gps coordinates and dome camera
CN111429518A (en) * 2020-03-24 2020-07-17 浙江大华技术股份有限公司 Labeling method, labeling device, computing equipment and storage medium
CN111625091A (en) * 2020-05-14 2020-09-04 佳都新太科技股份有限公司 Label overlapping method and device based on AR glasses
CN114511447A (en) * 2022-01-29 2022-05-17 深圳市商汤科技有限公司 Image processing method, device, equipment and computer storage medium

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP3457682A1 (en) * 2016-05-13 2019-03-20 Olympus Corporation Calibration device, calibration method, optical device, imaging device, projection device, measurement system and measurement method
WO2019049331A1 (en) * 2017-09-08 2019-03-14 株式会社ソニー・インタラクティブエンタテインメント Calibration device, calibration system, and calibration method

Patent Citations (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101577002A (en) * 2009-06-16 2009-11-11 天津理工大学 Calibration method of fish-eye lens imaging system applied to target detection
JP2013003970A (en) * 2011-06-20 2013-01-07 Nippon Telegr & Teleph Corp <Ntt> Object coordinate system conversion device, object coordinate system conversion method and object coordinate system conversion program
CN104081433A (en) * 2011-12-22 2014-10-01 派尔高公司 Transformation between image and map coordinates
JP2018038087A (en) * 2012-03-09 2018-03-08 株式会社リコー Image capturing apparatus, image capturing system, image processing method, information processing apparatus, and program
JP2016200557A (en) * 2015-04-14 2016-12-01 国立大学法人東京工業大学 Calibration device, distance measurement apparatus and calibration method
CN109155056A (en) * 2016-05-24 2019-01-04 高通股份有限公司 Flake with the lens distortion correction for 360 degree of videos is presented
CN107105218A (en) * 2017-05-05 2017-08-29 珠海全志科技股份有限公司 A kind of visual field picture image generation method and device
CN109523471A (en) * 2018-11-16 2019-03-26 厦门博聪信息技术有限公司 A kind of conversion method, system and the device of ground coordinate and wide angle cameras picture coordinate
WO2020114235A1 (en) * 2018-12-05 2020-06-11 杭州海康威视数字技术股份有限公司 Conversion method for pt coordinates and gps coordinates and dome camera
CN111199560A (en) * 2019-12-31 2020-05-26 海能达通信股份有限公司 Video monitoring positioning method and video monitoring system
CN111429518A (en) * 2020-03-24 2020-07-17 浙江大华技术股份有限公司 Labeling method, labeling device, computing equipment and storage medium
CN111625091A (en) * 2020-05-14 2020-09-04 佳都新太科技股份有限公司 Label overlapping method and device based on AR glasses
CN114511447A (en) * 2022-01-29 2022-05-17 深圳市商汤科技有限公司 Image processing method, device, equipment and computer storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于全景图像及枪球联动的机场场面监控优化_潘辉;潘辉;基于全景图像及枪球联动的机场场面监控优化_潘辉;第1卷(第1期);全文 *
基于单目视觉的高速并联机器人动态目标跟踪算法;梅江平;王浩;张舵;闫寒;李策;;天津大学学报(自然科学与工程技术版)(第02期);全文 *

Also Published As

Publication number Publication date
CN115100026A (en) 2022-09-23

Similar Documents

Publication Publication Date Title
US11157766B2 (en) Method, apparatus, device and medium for calibrating pose relationship between vehicle sensor and vehicle
CN111127563A (en) Combined calibration method and device, electronic equipment and storage medium
US9892488B1 (en) Multi-camera frame stitching
JP2019537023A (en) Positioning method and device
CN106570907B (en) Camera calibration method and device
CN110717861A (en) Image splicing method and device, electronic equipment and computer readable storage medium
CN113256742B (en) Interface display method and device, electronic equipment and computer readable medium
KR20180022539A (en) Method and apparatus of stitching for minimizing parallax using control points in overlapping region
CN111815672A (en) Dynamic tracking control method, device and control equipment
CN114494388A (en) Three-dimensional image reconstruction method, device, equipment and medium in large-view-field environment
CN111429529B (en) Coordinate conversion calibration method, electronic equipment and computer storage medium
CN115100026B (en) Label coordinate conversion method, device, equipment and storage medium based on target object
JP2023523364A (en) Visual positioning method, device, equipment and readable storage medium
CN111862240A (en) Panoramic camera and calibration method thereof, panoramic image splicing method and storage medium
CN113628284B (en) Pose calibration data set generation method, device and system, electronic equipment and medium
CN111353945A (en) Fisheye image correction method, fisheye image correction device and storage medium
CN110675445B (en) Visual positioning method, device and storage medium
CN114140771A (en) Automatic annotation method and system for image depth data set
CN108650465B (en) Method and device for calculating augmented reality label of camera picture and electronic equipment
CN115147268A (en) Live view method, panoramic camera, and computer-readable storage medium
Porzi et al. An automatic image-to-DEM alignment approach for annotating mountains pictures on a smartphone
CN113068006B (en) Image presentation method and device
CN117255247B (en) Method and device for linkage of panoramic camera and detail dome camera
CN117406185B (en) External parameter calibration method, device and equipment between radar and camera and storage medium
CN111784622B (en) Image splicing method based on monocular inclination of unmanned aerial vehicle and related device

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
GR01 Patent grant
GR01 Patent grant