Object pose determination method and device and storage medium

Through the image acquisition device and calibration data, the position of the three-dimensional Marker point in the virtual reality device is determined, which solves the problem of high alignment cost between virtual objects and real objects, and achieves high-accurate posture coordination and reduces the alignment cost.

CN118887281AActive Publication Date: 2024-11-01GEER TECH CO LTD

Patent Information

Application Number
CN202410929189.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-07-11
Publication Date
2024-11-01
Estimated Expiration
2044-07-11

AI Technical Summary

Technical Problem

In existing virtual reality technology, alignment of virtual objects with real objects requires pre-construction of external base stations, resulting in high alignment cost and low efficiency.

Method used

The positioning image is acquired through the image acquisition device, the pixel coordinates of the two-dimensional Marker point are determined, the relative position between the three-dimensional Marker and the image acquisition device is calculated, and the target position of the three-dimensional Marker point in the world coordinate system is determined using calibration data, so as to achieve the realization of the three-dimensional Marker point Accurate positioning of virtual objects and real objects.

Benefits of technology

It improves the accuracy of coordination between virtual objects and real objects in virtual reality devices, reduces alignment costs, and does not rely on external base station construction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118887281A_ABST
    Figure CN118887281A_ABST
Patent Text Reader

Abstract

The invention discloses an object pose determination method and device and a storage medium, relates to the technical field of virtual reality, and discloses an object pose determination method, which is applied to virtual reality equipment and comprises the following steps: acquiring a positioning image acquired by an image acquisition device, and determining pixel coordinates of a two-dimensional Marker point in the positioning image; according to the pixel coordinates, determining a relative pose between the three-dimensional Marker and the image acquisition device; and determining a target pose of an entity corresponding to the three-dimensional Marker point in a world coordinate system according to the relative pose and calibration data of the image acquisition device. According to the method and the device, the relative pose between the three-dimensional Marker and the image acquisition device is determined, and the target pose of the three-dimensional Marker point in the world coordinate system is determined by using the calibration data, so that the pose coordination accuracy between the virtual object and the real object in the virtual reality equipment is improved, external base station construction is not needed, and the alignment cost is reduced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of virtual reality technology, and in particular to a method, device and storage medium for determining a physical object posture. Background Art

[0002] When a virtual reality (VR) device is turned on, it will use the center of the inertial measurement unit (IMU) as the origin to create a world coordinate system to describe the position and posture of the output content. In related technologies, in order to ensure the coordination of the virtual objects output by the VR device with the real objects, the position description information of the virtual objects and the real objects is generally aligned based on a pre-built external base station. However, this method has the disadvantage of high alignment cost because it requires the pre-construction of an external base station.

[0003] The above contents are only used to assist in understanding the technical solution of the present application and do not constitute an admission that the above contents are prior art. Summary of the invention

[0004] The main purpose of this application is to provide a method, device and storage medium for determining the posture of a real object, aiming to solve the technical problem of merging and aligning the posture of a virtual object with that of a real object.

[0005] To achieve the above-mentioned purpose, the present application proposes a method for determining the posture of a physical object, which is applied to a virtual reality device, wherein the virtual reality device is provided with an image acquisition device, and the method comprises:

[0006] Acquire the positioning image acquired by the image acquisition device, and determine the pixel coordinates of the two-dimensional marker points in the positioning image;

[0007] Determine the relative position between the three-dimensional marker and the image acquisition device according to the pixel coordinates;

[0008] According to the relative posture and the calibration data of the image acquisition device, the target posture of the entity corresponding to the three-dimensional marker point in the world coordinate system is determined.

[0009] In one embodiment, the step of determining the relative position between the three-dimensional marker and the image acquisition device according to the pixel coordinates includes:

[0010] Determine the optional spot order corresponding to the two-dimensional marker points in the positioning image according to the pixel coordinates;

[0011] The optional spot order with the smallest projection error is set as the target spot order;

[0012] A two-dimensional-three-dimensional point pair is constructed according to the target spot sequence, and the relative position and posture is determined based on the two-dimensional-three-dimensional point pair.

[0013] In one embodiment, before the step of setting the optional spot order with the smallest projection error as the target spot order, the method further includes:

[0014] Determine the rotation vector and the translation vector corresponding to each of the optional spot sequences;

[0015] The projection error corresponding to the selectable spot sequence is determined according to the rotation vector and the translation vector.

[0016] In one embodiment, the step of sequentially constructing two-dimensional-three-dimensional point pairs according to the target spots and determining the relative position based on the two-dimensional-three-dimensional point pairs includes:

[0017] Constructing the two-dimensional-three-dimensional point pairs according to the target spot sequence;

[0018] Determine the control points and construct the local coordinate system based on the control points;

[0019] A set of equations is constructed according to the two-dimensional-three-dimensional point pairs and the local coordinate system, and the relative posture is solved based on the set of equations.

