A method for virtual-real fusion in training applications based on MR equipment

By identifying and correcting the calibration marks on the MR equipment, virtual and real alignment is achieved, which solves the problems of virtual and real alignment jitter and high computing resource consumption, and achieves automated alignment and real-time effects.

CN118521495BActive Publication Date: 2024-10-11HANGZHOU HUIJIAN ZHILIAN TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410977749.5
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-22
Publication Date
2024-10-11
Estimated Expiration
2044-07-22

AI Technical Summary

Technical Problem

There is a jitter problem in virtual and real alignment in existing MR training applications, and it consumes a lot of computing resources, making it difficult to achieve real-time effects.

Method used

By collecting images captured by the MR equipment camera, identifying the calibration marks on the physical training equipment, calculating its posture in the real world coordinate system, and correcting the equipment posture based on the virtual anchor point, achieving virtual and real alignment, reducing computing resource consumption, and improving real-time effects. .

Benefits of technology

It achieves automated virtual and real alignment, which is simple and fast, avoids real layer jitter, saves system resources, and improves computing efficiency and recognition accuracy.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118521495B_ABST
    Figure CN118521495B_ABST
Patent Text Reader

Abstract

The present invention relates to a method for virtual-real fusion of training applications based on MR devices, belongs to the field of virtual reality technology, and solves the problem of jitter and resource consumption of virtual-real alignment in existing MR training applications. The method comprises: identifying a calibration mark from an image taken by a camera, calculating the first pose of the calibration mark relative to the camera, and the second pose of the calibration mark in the real-world coordinate system; the calibration mark corresponds to a virtual anchor point with the same position on the virtual training device; according to the second pose and the third pose of the virtual anchor point in the virtual-world coordinate system, the pose of the MR device is corrected to complete virtual-real alignment; according to the fourth pose of the calibration mark relative to the camera at each moment calculated in real time, the pixel coordinates of the vertices of the observation area at each moment on the image are obtained, the perspective window is rendered according to the vertex pixel coordinates, and the virtual layer is rendered according to the pose corrected by the MR device to complete virtual-real fusion. Automatic and fast virtual-real fusion is achieved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of virtual reality technology, and in particular to a method for integrating virtuality and reality in training applications based on MR equipment. Background Art

[0002] The application of virtual-reality fusion builds a new space that is different from the traditional physical space. This space has both physical and virtual space characteristics. Based on this, MR (Mixed Reality) application technology has been applied in emergency, education, exhibition, medical and other industry markets.

[0003] Currently, virtual-reality fusion can be divided into virtual scenes fused into real scenes, and real scenes fused into virtual scenes. MR training applications are mostly virtual scenes fused into real scenes, integrating actual equipment into virtual training task scenes for work, where the real scene is called VST and the virtual scene is called VR.

[0004] The effect of virtual-real alignment and fusion can be directly perceived by the trainees. At present, the existing technology generally performs virtual-real alignment manually. However, the manual method is not easy to align postures, and it will cause jitter in virtual-real alignment and the virtual-real scene will not be integrated. As a result, the trainees are easily affected and cannot train normally. In addition, the existing computing resources are consumed a lot, and there are still challenges in achieving real-time effects. Summary of the invention

[0005] In view of the above analysis, an embodiment of the present invention aims to provide a method for virtual-real fusion in training applications based on MR devices, so as to solve the problem of virtual-real alignment jitter and resource consumption in existing MR training applications.

[0006] The embodiment of the present invention provides a method for virtual-real fusion of training applications based on MR equipment, comprising the following steps:

[0007] The image captured by the camera on the MR device is collected, the calibration mark on the physical training device is identified from the image, and the first pose of the calibration mark relative to the camera is calculated; the second pose of the calibration mark in the real world coordinate system is calculated based on the external parameters of the MR device, the pose of the MR device and the first pose;

[0008] The calibration mark corresponds to a virtual anchor point at the same position on the virtual training device; according to the second posture and the third posture of the virtual anchor point in the virtual scene world coordinate system, the posture of the MR device is corrected to complete the virtual-real alignment;

[0009] According to the fourth pose of the calibration mark relative to the camera calculated in real time at each moment, the pixel coordinates of the vertices of the observation area on the image at each moment are obtained, the perspective window is rendered according to the pixel coordinates of the vertices at each moment, and the virtual image is obtained according to the pose corrected by the MR device to render the virtual layer, thus completing the fusion of virtual and real.

