A spherical center positioning method and a spherical center positioning device

By using multi-camera arrays and gradient descent algorithms, the problems of high cost and insufficient accuracy of sphere center positioning are solved, and the effect of significantly improving accuracy at low cost is achieved.

CN117788564BActive Publication Date: 2024-09-13ZHEJIANG VERSATILE MEDIA
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311798029.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-12-25
Publication Date
2024-09-13
Estimated Expiration
2043-12-25

AI Technical Summary

Technical Problem

In the existing technology, the cost of positioning the ball center is high and the accuracy is insufficient, making it difficult to accurately obtain the position of the ball in three-dimensional space.

Method used

Use at least three cameras to form a camera array, take photos of the sphere from different angles, mark the pixels, and use the internal and external parameter matrices of the camera to construct a target loss function. Combined with the gradient descent algorithm to calculate the coordinates of the center of the sphere, add cameras and pixels. quantity to improve accuracy.

Benefits of technology

It effectively reduces the cost of ball center positioning, significantly improves accuracy, and achieves more accurate ball center position information at low cost. Compared with existing technologies, it has higher robustness and lower hardware requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117788564B
    Figure CN117788564B
Patent Text Reader

Abstract

The present invention relates to a sphere center positioning method and a sphere center positioning device, comprising: combining at least three cameras into a camera array, each camera photographing a sphere at a different angle to obtain at least three photos, marking pixel points at the edge of a sphere pattern in the photos, and corresponding the marked pixel points to the cameras; obtaining an internal parameter matrix and an external parameter matrix of each camera; constructing a target loss function T for the nth marked pixel point corresponding to the mth camera; mn , T mn It is constructed based on the intrinsic and extrinsic matrix of the mth camera and the pixel coordinates of the nth annotated pixel point; mn The target loss function T of the camera array is obtained; the extreme value of T is obtained by using a gradient descent algorithm to determine the coordinates of the center of the sphere in the world coordinate system.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the field of spherical center positioning, and in particular to a spherical center positioning method and a spherical center positioning device. Background Art

[0002] In the fields of light source calibration, 4D scanning and rendering, it is necessary to obtain the position of a ball from multiple perspectives in three-dimensional space to determine the coordinates of the center of the ball. The existing technology usually uses a special calibration device to determine the position of the center of the ball. This device is not only expensive, but also has relatively insufficient actual calibration accuracy. Summary of the invention

[0003] Based on this, it is necessary to provide a sphere center positioning method and sphere center positioning device to address the problems of high cost and insufficient accuracy in sphere center positioning.

[0004] A spherical center positioning method, comprising:

[0005] At least three cameras are combined into a camera array, each camera photographs the sphere at a different angle to obtain at least three photos, pixel points at the edge of the sphere pattern in the photos are marked, and the marked pixel points are matched with the cameras;

[0006] Get the intrinsic and extrinsic matrix of each camera;

[0007] Construct the target loss function T for the nth annotated pixel corresponding to the mth camera mn , T mn Constructed based on the intrinsic and extrinsic matrix of the m-th camera and the pixel coordinates of the n-th annotated pixel point;

[0008] Based on all T mn Obtain the target loss function T of the camera array;

[0009] The gradient descent algorithm is used to obtain the extreme value of T to determine the coordinates of the center of the sphere in the world coordinate system.

[0010] In the present invention, T is all T mn Weighted sum, each T mn The weight coefficients are equal, and the number of pixels corresponding to each camera is the same.

[0011] In the present invention, each camera corresponds to at least two pixels.

[0012] The internal parameter matrix corresponding to the mth camera of the present invention where f m is the focal length of the mth camera in pixels, u 0m and v 0mare the horizontal and vertical coordinates of the corresponding pixels of the focus of the m-th camera in the imaging plane. The m-th camera has two external parameter matrices, which are R m and T m , where R m is the rotation matrix of the mth camera relative to the world coordinate system, T m is the translation matrix of the optical center of the m-th camera relative to the world coordinate system.

[0013] The present invention obtains the coordinates (u mn ,v mn ),

[0014] Based on (u mn ,v mn )Get m =(u mn -u 0m ,v mn -v 0m , f m );