[0020] In one embodiment, the image acquisition device is a binocular camera, and the step of determining the relative position between the three-dimensional marker and the image acquisition device according to the pixel coordinates includes:

[0021] Acquire a binocular baseline and binocular extrinsic parameters corresponding to the binocular camera, and determine an initial relative pose according to the positioning image captured by a sub-camera of the binocular camera;

[0022] Based on the binocular baseline and the binocular extrinsic parameters, establishing a relationship equation between the projection positions of the three-dimensional marker points in the binocular camera image respectively;

[0023] The relative posture is determined according to the relationship equation and the initial relative posture.

[0024] In one embodiment, the step of determining the target pose of the entity corresponding to the three-dimensional marker point in the world coordinate system according to the relative pose and the calibration data of the image acquisition device further includes:

[0025] Determining a device posture of the virtual reality device according to inertial data collected by an inertial measurement unit;

[0026] Determining the acquisition device posture of the image acquisition device according to the calibration data and the device posture;

[0027] The target posture is determined according to the acquisition device posture and the relative posture.

[0028] In one embodiment, the method further comprises:

[0029] Acquiring display parameters of a virtual object to be output, and rendering the virtual object according to the display parameters;

[0030] The display posture of the virtual object is determined according to the target posture.

[0031] In one embodiment, the step of acquiring the positioning image acquired by the image acquisition device and determining the pixel coordinates of the two-dimensional marker points in the positioning image includes:

[0032] Identify the two-dimensional marker points of the positioning image according to an image recognition algorithm, and determine the edge contours of the two-dimensional marker points;

[0033] The center point of the edge contour is calculated, and the pixel coordinates of the corresponding two-dimensional marker point are determined.

[0034] In addition, to achieve the above-mentioned purpose, the present application also proposes a virtual reality device, which includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for determining the posture of a physical object as described in any one of claims 1 to 8.

[0035] In addition, to achieve the above-mentioned purpose, the present application also proposes a storage medium, which is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by the processor, the steps of the method for determining the physical object posture as described above are implemented.

[0036] The present application provides a method, device and storage medium for determining the posture of a physical object, by acquiring a positioning image acquired by the image acquisition device and determining the pixel coordinates of the two-dimensional marker point in the positioning image; determining the relative posture between the three-dimensional marker and the image acquisition device according to the pixel coordinates; determining the target posture of the entity corresponding to the three-dimensional marker point in the world coordinate system according to the relative posture and the calibration data of the image acquisition device. The present application determines the target posture of the three-dimensional marker point in the world coordinate system based on the calibration data of the three-dimensional marker point and the camera, thereby improving the accuracy of the posture coordination between the virtual object and the real object in the virtual reality device, and does not need to rely on the construction of an external base station, thereby reducing the alignment cost of the virtual scene and the real scene. BRIEF DESCRIPTION OF THE DRAWINGS

[0037] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0038] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0039] Figure 1 A schematic diagram of the device structure of the hardware operating environment involved in the method for determining the physical object posture in the embodiment of the present application;

[0040] Figure 2 This is a flow chart of the first embodiment of the method for determining the physical object posture of the present application;

[0041] Figure 3 This is a schematic diagram of the first process of the second embodiment of the method for determining the physical object posture of the present application;

[0042] Figure 4 This is a schematic diagram of a second process flow of a second embodiment of a method for determining a physical object posture of the present application;

[0043] Figure 5 A schematic diagram of a specific application scenario of the second embodiment of the method for determining the physical object posture of the present application;

[0044] Figure 6 This is a schematic diagram of the algorithm flow of the second embodiment of the method for determining the physical object posture of the present application.

[0045] The purpose, features and advantages of this application will be further described in conjunction with the embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0046] It should be understood that the specific embodiments described herein are only used to explain the technical solutions of the present application and are not used to limit the present application.

[0047] In order to better understand the technical solution of the present application, a detailed description will be given below in conjunction with the accompanying drawings and specific implementation methods.

[0048] In Virtual Reality (VR) systems, achieving virtual-real alignment relies heavily on precise tracking and positioning equipment, namely head-mounted displays (HMDs) and external trackers (often called lighthouses). The working principle of a VR system is to use infrared light signals emitted by lighthouses to form a known light pattern in space, which are then captured by the photosensitive sensors on the HMD; by measuring the angles and intensities of signals from multiple lighthouses, VR devices can continuously calculate their exact position and posture in three-dimensional space.

[0049] Once the objects and scenes in the virtual world are rendered by the computer and displayed on the HMD, when the user moves in the real world, the position and posture information of the VR device will be captured in real time and transmitted back to the computer system; based on this data, the computer will adjust the perspective and scene of the virtual world accordingly, so that the virtual objects are highly consistent with the movement of the real world. This real-time virtual-real alignment achieves a seamless match between the virtual environment and the user's movements, greatly enhancing the user's sense of immersion.