[0010] Based on the further improvement of the above method, the fourth pose of the calibration marker relative to the camera at each moment is calculated in real time by the following formula:

[0011] ,

[0012] in, express Time calibration mark Relative to the camera The fourth position; and They represent the initial time and Camera on MR device and equipment The relative pose of is a pre-calibrated external parameter; Indicates the initial moment calibration mark Relative to the camera 's posture; Indicates MR equipment Initial time relative to The position at the moment; and They represent the initial time and Moment MR equipment In the real world coordinate system 's posture.

[0013] Based on the further improvement of the above method, the perspective window is rendered according to the vertex pixel coordinates at each moment, including: setting the lighting environment to a white light environment in the real scene to capture the image, mapping the perspective window according to the vertex pixel coordinates at each moment, and setting all pixels beyond the image range to transparent mode; rendering the perspective window according to the ambient lighting conditions of the virtual scene.

[0014] Based on further improvement of the above method, the position and posture of the MR device is obtained by extracting the six-degree-of-freedom data corresponding to the image shooting time from the high-frequency six-degree-of-freedom data obtained using the inside-out positioning technology.

[0015] Based on the further improvement of the above method, according to the external parameters of the MR device, the posture of the MR device and the first posture, the second posture of the calibration marker in the real world coordinate system is calculated by the following formula:

[0016] ,

[0017] in, Indicates calibration mark In the real world coordinate system The second position, Indicates the position of the MR device, that is, the MR device In the real world coordinate system The posture, Represents the camera on the MR device and equipment The relative position of is a pre-calibrated external parameter. Indicates calibration mark Relative to the camera The first position.

[0018] Based on the further improvement of the above method, the method also includes: by collecting and shooting multiple images, the calibration marks identified in each image are placed into a calibration set, and according to the posture of the physical training device in the real world coordinate system, the abnormal calibration marks in the calibration set are removed, and the mean of the first posture and the second posture of the remaining calibration marks are calculated to obtain the optimal first posture and second posture.

[0019] Based on the further improvement of the above method, according to the pose of the physical training device in the real world coordinate system, the abnormal calibration marks in the mark set are removed, including:

[0020] Calculate the pose of the physical training device in the real world coordinate system according to the second pose of each calibration marker in the marker set and the pose of each calibration marker relative to the physical training device as multiple poses to be verified;

[0021] Calculate the mean of the rotation part and the translation part for multiple postures to be verified;

[0022] The errors between the rotation part and the translation part of each posture to be verified and the corresponding mean are checked in turn. If any error exceeds the corresponding first error threshold, the corresponding calibration mark is removed.

[0023] Based on the further improvement of the above method, the middle moment of the time period of multiple images collected when calculating the optimal first pose and second pose is used as the initial moment in the real-time calculation.

[0024] Based on the further improvement of the above method, the posture of the MR device is corrected by the following formula:

[0025] ,

[0026] in, and Respectively represent the posture of the MR device before and after correction, Indicates a virtual anchor point In the virtual world coordinate system The third position; Indicates calibration mark In the real world coordinate system The second posture.

[0027] Based on the further improvement of the above method, the third posture of the virtual anchor point in the virtual world coordinate system is calculated according to the posture of the virtual training device in the virtual world coordinate system and the posture of the virtual anchor point relative to the virtual training device; the posture of the virtual anchor point relative to the virtual training device is the same as the posture of the calibration mark relative to the physical training device.

[0028] Compared with the prior art, the present invention can achieve at least one of the following beneficial effects:

[0029] 1. According to the position of the calibration mark in the real world and the known position of the virtual anchor point corresponding to the calibration mark in the virtual world, the physical training equipment and the virtual training equipment are aligned, thereby automatically realizing virtual-real alignment, which is simple and fast; virtual-real alignment makes the relative position relationship between the trainer and the training equipment in the real world and the virtual world consistent, and the virtual-real fusion can be realized by superimposing the perspective window and the virtual layer, removing the display of the real layer, which not only avoids the jitter problem of the real layer, but also saves system resources.

[0030] 2. By taking multiple images, the recognition accuracy of the calibration marks is improved, and abnormal calibration marks are removed according to the posture of the physical training device in the real world coordinate system, so that the posture of the calibration marks in the real world is more accurate, reducing the impact of inaccurate data caused by factors such as shooting angle, distance and calculated posture data of the MR device.

