A 2D-3D coordinate system conversion method, system and electronic device
Feature extraction through cascade sequence group attention structure and sparse convolution, combined with Gauss-Newton algorithm, solves the accuracy and efficiency problems of existing 2D-3D conversion methods, and achieves efficient and accurate coordinate system conversion, which is suitable for Complex scenes and high-resolution images.
Patent Information
- Application Number
- CN202410755981.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-13
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2044-06-13
AI Technical Summary
Existing 2D-3D conversion methods have limitations in accuracy and efficiency. Especially when processing complex scenes and high-resolution images, the computational cost is high and the memory efficiency is low, making it difficult to process sparse point cloud data.
The cascade sequence group attention structure is used to encode features of 2D images, and 3D features are extracted through sparse convolution and PointNet++. Combined with the iterative PnP solver of the Gauss-Newton algorithm, the conversion coefficient from the image coordinate system to the world coordinate system is automatically generated.
It improves the performance of 2D-3D coordinate system conversion, saves computing costs, enhances feature discrimination and memory efficiency, reduces the difficulty of 2D-3D matching, and significantly improves matching capabilities and coordinate system conversion accuracy.
Smart Images

Figure CN118333847B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a 2D-3D coordinate system conversion method, system and electronic equipment. Background Art
[0002] In today's digital age, the demand for reconstructing three-dimensional scenes from two-dimensional images is growing rapidly. Accurate 2D-3D mapping is a critical technology in many fields, including augmented reality (AR), virtual reality (VR), self-driving cars, urban planning, and monument protection. Especially in self-driving cars, the vehicle needs to understand the accurate three-dimensional structure of its surroundings for safe navigation.
[0003] Although there are many methods that can perform 2D-3D conversion, many methods are still limited in accuracy and efficiency. Traditional methods, such as stereo matching and structured light, are often limited to specific hardware and prone to errors in complex scenes. Although learning-based methods have improved, they are computationally expensive when processing huge amounts of data and have difficulty processing sparse point cloud data. In addition, existing methods also face problems such as low memory efficiency and waste of computing resources when processing high-resolution images. For example, CN117710198A discloses a method and system for converting key point mapping from two-dimensional space to three-dimensional space, including a sequence preprocessing module: obtaining the length of the two-dimensional space key point sequence, performing sparse preprocessing, and obtaining a sparse two-dimensional space key point sequence; a mapping dimension upgrade module: performing sequence modeling on the sparse two-dimensional space key point sequence, and obtaining a three-dimensional space key point sequence after preliminary mapping; a sequence aggregation module: compressing and aggregating the three-dimensional space key point sequence after preliminary mapping, and obtaining the three-dimensional space key points of the central target; a training network module: using supervised learning to perform end-to-end training on the network, and using a spatiotemporal constraint strategy to improve the mapping accuracy of the three-dimensional space key point estimation network; and a visualization module for obtaining visualization results. CN103578133A discloses a method and device for three-dimensional reconstruction of two-dimensional image information, including: determining position parameters and hardware parameters, as well as intrinsic point information on the two-dimensional image; determining a mapping matrix according to the determined position parameters, hardware parameters and intrinsic point information; converting pixel points on the two-dimensional image into coordinate points in three-dimensional coordinates according to the determined mapping matrix; and determining three-dimensional object information corresponding to the two-dimensional image according to each coordinate point in the three-dimensional coordinates obtained by the conversion. Summary of the invention
[0004] In order to solve the above-mentioned problems of 2D-3D conversion in accuracy and efficiency, the present invention proposes a 2D-3D coordinate system conversion method, system and electronic device, which perform feature matching on the 3D modeling data of the scene and the 2D plane image of the RGB camera, thereby estimating the camera's pose and automatically generating conversion coefficients from the image coordinate system to the world coordinate system, so as to facilitate the calculation of the real position of the structured data of the image.
[0005] In order to achieve the above object, the present invention adopts the following technical solution:
[0006] In a first aspect, the present invention provides a 2D-3D coordinate system conversion method, comprising the following steps:
[0007] S1. 2D-3D input data acquisition: converting RGB images into overlapping embedding tokens and acquiring the point cloud and voxel representation of 3D modeling data;
[0008] S2, 3D modeling point cloud and voxel feature encoding: extract point features and voxel features respectively, and combine point features with voxel features to obtain 3D features;
[0009] S3. 2D image feature encoding based on cascaded sequence group attention: The overlapping embedding tokens of the 2D image are encoded through a feature encoder of a sequence group attention block based on a symmetric sandwich structure to obtain the 2D image features;
[0010] S4, 2D-3D feature matching and coordinate system conversion: Perform cosine similarity matching on 3D features and 2D image features, and estimate the pose through an iterative PnP solver based on the Gauss-Newton algorithm to obtain the coordinate system conversion coefficient.
[0011] As a further technical solution of the present invention, the specific process of step S1 is:
[0012] S11. For a given RGB training image , divided into several equal-sized image blocks by sliding windows, where the step size of the window is less than or equal to the side length of the image block, so that there is overlap between the image blocks; use a fully connected layer or convolutional layer to map the vector of each image block to C-dimensional space to obtain the embedded token ;
[0013] S12. For input 3D modeling data , obtain its voxel representation V, divide the three-dimensional space into a regular voxel grid, represent the voxel grid as a three-dimensional array, where each element represents a voxel, and for each point cloud data point, use the nearest neighbor search algorithm to associate each point cloud data point with the nearest voxel center point.
[0014] As a further technical solution of the present invention, the specific process of step S2 is:
[0015] S21. First, capture the 3D spatial pattern of voxels through sparse convolution, where empty voxels are skipped, and then convert the voxel representation into point-by-point voxel features by interpolating each point position with its 8 neighboring voxel grids using trilinear interpolation. ;
[0016] S22. Extract point features through PointNet++ to restore the lost 3D detail pattern and obtain global features and point-wise features ;
[0017] S23. Combine the voxel features with the point-by-point features to obtain a 3D feature representation: .
[0018] As a further technical solution of the present invention, the three-layer cascaded sequence group attention block in step S3 Zhongzai and Then, a downsampling layer is added to perform downsampling of 2 times the resolution to achieve multi-scale feature encoding. , each sequence group attention block is a symmetric sandwich structure, using the sequence group self-attention layer and feedforward interaction layers Channel communication is performed, where Contains a deep spatial convolutional layer and a feed-forward layer , which is expressed as follows: ,in, represents the nth feed-forward interaction layer, , N is the total number of feed-forward interaction layers, and Represent the output and input features of the nth feedforward interaction layer respectively;
[0019] Sequence Group Self-Attention Layer Receive a different subset of input features for each head and concatenate the output features between each head, sequence group self-attention layer The working process is:
[0020] S31, the characteristics Divide into h subsets, that is, , h is the total number of attention heads, for each ,in , obtained by linear transformation : , , ,in, It is a projection layer that decomposes the input features into different subspaces;
[0021] S32. Perform linear self-attention through the following formula: ,in, is the ReLU kernel function;
[0022] S33. Using Linear Layer The output features of each attention head after concatenation are projected back to the same dimension as the input. The process is expressed as: ;
[0023] S34. Combine the output of each attention head with the subsequent heads to refine the feature representation in cascade: ,in, is the Nth input segmentation and the output of the i-1th head When calculating self-attention, replace As the new input features of the i-th head;
[0024] S35, each sequence group attention block A single sequence group self-attention layer is inserted between several layers of feedforward interaction layers for spatial mixing. N feedforward interaction layers are used before and after the single sequence group self-attention layer to mix the Convert to , the calculation process is as follows: ,in for The complete input features, the final 2D image features are expressed as .
[0025] As a further technical solution of the present invention, when performing cosine similarity matching on the 3D features and the 2D image features in step S4, and The corresponding relationship between the cosine similarity is: , the nearest neighbor principle is used to perform 2D-3D feature matching in the cross-modal latent space, and the 2D-3D correspondence is established by finding the 3D point coordinates with the greatest similarity in the cross-modal latent space for each 2D pixel coordinate; the process of estimating the pose using the iterative PnP solver based on the Gauss-Newton algorithm is as follows: given a set of correspondences , converting it into a PnP problem: , that is, to find an optimal posture Minimize the reprojection error, where t is the translation vector and R is the rotation matrix: ,in, is the projection function, is the reprojection error. By solving the PnP problem, we can obtain the conversion coefficient between 3D coordinates and image coordinates.
[0026] In a second aspect, the present invention provides a 2D-3D coordinate system conversion system, comprising:
[0027] 2D-3D input data acquisition module, used to acquire overlapping image blocks of RGB images, embed tokens and 3D modeling data point clouds and voxel representations;
[0028] 3D modeling point cloud and voxel feature encoding module, which obtains 3D features by combining sparse convolutional voxel representation and PointNet++ point feature learning;
[0029] A 2D image feature encoding module based on cascaded sequence group attention, which encodes the image embedding tokens through cascaded sequence group attention to obtain 2D image features;
[0030] The 2D-3D feature matching and coordinate system conversion module performs similarity matching between 3D features and 2D image features, estimates the pose through an iterative PnP solver based on the Gauss-Newton algorithm, and obtains the coordinate system conversion coefficient.
[0031] In a third aspect, the present invention provides an electronic device comprising a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in the first aspect is performed.
[0032] In a fourth aspect, the present invention provides a computer-readable storage medium for storing computer instructions, wherein when the computer instructions are executed by a processor, the method described in the first aspect is performed.
[0033] Compared with the prior art, the present invention has the following beneficial effects:
[0034] The present invention uses a cascaded sequence group attention structure to input different segments of the complete feature into different attention heads, which saves computational costs while improving the diversity of attention and the discriminability of features. In addition, by introducing voxel features, the representation capability of 3D features is improved, thereby improving the performance of 2D-3D coordinate system conversion. Specifically, it has the following advantages:
[0035] (1) The image feature encoding method based on cascaded sequence group attention performs multi-scale feature encoding through a cascaded sequence group attention structure, and inputs different segments of the complete feature into different attention heads, which saves computational costs while improving the diversity of attention and the discriminability of features.
[0036] (2) The sequence group attention block improves memory efficiency and enhances inter-channel communication by using a symmetrical sandwich structure of a sequence group attention layer between multiple efficient feed-forward neural network (FFN) layers, and enhances the ability to learn local structural information through deep convolution before each FFN.
[0037] (3) The voxel branch with sparse convolution can capture spatial local patterns and narrow the domain differences with 2D image features. By fusing point features with voxel features, the comprehensiveness of 3D feature representation is improved and the spatial information of each point is enhanced, reducing the difficulty of 2D-3D matching. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] The accompanying drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are used to explain the present disclosure and do not constitute improper limitations on the present invention.
[0039] Figure 1 A schematic flow chart of a 2D-3D coordinate system conversion method provided by the present invention.
[0040] Figure 2 This is a structural block diagram of a 2D-3D coordinate system conversion system provided by the present invention. DETAILED DESCRIPTION
[0041] The present invention will be further described below in conjunction with the accompanying drawings and embodiments.
[0042] It should be noted that the following detailed descriptions are exemplary and are intended to provide further explanation of the present invention. Unless otherwise specified, all technical and scientific terms used herein have the same meanings as those commonly understood by those skilled in the art to which the present invention belongs.
[0043] It should be noted that the terms used herein are only for describing specific embodiments, and are not intended to limit exemplary embodiments according to the present invention. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that the terms "include" and "have" and any of their variations are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device comprising a series of steps or units is not necessarily limited to those steps or units clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.
[0044] In the absence of conflict, the embodiments of the present invention and the features of the embodiments may be combined with each other.
[0045] Embodiment 1:
[0046] like Figure 1 As shown, a 2D-3D coordinate system conversion method based on cascade sequence group attention in an embodiment of the present invention includes the following steps:
[0047] S1. 2D-3D input data acquisition:
[0048] Convert the RGB image into overlapping embedding tokens and obtain the point cloud and voxel representation of the 3D modeling data at the same time; specifically:
[0049] S11. For a given RGB training image , divided into several equal-sized image blocks by sliding windows, where the step size of the window is less than or equal to the side length of the image block, ensuring that there is overlap between image blocks. Overlap can help capture more contextual information, thereby enhancing the expressiveness of features; use a trainable linear transformation (such as a fully connected layer or a convolutional layer) to map the vector of each image block to a C-dimensional space to obtain an embedded token ;
[0050] S12. For input 3D modeling data , obtain its voxel representation V, divide the three-dimensional space into a regular voxel grid, represent the voxel grid as a three-dimensional array, where each element represents a voxel, and for each point cloud data point, use the nearest neighbor search algorithm to associate each point cloud data point with the nearest voxel center point.
[0051] S2, 3D modeling point cloud and voxel feature encoding:
[0052] Extract point features and voxel features separately, and combine point features with voxel features to obtain rich and comprehensive 3D features; specifically:
[0053] S21. To avoid information loss caused by the limited resolution of voxel data, the 3D spatial pattern of voxels is first captured by sparse convolution, where empty voxels are skipped, and then the voxel representation is converted into point-by-point voxel features by interpolating each point position with its 8 neighboring voxel grids using trilinear interpolation. ;
[0054] S22. Extract point features through PointNet++ to restore the lost 3D detail pattern and obtain global features and point-wise features ;
[0055] S23. Combine the voxel features with the point-by-point features to obtain a 3D feature representation: .
[0056] S3. 2D image feature encoding based on cascaded sequence group attention:
[0057] The overlapping embedding tokens of the 2D image are encoded through a feature encoder of a sequence group attention block based on a symmetric sandwich structure in a three-layer cascade to obtain the 2D image features; specifically, the embedding tokens Feed to a three-layer cascade of sequence group attention blocks In the feature encoder of , and in and A downsampling layer is added to perform 2x resolution downsampling to achieve multi-scale feature encoding, where each sequence group attention block is a symmetrical sandwich structure, using a sequence group self-attention layer with less memory constraints and more memory efficient feed-forward interaction layers To communicate through channels:
[0058] Contains a deep spatial convolutional layer to introduce an inductive bias for local structural information and integrate spatial information and a feed-forward layer that allows efficient communication between feature channels , which is expressed as follows: ,in, represents the nth feed-forward interaction layer, , N is the total number of feed-forward interaction layers, and Represent the output and input features of the nth feedforward interaction layer respectively;
[0059] Sequence Group Self-Attention Layer Each head receives a different complete feature subset, which effectively decomposes the attention calculation across multiple heads in the attention module and enhances the diversity of the features of the input attention head. Different from the existing self-attention that uses the same features for all heads, the sequence group self-attention layer receives a different input feature subset for each head and cascades the output features between each head. This module not only reduces the computational redundancy in multi-head attention, but also improves the model capacity by increasing the network depth. The sequence group self-attention layer The working process is:
[0060] S31, the characteristics Divide into h subsets, that is, , h is the total number of attention heads, for each ,in , obtained by linear transformation : , , ,in, It is a projection layer that decomposes the input features into different subspaces;
[0061] S32. Perform linear self-attention through the following formula: ,in, It is the ReLU kernel function. Compared with softmax attention, linear attention has lower complexity, is more efficient on hardware and reduces latency.
[0062] S33. Using Linear Layer The output features of each attention head after concatenation are projected back to the same dimension as the input to ensure the consistency of dimension aggregation. The process can be expressed as: ,
[0063] S34. To further enhance the ability to learn feature representations that contain more comprehensive information, sequential group attention combines the output of each attention head with the subsequent heads to refine the feature representation in cascade: ,in, is the Nth input segmentation and the output of the i-1th head When calculating self-attention, replace As the new input features of the i-th head;
[0064] Each sequence group attention block A single sequence group self-attention layer is inserted between several layers of feedforward interaction layers for spatial mixing. N feedforward interaction layers are used before and after the single sequence group self-attention layer to mix the Convert to , the calculation process is as follows: ,in for This design reduces the memory time consumption caused by the self-attention layer in the model, and applies more feed-forward layers to allow efficient communication between different feature channels. The final 2D image feature representation is .
[0065] S4, 2D-3D feature matching and coordinate system conversion:
[0066] After steps S2 and S3, the 2D image features and 3D features are mapped to the same latent space, the cosine similarity matching is performed on the 3D and 2D feature representations, and the pose is estimated by an iterative PnP solver based on the Gauss-Newton algorithm to obtain the coordinate system conversion coefficient, where and The corresponding relationship between the cosine similarity is: , 2D-3D feature matching is performed using the nearest neighbor principle in the cross-modal latent space. Due to the different densities of points and pixels, they do not have a complete one-to-one correspondence. In order to avoid ambiguous matching, this method embodiment establishes a 2D-3D correspondence by finding the 3D point coordinates with the greatest similarity for each 2D pixel coordinate in the cross-modal latent space. The process of estimating the pose using an iterative PnP solver based on the Gauss-Newton (GN) algorithm is as follows: Given a set of correspondences The PnP problem is to find an optimal pose Minimize the reprojection error, where t is the translation vector and R is the rotation matrix: ,in, is the projection function, is the reprojection error. By solving the PnP problem, we can obtain the conversion coefficient between 3D coordinates and image coordinates.
[0067] This embodiment reduces the computational burden and improves the feature discrimination by dividing the whole image features and inputting them into different attention heads. In addition, this embodiment obtains voxel features through sparse convolution, showing more powerful performance in capturing local spatial patterns, effectively reducing the information loss caused by the limited resolution of voxel data, and improving the comprehensiveness of 3D feature representation and enhancing the spatial information of each point through the fusion of point features and voxel features.
[0068] In summary, this embodiment can significantly improve the matching capability and coordinate system conversion accuracy from 2D-3D models, and makes it possible to calculate the exact location of the structured data of the image in the real world. In autonomous driving, this method can help the vehicle better understand the environment and improve driving safety. It is not only a breakthrough in technology, but also has far-reaching significance in commercial and social value. It provides innovative solutions for related industries, making 2D-3D coordinate system conversion a usable, efficient and accurate technology, meeting the market demand for high-quality three-dimensional visual information.
[0069] Embodiment 2:
[0070] like Figure 2 As shown, this embodiment provides a 2D-3D coordinate system conversion system, including:
[0071] 2D-3D input data acquisition module, used to acquire overlapping image blocks of RGB images, embed tokens and 3D modeling data point clouds and voxel representations;
[0072] 3D modeling point cloud and voxel feature encoding module, which obtains 3D features by combining sparse convolutional voxel representation and PointNet++ point feature learning;
[0073] A 2D image feature encoding module based on cascaded sequence group attention, which encodes the image embedding tokens through cascaded sequence group attention to obtain 2D image features;
[0074] The 2D-3D feature matching and coordinate system conversion module performs similarity matching on the 3D features and 2D image feature representations, estimates the pose through an iterative PnP solver based on the Gauss-Newton algorithm, and obtains the coordinate system conversion coefficient.
[0075] It should be noted that the above modules correspond to steps S1 to S4 in Example 1, and the examples and application scenarios implemented by the above modules and the corresponding steps are the same, but are not limited to the contents disclosed in the above Example 1. It should be noted that the above modules, as part of the robot system, can be executed in an embedded system such as a set of computer executable instructions.
[0076] In further embodiments, there is also provided:
[0077] An electronic device includes a memory and a processor, and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method described in Embodiment 1 is performed. For the sake of brevity, it will not be described in detail here.
[0078] It should be understood that in this embodiment, the processor may be a central processing unit CPU, and the processor may also be other general-purpose processors, digital signal processors DSP, application-specific integrated circuits ASIC, off-the-shelf programmable gate arrays FPGA or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or the processor may also be any conventional processor, etc.
[0079] The memory may include a read-only memory and a random access memory, and provide instructions and data to the processor. A portion of the memory may also include a non-volatile random access memory. For example, the memory may also store information about the device type.
[0080] A computer-readable storage medium is used to store computer instructions, and when the computer instructions are executed by a processor, the method described in Example 1 is completed.
[0081] The method in Example 1 can be directly embodied as a hardware processor, or a combination of hardware and software modules in the processor. The software module can be located in a mature storage medium in the field such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and completes the steps of the above method in combination with its hardware. To avoid repetition, it is not described in detail here.
[0082] Those skilled in the art will appreciate that the units, i.e., algorithm steps, of the various examples described in conjunction with this embodiment can be implemented in electronic hardware or in a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0083] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
[0084] Although the above describes the specific implementation mode of the present invention in conjunction with the accompanying drawings, it is not intended to limit the scope of protection of the present invention. Those skilled in the art should understand that various modifications or variations that can be made by those skilled in the art on the basis of the technical solution of the present invention without creative work are still within the scope of protection of the present invention.
Claims
1. A 2D-3D coordinate system conversion method, characterized in that: The following steps are involved: S1. 2D-3D input data acquisition: Convert RGB images into overlapping embedding tokens and obtain the point cloud and voxel representation of 3D modeling data at the same time. The specific process is as follows: S11. For a given RGB training image , divided into several equal-sized image blocks by sliding windows, where the step size of the window is less than or equal to the side length of the image block, so that there is overlap between the image blocks; use a fully connected layer or convolutional layer to map the vector of each image block to C-dimensional space to obtain the embedded token ; S12. For input 3D modeling data , obtain its voxel representation V, divide the three-dimensional space into a regular voxel grid, represent the voxel grid as a three-dimensional array, where each element represents a voxel, and for each point cloud data point, use the nearest neighbor search algorithm to associate each point cloud data point with the nearest voxel center point; S2, 3D modeling point cloud and voxel feature encoding: extract point features and voxel features respectively, and combine point features with voxel features to obtain 3D features; S3, 2D image feature encoding based on cascaded sequence group attention: The overlapping embedded tokens of the 2D image are encoded by a feature encoder of a sequence group attention block based on a symmetric sandwich structure in a three-layer cascade to obtain the 2D image features; the three-layer cascaded sequence group attention block Zhongzai and Then, a downsampling layer is added to perform downsampling of 2 times the resolution to achieve multi-scale feature encoding. , each sequence group attention block is a symmetric sandwich structure, using the sequence group self-attention layer and feedforward interaction layers For channel communication, in Contains a deep spatial convolutional layer and a feed-forward layer , which is expressed as follows: ,in, represents the nth feed-forward interaction layer, , N is the total number of feed-forward interaction layers, and Represent the output and input features of the nth feedforward interaction layer respectively; Sequence Group Self-Attention Layer Receive a different subset of input features for each head and concatenate the output features between each head, sequence group self-attention layer The working process is: S31, the characteristics Divide into h subsets, that is, , h is the total number of attention heads, for each ,in , obtained by linear transformation : , , ,in, It is a projection layer that decomposes the input features into different subspaces; S32. Perform linear self-attention through the following formula: ,in, is the ReLU kernel function; S33. Using Linear Layer The output features of each attention head after concatenation are projected back to the same dimension as the input. The process is expressed as: , S34. Combine the output of each attention head with the subsequent heads to refine the feature representation in cascade: ,in, is the Nth input segmentation and the output of the i-1th head When calculating self-attention, replace As the new input features of the i-th head; S35, each sequence group attention block A single sequence group self-attention layer is inserted between several layers of feedforward interaction layers for spatial mixing. N feedforward interaction layers are used before and after the single sequence group self-attention layer to mix the Convert to , the calculation process is as follows: ,in for The complete input features, the final 2D image features are expressed as ; S4, 2D-3D feature matching and coordinate system conversion: Perform cosine similarity matching on 3D features and 2D image features, and estimate the pose through an iterative PnP solver based on the Gauss-Newton algorithm to obtain the coordinate system conversion coefficient.
2. The 2D-3D coordinate system conversion method according to claim 1, characterized in that: The specific process of step S2 is: S21. First, capture the 3D spatial pattern of voxels through sparse convolution, where empty voxels are skipped, and then convert the voxel representation into point-by-point voxel features by interpolating each point position with its 8 neighboring voxel grids using trilinear interpolation. ; S22. Extract point features through PointNet++ to restore the lost 3D detail pattern and obtain global features and point-wise features ; S23. Combine the voxel features with the point-by-point features to obtain a 3D feature representation: .
3. The 2D-3D coordinate system conversion method according to claim 2, characterized in that: When performing cosine similarity matching on the 3D features and the 2D image features in step S4, and The corresponding relationship between the cosine similarity is: , the nearest neighbor principle is used to perform 2D-3D feature matching in the cross-modal latent space, and the 2D-3D correspondence is established by finding the 3D point coordinates with the greatest similarity in the cross-modal latent space for each 2D pixel coordinate; the process of estimating the pose using the iterative PnP solver based on the Gauss-Newton algorithm is as follows: given a set of correspondences , converting it into a PnP problem: , that is, to find an optimal posture Minimize the reprojection error, where t is the translation vector and R is the rotation matrix: ,in, is the projection function, is the reprojection error. By solving the PnP problem, we can obtain the conversion coefficient between 3D coordinates and image coordinates.
4. A 2D-3D coordinate conversion system, characterized in that: The method according to any one of claims 1 to 3 is performed, comprising: 2D-3D input data acquisition module, used to acquire overlapping image blocks of RGB images, embed tokens and 3D modeling data point clouds and voxel representations; 3D modeling point cloud and voxel feature encoding module, which obtains 3D features by combining sparse convolutional voxel representation and PointNet++ point feature learning; A 2D image feature encoding module based on cascaded sequence group attention, which encodes the image embedding tokens through cascaded sequence group attention to obtain 2D image features; The 2D-3D feature matching and coordinate system conversion module performs similarity matching between 3D features and 2D image features, estimates the pose through an iterative PnP solver based on the Gauss-Newton algorithm, and obtains the coordinate system conversion coefficient.
5. An electronic device, characterized in that: The invention comprises a memory and a processor and computer instructions stored in the memory and executed on the processor, wherein when the computer instructions are executed by the processor, the method according to any one of claims 1 to 3 is completed.
Citation Information
Patent Citations
Method and device for reconstructing two-dimensional image information in three-dimensional mode
CN103578133A
Key point mapping conversion method and system from two-dimensional space to three-dimensional space
CN117710198A
Continuous sign language recognition method
CN111339837A
Multi-view reconstruction method and system fusing attention mechanism
CN116958437A
Image depth estimation method based on lightweight attention mechanism
CN117788544A