[0050] To maximize system performance, lighthouses should be strategically placed around user activity areas to avoid signal blind spots; lighthouses should also be avoided from being exposed to direct sunlight or other strong light sources, which may cause signal interference. When using VR devices, users should be careful not to block the infrared light signals emitted by the lighthouses with their own or other people's limbs or other objects, so as not to affect the tracking quality.

[0051] When a virtual reality device is turned on, it will use the center of the inertial measurement unit (IMU) as the origin to create a world coordinate system to describe the position and posture of the output content. In related technologies, in order to ensure the coordination of the virtual objects output by the VR device with the real objects, the position description information of the virtual objects and the real objects is generally aligned based on a pre-built external base station. However, this method has the disadvantage of high alignment cost because it requires the pre-construction of an external base station.

[0052] In view of the above problems, the present application proposes a method for determining the posture of a real object. The method determines the relative posture between a three-dimensional marker and an image acquisition device, and uses calibration data to determine the target posture of the three-dimensional marker point in the world coordinate system, thereby improving the accuracy of posture coordination between virtual objects and real objects in virtual reality devices. In addition, the method does not need to rely on the construction of an external base station, thereby reducing the alignment cost.

[0053] In order to explain this technical solution more clearly, this application is explained with VR head mounted device as the execution subject, please refer to Figure 1 , Figure 1This is a schematic diagram of the device structure of the hardware operating environment involved in the embodiment of the present application.

[0054] like Figure 1 As shown, the virtual reality device may include a processing device 1001 (e.g., a central processing unit, a graphics processor, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM: Read Only Memory) 1002 or a program loaded from a storage device 1003 to a random access memory (RAM: Random Access Memory) 1004. In RAM1004, various programs and data required for the operation of the virtual reality device are also stored. The processing device 1001, ROM1002, and RAM1004 are connected to each other through a bus 1005. An input / output (I / O) interface 1006 is also connected to the bus. Generally, the following systems can be connected to the I / O interface 1006: an input device 1007 including, for example, a touch screen, a touch pad, a keyboard, etc.; an output device 1008 including, for example, a liquid crystal display (LCD: Liquid Crystal Display), a speaker, a vibrator, etc.; a storage device 1003 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 1009. The communication device 1009 can allow the virtual reality device to communicate with other devices wirelessly or by wire to exchange data. Although the figure shows a virtual reality device with various systems, it should be understood that it is not required to implement or have all the systems shown. More or fewer systems can be implemented or have instead.

[0055] Those skilled in the art will appreciate that although Figure 1 Various structural devices are shown, but they do not constitute a limitation on the electronic devices, and more or fewer systems may be implemented alternatively or provided.

[0056] This application embodiment provides a method for determining the physical posture. Please refer to Figure 2 , Figure 2 This is a flow chart of the first embodiment of the method for determining the physical object posture of the present application.

[0057] In this embodiment, the method for determining the physical object posture includes the following steps:

[0058] Step S10, acquiring the positioning image acquired by the image acquisition device, and determining the pixel coordinates of the two-dimensional marker points in the positioning image.

[0059] It should be noted that marker points are usually deployed in one or more objects or scenes that need to be accurately positioned and measured. These marker points form a rigid body in a non-linear and asymmetrical manner and are arranged on real objects. There are many reasonable ways to arrange the rigid body.

[0060] It should be explained that since the three points are arranged non-collinearly in three-dimensional space, a unique plane can be determined, so at least three marker points are required to define the starting point, end point and middle point of the rigid body.

[0061] It is understandable that in order to ensure that the image acquisition device can clearly identify each Marker point and reduce the interference between adjacent Marker points, the spacing between the Marker points needs to be set to at least twice the Marker diameter.

[0062] It should be noted that the marker point is usually round or square and made of infrared reflective material. This material will emit obvious reflections under infrared light, thus forming a significant bright spot in the captured image, which is easy to identify and locate. When the user puts on the HMD and turns it on, the world coordinate system will be rebuilt with the center of the IMU as the origin, and then the system will remind the user to enter the correction process and trigger the image acquisition device to collect images.

[0063] Optionally, the marker points can be selected as high-contrast patterns, such as black and white grids or logos of specific shapes, to be displayed in specific colors in the images captured by the camera. Alternatively, irregular arrays of LED lights or other light sources can be used as marker points. These light sources can be programmed to work at specific flashing frequencies and / or color modes, which are easy to identify in the images captured by the camera, and the pixel coordinates of each light source point can be determined by image analysis technology.

[0064] Optionally, five objects with marker points are combined into a rigid body in a specific shape and placed on an object in the real environment. The user then enters the correction process and triggers the image acquisition device to capture images of the rigid body.