[0031] 3. Using the high-frequency output of the MR device after virtual-real alignment, the position of the calibration mark relative to the camera at the initial moment is updated at each moment, reducing the consumption of computing resources, improving computing efficiency, and achieving real-time effects.

[0032] In the present invention, the above-mentioned technical solutions can also be combined with each other to achieve more preferred combination solutions. Other features and advantages of the present invention will be described in the subsequent description, and some advantages can become obvious from the description, or can be understood by practicing the present invention. The purpose and other advantages of the present invention can be achieved and obtained through the contents particularly pointed out in the description and the drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] The accompanying drawings are only used for the purpose of illustrating specific embodiments and are not to be considered as limiting the present invention. In the entire drawings, the same reference symbols represent the same components;

[0034] Figure 1 This is a flow chart of a method for virtual-real fusion in a training application based on an MR device in an embodiment of the present invention;

[0035] Figure 2A schematic diagram of an MR device in an embodiment of the present invention;

[0036] Figure 3 Schematic diagram of the calibration mark in the embodiment of the present invention. DETAILED DESCRIPTION

[0037] The preferred embodiments of the present invention are described in detail below in conjunction with the accompanying drawings, wherein the accompanying drawings constitute a part of this application and are used together with the embodiments of the present invention to illustrate the principles of the present invention, but are not used to limit the scope of the present invention.

[0038] A specific embodiment of the present invention discloses a method for integrating virtual and real aspects of training applications based on MR equipment, such as Figure 1 As shown, the following steps are included:

[0039] S1. Acquire an image captured by a camera on the MR device, identify a calibration marker on the physical training device from the image, and calculate a first pose of the calibration marker relative to the camera; calculate a second pose of the calibration marker in the real world coordinate system based on the external parameters of the MR device, the pose of the MR device, and the first pose;

[0040] S2, the calibration mark corresponds to a virtual anchor point with the same position on the virtual training device; according to the second posture and the third posture of the virtual anchor point in the virtual scene world coordinate system, the posture of the MR device is corrected to complete the virtual-real alignment;

[0041] S3. According to the fourth posture of the calibration mark relative to the camera at each moment calculated in real time, the pixel coordinates of the vertices of the observation area at each moment on the image are obtained, the perspective window is rendered according to the pixel coordinates of the vertices at each moment, and the virtual image is obtained according to the posture corrected by the MR device to render the virtual layer, thereby completing the fusion of virtual and real.

[0042] It should be noted that the MR device is a head-mounted display device, including: 1 binocular color camera, 2 binocular black and white cameras and IMU (Inertial Measurement Unit). The binocular color camera is used to capture real-life images, and the binocular black and white camera and IMU are used to track the MR device and calculate the position and posture of the MR device. The relative position and posture between any camera on the MR device and the device is a pre-calibrated external parameter.

[0043] The MR device includes: IMU coordinate system, camera coordinate system and MR device coordinate system. The IMU is installed in the middle of the binocular color camera, the x-axis of the IMU coordinate system points to the right side of the MR device, the y-axis points to the top of the MR device, and the z-axis points to the front of the MR device; the origin of the MR device coordinate system is moved to the center of the head in the negative direction of the z-axis in the IMU coordinate system.

[0044] For example, Figure 2As shown in the figure, the solid dots represent binocular color cameras, and the black hollow circles represent binocular black and white cameras. The cross in the middle of the solid dots represents the origin of the IMU coordinate system, and the other cross represents the origin of the MR device coordinate system.

[0045] The training application in this embodiment is a simulated training scenario provided to trainees, such as a cockpit simulation training application; there is a physical training device in the real scene (real world / world coordinate system where MR equipment is positioned), such as a cockpit dashboard; and there is a virtual dashboard of the same size ratio in the virtual scene (virtual world).

[0046] Furthermore, a calibration mark is provided on the physical training device. For example, the calibration mark is as follows: Figure 3 As shown. Since the position of the calibration mark is predetermined, the calibration mark Compared to physical training equipment Posture It can be pre-calculated based on the calibration mark and the position coordinates of the physical training device. Correspondingly, a virtual calibration mark is also set at the same position on the virtual training device, which is called a virtual anchor point. In this embodiment, the virtual anchor point Compared with virtual training equipment Posture , which is the same as the position of the calibration marker relative to the physical training device, that is .