[0015] Based on s m Get (L m ,M m ,N m ), where (L m ,M m ,N m )=R m ×s m ;

[0016] Based on T m Get the coordinates of the optical center of the mth camera in the world coordinate system (X m ,Y m ,Z m );

[0017] Then T mn =(xX m ) 2 +(yY m ) 2 +(zZ m ) 2 -r 2 -[(xX m )*L m +(yY m )*M m +(zZ m )*N m ] / (L m 2 +M m 2 +N m2 );

[0018] When T is an extreme value, the corresponding (x, y, z) is the coordinate of the center of the sphere in the world coordinate system.

[0019] The present invention substitutes (x, y, z) into T to obtain the numerical solution corresponding to r when T is an extreme value, thereby obtaining the radius of the sphere.

[0020] A spherical center positioning device, comprising:

[0021] A camera array, the camera array comprising at least three cameras, the cameras being used to photograph the sphere to obtain photos;

[0022] The parameter acquisition module is used to obtain the pixel coordinates of the pixel points in the photo and the intrinsic parameter matrix and extrinsic parameter matrix of the camera;

[0023] The loss function building module is used to build the target loss function of the camera array;

[0024] The computing module is used to perform a gradient descent algorithm on the target loss function of the camera array to obtain the coordinates of the center of the sphere in the world coordinate system.

[0025] The calculation module of the present invention is also used to calculate the radius of the sphere.

[0026] The sphere center positioning device of the present invention further comprises a marking module, and the marking module is used to mark the pixel points of the edge of the sphere pattern in the photo.

[0027] The beneficial effects of the present invention are:

[0028] The present invention uses at least three cameras to shoot a sphere, and then obtains photos of the sphere at three different angles, and combines the camera's own parameter matrix to obtain the target loss function of the camera array. Correspondingly, the target loss function contains the three-dimensional information of the sphere, and the center coordinates of the sphere can be calculated based on the gradient descent algorithm. As long as the number of cameras and / or annotated pixels is increased, the calculation accuracy of the center coordinates can be effectively improved. The accuracy improvement means is low-cost and the improvement effect is more obvious.

[0029] Compared with the prior art, the present invention has high robustness, low hardware requirements, and can obtain more accurate ball center position information at a lower cost. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] Figure 1 is a flowchart of the steps of the ball center positioning method in Example 1 of the present invention;

[0031] Figure 2 This is a topological diagram of the spherical center positioning device in Example 1 of the present invention. DETAILED DESCRIPTION

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

[0033] Embodiment 1:

[0034] See also Figure 1 This embodiment provides a method for locating the center of a sphere, comprising the following steps:

[0035] Step 101: at least three cameras are arranged in a circular array to form 201. The sphere whose center position is to be determined is located at the center of 201, so that each camera can take a picture of the sphere at a different angle. Each camera corresponds to a photo, so there are at least three photos in total, each photo corresponds to the sphere at a different angle, so after the three photos are combined, theoretically, they contain complete three-dimensional information of the sphere.

[0036] Step 102: Obtain the intrinsic parameter matrix and extrinsic parameter matrix of each camera. Each camera has one intrinsic parameter matrix and two extrinsic parameter matrices.

[0037] The intrinsic parameter matrix corresponding to the mth camera where f m is the focal length of the mth camera in pixels, u 0m and v 0m are respectively the horizontal and vertical coordinates of the pixel corresponding to the focus of the m-th camera in the imaging plane.

[0038] The m-th camera has two external parameter matrices, namely R m and T m , where R m is the rotation matrix of the mth camera relative to the world coordinate system, T m is the translation matrix of the optical center of the m-th camera relative to the world coordinate system.

[0039] Step 103: Annotate the pixel points at the edge of the sphere pattern in each photo. The number of annotated pixel points in each photo can be one or more than two. The annotated pixel points are matched by the photo and the camera in which they are located, so that each camera corresponds to at least one annotated pixel point.

[0040] There is no limit to the way of labeling pixels, which can be AI labeling or manual labeling.

[0041] Step 104: Construct a target loss function T for the nth annotated pixel corresponding to the mth camera mn , and then obtain the target loss function T of 201.