[0065] It should be clear that as the number of Marker points increases, the system can obtain more position constraint information, which helps to more accurately determine the position and posture of the rigid body. In addition, more Marker points can also provide redundant information. When some Marker points cannot be captured by the system due to occlusion or recognition problems, other Marker points can still maintain the positioning accuracy of the system. However, too many Marker points may increase the computational complexity of the system. Therefore, in actual applications, an appropriate number of Marker points can be selected according to specific scenarios and needs to achieve the best balance. This embodiment does not impose any limitation on the number of Marker point markings.

[0066] In an optional implementation, after the positioning image is acquired, the two-dimensional marker points in the positioning image can be first identified according to the image recognition algorithm, and the edge contour of the two-dimensional marker points can be determined, and then the center point of the edge contour can be calculated to determine the pixel coordinates of the corresponding two-dimensional marker points. Among them, the edge contour refers to the specific shape boundary of the marker point in the image. By identifying the edge contour, the boundary of the marker point can be located.

[0067] Optionally, after the positioning image is acquired, the positioning image is first converted into a grayscale image and noise reduction is performed at the same time; then the horizontal and vertical gradients of the pixels are calculated respectively through two 3x3 kernels to obtain the gradient information of each pixel; the total gradient amplitude and direction are calculated in combination with the gradient information to identify potential edge points; then the pixel points with the largest gradient amplitude and the pixel points with a gradient amplitude higher than the high threshold and suppressed below the low threshold are retained through the steps of non-maximum suppression and edge refinement and double threshold processing, wherein the pixel points between the high and low thresholds are regarded as edges if they are connected to strong edge points. After obtaining a clear edge contour through the above steps, the edge contour of the marker point is determined according to the contour tracking algorithm, and the center point of the edge contour is calculated to determine the pixel coordinates of the marker point in the image.

[0068] To better understand the solution provided in this example, this example is further explained in combination with specific application scenarios.

[0069] In this example, the application of augmented reality (AR) games requires placing virtual objects at specific locations in the real world. Therefore, multiple marker points need to be arranged in the real environment. These marker points can be effectively identified in the positioning image captured by the camera and used as references to determine the position of the virtual object. Five objects with marker points can be formed into a rigid body according to a specific shape and placed on objects in the real environment. When wearing the HMD and moving in the game area, the camera on the AR helmet will capture the corresponding marker points and collect the positioning image.

[0070] The acquired positioning image is converted into a grayscale image and noise reduction is performed at the same time; then, the horizontal and vertical gradients of each pixel in the image are calculated respectively through two 3x3 kernels to obtain the gradient information of each pixel; combined with the gradient information, the amplitude and direction of the total gradient are further calculated. Then, the non-maximum suppression algorithm is used to retain the pixels with the largest gradient amplitude, and the double threshold processing is used to filter out the true edge points; among them, the pixels with gradient amplitudes higher than the high threshold are accepted as strong edges, while those lower than the low threshold are suppressed. Through the above steps, the clear edge contours of the 5 marker points in the positioning image are obtained, and then the center points of the corresponding marker points are calculated to determine the pixel coordinates of the 5 markers in the positioning image.

[0071] Optionally, a template image of the rigid body corresponding to the Marker point can be created first, wherein the template image contains the precise shape and size of the Marker point; then the template image is matched and retrieved on the positioning image acquired by the image acquisition device, starting from the upper left corner of the positioning image, the template image is compared with the area of ​​the same size in the positioning image, wherein the comparison is performed by calculating the sum of the squares of the differences in the pixel values ​​in the two areas; then the template image is moved and compared with the next area in the positioning image until the entire positioning image is traversed. The coordinates of the area with the highest matching degree are obtained, which are the pixel coordinates of the Marker in the positioning image.

[0072] Optionally, a large number of image data sets containing various types of Marker points are collected and manually labeled to indicate the pixel coordinates of each Marker point; then the collected image data sets are used to train the convolutional neural network model. During the training process, the model will learn and recognize the features of each type of Marker point, including shape and pattern. By adjusting the parameters, the accuracy of the model in identifying the pixel coordinates of the Marker point is gradually improved, and the trained model is integrated into the AR system. When an AR device equipped with a camera captures a positioning image of the Marker point, the system will identify the Marker point in the positioning image in real time through the trained convolutional neural network model and output the pixel coordinates of the corresponding Marker point.

[0073] Step S20: determining the relative position between the three-dimensional marker and the image acquisition device according to the pixel coordinates.

[0074] It should be noted that the pixel coordinates are the horizontal and vertical positions of each pixel point in a digital image relative to the upper left corner of the image, and a two-dimensional coordinate system is usually used to represent the pixel coordinates.

[0075] It should be noted that the relative position and posture includes the translation vector (position) and the rotation matrix (posture) in the three-dimensional space, which describes the transformation relationship from the coordinate system of the image acquisition device to the coordinate system of the three-dimensional marker point.