[0047] It should be noted that the calibration mark can be captured by any binocular color camera or a binocular black and white camera on the MR device to determine the posture relationship between the trainee and the physical training device. However, in order not to affect the training scene, the calibration mark is outside the trainee's observation area. The trainee's observation area is predetermined according to the shape parameters of the physical training device, and the posture of the vertices of the observation area relative to the physical training device is recorded. Ultimately, these vertices can generate a perspective area in which the image of the physical training device is displayed.

[0048] During implementation, physical training equipment, calibration markers and MR equipment are combined to start the training application to perform training tasks, which means replacing the physical training equipment in the real scene with virtual training equipment in the virtual scene. In this way, trainees can control the real physical training equipment to perform various task trainings. The consistent fusion of virtual and real brings better perception to trainees and improves the success rate of completing training tasks.

[0049] Specifically, in step S1, the calibration mark on the physical training device is identified from the image taken by the camera using existing technology, such as using a trained neural network model to detect the calibration mark. Then, by determining the matching point pairs between the feature points in the calibration mark in the image and the corresponding points in the world coordinate system, the rotation matrix and translation vector of the calibration mark relative to the camera are solved based on at least 4 non-collinear matching point pairs to obtain the calibration mark. Relative to the camera The first position .

[0050] It should be noted that, based on the image collected by the binocular black-and-white camera on the MR device and the position and posture of the MR device tracked by the IMU, the Inside-out positioning technology is used, and the SLAM algorithm is used to calculate the six-degree-of-freedom data of the MR device in real time. The data is output at a high frequency (such as 1000 Hz). In this embodiment, the six-degree-of-freedom data corresponding to the image shooting moment (i.e., the image exposure moment) is taken from the high-frequency output data as the posture of the MR device for subsequent calculation.

[0051] Furthermore, according to the external parameters of the MR device, the posture of the MR device and the first posture, the second posture of the calibration marker in the real world coordinate system is calculated by the following formula:

[0052] ,

[0053] in, Indicates calibration mark In the real world coordinate system The second position, Indicates the position of the MR device, that is, the MR device In the real world coordinate system The posture, Represents the camera on the MR device and equipment The relative position of is a pre-calibrated external parameter. Indicates calibration mark Relative to the camera The first position.

[0054] It should be noted that the second pose of the calibration mark in the real world coordinate system is theoretically an absolute pose, but the accuracy of the data is often affected by factors such as shooting angle, distance, and pose data of the MR device. Therefore, this embodiment captures multiple images, obtains the second pose of each calibration mark from the multiple images, and puts each calibration mark into a mark set. According to the pose of the physical training device in the real world coordinate system, the abnormal calibration marks in the mark set are removed, and the mean of the second poses of the remaining calibration marks is calculated to obtain the optimal second pose.

[0055] Specifically, according to the second pose of each calibration marker in the marker set and the pose of each calibration marker relative to the physical training device, the pose of the physical training device in the real world coordinate system, that is, the pose of the world coordinate system where the MR device is positioned, is calculated by the following formula as multiple poses to be verified:

[0056] ,

[0057] in, Indicates that according to the calibration mark Computed physical training equipment In the real world coordinate system The posture, Indicates calibration mark Relative to the pose of the physical training device, Indicates calibration mark The second posture.

[0058] Furthermore, the mean of the rotation part and the translation part are calculated for each of the multiple postures to be verified.

[0059] It should be noted that the translation mean of the translation part in the posture to be verified is obtained by calculating the arithmetic mean of the translation vector in each dimension; the rotation part usually has a variety of representation methods. This embodiment uses quaternion to represent the rotation part. Each normalized quaternion is converted to logarithmic space, and then the average logarithm of all quaternions is calculated, the average logarithm is mapped back to the quaternion space, and finally normalized to obtain the mean quaternion of the rotation part.

[0060] Furthermore, the errors between the rotation part and the translation part of each posture to be verified and the corresponding mean are checked in turn. If any error exceeds the corresponding first error threshold, the corresponding calibration mark is removed.