[0042] Step 104 specifically includes step 1041 to step 1046.

[0043] Step 1041: Obtain the coordinates (u mn ,v mn ).

[0044] Step 1042: Based on (u mn ,v mn )Get m =(u mn -u 0m ,v mn -v 0m , f m ), where s m Represents the direction of one of the rays that passes through the optical center of the m-th camera and is tangent to the sphere.

[0045] Step 1043: Based on s m Get (L m ,M m ,N m ), where (L m ,M m ,N m )=R m ×s m .

[0046] Step 1044: Based on T m Get the coordinates of the optical center of the mth camera in the world coordinate system (X m ,Y m ,Z m ).

[0047] Step 1045: Construct the target loss function T corresponding to the nth annotated pixel point corresponding to the mth camera mn ,in

[0048] T mn =(xX m ) 2 +(yY m ) 2 +(zZ m ) 2 -r 2 -[(xX m )*L m +(yY m )*M m +(zZ m )*N m ] / (L m 2+M m 2 +N m 2 ).

[0049] Step 1046: For all T mn A weighted sum is performed to obtain the target loss function T of 201.

[0050] Step 105: Execute the gradient descent algorithm on T, thereby eliminating the parameter r and obtaining the extreme value of T (as close to the zero extreme value point as possible). The (x, y, z) corresponding to the extreme value of T is the coordinate of the center of the sphere in the world coordinate system.

[0051] Step 106: Substitute (x, y, z) corresponding to the extreme value of T into T. Combined with the extreme value of T, the specific value of the parameter r can be obtained. At this time, the specific value of r corresponds to the radius of the sphere.

[0052] That is, the sphere center positioning method of this embodiment can not only solve the three-dimensional coordinates of the sphere center in the world coordinate system, that is, three variables, but also solve the radius of the sphere.

[0053] When there are only three cameras, the 3D information of the sphere can still be obtained, and it is not difficult to understand that the 3D coordinates of the center of the sphere in the world coordinate system can be obtained from this. However, under this condition, the fourth dimensional information of the radius of the sphere can be obtained, which is obviously contrary to the common sense of those skilled in the art. The reason for achieving this result is that in this embodiment, for T mn The construction method of the quadratic function transforms the optimization problem of T into a convex optimization problem, so that the true value of the sphere radius and the true coordinates of the sphere center position correspond to the extreme points of T, and the parameter r of the sphere radius with respect to is eliminated in the derivation process, so that the acquisition processes of the true value of the sphere radius and the true coordinates of the sphere center position are independent of each other and are carried out in sequence.

[0054] However, it is worth noting that in this embodiment, T mn In the expression of mn For , the derivative actually results in the same type of function with only different constant terms, and no extreme value information can be obtained. Therefore, in order to obtain the extreme value of T, it is necessary to rely on at least three T with different m values. mn To construct T, at least three cameras are required.

[0055] Due to radial and tangential distortion in the photo imaging process and personal subjective awareness in pixel annotation, noise is inevitably introduced into the measurement. Therefore, in theory, more cameras and more annotated pixels can improve the calculation accuracy of the true value of the sphere radius and the true coordinates of the sphere center position.

[0056] See also Figure 2 In one embodiment, a sphere center positioning device is provided, including 201, a parameter acquisition module 203, a labeling module 202, a loss function construction module 204 and a calculation module 205.

[0057] Wherein 201 comprises at least three cameras, and the cameras are used to photograph the sphere to obtain photos.

[0058] The labeling module 202 is used to label the pixel points at the edge of the sphere pattern in the photo.

[0059] The parameter acquisition module 203 is used to acquire the pixel coordinates of the pixel points in the photo and the intrinsic parameter matrix and extrinsic parameter matrix of the camera.

[0060] The loss function construction module 204 is used to construct the target loss function of 201;

[0061] The calculation module 205 is used to perform a gradient descent algorithm on the target loss function of 201 to obtain the coordinates of the center of the sphere in the world coordinate system, and substitute the coordinates of the center of the sphere in the world coordinate system into the target loss function of 201 to obtain the radius of the sphere.

[0062] Embodiment 2:

[0063] The difference between this embodiment and embodiment 1 is that the pixel annotation relies on manual work. It is easy to understand that pixel annotation, whether it is done manually or by AI, will produce errors, but the errors of manual annotation may be greater.

[0064] Based on this, when AI annotation is used in Example 1, the confidence of the annotation result can be directly used as T mn The weight coefficient of all T mn Perform weighted summation to get T.

[0065] In this embodiment, each T mn The weight coefficients of all cameras are equal, so the number of pixels corresponding to each camera needs to be consistent to ensure that the sum of the weight coefficients of all cameras is equal, so as to avoid introducing additional unnecessary errors in the value of T when performing the gradient descent algorithm.

[0066] It should be understood that, unless otherwise specified herein, the execution of the above steps is not strictly limited in order, and the steps may be executed in other orders. Moreover, each step may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but may be executed at different times, and the execution order of these steps or stages is not necessarily sequential, but may be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0067] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).

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

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

Claims

1. A method for locating the center of a sphere, characterized in that: include: At least three cameras are combined into a camera array, each camera photographs the sphere at a different angle to obtain at least three photos, pixel points at the edge of the sphere pattern in the photos are marked, and the marked pixel points are matched with the cameras; Get the intrinsic and extrinsic matrix of each camera. The intrinsic parameter matrix corresponding to the camera ,in For the The focal length of the camera in pixels, and Respectively The focal point of each camera corresponds to the horizontal and vertical coordinates of the pixel in the imaging plane. Each camera has two external parameter matrices, which are and ,in For the The rotation matrix of the camera relative to the world coordinate system, For the The translation matrix of the optical center of each camera relative to the world coordinate system; For the The camera corresponds to The target loss function is constructed by using the labeled pixels , Based on The intrinsic and extrinsic matrix of the camera, and the The pixel coordinates of the annotated pixels are constructed to obtain the The camera corresponds to The coordinates of the annotated pixels in the imaging plane ,based on get ;based on Get ,in = ;based on Get the The coordinates of the camera optical center in the world coordinate system ; but ; Based on all Get the target loss function for the camera array , for all Perform weighted summation to obtain the target loss function ; Using the gradient descent algorithm to obtain to determine the coordinates of the center of the sphere in the world coordinate system, The corresponding extreme value is the coordinate of the sphere center in the world coordinate system; Substitution , to obtain When it is an extreme value, it corresponds to The radius of the sphere is obtained by numerically solving .

2. The spherical center positioning method according to claim 1, characterized in that: For all Weighted sum, each The weight coefficients are equal, and the number of pixels corresponding to each camera is the same.

3. The spherical center positioning method according to claim 2, characterized in that: The number of pixels corresponding to each camera is at least two.

4. The spherical center positioning method according to claim 1, characterized in that: The number of cameras is only three.

5. A ball center positioning device, characterized in that: include: A camera array, the camera array comprising at least three cameras, the cameras being used to photograph the sphere to obtain photos; The parameter acquisition module is used to obtain the pixel coordinates of the pixel points in the photo and the intrinsic and extrinsic matrix of the camera. The intrinsic parameter matrix corresponding to the camera ,in For the The focal length of the camera in pixels, and Respectively The focal point of each camera corresponds to the horizontal and vertical coordinates of the pixel in the imaging plane. Each camera has two external parameter matrices, which are and ,in For the The rotation matrix of the camera relative to the world coordinate system, For the The translation matrix of the optical center of each camera relative to the world coordinate system; Loss function building module, used to build the target loss function of the camera array , get the The camera corresponds to The coordinates of the annotated pixels in the imaging plane ,based on get ;based on Get ,in = ;based on Get the The coordinates of the camera optical center in the world coordinate system ;but , for all Perform weighted summation to obtain the target loss function ; A computation module is used to perform a gradient descent algorithm on the target loss function of the camera array to obtain the coordinates of the center of the sphere in the world coordinate system. The corresponding extreme value is the coordinate of the sphere center in the world coordinate system; Substitution , to obtain When it is an extreme value, it corresponds to The radius of the sphere is obtained by numerically solving .

6. The spherical center positioning device according to claim 5, characterized in that: The sphere center positioning device also includes a marking module, which is used to mark pixel points on the edge of the sphere pattern in the photo.