[0076] It is understandable that to determine the relative position between the three-dimensional marker and the image acquisition device, the pixel coordinates need to be converted into three-dimensional coordinates first. Therefore, the camera needs to be calibrated first to determine the camera intrinsic parameters and camera extrinsic parameters. Among them, the camera intrinsic parameters include focal length, optical center position, radial and tangential distortion coefficients, etc., and the camera extrinsic parameters refer to the position and posture of the camera in the world coordinate system.

[0077] In an optional embodiment, the camera can be calibrated using a calibration plate of known size and shape, such as a black and white checkerboard. Images of the calibration plate are then taken at different angles, and image processing algorithms are used to detect the corner points of the checkerboard in the image. The camera's intrinsic and extrinsic parameters are calculated by comparing the positions of these corner points in the image with their positions in the real world.

[0078] In an optional embodiment, a self-calibration method can be used to capture images containing straight lines or vanishing points, such as corners, square objects, etc.; then, the camera's intrinsic parameters are calculated using these straight lines or vanishing points, such as the side length of a square object.

[0079] In an optional embodiment, after the camera is calibrated, points on the two-dimensional image plane are mapped to rays in three-dimensional space through an inverse projection transformation, wherein the inverse projection transformation requires the use of camera intrinsic parameters to correct image distortion, and then the pixel coordinates are converted into normalized coordinates, and then the camera extrinsic parameters are used to convert the normalized coordinates into three-dimensional coordinates in the camera coordinate system.

[0080] In an optional implementation scheme, after obtaining the intrinsic and extrinsic parameters of the camera, a specific light pattern is projected into the scene using structured light, and the camera is used to capture the deformation of the light pattern to calculate the depth; or a ToF sensor is used to measure the time from the emission to the reflection of the light wave to directly calculate the depth, and obtain the depth information of each pixel in the positioning image; the spatial coordinates of the three-dimensional marker point are calculated by triangulation principle based on the pixel coordinates of the two-dimensional marker point and the corresponding depth information; based on the spatial coordinates, a point cloud representing the scene is constructed, in which each marker point is a data point in the point cloud, and its position corresponds to the position in the real world. Then, the iterative closest point (ICP) algorithm is used to align the three-dimensional point cloud in the camera coordinate system with the known three-dimensional marker point cloud, and the distance between the corresponding points of the two point clouds is minimized, so as to find the best coordinate transformation and obtain the relative position of the camera coordinate system relative to the three-dimensional marker.

[0081] Step S30, determining the target posture of the entity corresponding to the three-dimensional marker point in the world coordinate system according to the relative posture and the calibration data of the image acquisition device.

[0082] It should be noted that the calibration data is a set of known data points used in the camera calibration process, and this set of data points has clear coordinates in the real world.

[0083] It should be noted that the target pose refers to the position and direction of the object or feature point that you want to determine in three-dimensional space. The target pose usually consists of a rotation matrix and a translation vector.

[0084] It should be explained that the purpose of calculating the target posture is to map the two-dimensional image information captured by the image acquisition device into the actual coordinate system of the three-dimensional world, so as to achieve accurate positioning and posture determination of the real object.

[0085] It should be explained that when converting the local coordinates of the three-dimensional marker point into the global world coordinate system, the perspective and position of the image acquisition device need to be considered. The calibration data provides the basis for the conversion, and the relative pose determines the specific position and orientation of the three-dimensional marker point observed from the camera perspective.

[0086] In an optional implementation scheme, the relative posture calculated in step S20 is converted into a posture in the world coordinate system using the intrinsic and extrinsic parameters obtained by camera calibration; for each three-dimensional marker point, the coordinates of the corresponding marker point in the world coordinate system are calculated through coordinate transformation based on its translation vector and rotation matrix relative to the camera, as well as the calibration data.

[0087] In an optional implementation scheme, a transformation matrix is ​​constructed using the intrinsic and extrinsic parameters obtained by camera calibration, as well as the relative position and posture; and the coordinates of the point in the world coordinate system are obtained by multiplying the local coordinates of the three-dimensional marker point by the transformation matrix.

[0088] This embodiment provides a method for determining the posture of a physical object, by capturing a positioning image and extracting the pixel coordinates of a two-dimensional marker point, using a camera calibration and posture estimation algorithm to determine the relative posture between a three-dimensional marker point and an image acquisition device, and then combining the calibration data to calculate the target posture of the three-dimensional marker point in the world coordinate system, thereby achieving precise positioning and posture determination of the position of each element in a virtual reality scene.

[0089] This application embodiment provides a method for determining the physical posture. Please refer to Figure 3 , Figure 3This is a first flow chart of the second embodiment of the method for determining the physical object posture of the present application. Based on the first embodiment, the steps of step S20 further include:

[0090] Step S201, determining the optional spot order corresponding to the two-dimensional marker points in the positioning image according to the pixel coordinates.

[0091] Step S202, setting the optional spot order with the smallest projection error as the target spot order.