[0061] Specifically, the rotation quaternion in each posture to be verified is multiplied by the inverse of the mean quaternion to obtain the error quaternion. The error quaternion is converted into a rotation matrix and the rank of the rotation matrix is ​​calculated. Since the rank of the unit rotation matrix is ​​3, the rank of the calculated rotation matrix is ​​compared with 3 to calculate the first error. If the first error exceeds the first error threshold corresponding to the rotation part, the calibration mark corresponding to the posture to be verified is removed.

[0062] The translation vector in each posture to be verified is compared with the translation mean in each dimension to obtain a three-dimensional error vector, and the modulus of the three-dimensional error vector is calculated. If it exceeds the error threshold corresponding to the translation part, the calibration mark corresponding to the posture to be verified is removed.

[0063] Finally, calculate the first pose of the remaining calibration markers in the calibration set The average of , get the optimal first pose; calculate the second pose of the remaining calibration markers in the calibration set The optimal second pose is obtained by taking the mean of

[0064] Preferably, in order to further improve the recognition accuracy of the calibration marks, multiple calibration marks are set on the physical training device, one of which is used as the main calibration mark, and only one virtual anchor point corresponding to the main calibration mark is required on the virtual training device.

[0065] At this time, before performing the above-mentioned removal of abnormal calibration mark points, multiple calibration marks on each image are first verified according to the relative postures between the calibration marks in pairs, and calibration marks that pass the verification are obtained.

[0066] Specifically, since multiple calibration markers are set on the physical training device and the position of each calibration marker is known, the actual relative pose between two calibration markers is fixed and can be calculated in advance.

[0067] According to the second poses of the calibration markers in the pairwise combination, the estimated relative pose between the two calibration markers in the combination is calculated by the following formula:

[0068] ,

[0069] in, Indicates calibration mark With calibration mark The estimated relative pose between ; and Respectively indicate the calibration mark and calibration marks The second posture.

[0070] Furthermore, the errors of the rotation part and the translation part between the estimated relative pose and the actual relative pose between the two calibration markers are calculated. If any one of the errors exceeds the corresponding second error threshold, both calibration markers fail the verification; otherwise, both calibration markers pass the verification.

[0071] For example, if If the error between the rotation part or the translation part of the corresponding actual relative posture exceeds the corresponding second error threshold, the calibration mark is removed. With calibration mark .

[0072] For each image, the first and second poses of each calibration marker that has passed the verification, as well as the relative pose with the main calibration marker, are converted to the first and second poses of the main calibration marker, and then the average is taken as the final first and second poses of the main calibration marker on each image and put into the marker set. Finally, for multiple images, the optimal first and second poses are calculated according to the method mentioned above when there is only one calibration marker.

[0073] In step S2, the virtual anchor point In the virtual world coordinate system The third position Based on virtual training equipment In the virtual world coordinate system Posture and virtual anchor points Compared with virtual training equipment Posture The calculation formula is as follows:

[0074] ,

[0075] Furthermore, the posture of the MR device is corrected by the following formula:

[0076] ,

[0077] in, and They represent the posture of the MR device before and after correction respectively.

[0078] Preferably, Take the calibration mark In the real world coordinate system The optimal second pose.

[0079] It can be seen from formula (5) that the correction method of this embodiment does not rely on training applications, has high correction efficiency, and is convenient for subsequent rapid realization of virtual-real alignment.

[0080] In this embodiment, the fused image displayed from the MR device is obtained by superimposing three layers, and the order of these three layers from front to back is: perspective window, virtual layer and real layer. Among them, the perspective window is used to determine the shape of the perspective area, and the perspective area is composed of pre-determined observation area vertices; the virtual layer is used to display a pre-determined virtual image in the training application; the real layer is used to display the real image taken by the camera on the MR device.

[0081] Since the positions of the vertices and calibration marks in the observation area are known, the pose of each vertex relative to the calibration mark can be calculated in advance. Therefore, after calculating the first pose of the calibration mark relative to the camera, the pose of each vertex relative to the camera can be calculated, and based on the position coordinates of each vertex relative to the physical training device, the pixel coordinates of each vertex in the image taken by the camera can be calculated.

[0082] Furthermore, the perspective window is mapped according to the vertex pixel coordinates; based on the corrected posture of the MR device, the corresponding virtual image is obtained from the training application to render the virtual layer, and the real image is collected to render the real layer. If the physical training device and the virtual scene training device completely overlap after the three layers are superimposed, the virtual-real alignment is completed. At this time, the relative posture relationship between the trainee and the training device is unified in the virtual-real world; otherwise, step S1 and step S2 are re-executed, the posture of the MR device is corrected again and the three layers are rendered, until the virtual-real alignment is completed and step S3 is executed.

