Virtual-real camera synchronous attitude parameter training method and device, and computer program product
Through the virtual and real camera synchronization attitude parameter training method, the problems of complex and costly installation of inspection cameras in the existing technology are solved, and more efficient and convenient camera positioning and monitoring effects are achieved.
Patent Information
- Application Number
- CN202510278622.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-10
- Publication Date
- 2025-06-20
AI Technical Summary
The prefabricated position installation of existing substation patrol cameras requires long-term commissioning by professionals, which is difficult to meet the requirements of management convenience, application scalability and cost-effectiveness.
Through the virtual and real camera synchronization attitude parameter training method, the substation digital twin scene is initialized, the 0-degree attitude of the real camera and the virtual camera is synchronized, multiple sets of attitude parameters are recorded randomly, and a linear regression model is established to train the attitude mapping relationship.
It reduces on-site operation demand, reduces labor and operation and maintenance costs, and improves the positioning accuracy and monitoring accuracy of patrol cameras.
Smart Images

Figure CN120180384A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of substation monitoring, and particularly relates to a method and device for training synchronous attitude parameters of virtual and real cameras, and a computer program product. Background Art
[0002] With the continuous advancement of power grid operation modes such as intelligent substations, unattended substations, and centralized monitoring of substation operations, the substation auxiliary monitoring system, as one of the important technical means necessary for power grid intelligence and safe production, provides an important guarantee for the safe and stable operation of the power grid. At present, the inspection cameras in substations all complete the camera positioning and image capture by driving the prefabricated inspection points of the cameras to complete the inspection tasks. The prefabricated positions of the inspection cameras are completed by professional construction personnel entering the station for on-site operations through long-term debugging and repeated testing during the camera construction and installation, which is difficult to meet the current requirements for management convenience, application scalability, and cost-effectiveness. Summary of the Invention
[0003] The purpose of the present invention is to propose a method and device for training synchronous attitude parameters of virtual and real cameras, and a computer program product to meet the current requirements for management convenience, application scalability, and cost-effectiveness.
[0004] To achieve the above purpose, an embodiment of the present invention provides a method for training synchronous attitude parameters of virtual and real cameras, including:
[0005] Step S10, initializing the digital twin scene of the substation; the digital twin scene of the substation is a digital copy of the real-world substation;
[0006] Step S20, synchronously adjusting the 0-degree attitude of the real camera in the real substation and the corresponding virtual camera in the digital twin scene of the substation to ensure that the center points of the two images point in the same direction; the 0-degree attitude refers to the attitude where the camera has not undergone any rotation;
[0007] Step S30, operating the real camera and the virtual camera to synchronously rotate a certain angle randomly to ensure that the center points of the two images are aligned with the feature positions of the same object, recording the current attitude parameters of the two, and recording them as a set of attitude parameters;
[0008] Step S40, repeating Step S30 to obtain multiple sets of attitude parameters;
[0009] Step S50, performing training on the synchronous attitude parameters of the virtual and real cameras according to the multiple sets of attitude parameters to obtain the attitude mapping relationship between the real camera and the virtual camera.
[0010] Preferably, Step S50 includes:
[0011] Let the pose of the real camera be (R1_x, R1_y), and the pose of the virtual camera be (R2_x, R2_y). R1_x is the rotation component of the x-axis of the real camera, R1_y is the rotation component of the y-axis of the real camera, R2_x is the rotation component of the x-axis of the virtual camera, and R2_y is the rotation component of the y-axis of the virtual camera. Then the mapping relationship for calculating the synchronous pose of the real camera based on the current pose of the virtual camera is expressed as:
[0012] R1_x = R2_x * N1 + R2_y * M1;
[0013] R1_y = R2_y * D1 + R2_y * Q1;
[0014] Based on the multiple sets of pose parameters, the mapping coefficients N1, M1, D1, and Q1 are obtained through training with a linear regression model.
[0015] Preferably, step S50 includes:
[0016] Establish the following linear regression model: R1_x = N1 * R2_x + M1 * R2_y + ε1, R1_y = D1 * R2_x + Q1 * R2_y + ε2; where ε1 and ε2 are the error terms between (R1_x, R1_y) mapped based on (R2_x, R2_y) and the real (R1_x, R1_y).
[0017] Based on the above linear regression model, using each set of pose parameters respectively, with the goal of minimizing ε1 and ε2, a corresponding set of mapping coefficients N1, M1, D1, and Q1 is solved, and finally multiple sets of mapping coefficients N1, M1, D1, and Q1 corresponding to multiple sets of pose parameters are obtained;
[0018] The final mapping coefficients N1, M1, D1, and Q1 are obtained according to the distribution of the multiple sets of mapping coefficients N1, M1, D1, and Q1.
[0019] Preferably, step S50 includes:
[0020] Let the pose of the real camera be (R1_x, R1_y), and the pose of the virtual camera be (R2_x, R2_y). R1_x is the rotation component of the x-axis of the real camera, R1_y is the rotation component of the y-axis of the real camera, R2_x is the rotation component of the x-axis of the virtual camera, and R2_y is the rotation component of the y-axis of the virtual camera. Then the mapping relationship for calculating the synchronous pose of the virtual camera based on the current pose of the real camera is expressed as:
[0021] R2_x = R1_x * N2 + R1_y * M2;
[0022] R2_y = R1_y * D2 + R1_y * Q2;
[0023] Based on the multiple sets of attitude parameters, mapping coefficients N2, M2, D2, and Q2 are obtained through training with a linear regression model.
[0024] Preferably, step S50 includes:
[0025] Establish the following linear regression models: R2_x = R1_x * N2 + R1_y * M2 + ε3, R2_y = R1_y * D2 + R1_y * Q2 + ε3; where ε3 and ε4 are error terms between (R2_x, R2_y) mapped based on (R1_x, R1_y) and the true (R2_x, R2_y).
[0026] Based on the above linear regression models, each set of attitude parameters is respectively used, with the goal of minimizing ε3 and ε4, to solve for a corresponding set of mapping coefficients N2, M2, D2, and Q2, and finally multiple sets of mapping coefficients N2, M2, D2, and Q2 corresponding to the multiple sets of attitude parameters are obtained.
[0027] The final mapping coefficients N2, M2, D2, and Q2 are obtained according to the distribution of the multiple sets of mapping coefficients N2, M2, D2, and Q2.
[0028] An embodiment of the present invention further provides a virtual-real camera synchronization attitude parameter training device, including a module for executing the method as described above.
[0029] An embodiment of the present invention further provides a virtual-real camera synchronization attitude parameter training device, including:
[0030] A communication interface for communicating with other electronic devices;
[0031] A memory for storing computer program instructions;
[0032] A processor for executing the computer program instructions to support the device in implementing the method as described above.
[0033] An embodiment of the present invention further provides a computer program product, characterized in that it includes computer program instructions, and the computer program instructions direct a computer device to execute the operations corresponding to the method as described above.
[0034] The virtual-real camera synchronization attitude parameter training method, device, and computer program product proposed by the present invention have the following beneficial effects:
[0035] The embodiments of the present invention are based on digital twin scenarios, so they can easily adapt to different substation environments and monitoring requirements. After establishing a digital twin scenario, camera settings can be quickly replicated and adjusted to meet the needs of different scenarios, while traditional prefabricated inspection point methods require a large amount of manpower and time for on-site debugging; the method of the embodiments of the present invention reduces the need for on-site operations by training attitude parameters in a virtual environment, thereby reducing labor costs and operation and maintenance costs; by synchronously adjusting the attitudes of the real camera and the virtual camera and recording multiple sets of attitude parameters, the embodiments of the present invention can train an accurate attitude mapping relationship to ensure that the inspection camera can accurately align with the target object and improve the accuracy of monitoring. Description of the Drawings
[0036] To more clearly illustrate the technical solutions in the embodiments of the present invention, the following will briefly introduce the drawings required in the description of the embodiments. Obviously, the following drawings are only some embodiments of the present invention. For those of ordinary skill in the art, without creative efforts, other drawings can be obtained based on these drawings.
[0037] Figure 1 It is a flowchart of a method for training synchronous attitude parameters of a real and virtual camera in an embodiment of the present invention. Detailed Description of the Embodiments
[0038] The detailed description of the drawings is intended to be illustrative of the current embodiments of the present invention, rather than representing the only form in which the present invention can be implemented. It should be understood that the same or equivalent functions can be accomplished by different embodiments intended to be included within the spirit and scope of the present invention.
[0039] Refer to Figure 1 , an embodiment of the present invention provides a method for training synchronous attitude parameters of a real and virtual camera, including the following steps:
[0040] Step S10, initialize the digital twin scenario of the substation; the digital twin scenario of the substation is a digital copy of the real-world substation;
[0041] Specifically, create a digital copy of the substation, that is, the digital twin scenario. This scenario is a detailed, three-dimensional, and dynamic virtual model that simulates the real-world substation, including its structure, equipment, environment, and other factors. This digital twin scenario will serve as the basic platform for subsequent operations and training.
[0042] Step S20, synchronously adjust the 0-degree attitudes of the real camera in the real substation and the corresponding virtual camera in the digital twin scenario of the substation to ensure that the center points of the two images point in the same direction; the 0-degree attitude refers to the attitude where the camera has not undergone any rotation;
[0043] Specifically, in a real substation, operate the real camera and at the same time operate the corresponding virtual camera in the digital twin scenario, and adjust the postures of both to 0 degrees, that is, ensure that the cameras do not rotate at all, and the center points of the images of both point in the same direction. This is to establish a common reference point to ensure the accuracy and consistency of subsequent operations.
[0044] Step S30: Operate the real camera and the virtual camera to synchronously rotate by a certain random angle, ensure that the center points of the images of both are aligned with the feature positions of the same object, record the current posture parameters of both, and record them as a set of posture parameters.
[0045] Specifically, operate the real camera and the virtual camera simultaneously to make them synchronously rotate by a certain random angle. This operation needs to ensure that after rotation, the center points of the images of both are still aligned with the feature positions of the same object. Record the current posture parameters of both after rotation. These parameters include information such as the rotation angle and direction, and record these parameters as a set of data.
[0046] Step S40: Repeat Step S30 to obtain multiple sets of posture parameters.
[0047] Specifically, to obtain more accurate and comprehensive data, repeat Step S30 multiple times. Each time, randomly rotate the angles of the real camera and the virtual camera, and record the posture parameters after each operation. Through multiple repetitions, collect multiple sets of different posture parameters. These data will be used in the subsequent training process.
[0048] Step S50: Perform synchronous posture parameter training for the real and virtual cameras based on the multiple sets of posture parameters to obtain the posture mapping relationship between the real camera and the virtual camera.
[0049] Specifically, use the multiple sets of posture parameters collected to perform the training of the synchronous posture parameters of the real and virtual cameras. This training process can be achieved through machine learning or deep learning algorithms. The purpose is to establish an accurate posture mapping relationship between the real camera and the virtual camera. After the training is completed, this mapping relationship can be used in actual monitoring to predict and set the best position of the real camera by adjusting the posture of the virtual camera, so as to achieve efficient patrol monitoring.
[0050] In some embodiments, Step S50 includes:
[0051] Let the pose of the real camera be (R1_x, R1_y), and the pose of the virtual camera be (R2_x, R2_y). R1_x is the rotation component of the real camera about the x-axis, R1_y is the rotation component of the real camera about the y-axis, R2_x is the rotation component of the virtual camera about the x-axis, and R2_y is the rotation component of the virtual camera about the y-axis. Then the mapping relationship for calculating the synchronous pose of the real camera based on the current pose of the virtual camera is expressed as:
[0052] R1_x = R2_x * N1 + R2_y * M1;
[0053] R1_y = R2_y * D1 + R2_y * Q1;
[0054] Based on the multiple sets of pose parameters, the mapping coefficients N1, M1, D1, and Q1 are obtained through training with a linear regression model.
[0055] Specifically, define the pose of the real camera as (R1_x, R1_y), where R1_x is the rotation component of the real camera on the x-axis, and R1_y is the rotation component of the real camera on the y-axis;
[0056] Define the pose of the virtual camera as (R2_x, R2_y), where R2_x is the rotation component of the virtual camera on the x-axis, and R2_y is the rotation component of the virtual camera on the y-axis;
[0057] The method of this embodiment proposes a linear mapping relationship for predicting the pose (R1_x, R1_y) of the real camera based on the pose (R2_x, R2_y) of the virtual camera. This mapping relationship is represented by the following two equations:
[0058] R1_x = R2_x * N1 + R2_y * M1;
[0059] R1_y = R2_x * D1 + R2_y * Q1;
[0060] N1, M1, D1, and Q1 are mapping coefficients, which are parameters in the linear regression model and are used to describe the relationship between the pose of the virtual camera and the pose of the real camera.
[0061] The first equation indicates that the rotation component R1_x of the real camera on the x-axis is obtained by multiplying the rotation component R2_x of the virtual camera on the x-axis by the coefficient N1 and adding the rotation component R2_y of the virtual camera on the y-axis multiplied by the coefficient M1;
[0062] The second equation indicates that the rotation component R1_y of the real camera on the y-axis is obtained by multiplying the rotation component R2_x of the virtual camera on the x-axis by the coefficient D1 and adding the rotation component R2_y of the virtual camera on the y-axis multiplied by the coefficient Q1;
[0063] The process of training through a linear regression model is as follows:
[0064] Collect multiple groups of attitude parameters (R1_x, R1_y) and (R2_x, R2_y) recorded after synchronous rotation. Use this data as the training set and apply the linear regression algorithm to estimate the mapping coefficients N1, M1, D1, and Q1. The linear regression algorithm will find the optimal values of these coefficients to minimize the difference between the predicted true camera attitude (R1_x, R1_y) and the actually recorded true camera attitude. After training is completed, the obtained mapping coefficients N1, M1, D1, and Q1 can be used to calculate and predict the corresponding attitude (R1_x, R1_y) of the true camera based on any attitude (R2_x, R2_y) of the virtual camera, thereby achieving synchronization between the virtual camera and the true camera.
[0065] In some embodiments, step S50 includes:
[0066] Establish the following linear regression model: R1_x = N1 * R2_x + M1 * R2_y + ε1, R1_y = D1 * R2_x + Q1 * R2_y + ε2; where ε1 and ε2 are the error terms between (R1_x, R1_y) mapped based on (R2_x, R2_y) and the true (R1_x, R1_y).
[0067] Based on the above linear regression model, use each group of attitude parameters respectively, with the goal of minimizing ε1 and ε2, to solve for a corresponding set of mapping coefficients N1, M1, D1, and Q1, and finally obtain multiple sets of mapping coefficients N1, M1, D1, and Q1 corresponding to multiple groups of attitude parameters;
[0068] Obtain the final mapping coefficients N1, M1, D1, and Q1 according to the distribution of the multiple sets of mapping coefficients N1, M1, D1, and Q1.
[0069] Specifically, in this embodiment, two linear regression equations are designed, corresponding to the attitude components of the true camera on the x-axis and y-axis respectively:
[0070] R1_x = N1 * R2_x + M1 * R2_y + ε1
[0071] R1_y = D1 * R2_x + Q1 * R2_y + ε2
[0072] In these two equations, R1_x and R1_y represent the attitude components of the real camera on the x-axis and y-axis respectively, while R2_x and R2_y represent the attitude components of the virtual camera on the x-axis and y-axis; N1, M1, D1, and Q1 are the mapping coefficients we are looking for, which describe the relationship between the virtual camera attitude and the real camera attitude; ε1 and ε2 are the error terms, which represent the difference between the real camera attitude (R1_x, R1_y) mapped according to the virtual camera attitude (R2_x, R2_y) and the actually measured real camera attitude.
[0073] Using each set of attitude parameters (R1_x, R1_y, R2_x, R2_y), substitute them into the above linear regression model. The goal is to minimize the error terms ε1 and ε2, which means finding a set of mapping coefficients N1, M1, D1, and Q1 such that the difference between the predicted real camera attitude and the actually measured attitude is minimized. This can be achieved through statistical methods such as the least squares method, which can find the coefficients of the best-fit line to minimize the squared difference between the predicted value and the actual value.
[0074] For each set of attitude parameters, a set of mapping coefficients N1, M1, D1, and Q1 will be obtained. Since we use multiple sets of data, multiple sets of mapping coefficients will be obtained. Finally, we need to determine the final mapping coefficients N1, M1, D1, and Q1 from these multiple sets of mapping coefficients. This can be achieved by analyzing the distribution of the multiple sets of mapping coefficients. For example, the average or median of these coefficients can be calculated as the final mapping coefficients. Doing so can reduce the influence of individual abnormal data on the final result and improve the accuracy and robustness of the mapping relationship.
[0075] In summary, step S50 establishes a linear regression model, uses actual data to solve for the mapping coefficients, and determines the final mapping relationship by analyzing the distribution of multiple sets of coefficients, thereby achieving an accurate correspondence between the virtual camera and the real camera attitudes.
[0076] In some embodiments, step S50 includes:
[0077] Let the attitude of the real camera be (R1_x, R1_y), and the attitude of the virtual camera be (R2_x, R2_y). R1_x is the rotation component of the real camera on the x-axis, R1_y is the rotation component of the real camera on the y-axis, R2_x is the rotation component of the virtual camera on the x-axis, and R2_y is the rotation component of the virtual camera on the y-axis. Then the mapping relationship for solving the synchronous attitude of the virtual camera based on the current attitude of the real camera is expressed as:
[0078] R2_x = R1_x * N2 + R1_y * M2;
[0079] R2_y = R1_y * D2 + R1_y * Q2;
[0080] Based on the multiple sets of pose parameters, mapping coefficients N2, M2, D2, and Q2 are obtained through training with a linear regression model.
[0081] Specifically, define the pose of the real camera as (R1_x, R1_y), where R1_x is the rotation component of the real camera on the x-axis and R1_y is the rotation component of the real camera on the y-axis; define the pose of the virtual camera as (R2_x, R2_y), where R2_x is the rotation component of the virtual camera on the x-axis and R2_y is the rotation component of the virtual camera on the y-axis;
[0082] Establish a mapping relationship equation, which is used to calculate the synchronous pose (R2_x, R2_y) of the virtual camera based on the pose (R1_x, R1_y) of the real camera. The equation is as follows:
[0083] R2_x = R1_xN2 + R1_yM2;
[0084] R2_y = R1_xD2 + R1_yQ2;
[0085] In these two equations, N2, M2, D2, and Q2 are mapping coefficients, which describe the conversion relationship between the real camera pose and the virtual camera pose.
[0086] By collecting the pose parameters (R1_x, R1_y) and (R2_x, R2_y) of the real camera and the virtual camera recorded after multiple sets of synchronous rotations, using this data as the training set, and applying the linear regression algorithm to estimate the mapping coefficients N2, M2, D2, and Q2, the goal of linear regression is to minimize the difference between the predicted virtual camera pose (R2_x, R2_y) and the actually recorded virtual camera pose; through training, we obtain the mapping coefficients N2, M2, D2, and Q2, and these coefficients can be used to calculate the synchronous pose (R2_x, R2_y) of the virtual camera according to any pose (R1_x, R1_y) of the real camera. In some embodiments, step S50 includes:
[0087] Establish the following linear regression model: R2_x = R1_x * N2 + R1_y * M2 + ε3, R2_y = R1_y * D2 + R1_y * Q2 + ε3; where ε3 and ε4 are the error terms between (R2_x, R2_y) mapped based on (R1_x, R1_y) and the real (R2_x, R2_y);
[0088] Based on the above linear regression model, each set of pose parameters is used, with the goal of minimizing ε3 and ε4, to solve for a corresponding set of mapping coefficients N2, M2, D2, and Q2, and finally obtain multiple sets of mapping coefficients N2, M2, D2, and Q2 corresponding to multiple sets of pose parameters;
[0089] Based on the distribution of the multiple sets of mapping coefficients N2, M2, D2, and Q2, the final mapping coefficients N2, M2, D2, and Q2 are obtained.
[0090] Specifically, two linear regression equations are used to represent the predicted values of the virtual camera pose:
[0091] R2_x = R1_xN2 + R1_yM2 + ε3;
[0092] R2_y = R1_xD2 + R1_yQ2 + ε4;
[0093] In these two equations, R1_x and R1_y respectively represent the pose components of the real camera on the x-axis and y-axis, while R2_x and R2_y represent the pose components of the virtual camera on the x-axis and y-axis; N2, M2, D2, and Q2 are mapping coefficients, which need to be solved through training data.
[0094] ε3 and ε4 are error terms, which represent the differences between the predicted virtual camera pose (R2_x, R2_y) and the actually recorded virtual camera pose; each set of pose parameters is used for training:
[0095] For each set of collected pose parameters (R1_x, R1_y) and the corresponding (R2_x, R2_y), these data are input into the linear regression model. The goal is to minimize the error terms ε3 and ε4, which means finding a set of mapping coefficients N2, M2, D2, and Q2 such that the difference between the predicted virtual camera pose and the actual pose is minimized. This can be achieved through optimization algorithms such as the least squares method, which will find the coefficients of the best fit line to minimize the squared error between the predicted value and the actual value; by training multiple sets of pose parameters, multiple sets of mapping coefficients N2, M2, D2, and Q2 can be obtained; finally, the final mapping coefficients N2, M2, D2, and Q2 need to be determined from these multiple sets of mapping coefficients, which can be achieved by analyzing the distribution of the multiple sets of mapping coefficients. For example, the average or median of these coefficients can be calculated as the final mapping coefficients. This method helps to reduce the impact of individual abnormal data on the final result and improve the accuracy and robustness of the mapping relationship.
[0096] In summary, step S50 realizes the accurate conversion from the real camera pose to the virtual camera pose by establishing a linear regression model, using actual data to train the mapping coefficients, and determining the final mapping relationship by analyzing the distribution of multiple sets of coefficients.
[0097] The device of this embodiment corresponds to the method of the above embodiment. Therefore, the content not described in detail in the device of this embodiment can be obtained by referring to the content of the method of the above embodiment, so it will not be elaborated herein.
[0098] Another aspect of the present invention further provides a virtual-real camera synchronization attitude parameter training device, including:
[0099] A communication interface for communicating with other electronic devices;
[0100] A memory for storing computer program instructions;
[0101] A processor for executing the computer program instructions to support the device in implementing the method as described above.
[0102] In this embodiment, the memory mainly includes a program storage area and a data storage area. Among them, the program storage area can store operating devices, application programs required for at least one function, etc., and the data storage area can store relevant data, etc. In addition, the memory can be a high-speed random access memory, or a non-volatile memory, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) card, a FlashCard, etc., or the memory can also be other volatile solid-state storage devices.
[0103] The processor can be a Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field-Programmable Gate Arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor can be a microprocessor, or the processor can also be any conventional processor. The processor is the control center of the device, connecting various parts of the device using various interfaces and lines.
[0104] Another aspect of the present invention further provides a computer program product, including computer program instructions, and the computer program instructions direct a computer device to perform operations corresponding to the method as described above.
[0105] Specifically, the computer program product includes a series of computer program instructions, which are codes written in the computer program, defining how to perform specific operations. These computer program instructions are designed to be loaded onto a computer device and guide the device to perform specific operations, which refer to the respective steps in the method described in the above embodiments. In this way, the computer program product of this embodiment provides a complete software solution, which can run on various computer devices to implement the method of the above embodiments.
[0106] The above has described the embodiments of the present invention. The above description is exemplary, not exhaustive, and is not limited to the disclosed embodiments. Many modifications and variations are obvious to those of ordinary skill in the art in the technical field without departing from the scope and spirit of the described embodiments. The choice of terms used herein is intended to best explain the principles of the embodiments, practical applications, or improvements to the technology in the market, or to enable other ordinary skilled persons in the technical field to understand the embodiments disclosed herein.
Claims
1. A virtual and real camera synchronization posture parameter training method, characterized in that: include: Step S10, initializing a substation digital twin scene; the substation digital twin scene is a digital copy of a real-world substation; Step S20, synchronously adjusting the 0-degree posture of the real camera in the actual substation and the corresponding virtual camera in the substation digital twin scene to ensure that the center points of the two images point to the same direction; the 0-degree posture refers to the posture of the camera without any rotation; Step S30, operating the real camera and the virtual camera to synchronously and randomly rotate a certain angle to ensure that the centers of the two images are aligned with the feature positions of the same object, and recording the current posture parameters of the two and recording them as a set of posture parameters; Step S40, repeating step S30 to obtain multiple sets of posture parameters; Step S50, performing synchronous posture parameter training of the virtual and real cameras according to the multiple groups of posture parameters to obtain a posture mapping relationship between the real camera and the virtual camera.
2. The method according to claim 1, characterized in that The step S50 comprises: Assume that the posture of the real camera is (R1_x, R1_y), and the posture of the virtual camera is (R2_x, R2_y), R1_x is the x-axis rotation component of the real camera, R1_y is the y-axis rotation component of the real camera, R2_x is the x-axis rotation component of the virtual camera, and R2_y is the y-axis rotation component of the virtual camera. Then, the mapping relationship of solving the synchronous posture of the real camera based on the current posture of the virtual camera is expressed as: R1_x=R2_x*N1+R2_y*M1; R1_y=R2_y*D1+R2_y*Q1; Based on the multiple groups of posture parameters, mapping coefficients N1, M1, D1 and Q1 are obtained by training a linear regression model.
3. The method according to claim 2, characterized in that The step S50 comprises: The following linear regression model is established: R1_x=N1*R2_x+M1*R2_y+ε1, R1_y=D1*R2_x+Q1*R2_y+ε2; where ε1 and ε2 are the error terms between (R1_x, R1_y) obtained based on the mapping of (R2_x, R2_y) and the true (R1_x, R1_y); Based on the above linear regression model, each group of posture parameters is used to minimize ε1 and ε2, and a corresponding set of mapping coefficients N1, M1, D1 and Q1 are solved, and finally multiple sets of mapping coefficients N1, M1, D1 and Q1 corresponding to multiple sets of posture parameters are obtained; The final mapping coefficients N1, M1, D1 and Q1 are obtained according to the distribution of the multiple groups of mapping coefficients N1, M1, D1 and Q1.
4. The method according to claim 1, characterized in that: The step S50 comprises: Assume that the posture of the real camera is (R1_x, R1_y), and the posture of the virtual camera is (R2_x, R2_y), R1_x is the x-axis rotation component of the real camera, R1_y is the y-axis rotation component of the real camera, R2_x is the x-axis rotation component of the virtual camera, and R2_y is the y-axis rotation component of the virtual camera. Then, the mapping relationship for solving the synchronous posture of the virtual camera based on the current posture of the real camera is expressed as: R2_x=R1_x*N2+R1_y*M2; R2_y=R1_y*D2+R1_y*Q2; Based on the multiple groups of posture parameters, mapping coefficients N2, M2, D2 and Q2 are obtained by training a linear regression model.
5. The method according to claim 4, characterized in that The step S50 comprises: The following linear regression model is established: R2_x=R1_x*N2+R1_y*M2+ε3, R2_y=R1_y*D2+R1_y*Q2+ε3; where ε3 and ε4 are the error terms between (R2_x, R2_y) obtained based on the mapping of (R1_x, R1_y) and the true (R2_x, R2_y); Based on the above linear regression model, each group of posture parameters is used to minimize ε3 and ε4, and a corresponding set of mapping coefficients N2, M2, D2 and Q2 are solved, and finally multiple sets of mapping coefficients N2, M2, D2 and Q2 corresponding to multiple sets of posture parameters are obtained; The final mapping coefficients N2, M2, D2 and Q2 are obtained according to the distribution of the multiple groups of mapping coefficients N2, M2, D2 and Q2.
6. A virtual and real camera synchronization posture parameter training device, characterized in that: The method comprises means for executing the method according to any one of claims 1 to 5.
7. A virtual and real camera synchronous posture parameter training device, characterized in that: include: A communication interface, used to communicate with other electronic devices; a memory for storing computer program instructions; A processor, configured to execute the computer program instructions to support the apparatus to implement the method according to any one of claims 1 to 5.
8. A computer program product, characterized in that The method comprises computer program instructions, wherein the computer program instructions instruct a computer device to execute operations corresponding to the method according to any one of claims 1 to 5.