[0092] Step S203: constructing two-dimensional-three-dimensional point pairs according to the target spot sequence, and determining the relative position and posture based on the two-dimensional-three-dimensional point pairs.

[0093] It should be noted that after determining multiple possible spot orders, the system will evaluate the projection error of each spot order, where the projection error refers to the error generated when projecting a point in three-dimensional space onto a two-dimensional image plane, reflecting the degree of matching between the two-dimensional image and the three-dimensional model.

[0094] It can be understood that the spot order with the smallest projection error indicates that the corresponding two-dimensional image has the highest matching degree with the three-dimensional model, and therefore is most likely to reflect the actual position and posture of the object, so it is set as the target spot order.

[0095] It can be understood that after determining the order of the target spots, the system will establish a correspondence between the two-dimensional image and the three-dimensional model, that is, construct a two-dimensional-three-dimensional point pair.

[0096] Optionally, before step S202, the method further includes:

[0097] Determine the rotation vector and the translation vector corresponding to each of the optional spot sequences;

[0098] The projection error corresponding to the selectable spot sequence is determined according to the rotation vector and the translation vector.

[0099] It should be noted that each optional spot order will correspond to a unique set of rotation vectors and translation vectors. A set of rotation vectors and translation vectors depends not only on the actual position of the corresponding marker points, but also on the order of the corresponding marker points in the image. Therefore, different spot orders may result in different rotation and translation combinations.

[0100] Optionally, step S203 further includes:

[0101] Constructing the two-dimensional-three-dimensional point pairs according to the target spot sequence;

[0102] Determine the control points and construct the local coordinate system based on the control points;

[0103] A set of equations is constructed according to the two-dimensional-three-dimensional point pairs and the local coordinate system, and the relative posture is solved based on the set of equations.

[0104] It should be noted that a control point refers to a specific point with a known and fixed position in a real scene, which may be an artificially set mark or a natural feature point.

[0105] It is understandable that the position of the control point in the real scene is fixed and known, which means that the corresponding control point can be accurately found in the image and the coordinates of the control point in the world coordinate system can be determined. Through this correspondence, the position and direction of the camera in the three-dimensional space can be determined, thereby realizing camera calibration and pose estimation.

[0106] Optionally, the image acquisition device is a binocular camera, please refer to Figure 4 , Figure 4 This is a second flow chart of the second embodiment of the method for determining the physical object posture of the present application. Based on the first embodiment, the steps of step S20 further include:

[0107] Step S211, obtaining a binocular baseline and binocular extrinsic parameters corresponding to the binocular camera, and determining an initial relative pose according to the positioning image captured by a sub-camera of the binocular camera;

[0108] Step S212, based on the binocular baseline and the binocular extrinsic parameters, establishing a relationship equation between the projection positions of the three-dimensional marker points in the binocular camera image;

[0109] Step S213, determining the relative posture according to the relationship equation and the initial relative posture.

[0110] It should be noted that the binocular baseline refers to the distance between two cameras, which can also be understood as the difference between the positions of the two cameras.

[0111] It should be noted that binocular extrinsic parameters refer to the offset and rotation of the camera relative to the external coordinates (also known as the world coordinates); in a binocular vision system, each camera has its own extrinsic parameters, which represent the relationship between it and the world coordinate system.

[0112] It can be understood that, according to the definition of the binocular baseline (the distance between the two cameras is fixed), a relationship equation about the projection position of the marker point in the two camera images can be established, and the position of the marker point in the three-dimensional space can be determined by solving the relationship equation.

[0113] It can be understood that by using binocular external parameters for constraints, the position of the determined marker point in the three-dimensional space can be converted into the world coordinate system.

[0114] Optionally, step S30 further includes:

[0115] Determining a device posture of the virtual reality device according to inertial data collected by an inertial measurement unit;

[0116] Determining the acquisition device posture of the image acquisition device according to the calibration data and the device posture;

[0117] The target posture is determined according to the acquisition device posture and the relative posture.

[0118] It should be noted that an inertial measurement unit is a sensor that can be used to measure and report information such as the acceleration, angular velocity, and magnetic field of a device, providing detailed information about the movement and rotation of the device in three-dimensional space.

[0119] It should be noted that the pose of the image acquisition device refers to the position and direction of the camera in space. Since the fixed position of the image acquisition device on the virtual reality device relative to the device is known, the pose of the image acquisition device can be determined by combining the calibration data and the device pose.

[0120] Optionally, a method for determining a physical object posture further includes:

[0121] Acquiring display parameters of a virtual object to be output, and rendering the virtual object according to the display parameters;

[0122] The display posture of the virtual object is determined according to the target posture.