[0083] That is to say, this embodiment corrects the posture data of the MR device according to the posture of the calibration mark in the real world and the known posture of the virtual anchor point corresponding to the calibration mark in the virtual world. The training application uses this data to display virtual images under different position perspectives to the trainee. At the same time, the rendering position perspective of the perspective window will also change, automatically realizing virtual-real alignment, and displaying the image of the physical training device in the real world in the perspective window area, so as to achieve the effect of aligning the physical training device and the virtual training device. At this time, the relative posture relationship between the person and the training device in the virtual world and the real world is consistent.

[0084] In step S3, considering the first position of the calibration marker relative to the camera If the calculation is performed according to the method mentioned in step S1, it will consume more computing resources. Therefore, after the virtual-real alignment is achieved, the middle moment of the time period of the multiple images collected when calculating the optimal first and second poses is used as the initial moment and recorded as , take the optimal first pose as the initial pose of the calibration marker relative to the camera , and take out the six-degree-of-freedom data corresponding to the initial moment from the six-degree-of-freedom data of the high-frequency output MR device as the initial moment posture of the MR device , and then according to the subsequent postures at each moment , calculate the fourth pose of the calibration marker relative to the camera at each subsequent moment , to achieve real-time effects.

[0085] Specifically, the fourth pose of the calibration marker relative to the camera at each moment is calculated in real time through the following formula:

[0086] ,

[0087] in, express Time calibration mark Relative to the camera The fourth position; and They represent the initial time and Camera on MR device and equipment The relative position and posture of is a pre-calibrated external parameter, which is the same at any time; Indicates the initial moment calibration mark Relative to the camera The posture of is the optimal first posture; Indicates the initial position of the MR device relative to The position at the moment; and They represent the initial time and Moment MR equipment The pose is obtained by extracting the corresponding moment data from the six-degree-of-freedom data using the Inside-out positioning technology.

[0088] Similarly, according to the fourth pose of the calibration mark relative to the camera at each moment calculated in real time, the pixel coordinates of the vertices of the observation area at each moment on the image are calculated in real time. It should be noted that since the relative pose relationship between the trainer and the training equipment in the real world and the virtual world has been unified in step S2, when the fused image is displayed again after completing the virtual-real alignment, it is only necessary to superimpose the perspective window and the virtual layer, and the display of the real layer is removed, which not only avoids the jitter problem of the real layer, but also saves more system resources.

[0089] Preferably, in order to maintain the consistency of virtual and real styles, the lighting environment in the real scene is set to a white light environment for image capture, the perspective window is mapped according to the vertex pixel coordinates at each moment, and all pixels beyond the image range are set to transparent mode; and according to the ambient lighting conditions of the virtual scene, the perspective window is rendered in the same way, so that the physical training equipment in the real scene displayed in the perspective window achieves the same effect as the virtual training equipment in the virtual scene.

[0090] Compared with the prior art, the present embodiment provides a method for virtual-real fusion of training applications based on MR devices. According to the position and posture of the calibration mark in the real world and the known position and posture of the virtual anchor point corresponding to the calibration mark in the virtual world, the physical training device and the virtual training device are aligned, thereby automatically realizing virtual-real alignment, which is simple and fast; virtual-real alignment makes the relative position and posture relationship between the trainer and the training device in the real world and the virtual world consistent, and only needs to superimpose the perspective window and the virtual layer to realize virtual-real fusion, and removes the display of the real layer, which not only avoids the jitter problem of the real layer, but also saves system resources. By shooting multiple images, the recognition accuracy of the calibration mark is improved, and the abnormal calibration mark is removed according to the position and posture of the physical training device in the real world coordinate system, so that the position and posture of the calibration mark in the real world are more accurate, and the influence of inaccurate data caused by factors such as shooting angle, distance and calculated position and posture data of the MR device is reduced. The position and posture of the MR device output at high frequency after virtual-real alignment are used to update the position and posture of the calibration mark relative to the camera at the initial moment at each moment, reduce the consumption of computing resources, improve computing efficiency, and achieve real-time effect.

[0091] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.

[0092] The above description is only a preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by any technician familiar with the technical field within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention.

Claims

