Registration method, apparatus, system, and storage medium
By acquiring 3D model images of the target object in a virtual scene and images of the target and reference objects in a real scene, a registration matrix is used to achieve rapid conversion between the image and the real space. This solves the problems of high computational complexity and low efficiency in existing technologies, and improves the efficiency and accuracy of registration.
Patent Information
- Application Number
- CN202211510151.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-11-29
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2042-11-29
AI Technical Summary
Existing image registration methods are computationally complex, time-consuming, and prone to registration failures, resulting in low efficiency.
By acquiring multiple virtual images of the target object's 3D model in a virtual scene and real images of the target object and reference objects in a real scene, the conversion relationship between image space and real space is determined using a registration matrix, simplifying the operation process.
It improves registration efficiency, simplifies operation steps, and ensures the accuracy and robustness of registration results.
Smart Images

Figure CN118115546B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of medical device technology, and in particular to a registration method, apparatus, system, storage medium, and computer program product. Background Technology
[0002] With the development of image registration technology in neurosurgery, by registering the image space with the real space, instruments in the real space can be projected into the image space in real time, which is beneficial for accurate positioning in the real space and accurate implementation of the planned path in the image space.
[0003] Existing registration methods often require acquiring a large amount of precise shape feature data of the target object in real space, and then using visual positioning technology or contact methods to acquire the shape feature data of the target object in image space, thereby achieving registration between image space and real space. However, this registration method has high computational complexity, long computation time, and is prone to registration failure, resulting in low registration efficiency. Summary of the Invention
[0004] Therefore, it is necessary to provide a registration method, apparatus, system, computer-readable storage medium, and computer program product that can improve registration efficiency in response to the above-mentioned technical problems.
[0005] Firstly, this application provides a registration method. The method includes:
[0006] Multiple virtual images of the 3D model of the target object in a virtual scene are obtained. The 3D model is obtained by 3D reconstruction of the scanned image of the target object.
[0007] Acquire real images of a real scene containing the target object and reference objects using an image acquisition device;
[0008] The registration matrix is determined based on multiple virtual and real images.
[0009] Secondly, this application also provides a registration apparatus. The apparatus includes:
[0010] The virtual image acquisition module is used to acquire multiple virtual images of the 3D model of the target object in a virtual scene. The 3D model is obtained by 3D reconstruction of the scanned image of the target object.
[0011] The real image acquisition module is used to acquire real images of a real scene containing the target object and the reference object through an image acquisition device;
[0012] The registration matrix acquisition module is used to determine the registration matrix based on multiple virtual images and real images.
[0013] Thirdly, this application also provides a registration system, characterized in that the system includes: an image acquisition device, a reference object, and a computer device; wherein, the image acquisition device is used to acquire a real image containing the target object and the reference object in a real scene. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the following steps:
[0014] Multiple virtual images of the 3D model of the target object in a virtual scene are obtained. The 3D model is obtained by 3D reconstruction of the scanned image of the target object.
[0015] Acquire real images of a real scene containing the target object and reference objects using an image acquisition device;
[0016] The registration matrix is determined based on multiple virtual and real images.
[0017] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, performs the following steps:
[0018] Multiple virtual images of the 3D model of the target object in a virtual scene are obtained. The 3D model is obtained by 3D reconstruction of the scanned image of the target object.
[0019] Acquire real images of a real scene containing the target object and reference objects using an image acquisition device;
[0020] The registration matrix is determined based on multiple virtual and real images.
[0021] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, performs the following steps:
[0022] Multiple virtual images of the 3D model of the target object in a virtual scene are obtained. The 3D model is obtained by 3D reconstruction of the scanned image of the target object.
[0023] Acquire real images of a real scene containing the target object and reference objects using an image acquisition device;
[0024] The registration matrix is determined based on multiple virtual and real images.
[0025] The aforementioned registration method, apparatus, system, storage medium, and computer program product acquire multiple virtual images of the target object's 3D model in a virtual scene, and acquire real images of the target object and reference object in the real scene using an image acquisition device. Based on these multiple virtual and real images, a registration matrix is determined. In real space, the image acquisition device can simultaneously obtain real images containing both the reference and target objects, which improves registration efficiency. Furthermore, since the virtual images are obtained based on the target object's 3D model in the virtual scene, while the real images are obtained by acquiring images of the target and reference objects in the real scene, the registration matrix can be directly determined based on multiple virtual and real images. This simple operation method allows for rapid acquisition of the registration matrix, further improving registration efficiency. Attached Figure Description
[0026] Figure 1 This is a diagram illustrating the application environment of the registration method in one embodiment;
[0027] Figure 2 This is a flowchart illustrating the registration method in one embodiment;
[0028] Figure 3 This is a schematic diagram of a sub-process of S206 in one embodiment;
[0029] Figure 4 This is a schematic diagram of a sub-process of S302 in one embodiment;
[0030] Figure 5 This is a schematic diagram of a sub-process of S306 in one embodiment;
[0031] Figure 6 This is a schematic diagram of a sub-process of S306 in another embodiment;
[0032] Figure 7 This is a schematic diagram of a sub-process of S604 in one embodiment;
[0033] Figure 8 This is a flowchart illustrating the registration method in another embodiment;
[0034] Figure 9 This is a schematic diagram of a sub-process of S806 in one embodiment;
[0035] Figure 10 This is a schematic diagram of the overall process of the registration method in one embodiment;
[0036] Figure 11 This is a schematic diagram of the marker points in a 3D model of the target object in one embodiment;
[0037] Figure 12 This is a schematic diagram of the marker points corresponding to the target object in a real image in one embodiment;
[0038] Figure 13 This is a schematic diagram illustrating the determination of the registration matrix in one embodiment;
[0039] Figure 14 This is a schematic diagram of a virtual camera capturing a 3D model in one embodiment;
[0040] Figure 15 This is a schematic diagram illustrating the identification of marker points in a 3D model from different perspectives in one embodiment;
[0041] Figure 16 This is a structural block diagram of the registration device in one embodiment;
[0042] Figure 17 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0043] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0044] The registration method provided in this application embodiment can be applied to, for example, Figure 1 In the application environment shown, terminal 102 interacts with image acquisition device 104. Image acquisition device 104 is used to acquire real images of the target object and reference object 106 in a real scene. Terminal 102 acquires multiple virtual images of the 3D model of the target object in the virtual scene, the 3D model being obtained by 3D reconstruction of the scanned image of the target object; it also acquires real images of the target object and reference object 106 in the real scene through image acquisition device 104; and determines a registration matrix based on the multiple virtual images and real images. Terminal 102 can be, but is not limited to, various personal computers, laptops, smartphones, tablets, IoT devices, and portable wearable devices. IoT devices can be smart speakers, smart TVs, smart air conditioners, smart in-vehicle devices, etc. Portable wearable devices can be smartwatches, smart bracelets, head-mounted devices, etc. In some embodiments, terminal 102 can also be a computer device. The registration system includes an image acquisition device, a reference object, and a computer device; the image acquisition device is used to acquire real images of the target object and the reference object in a real scene; the computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps of the registration method.
[0045] In one embodiment, such as Figure 2 As shown, a registration method is provided, which can be applied to... Figure 1Taking terminal 102 as an example, the explanation includes the following steps:
[0046] S202, acquire multiple virtual images of the three-dimensional model of the target object in the virtual scene. The three-dimensional model is obtained by three-dimensional reconstruction of the scanned image of the target object.
[0047] 3D reconstruction refers to the method of obtaining a 3D model of a target object by post-processing its scanned image. Common post-processing methods for 3D reconstruction include multi-slice reconstruction, maximum density projection, surface shading, volumetric roaming, surface reconstruction, and virtual endoscopy. In some embodiments, the image scanning equipment used to scan the target object includes CT (Computed Tomography), MRI (Magnetic Resonance Imaging), or PET (Positron Emission Computed Tomography). The 3D model is obtained by reconstructing the scanned image of the target object.
[0048] A virtual scene refers to a virtual simulation software environment. A virtual scene includes a virtual camera. A virtual camera is a software module within the virtual environment that functions like a real camera. The terminal imports a 3D model of the target object into the virtual scene and uses multiple virtual images of the 3D model from the virtual camera within the virtual environment. For example, the angle of the virtual camera is adjusted so that it faces the 3D model directly, thereby acquiring multiple virtual images of the target object's 3D model within the virtual scene.
[0049] S204: Acquire real images of a real scene containing the target object and a reference object through an image acquisition device.
[0050] In this context, an image acquisition device refers to a device that acquires a real image of a target object in a real scene. Exemplarily, an image acquisition device includes, but is not limited to, a 2D camera, a depth camera, a video camera, or other devices capable of acquiring target images. Exemplarily, an image acquisition device can be a head-mounted image acquisition device, such as an AR (Augmented Reality) device with an image acquisition unit. The terminal acquires a real image of the target object and a reference object within a real scene using an AR device with an image acquisition unit. The real image is obtained by the wearer taking a picture of the target object and the reference object in the real scene while wearing the AR device with the image acquisition unit. The reference object refers to an object in the real scene used to acquire the registration matrix. In some embodiments, the target object is fixed to a support device that carries the target object via a bracket, and the reference object is mounted on the bracket. Since the bracket and the target object are relatively stationary, and the reference object and the bracket are relatively stationary, the reference object and the target object have a fixed pose relationship. Exemplarily, the support device can be a bed frame, the target object is fixed to the bed frame via a bracket, and the reference object is mounted on the bracket. The bracket and the target object are relatively stationary, the reference object and the bracket are relatively stationary, and both are relatively stationary. In other embodiments, a reference object may be deployed inside the target object, and the reference object and the target object have a fixed pose relationship. In some embodiments, the reference object may be a reflective sphere or a marker with a specific pattern. The reference object can be identified by the image acquisition device along with the target object. The terminal acquires a real image of the real scene containing both the target object and the reference object through the image acquisition device.
[0051] S206, Determine the registration matrix based on multiple virtual and real images.
[0052] Since virtual images are obtained through 3D reconstruction and virtual camera capture based on scanned images of the target object, they are images within image space. The terminal establishes an image coordinate system in image space, and the virtual image is the image within that coordinate system.
[0053] Since a real image is an image of both the reference object and the target object in real space, the terminal establishes a reference coordinate system based on the reference object and an image acquisition device coordinate system based on the image acquisition device in real space. Combining the fact that the target object has the same marker points in both the virtual and real images, the terminal determines the registration matrix. The registration matrix represents the transformation relationship between the image coordinate system and the reference coordinate system. The registration matrix is used to characterize the transformation relationship from image space to real space.
[0054] In the above registration method, multiple virtual images of the target object's 3D model in a virtual scene are acquired, while real images containing both the target object and a reference object in the real scene are acquired using an image acquisition device. The registration matrix is then determined based on these multiple virtual and real images. In real space, the image acquisition device can simultaneously obtain real images containing both the reference and target objects, which improves registration efficiency. Furthermore, since the virtual images are obtained based on the target object's 3D model in a virtual scene, while the real images are obtained by acquiring images of both the target and reference objects in the real scene, the registration matrix can be directly determined based on multiple virtual and real images. This simple operation method allows for rapid acquisition of the registration matrix, further improving registration efficiency.
[0055] In one embodiment, such as Figure 3 As shown, the reference object and the target object have a fixed pose relationship. Based on multiple virtual images and real images, the registration matrix is determined, including:
[0056] S302, obtain the three-dimensional coordinates of each marker point in the three-dimensional model in multiple virtual images.
[0057] In this context, marker points refer to the feature points of the target object. A virtual image includes all the marker points of the target object. The terminal identifies each virtual image from multiple virtual images to obtain the marker points in each virtual image.
[0058] Virtual images are images obtained by capturing images of a 3D model using a virtual camera. The terminal can obtain the position of each marker point in each virtual image within the 3D model and its 3D coordinates. In some embodiments, the method for identifying each marker point in each virtual image includes, but is not limited to, Active Appearance Model (AAM) or Active Shape Model (ASM) algorithms. The terminal can automatically acquire multiple virtual images of the 3D model using a virtual camera and automatically identify each marker point in each virtual image using algorithms. This is more accurate and efficient than manually marking each image, further improving registration efficiency and the accuracy of the registration results.
[0059] S304, Obtain the coordinates of each key point in the real image. Key points include the marker points corresponding to the target object and the reference points corresponding to the reference object.
[0060] In this context, a reference point refers to a fixed feature point of a reference object. For example, the reference object is a marker with a checkerboard grid pattern, and the reference points are the intersections of the grid lines. A key point refers to a crucial feature point in the real image. The real image includes both the target object and the reference object; the key points in the real image include the marker points corresponding to the target object and the reference points corresponding to the reference objects.
[0061] The terminal acquires the coordinates of key points in the real image. The terminal establishes an image coordinate system based on the real image. The coordinates of each key point in the real image are the coordinate values in the image coordinate system. In some embodiments, the image acquisition device is a 2D camera, the real image is a 2D image, and the coordinates of each key point in the real image are 2D coordinates. In other embodiments, the image acquisition device is a depth camera, the real image is a 3D image, and the coordinates of each key point in the real image include the 3D coordinates of the marker points and the 2D coordinates of the reference points. In still other embodiments, the image acquisition device is a depth camera, the real image is a 3D image, and the coordinates of each key point in the real image are 3D coordinates; that is, the coordinates of each marker point and reference point in the real image are both 3D coordinates.
[0062] S306. Determine the registration matrix based on the three-dimensional coordinates of each marker point in multiple virtual images and the coordinates of each key point in the real image.
[0063] In this system, the 3D coordinates of each marker point in multiple virtual images represent the position of the target object in image space, while the coordinates of each key point in the real image represent the positions of the target object and the reference object in real space. The registration matrix determined by the terminal based on the 3D coordinates of each marker point in the multiple virtual images and the coordinates of each key point in the real image represents the transformation relationship between image space and real space. The registration matrix represents the transformation relationship between the image coordinate system and the reference coordinate system.
[0064] In this embodiment, the registration matrix is determined by acquiring the 3D coordinates of each marker point in the 3D model and the coordinates of each key point in the real image. Since each marker point has a fixed position on the target object, there is a one-to-one correspondence between the marker points in the virtual image and the corresponding marker points in the real image. The reference object and the target object have a fixed pose relationship, and the marker points corresponding to the target object in the real image have a fixed pose relationship with the corresponding reference points. Therefore, the registration matrix determined by the 3D coordinates of each marker point and the coordinates of each key point has high accuracy and robustness. Furthermore, the registration matrix can be directly determined based on multiple virtual and real images, simplifying the operation and enabling rapid acquisition of the registration matrix, thus improving registration efficiency.
[0065] In one embodiment, obtaining multiple virtual images of a 3D model of a target object in a virtual scene includes: importing the 3D model of the target object into the virtual scene, taking pictures of the 3D model using a virtual camera in the virtual scene, and obtaining multiple virtual images of the 3D model in the virtual scene.
[0066] The terminal imports a 3D model of the target object into a virtual scene. The shooting angle of the virtual camera is adjusted so that the 3D model of the target object is within the virtual camera's field of view. Multiple virtual images of the 3D model within the field of view are then captured by the virtual camera in the virtual scene.
[0067] In some embodiments, adjusting the shooting angle of the virtual camera so that the 3D model of the target object is within the field of view of the virtual camera further includes placing the virtual camera at two different angles in the virtual environment and adjusting the shooting angle of the virtual camera so that the 3D model of the target object is within the field of view of the virtual camera. The virtual camera is capable of capturing all the marker points in the target image.
[0068] In some embodiments, after the terminal imports the 3D model of the target object into the virtual scene, it renders the 3D model of the target object to obtain a rendered 3D model. Rendering the 3D model of the target object includes adding at least one of texture information, scene information, and light source information to the model of the target object to obtain the rendered 3D model. Multiple virtual images of the 3D model in the virtual scene are then captured by a virtual camera in the virtual scene.
[0069] In this embodiment, a 3D model of the target object is imported into a virtual scene, and a virtual camera in the virtual scene captures images of the 3D model, resulting in multiple virtual images of the 3D model within the virtual scene. These virtual images are obtained based on the 3D model of the target object within the virtual scene. Determining the registration matrix based on the virtual images obtained from the virtual camera in the virtual environment helps improve registration efficiency.
[0070] In one embodiment, such as Figure 4 As shown, the 3D coordinates of each marker point in each virtual image in the 3D model are obtained, including:
[0071] S402 identifies the two-dimensional coordinates of each marked point in multiple virtual images.
[0072] Specifically, the terminal identifies the two-dimensional coordinates of each marker point in multiple virtual images. The terminal uses an image recognition algorithm to identify each marker point in the multiple virtual images. A virtual image coordinate system is then established within the virtual images to obtain the two-dimensional coordinates of each marker point in the virtual image coordinate system.
[0073] S404, based on the two-dimensional coordinates of each marker point in multiple virtual images, the intrinsic parameters of the virtual camera, and the extrinsic parameters of the virtual camera, determine the three-dimensional coordinates of each marker point in multiple virtual images in the three-dimensional model.
[0074] The intrinsic parameters of a virtual camera describe its internal parameters, including focal length, principal point position, and pixel size ratio to the real environment. These intrinsic parameters are inherent properties of the virtual camera. The extrinsic parameters refer to the transformation relationship between the virtual camera coordinate system and the image coordinate system. The virtual camera coordinate system is the coordinate system established by the terminal based on the virtual camera.
[0075] The terminal multiplies the intrinsic and extrinsic parameters of the virtual camera to obtain a first projection matrix. In some embodiments, the virtual camera captures virtual images from two different angles, resulting in different first projection matrices for the two captures. The transformation relationship between the two-dimensional coordinates and the three-dimensional coordinates of each marker point is as follows: the two-dimensional coordinates of each marker point in the virtual image are equal to the product of the first projection matrix and the three-dimensional coordinates of each marker point in the virtual image within the three-dimensional model. The terminal substitutes the first projection matrices corresponding to the two captures and the two-dimensional coordinates of each marker point in the virtual image into the transformation relationship between the two-dimensional and three-dimensional coordinates of each marker point, and calculates the three-dimensional coordinates of each marker point in the virtual image within the three-dimensional model using the least squares method.
[0076] In this embodiment, by identifying the two-dimensional coordinates of each marker point in multiple virtual images, and based on the two-dimensional coordinates of each marker point in the multiple virtual images, the intrinsic and extrinsic parameters of the virtual camera, the three-dimensional coordinates of each marker point in the multiple virtual images in the three-dimensional model are determined. The three-dimensional coordinates of each marker point in the virtual images can be calculated using the two-dimensional coordinates of each marker point and the intrinsic and extrinsic parameters of the virtual camera. The obtained three-dimensional coordinates of each marker point in the virtual images have the characteristics of high accuracy, good robustness, and high computational efficiency, which is beneficial to improving the registration efficiency. At the same time, the terminal automatically identifies each marker point in multiple virtual images through an image recognition algorithm, and obtains the two-dimensional coordinates of each marker point. The two-dimensional coordinates of each marker point can be automatically calculated into the three-dimensional coordinates of each marker point in the three-dimensional model using the intrinsic and extrinsic parameters of the virtual camera. Compared with the method of directly manually marking each image to obtain each marker point, two-dimensional coordinates, and three-dimensional coordinates, this method is more accurate and more efficient, further improving the registration efficiency and the accuracy of the registration results.
[0077] In one embodiment, such as Figure 5 As shown, the coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both two-dimensional coordinates. Based on the three-dimensional coordinates of each marker point in multiple virtual images and the coordinates of each key point in the real image, the registration matrix is determined, including:
[0078] S502, based on the three-dimensional coordinates of each marker point in multiple virtual images, the two-dimensional coordinates of each marker point in the real image, and the intrinsic parameters of the image acquisition device, determine the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system.
[0079] The intrinsic parameters of the image acquisition device describe its internal parameters, including focal length, principal point position, and pixel size ratio to the real environment. These intrinsic parameters are inherent properties of the image acquisition device. The transformation relationship between the image acquisition device coordinate system and the image coordinate system constitutes the extrinsic parameters of the image acquisition device. The image acquisition device coordinate system is the coordinate system established by the terminal based on the image acquisition device.
[0080] The transformation relationship between the three-dimensional coordinates of each marker point in the virtual image and the two-dimensional coordinates of each marker point in the real image is as follows: the two-dimensional coordinates of each marker point in the real image are equal to the product of the second projection matrix and the three-dimensional coordinates of each marker point in the virtual image.
[0081] For each virtual image in multiple virtual images, the terminal substitutes the three-dimensional coordinates of each marker point in the current virtual image and the two-dimensional coordinates of each marker point in the real image into the transformation relationship between the three-dimensional coordinates of each marker point in the virtual image and the two-dimensional coordinates of each marker point in the real image to obtain the second projection matrix.
[0082] The second projection matrix is the product of the virtual camera's intrinsic and extrinsic parameters. Based on the second projection matrix and the intrinsic parameters of the image acquisition device, the terminal calculates the extrinsic parameters of the image acquisition device, i.e., the transformation relationship between the image acquisition device's coordinate system and the image coordinate system.
[0083] S504. Based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix is determined.
[0084] In the case where the image acquisition device is a two-dimensional camera, the coordinates of each key point in the real image are two-dimensional coordinates.
[0085] The terminal multiplies the transformation relationship between the image acquisition device's coordinate system and the image coordinate system with the intrinsic parameters of the image acquisition device to obtain the second projection matrix. Based on the second projection matrix and the two-dimensional coordinates of each reference point in the real image, the registration matrix is calculated.
[0086] In this embodiment, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined by using the three-dimensional coordinates of each marker point in multiple virtual images, the two-dimensional coordinates of each marker point in the real image, and the intrinsic parameters of the image acquisition device. Based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix is determined. Since the virtual images are obtained based on the three-dimensional model of the target object in a virtual scene, while the real images are obtained by acquiring images of the target object and reference objects in a real scene, the registration matrix can be directly determined based on multiple virtual and real images. The operation method is simple, the registration matrix can be obtained quickly, and the registration efficiency is improved.
[0087] In one embodiment, such as Figure 6 As shown, the coordinates of the key points include: the coordinates of each marker point in the real image are three-dimensional coordinates, and the coordinates of each reference point in the real image are two-dimensional coordinates; based on the three-dimensional coordinates of each marker point in multiple virtual images and the coordinates of each key point in the real image, the registration matrix is determined, including:
[0088] S602, based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image, determine the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system.
[0089] In the case where the image acquisition device is a depth camera, the coordinates of each key point in the real image include both three-dimensional and two-dimensional coordinates. Specifically, the three-dimensional coordinates of each marker point in the real image are the coordinate values in the coordinate system of the image acquisition device.
[0090] The three-dimensional coordinates of each marker point in the virtual image are the coordinate values of the marker point corresponding to the target object in the image coordinate system.
[0091] Since each marker point in the virtual image corresponds one-to-one with the marker point corresponding to the target object in the real image, the terminal determines the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image.
[0092] S604. Based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix is determined.
[0093] The terminal multiplies the transformation relationship between the image acquisition device's coordinate system and the image coordinate system with the intrinsic parameters of the image acquisition device to obtain the second projection matrix. Based on the second projection matrix and the two-dimensional coordinates of each reference point in the real image, the registration matrix is calculated.
[0094] In this embodiment, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined by using the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image. Based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix is determined. Since the virtual images are obtained based on the three-dimensional model of the target object in a virtual scene, while the real images are obtained by acquiring images of the target object and reference objects in a real scene, the registration matrix can be directly determined based on multiple virtual and real images. The operation method is simple, the registration matrix can be obtained quickly, and the registration efficiency is improved.
[0095] In one embodiment, such as Figure 7 As shown, based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix is determined, including:
[0096] S702, Establish a reference coordinate system based on the reference object, and obtain the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system.
[0097] In this system, the terminal establishes a reference coordinate system based on a reference object. The terminal obtains the three-dimensional coordinates of each reference point corresponding to the reference object, which is equivalent to obtaining the three-dimensional coordinates of each reference point in the reference coordinate system. In some embodiments, the reference object is a calibration target. The calibration target is manufactured according to mechanical drawings, and its physical dimensions are known. The terminal establishes a reference coordinate system based on the calibration target, and the three-dimensional coordinates of each reference point corresponding to the reference object are the three-dimensional coordinates in the reference coordinate system.
[0098] S704, based on the two-dimensional coordinates of each reference point in the real image, the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system, and the intrinsic parameters of the image acquisition device, obtains the transformation relationship between the coordinate system of the image acquisition device and the reference coordinate system.
[0099] The transformation relationship between the two-dimensional coordinates of each reference point in the real image and the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system is as follows: the two-dimensional coordinates of each reference point in the real image are equal to the product of the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system and the third projection matrix.
[0100] The terminal inputs the two-dimensional coordinates of each reference point in the real image and the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system into the transformation relationship between the two-dimensional coordinates of each reference point in the real image and the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system, and obtains the third projection matrix.
[0101] The third projection matrix is equal to the intrinsic parameters of the image acquisition device multiplied by the transformation relationship between the image acquisition device coordinate system and the reference coordinate system. Based on the third projection matrix and the intrinsic parameters of the image acquisition device, the terminal obtains the transformation relationship between the image acquisition device coordinate system and the reference coordinate system.
[0102] S706. Based on the transformation relationship between the coordinate system of the image acquisition device and the reference coordinate system, and the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the registration matrix is obtained.
[0103] The terminal multiplies the transformation relationship between the image acquisition device coordinate system and the reference coordinate system by the transformation relationship between the image acquisition device coordinate system and the image coordinate system to obtain the transformation relationship between the image coordinate system and the reference coordinate system. The transformation relationship between the image coordinate system and the reference coordinate system is used as the registration matrix.
[0104] In this embodiment, the transformation relationship between the image acquisition device coordinate system and the reference coordinate system is obtained through the two-dimensional coordinates of each reference point in the real image, the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system, and the intrinsic parameters of the image acquisition device. The registration matrix is determined based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, as well as the transformation relationship between the image acquisition device coordinate system and the image coordinate system. Since the transformation relationship between the image acquisition device coordinate system and the reference coordinate system can be obtained based on the real image, and the transformation relationship between the image acquisition device coordinate system and the image coordinate system can be obtained based on both the virtual image and the real image, the method for obtaining the registration matrix is simple and fast, improving registration efficiency.
[0105] In one embodiment, the coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both three-dimensional coordinates. Determining the registration matrix based on the three-dimensional coordinates of each marker point in multiple virtual images and the coordinates of each key point in the real image includes: determining the transformation relationship between the image acquisition device coordinate system and the image coordinate system based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image; and obtaining the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system and the three-dimensional coordinates of each reference point in the real image.
[0106] In the case of a depth camera as the image acquisition device, the coordinates of each key point in the real image are three-dimensional coordinates. That is, the coordinates of the reference point corresponding to the reference object in the real image are three-dimensional coordinates, and the coordinates of the marker point corresponding to the target object in the real image are three-dimensional coordinates.
[0107] The terminal establishes an image acquisition device coordinate system based on the image acquisition device. The three-dimensional coordinates of each marker point in the real image are the three-dimensional coordinates in the image acquisition device coordinate system. The three-dimensional coordinates of each reference point corresponding to the reference object in the real image are the three-dimensional coordinates in the image acquisition device coordinate system.
[0108] The three-dimensional coordinates of each marker point in the virtual image are the coordinate values of the marker point corresponding to the target object in the image coordinate system.
[0109] Since each marker point in the virtual image corresponds one-to-one with the marker point corresponding to the target object in the real image, the terminal determines the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image.
[0110] The terminal obtains the registration matrix based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, as well as the three-dimensional coordinates of the reference point corresponding to the reference object in the real image in the coordinate system of the image acquisition device.
[0111] In this embodiment, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined by using the 3D coordinates of each marker point in multiple virtual images and the 3D coordinates of each marker point in the real image. Based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, and the 3D coordinates of each reference point in the real image, the registration matrix is obtained. Since the virtual images are obtained based on the 3D model of the target object in a virtual scene, while the real images are obtained by acquiring images of the target object and reference objects in a real scene, the registration matrix can be directly determined based on multiple virtual and real images. The operation method is simple, the registration matrix can be obtained quickly, and the registration efficiency is improved.
[0112] In one embodiment, obtaining a registration matrix based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system, and the three-dimensional coordinates of each reference point in the real image, includes: establishing a reference coordinate system based on a reference object, and obtaining the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system; obtaining the transformation relationship between the image acquisition device coordinate system and the reference coordinate system based on the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system and the three-dimensional coordinates of each reference point in the real image; and obtaining a registration matrix based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, and the transformation relationship between the image acquisition device coordinate system and the image coordinate system.
[0113] In this system, the terminal establishes a reference coordinate system based on a reference object. The terminal obtains the three-dimensional coordinates of each reference point corresponding to the reference object within the reference coordinate system; this is equivalent to obtaining the three-dimensional coordinates of each reference point corresponding to the reference object within the reference coordinate system. In some embodiments, the reference object is a calibration target. The calibration target is manufactured according to mechanical drawings, and its physical dimensions are known. The terminal establishes a reference coordinate system based on the calibration target, and the three-dimensional coordinates of each reference point corresponding to the reference object are the three-dimensional coordinates within the reference coordinate system.
[0114] Since each reference point in the reference coordinate system corresponds one-to-one with each reference point in the real image, the terminal obtains the transformation relationship between the image acquisition device coordinate system and the reference coordinate system based on the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system and the three-dimensional coordinates of each reference point in the real image in the image acquisition device coordinate system. The terminal multiplies this transformation relationship between the image acquisition device coordinate system and the reference coordinate system by the transformation relationship between the image acquisition device coordinate system and the image coordinate system to obtain the transformation relationship between the image coordinate system and the reference coordinate system. This transformation relationship is then used as the registration matrix.
[0115] In this embodiment, the transformation relationship between the image acquisition device coordinate system and the reference coordinate system is obtained by using the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system and the three-dimensional coordinates of each reference point in the real image. The registration matrix is determined based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, as well as the transformation relationship between the image acquisition device coordinate system and the image coordinate system. Since the transformation relationship between the image acquisition device coordinate system and the reference coordinate system can be obtained based on the real image, and the transformation relationship between the image acquisition device coordinate system and the image coordinate system can be obtained based on both the virtual image and the real image, the method for obtaining the registration matrix is simple and fast, improving registration efficiency.
[0116] In one embodiment, such as Figure 8 As shown, the registration method also includes:
[0117] S802, determine the first three-dimensional coordinates of the first verification point on the surface of the three-dimensional model in the image coordinate system, and obtain the second three-dimensional coordinates of the first verification point in the image acquisition device coordinate system based on the first three-dimensional coordinates and the transformation relationship between the image acquisition device coordinates and the image coordinate system.
[0118] S804, when the calibration instrument contacts the second verification point on the surface of the target object, a calibration image containing the calibration instrument is acquired through an image acquisition device. Based on the calibration image, the third three-dimensional coordinates of the second verification point in the coordinate system of the image acquisition device are obtained. The second verification point corresponds to the first verification point. Wherein:
[0119] When the image acquisition device is a depth camera, the third and third-dimensional coordinates of the second verification point in the coordinate system of the image acquisition device can be directly obtained from the calibration image. The following explanation uses a depth camera as the image acquisition device as an example:
[0120] The calibration device is used to assist in verifying the accuracy of the registration matrix. The calibration device is equipped with markers that can be recognized by the image acquisition device. For example, the calibration device is a registration probe with a reflective ball. The tip of the registration probe contacts the second verification point on the surface of the target area. When the tip of the registration probe contacts the second verification point, the image acquisition device can be controlled to acquire a calibration image containing the registration probe. Since the reflective ball and the registration probe have a fixed pose relationship, and the shape, size and other parameters of the registration probe have been pre-calibrated, the three-dimensional coordinates of the tip of the registration probe in the coordinate system of the image acquisition device can be determined by identifying the three-dimensional coordinates of the reflective ball in the calibration image in the coordinate system of the image acquisition device. Since the tip of the registration probe is in contact with the second verification point, the three-dimensional coordinates of the tip of the registration probe in the coordinate system of the image acquisition device can be considered to be equivalent to the three-dimensional coordinates of the second verification point in the coordinate system of the image acquisition device, which is the aforementioned third three-dimensional coordinate.
[0121] The second verification point corresponds to the first verification point. For example, the first verification point is the location of the right eyebrow tail in the 3D model of the target object, and the second verification point is the location of the right eyebrow tail of the target object. In some embodiments, a developing marker can be pasted on the right eyebrow tail of the target object beforehand. By taking a scanned image of the target object carrying the developing marker and reconstructing the 3D model of the target object based on the scanned image, the developing marker pasted on the right eyebrow tail of the target object can be displayed in the 3D model. The location of the developing marker displayed in the 3D model is defined as the first verification point, and the location of the developing marker pasted on the right eyebrow tail of the target object is defined as the second verification point.
[0122] S806 optimizes the registration matrix based on the second and third three-dimensional coordinates to obtain the optimized registration matrix.
[0123] The terminal compares the second 3D coordinates of the first verification point in the image acquisition device's coordinate system with the third 3D coordinates of the second verification point in the same coordinate system. If the difference between the two is greater than a preset difference, it indicates that the registration matrix does not meet the accuracy requirements. The process then returns to the step of acquiring a real image of the scene containing the target object and the reference object through the image acquisition device, resulting in an optimized registration matrix. This process continues until the difference between the second and third 3D coordinates is no greater than the preset difference.
[0124] In this embodiment, the method of using calibration instruments to verify and optimize the registration matrix can ensure the accuracy and robustness of the optimized registration matrix and improve the registration accuracy.
[0125] In one embodiment, such as Figure 9 As shown, the registration matrix is optimized based on the second and third 3D coordinates to obtain the optimized registration matrix, including:
[0126] S902, determine the Euclidean distance between the second and third three-dimensional coordinates.
[0127] Euclidean distance is the data that reflects the true distance between two points. The terminal subtracts the second three-dimensional coordinates of the first verification point in the image acquisition device coordinate system from the third three-dimensional coordinates of the second verification point in the image acquisition device coordinate system to obtain the Euclidean distance between the second and third three-dimensional coordinates.
[0128] S904, if the Euclidean distance meets the preset accuracy conditions, then the registration matrix will be used as the optimized registration matrix.
[0129] Specifically, if the Euclidean distance between the second and third 3D coordinates meets a preset accuracy condition, it indicates that the difference in Euclidean distance between the second and third 3D coordinates is small. The terminal then uses the registration matrix where the Euclidean distance meets the preset accuracy condition as the optimized registration matrix. In some embodiments, the preset accuracy condition includes the Euclidean distance being less than a preset distance.
[0130] S906, if the Euclidean distance does not meet the preset accuracy condition, return to reacquire the real image containing the target object and the reference object in the real scene, and obtain the optimized registration matrix based on the reacquired real image until the Euclidean distance meets the preset accuracy condition.
[0131] Specifically, if the Euclidean distance between the second and third 3D coordinates does not meet the preset accuracy condition, it indicates a significant difference in the Euclidean distance between them, and the registration matrix does not meet the preset accuracy requirements. The terminal then returns the steps of acquiring real images of the target object and reference object within the real scene using the image acquisition device. Based on the re-acquired real images, an optimized registration matrix is obtained until the Euclidean distance meets the preset accuracy condition.
[0132] In this embodiment, by determining the Euclidean distance between the second and third 3D coordinates, and when the Euclidean distance does not meet the preset accuracy condition, a new real image is acquired to obtain an optimized registration matrix. This ensures the accuracy and robustness of the optimized registration matrix and improves registration efficiency.
[0133] To illustrate the registration method and its effects in this scheme in detail, a specific embodiment is described below:
[0134] The terminal scans the target object to obtain a scanned image, such as... Figure 10 The diagram shows the overall workflow of the registration method. A 3D model of the target object is obtained by reconstructing the scanned image. For example... Figure 11 The diagram shows a schematic representation of the marker points in the 3D model of the target object. The 3D model of the target object is imported into a virtual scene, and a virtual camera within the virtual scene is used to capture images of the 3D model, resulting in multiple virtual images of the 3D model within the virtual scene. The 2D coordinates of each marker point in the multiple virtual images are identified. Based on the 2D coordinates of each marker point in the multiple virtual images, the intrinsic and extrinsic parameters of the virtual camera, the 3D coordinates of each marker point in the virtual images within the 3D model are determined.
[0135] Acquire real-world images containing the target object and reference objects within a real-world scene using an image acquisition device. Obtain the coordinates of key points in the real-world images, including marker points corresponding to the target object and reference points corresponding to the reference objects. Figure 12 The diagram shows a schematic representation of the marker points corresponding to the target object in a real image. Specifically, when the image acquisition device captures images of the target object and a reference object from any angle, the resulting real image can completely identify the marker points corresponding to the target object and the reference points corresponding to the reference object.
[0136] The reference object and the target object have a fixed pose relationship. The registration matrix is determined based on the 3D coordinates of marker points in multiple virtual images and the coordinates of key points in the real image. Specifically, depending on the type of image acquisition device, the coordinates of key points in the real image may be 2D or 3D coordinates. For example... Figure 13 The diagram shown illustrates the determination of the registration matrix.
[0137] In some embodiments, the image acquisition device is a two-dimensional camera, and the coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both two-dimensional coordinates. Based on the three-dimensional coordinates of each marker point in multiple virtual images, the two-dimensional coordinates of each marker point in the real image, and the intrinsic parameters of the image acquisition device, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined; based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix is determined.
[0138] In other embodiments, the image acquisition device is a depth camera, the coordinates of each marker point in the real image are three-dimensional coordinates, and the coordinates of each reference point in the real image are two-dimensional coordinates. Based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined; based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix is determined.
[0139] The registration matrix is determined based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image. Specifically, the terminal establishes a reference coordinate system based on the reference object and obtains the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system. Based on the two-dimensional coordinates of each reference point in the real image, the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system, and the intrinsic parameters of the image acquisition device, the transformation relationship between the image acquisition device coordinate system and the reference coordinate system is obtained. Based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, and the transformation relationship between the image acquisition device coordinate system and the image coordinate system, the registration matrix is obtained. The registration matrix represents the transformation relationship between the image coordinate system and the reference coordinate system.
[0140] In some embodiments, the image acquisition device is a depth camera, and the coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both three-dimensional coordinates. Based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image, the transformation relationship between the image acquisition device coordinate system and the image coordinate system is determined. A reference coordinate system is established based on a reference object, and the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system are obtained. Based on the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system and the three-dimensional coordinates of each reference point in the real image, the transformation relationship between the image acquisition device coordinate system and the reference coordinate system is obtained. Based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, and the transformation relationship between the image acquisition device coordinate system and the image coordinate system, a registration matrix is obtained.
[0141] Furthermore, the registration method also includes: determining the first three-dimensional coordinates of the first verification point on the surface of the three-dimensional model in the image coordinate system; obtaining the second three-dimensional coordinates of the first verification point in the image acquisition device coordinate system based on the first three-dimensional coordinates and the transformation relationship between the image acquisition device coordinates and the image coordinate system; when the calibration instrument contacts the second verification point on the surface of the target object, acquiring a calibration image containing the calibration instrument through the image acquisition device; obtaining the third three-dimensional coordinates of the second verification point in the image acquisition device coordinate system based on the calibration image, with the second verification point corresponding to the first verification point; determining the Euclidean distance between the second and third three-dimensional coordinates; if the Euclidean distance meets the preset accuracy condition, using the registration matrix as the optimized registration matrix; if the Euclidean distance does not meet the preset accuracy condition, returning to reacquire a real image containing the target object and the reference object in the real scene; obtaining the optimized registration matrix based on the reacquired real image, until the Euclidean distance meets the preset accuracy condition.
[0142] Furthermore, based on the two-dimensional coordinates of each marker point in the virtual image, the intrinsic and extrinsic parameters of the virtual camera, the three-dimensional coordinates of each marker point in the virtual image within the three-dimensional model are determined. Specifically, in the virtual environment, virtual cameras are placed at two different viewpoints so that all marker points of the target object can be completely captured on the corresponding imaging plane. Since all coordinate systems are configured within the virtual scene, the transformation relationships between the coordinate systems are known. The intrinsic parameters of the virtual camera are only related to the properties of the virtual camera itself. The transformation matrix from the virtual camera coordinate system to the image coordinate system is the extrinsic parameter of the virtual camera, and the extrinsic parameter of the virtual camera differs at the two different viewpoints. The virtual camera captures the three-dimensional model of the target object from the two different viewpoints, resulting in multiple virtual images. Figure 14 The diagram illustrates a 3D model of a target object captured by a virtual camera from different perspectives. Based on image recognition algorithms, the 2D coordinates of each marker point on the virtual image are obtained from each perspective. Figure 15 The diagram shows how a virtual camera identifies marker points in a 3D model from different perspectives. The conversion relationship between the 2D coordinates and 3D coordinates of each marker point can be obtained using the following formula.
[0143]
[0144] Where (u, v) represents the two-dimensional coordinates of each marker point, and (X, Y, Z) represents the three-dimensional coordinates of each marker point.
[0145] This represents the intrinsic parameters of the virtual camera. The intrinsic parameters of the virtual camera are inherent properties of the virtual camera and do not need to be calculated in the virtual environment. You can directly set a normal value manually.
[0146] This represents the extrinsic parameters of the virtual camera, i.e., the transformation relationship between the virtual camera coordinate system and the image coordinate system, which can be obtained directly in the virtual environment without calculation.
[0147] The product of the virtual camera's intrinsic parameters and its extrinsic parameters is the first projection matrix, denoted as M. The first projection matrices obtained from two different viewpoints are M1 and M2, respectively.
[0148]
[0149] Substituting the first projection matrices obtained from the two different viewpoints into the formula for the transformation relationship between the two-dimensional coordinates and the three-dimensional coordinates of each marker point, we obtain the following two equations:
[0150]
[0151]
[0152] In the two equations above, only (X, Y, Z) are unknowns. The three-dimensional coordinates (X, Y, Z) of each marked point can be obtained by using the least squares method.
[0153] The aforementioned registration method involves acquiring multiple virtual images of the target object's 3D model within a virtual scene, and then using an image acquisition device to obtain real images of the target object and reference object within the real scene. The registration matrix is then determined based on these virtual and real images. In real space, the image acquisition device can simultaneously obtain real images containing both the reference and target objects, which improves registration efficiency. Furthermore, since the virtual images are obtained based on the target object's 3D model within the virtual scene, while the real images are obtained by acquiring images of both the target and reference objects in the real scene, the registration matrix can be directly determined based on multiple virtual and real images. This simple operation allows for rapid acquisition of the registration matrix, further enhancing registration efficiency.
[0154] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0155] Based on the same inventive concept, this application also provides a registration apparatus for implementing the registration method described above. The solution provided by this apparatus is similar to the implementation described in the above method; therefore, the specific limitations in one or more registration apparatus embodiments provided below can be found in the limitations of the registration method described above, and will not be repeated here.
[0156] In one embodiment, such as Figure 16 As shown, a registration device 100 is provided, including: a virtual image acquisition module 120, a real image acquisition module 140, and a registration matrix acquisition module 160, wherein:
[0157] The virtual image acquisition module 120 is used to acquire multiple virtual images of the three-dimensional model of the target object in a virtual scene. The three-dimensional model is obtained by three-dimensional reconstruction of the scanned image of the target object.
[0158] The real image acquisition module 140 is used to acquire real images of a real scene containing the target object and the reference object through an image acquisition device.
[0159] The registration matrix acquisition module 160 is used to determine the registration matrix based on multiple virtual images and real images.
[0160] The aforementioned registration device acquires multiple virtual images of the target object's 3D model within a virtual scene, and then acquires real images of the target object and reference object within the real scene using an image acquisition device. Based on these virtual and real images, a registration matrix is determined. In real space, the image acquisition device can simultaneously obtain real images containing both the reference and target objects, improving registration efficiency. Furthermore, since the virtual images are obtained based on the target object's 3D model within the virtual scene, while the real images are acquired by image acquisition of both the target and reference objects in the real scene, the registration matrix can be directly determined based on multiple virtual and real images. This simple operation method allows for rapid acquisition of the registration matrix, further enhancing registration efficiency.
[0161] In one embodiment, where the reference object and the target object have a fixed pose relationship, the registration matrix acquisition module 160 is further configured to: acquire the three-dimensional coordinates of each marker point in the multiple virtual images in the three-dimensional model; acquire the coordinates of each key point in the real image, the key points including the marker point corresponding to the target object and the reference point corresponding to the reference object; and determine the registration matrix based on the three-dimensional coordinates of each marker point in the multiple virtual images and the coordinates of each key point in the real image.
[0162] In one embodiment, in acquiring multiple virtual images of the three-dimensional model of the target object in a virtual scene, the virtual image acquisition module 120 is further configured to: import the three-dimensional model of the target object into the virtual scene, take pictures of the three-dimensional model through a virtual camera in the virtual scene, and obtain multiple virtual images of the three-dimensional model in the virtual scene.
[0163] In one embodiment, in obtaining the three-dimensional coordinates of each marker point in each virtual image in the three-dimensional model, the registration matrix acquisition module 160 is further configured to: identify the two-dimensional coordinates of each marker point in multiple virtual images; and determine the three-dimensional coordinates of each marker point in multiple virtual images in the three-dimensional model based on the two-dimensional coordinates of each marker point in multiple virtual images, the intrinsic parameters of the virtual camera, and the extrinsic parameters of the virtual camera.
[0164] In one embodiment, the coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both two-dimensional coordinates. Regarding determining the registration matrix based on the three-dimensional coordinates of each marker point in multiple virtual images and the coordinates of each key point in the real image, the registration matrix acquisition module 160 is further configured to: determine the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system based on the three-dimensional coordinates of each marker point in multiple virtual images, the two-dimensional coordinates of each marker point in the real image, and the intrinsic parameters of the image acquisition device; and determine the registration matrix based on the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image.
[0165] In one embodiment, the coordinates of each marker point in the real image are three-dimensional coordinates, and the coordinates of each reference point in the real image are two-dimensional coordinates. Regarding determining the registration matrix based on the three-dimensional coordinates of each marker point in multiple virtual images and the coordinates of each key point in the real image, the registration matrix acquisition module 160 is further configured to: determine the transformation relationship between the image acquisition device coordinate system and the image coordinate system based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image; and determine the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image.
[0166] In one embodiment, regarding the determination of the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system, the intrinsic parameters of the image acquisition device, and the two-dimensional coordinates of each reference point in the real image, the registration matrix acquisition module 160 is further configured to: establish a reference coordinate system based on the reference object, and obtain the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system; obtain the transformation relationship between the image acquisition device coordinate system and the reference coordinate system based on the two-dimensional coordinates of each reference point in the real image, the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system, and the intrinsic parameters of the image acquisition device; and obtain the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, and the transformation relationship between the image acquisition device coordinate system and the image coordinate system.
[0167] In one embodiment, the coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both three-dimensional coordinates. Regarding determining the registration matrix based on the three-dimensional coordinates of each marker point in multiple virtual images and the coordinates of each key point in the real image, the registration matrix acquisition module 160 is further configured to: determine the transformation relationship between the image acquisition device coordinate system and the image coordinate system based on the three-dimensional coordinates of each marker point in multiple virtual images and the three-dimensional coordinates of each marker point in the real image; and obtain the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system and the three-dimensional coordinates of each reference point in the real image.
[0168] In one embodiment, regarding obtaining the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the image coordinate system, and the three-dimensional coordinates of each reference point in the real image, the registration matrix acquisition module 160 is further configured to: establish a reference coordinate system based on the reference object, and obtain the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system; obtain the transformation relationship between the image acquisition device coordinate system and the reference coordinate system based on the three-dimensional coordinates of each reference point corresponding to the reference object and the three-dimensional coordinates of each reference point in the real image in the reference coordinate system; and obtain the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, and the transformation relationship between the image acquisition device coordinate system and the image coordinate system.
[0169] In one embodiment, the registration device 100 is further configured to: determine the first three-dimensional coordinates of the first verification point on the surface of the three-dimensional model in the image coordinate system; obtain the second three-dimensional coordinates of the first verification point in the image acquisition device coordinate system based on the first three-dimensional coordinates and the transformation relationship between the coordinates of the image acquisition device and the image coordinate system; when the calibration instrument contacts the second verification point on the surface of the target object, acquire a calibration image containing the calibration instrument through the image acquisition device; obtain the third three-dimensional coordinates of the second verification point in the image acquisition device coordinate system based on the calibration image, wherein the second verification point corresponds to the first verification point; and optimize the registration matrix based on the second and third three-dimensional coordinates to obtain an optimized registration matrix.
[0170] In one embodiment, in optimizing the registration matrix based on the second and third three-dimensional coordinates to obtain an optimized registration matrix, the registration device 100 is further configured to: determine the Euclidean distance between the second and third three-dimensional coordinates; if the Euclidean distance meets a preset accuracy condition, then the registration matrix is used as the optimized registration matrix; if the Euclidean distance does not meet the preset accuracy condition, then the process returns to re-acquiring a real image containing the target object and the reference object in the real scene, and based on the re-acquiring real image, obtain the optimized registration matrix until the Euclidean distance meets the preset accuracy condition.
[0171] Each module in the above-mentioned registration device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0172] In one embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 17As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, NFC (Near Field Communication), or other technologies. When the computer program is executed by the processor, it implements a registration method.
[0173] Those skilled in the art will understand that Figure 17 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0174] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.
[0175] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.
[0176] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.
[0177] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data shall comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0178] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
[0179] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0180] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A method of registration, characterized by, The method includes: Multiple virtual images of a 3D model of a target object in a virtual scene are obtained, wherein the 3D model is obtained by 3D reconstruction of a scanned image of the target object; A real image containing the target object and a reference object is acquired through an image acquisition device; the reference object and the target object have a fixed pose relationship. Obtain the three-dimensional coordinates of each marker point in the multiple virtual images within the three-dimensional model; Obtain the coordinates of each key point in the real image, wherein the key points include the marker points corresponding to the target object and the reference points corresponding to the reference object; Based on the three-dimensional coordinates of each marker point in the multiple virtual images and the coordinates of each key point in the real image, a registration matrix is determined; specifically, this includes: Based on the three-dimensional coordinates of each marker point in the multiple virtual images and the coordinates of each marker point in the real image, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined; Establish a reference coordinate system based on the reference object, and obtain the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system; Based on the coordinates of each reference point in the real image, the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system, and the intrinsic parameters of the image acquisition device, the transformation relationship between the image acquisition device coordinate system and the reference coordinate system is obtained. Based on the transformation relationship between the coordinate system of the image acquisition device and the reference coordinate system, and the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system, the registration matrix is obtained.
2. The method of claim 1, wherein, The acquisition of multiple virtual images of the target object's 3D model in a virtual scene includes: The three-dimensional model of the target object is imported into a virtual scene, and the three-dimensional model is photographed by a virtual camera in the virtual scene to obtain multiple virtual images of the three-dimensional model in the virtual scene.
3. The method of claim 2, wherein, The step of obtaining the three-dimensional coordinates of each marker point in the multiple virtual images within the three-dimensional model includes: Identify the two-dimensional coordinates of each marker point in the multiple virtual images; Based on the two-dimensional coordinates of each marker point in the multiple virtual images, the intrinsic parameters of the virtual camera, and the extrinsic parameters of the virtual camera, the three-dimensional coordinates of each marker point in the multiple virtual images in the three-dimensional model are determined.
4. The method according to claim 1, characterized in that, The coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both two-dimensional coordinates; the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined as follows: Based on the three-dimensional coordinates of each marker point in the multiple virtual images, the two-dimensional coordinates of each marker point in the real image, and the intrinsic parameters of the image acquisition device, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined.
5. The method according to claim 1, characterized in that, The coordinates of each marker point in the real image are three-dimensional coordinates, and the coordinates of each reference point in the real image are two-dimensional coordinates; the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined as follows: Based on the three-dimensional coordinates of each marker point in the multiple virtual images and the three-dimensional coordinates of each marker point in the real image, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined.
6. The method according to claim 1, characterized in that, The coordinates of each marker point in the real image and the coordinates of each reference point in the real image are both three-dimensional coordinates; The transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined as follows: Based on the three-dimensional coordinates of each marker point in the multiple virtual images and the three-dimensional coordinates of each marker point in the real image, the transformation relationship between the coordinate system of the image acquisition device and the image coordinate system is determined.
7. The method according to claim 6, characterized in that, The transformation relationship between the coordinate system of the image acquisition device and the reference coordinate system is determined as follows: Based on the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system and the three-dimensional coordinates of each reference point in the real image, the transformation relationship between the coordinate system of the image acquisition device and the reference coordinate system is obtained.
8. A registration device, characterized in that, The device includes: The virtual image acquisition module is used to acquire multiple virtual images of a 3D model of a target object in a virtual scene, wherein the 3D model is obtained by 3D reconstruction of a scanned image of the target object. The real image acquisition module is used to acquire real images of a real scene containing the target object and a reference object through an image acquisition device; the reference object and the target object have a fixed pose relationship. The registration matrix acquisition module is used to acquire the three-dimensional coordinates of each marker point in the multiple virtual images in the three-dimensional model; acquire the coordinates of each key point in the real image, the key points including the marker point corresponding to the target object and the reference point corresponding to the reference object; and determine the registration matrix based on the three-dimensional coordinates of each marker point in the multiple virtual images and the coordinates of each key point in the real image. The registration matrix acquisition module is specifically used for: determining the transformation relationship between the image acquisition device coordinate system and the image coordinate system based on the three-dimensional coordinates of each marker point in the multiple virtual images and the coordinates of each marker point in the real image; establishing a reference coordinate system based on the reference object and obtaining the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system; obtaining the transformation relationship between the image acquisition device coordinate system and the reference coordinate system based on the coordinates of each reference point in the real image, the three-dimensional coordinates of each reference point corresponding to the reference object in the reference coordinate system, and the intrinsic parameters of the image acquisition device; and obtaining the registration matrix based on the transformation relationship between the image acquisition device coordinate system and the reference coordinate system, as well as the transformation relationship between the image acquisition device coordinate system and the image coordinate system.
9. A registration system, characterized in that, The system includes: an image acquisition device, a reference object, and a computer device; wherein, the image acquisition device is used to acquire a real image of a real scene containing a target object and the reference object; the computer device includes a memory and a processor, the memory stores a computer program, and the processor executes the computer program to implement the steps of the method according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method for displaying perspective area based on mixed reality technology in orthodontic treatment
CN112826615A