[0123] It should be noted that in augmented reality (AR) technology, in order to achieve accurate fusion of virtual objects with the real world, it is necessary to determine the position and posture of real objects. In this process, the actual scene where the target object is located is first perspective-performed and the virtual object is rendered based on the target position of the entity corresponding to the three-dimensional Marker point in the world coordinate system, ensuring that the target position of the virtual object in the world coordinate system is consistent with the target position of the entity corresponding to the three-dimensional Marker point in the world coordinate system; then the rendered virtual object is fused with the three-dimensional Marker point to form a real view; the fusion process is specifically implemented by superimposing the image of the virtual object on the corresponding part of the real scene.

[0124] To better understand the solution given in this example, please refer to Figure 5 This example is further explained in combination with specific application scenarios.

[0125] In this example, the scene of virtual-reality fusion takes a driving training cabin as an example. The "virtual" in the VR headset is a rendered environment similar to high-speed driving, with the scenery outside the car window moving rapidly backwards; the "real" in the actual environment is the cockpit in front of you, with a display screen and various dashboards.

[0126] The perspective function in VR headsets allows users to see the external environment, and replaces the external environment other than the dashboard seen through the VR headset with a "virtual" scene. Therefore, it is necessary to align the virtual scenery seen from the headset with the real scene of the outside world other than the dashboard seen through perspective.

[0127] The headset is turned on at point O, and O_World when the VR headset is turned on is selected as the reference coordinate system. The VR headset ("virtual") knows the relationship between itself and O at all times, T_HMD_O. By calculating the relationship between the VR headset and the real cockpit at all times, T_HMD_W, the relationship between the real cockpit ("real") and O_World can be calculated. The formula is as follows:

[0128] T_W_O=T_HMD_O*T_HMD_W

[0129] Now the problem is to solve T_HMD_W, so we introduce marker points, fix the three-dimensional marker points to the real cockpit, identify the marker points through the camera on the VR headset and solve the pose to get T_HMD_W.

[0130] Specifically, the VR headset is turned on at point O, the camera is aimed at the 3D Marker rigid body and starts shooting, and the system gives the positioning image to the image processing algorithm according to the LoadImage interface;

[0131] After the image processing algorithm is solved, the system obtains the relative pose of the marker and camera T_Marker_Camera according to the GetMarkerPose interface

[0132] Parse the HMD calibration file to obtain the pose conversion relationship between the camera and IMU T_IMU_Camera. According to T_Marker_Camera, perform matrix operations to obtain the pose of the Marker relative to the IMU T_Marker_IMU, which is equivalent to Figure 5 The T_HMD_W in is as follows:

[0133] T_Marker_IMU=T_IMU_Camera*T_Marker_Camera

[0134] Then obtain the spatial positioning posture T_HMD_O of the system, perform matrix operation with T_HMD_W, and according to the formula: T_W_O = T_HMD_O*T_HMD_W, obtain the target posture T_W_O of the entity corresponding to the three-dimensional marker point in the world coordinate system.

[0135] In an alternative embodiment, see Figure 6 The algorithm flow of this embodiment may include the following steps:

[0136] First, the system is initialized, including preprocessing the collected images and loading the camera calibration file and algorithm configuration file;

[0137] Then the algorithm matching steps are performed, including blob detection using the OpenCV library and calling the Blob::detect function to identify marker points in the image;

[0138] According to the known sequence of Marker 3D points, all possible sequences of spots are traversed, and the correct sequence of 2D points is determined by minimizing the projection error, using the projection error as a constraint.

[0139] By building the correspondence between 2D and 3D points, the system will perform spatial posture calculation to obtain the position of the marker relative to the camera.

[0140] Finally, the dual constraints of binocular baseline and binocular extrinsic parameters are used to ensure that the only correct pose value is obtained.

[0141] It should be noted that the above examples are only used to understand the present application and do not constitute a limitation on the method for determining the physical posture of the present application. More simple transformations based on this technical concept are all within the scope of protection of the present application.

[0142] The present application also provides a virtual reality device, comprising: at least one processor; and a memory connected to the at least one processor in communication; wherein the memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for determining the physical object posture in the above-mentioned embodiment 1.

[0143] The present application provides a computer-readable storage medium having computer-readable program instructions (ie, computer programs) stored thereon, and the computer-readable program instructions are used to execute the method for determining the posture of a physical object in the above-mentioned embodiment.

[0144] The computer-readable storage medium provided in the present application may be, for example, a USB flash drive, but is not limited to electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, systems or devices, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, system or device. The program code contained on the computer-readable storage medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination of the above.

[0145] The computer-readable storage medium may be included in the virtual reality device; or may exist independently without being assembled into the virtual reality device.

[0146] Computer program code for performing the operations of the present application may be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, C++, and conventional procedural programming languages ​​such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0147] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present application. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0148] The modules involved in the embodiments described in this application may be implemented by software or hardware, wherein the name of the module does not constitute a limitation on the unit itself in some cases.