1. A method for virtual-real fusion in training applications based on MR equipment, characterized in that: The following steps are involved: Acquire an image taken by a camera on the MR device, identify a calibration mark on the physical training device from the image, and calculate a first pose of the calibration mark relative to the camera; calculate a second pose of the calibration mark in a real-world coordinate system based on an external parameter of the MR device, the pose of the MR device, and the first pose; The calibration mark corresponds to a virtual anchor point at the same position on the virtual training device; according to the second posture and the third posture of the virtual anchor point in the virtual world coordinate system, the posture of the MR device is corrected to complete virtual-real alignment; According to the fourth posture of the calibration mark at each moment calculated in real time relative to the camera, the pixel coordinates of the vertices of the observation area at each moment on the image are obtained, the perspective window is rendered according to the pixel coordinates of the vertices at each moment, and the virtual image is obtained according to the posture corrected by the MR device to render the virtual layer, thereby completing the virtual-real fusion; The virtual anchor point In the virtual world coordinate system The third position Virtual Training Device In the virtual world coordinate system Posture and virtual anchor points Compared with virtual training equipment Posture The calculation formula is as follows: , Among them, the virtual anchor point Compared with virtual training equipment Posture , with the calibration mark Compared to physical training equipment Posture same; The posture of the MR device is corrected by the following formula: , in, and Respectively represent the posture of the MR device before and after correction, Indicates calibration mark In the real world coordinate system The second position; The fourth pose of the calibration marker relative to the camera at each moment is calculated in real time using the following formula: , in, express Time calibration mark Relative to the camera The fourth position; and They represent the initial time and Camera on MR device and equipment The relative pose of is a pre-calibrated external parameter; Indicates the initial moment calibration mark Relative to the camera 's posture; Indicates MR equipment At the initial moment relative to The position at the moment; and They represent the initial time and Moment MR equipment In the real world coordinate system 's posture.

2. The method for virtual-reality fusion of training applications based on MR equipment according to claim 1, characterized in that: The perspective window is rendered according to the vertex pixel coordinates at each moment, including: setting the lighting environment in the real scene to a white light environment for image capture, mapping the perspective window according to the vertex pixel coordinates at each moment, and setting all pixel points beyond the image range to a transparent mode; and rendering the perspective window according to the ambient lighting conditions of the virtual scene.

3. The method for virtual-real fusion in training applications based on MR equipment according to claim 1, characterized in that: The posture of the MR device is obtained by extracting six-degree-of-freedom data corresponding to the image capturing time from high-frequency six-degree-of-freedom data obtained using the inside-out positioning technology.

4. The method for virtual-real fusion in training applications based on MR equipment according to claim 3, characterized in that: The second posture of the calibration mark in the real world coordinate system is calculated according to the external parameters of the MR device, the posture of the MR device and the first posture by the following formula: , in, Indicates calibration mark In the real world coordinate system The second position, Indicates the position of the MR device, that is, the MR device In the real world coordinate system The posture, Represents the camera on the MR device and equipment The relative position of is a pre-calibrated external parameter. Indicates calibration mark Relative to the camera The first position.

5. The method for virtual-real fusion in training applications based on MR equipment according to claim 1, characterized in that: The method also includes: by collecting and shooting multiple images, placing the calibration marks identified in each image into a calibration set, removing abnormal calibration marks in the calibration set according to the posture of the physical training device in the real world coordinate system, calculating the mean of the first posture and the second posture of the remaining calibration marks, and obtaining the optimal first posture and second posture.

6. The method for virtual-real fusion in training applications based on MR equipment according to claim 5, characterized in that: The removing of abnormal calibration marks in the mark set according to the position and posture of the physical training device in the real world coordinate system includes: Calculate the pose of the physical training device in the real world coordinate system according to the second pose of each calibration marker in the marker set and the pose of each calibration marker relative to the physical training device as multiple poses to be verified; Calculating the mean of the rotation part and the translation part for each of the plurality of postures to be verified; The errors between the rotation part and the translation part of each posture to be verified and the corresponding mean are checked in turn. If any error exceeds the corresponding first error threshold, the corresponding calibration mark is removed.

7. The method for virtual-real fusion in training applications based on MR equipment according to claim 5, characterized in that: The middle moment of the time period of the multiple images collected when calculating the optimal first pose and second pose is used as the initial moment in the real-time calculation.