[0149] The readable storage medium provided by the present application is a computer-readable storage medium, which stores computer-readable program instructions (i.e., computer programs) for executing the above-mentioned method for determining the physical posture, and can solve the technical problem of merging and aligning the postures of virtual objects and real objects. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided by the present application are the same as the beneficial effects of the method for determining the physical posture provided by the above-mentioned embodiment, and will not be repeated here.

[0150] The above descriptions are only some embodiments of the present application, and are not intended to limit the patent scope of the present application. All equivalent structural changes made using the contents of the present application specification and drawings under the technical concept of the present application, or direct / indirect applications in other related technical fields are included in the patent protection scope of the present application.

Claims

1. A method for determining the position and posture of a physical object, characterized in that: Applied to a virtual reality device, the virtual reality device is provided with an image acquisition device, and the method comprises: Acquire the positioning image acquired by the image acquisition device, and determine the pixel coordinates of the two-dimensional marker points in the positioning image; Determine the relative position between the three-dimensional marker and the image acquisition device according to the pixel coordinates; According to the relative posture and the calibration data of the image acquisition device, the target posture of the entity corresponding to the three-dimensional marker point in the world coordinate system is determined.

2. The method according to claim 1, characterized in that The step of determining the relative position between the three-dimensional marker and the image acquisition device according to the pixel coordinates comprises: Determine the optional spot order corresponding to the two-dimensional marker points in the positioning image according to the pixel coordinates; The optional spot order with the smallest projection error is set as the target spot order; A two-dimensional-three-dimensional point pair is constructed according to the target spot sequence, and the relative position and posture is determined based on the two-dimensional-three-dimensional point pair.

3. The method according to claim 2, characterized in that Before the step of setting the optional spot order with the smallest projection error as the target spot order, the method further includes: Determine the rotation vector and the translation vector corresponding to each of the optional spot sequences; The projection error corresponding to the selectable spot sequence is determined according to the rotation vector and the translation vector.

4. The method according to claim 2, characterized in that The step of sequentially constructing two-dimensional-three-dimensional point pairs according to the target spots and determining the relative position and posture based on the two-dimensional-three-dimensional point pairs comprises: Constructing the two-dimensional-three-dimensional point pairs according to the target spot sequence; Determine the control points and construct the local coordinate system based on the control points; A set of equations is constructed according to the two-dimensional-three-dimensional point pairs and the local coordinate system, and the relative posture is solved based on the set of equations.

5. The method according to claim 1, characterized in that The image acquisition device is a binocular camera, and the step of determining the relative position between the three-dimensional marker and the image acquisition device according to the pixel coordinates comprises: Acquire a binocular baseline and binocular extrinsic parameters corresponding to the binocular camera, and determine an initial relative pose according to the positioning image captured by a sub-camera of the binocular camera; Based on the binocular baseline and the binocular extrinsic parameters, establishing a relationship equation between the projection positions of the three-dimensional marker points in the binocular camera image respectively; The relative posture is determined according to the relationship equation and the initial relative posture.

6. As claimed in claim 1, characterized in that The step of determining the target posture of the entity corresponding to the three-dimensional marker point in the world coordinate system according to the relative posture and the calibration data of the image acquisition device also includes: Determining a device posture of the virtual reality device according to inertial data collected by an inertial measurement unit; Determining the acquisition device posture of the image acquisition device according to the calibration data and the device posture; The target posture is determined according to the acquisition device posture and the relative posture.

7. As claimed in claim 1, characterized in that The method further comprises: Acquiring display parameters of a virtual object to be output, and rendering the virtual object according to the display parameters; The display posture of the virtual object is determined according to the target posture.

8. As claimed in claim 1, characterized in that The step of acquiring the positioning image acquired by the image acquisition device and determining the pixel coordinates of the two-dimensional marker points in the positioning image comprises: Identify the two-dimensional marker points of the positioning image according to an image recognition algorithm, and determine the edge contours of the two-dimensional marker points; The center point of the edge contour is calculated, and the pixel coordinates of the corresponding two-dimensional marker point are determined.

9. A virtual reality device, characterized in that: The device comprises: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the computer program is configured to implement the steps of the method for determining the posture of a physical object as claimed in any one of claims 1 to 8.

10. A storage medium, characterized in that: The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, the steps of the method for determining the posture of a physical object as described in any one of claims 1 to 8 are implemented.

Citation Information

Patent Citations

  • Kinect-based augmented reality three-dimensional registration method

    CN110288657A

  • Projection marking and machine vision real-time registration method based on CAD model

    CN112017302A

  • Device pose determination method, device and system, electronic device and medium

    CN114862970A

  • Method and device for processing picture image of virtual reality equipment and electronic equipment

    CN115100276A

  • Camera pose determination method and device, electronic equipment and storage medium

    CN115205383A

Cited By

  • Elbow screening method and device, elbow screening and classifying system and storage medium

    CN119680898A