A method and device for converting a three-dimensional texture map into a three-dimensional point cloud

By importing obj files and analyzing texture data, building orthogonal pixelated three-dimensional point clouds, and reconstructing orthogonal 2D textures, the problem that the existing technology cannot express texture point cloud data in black, white and gray scale is solved, and efficient three-dimensional texture map conversion and user experience improvement is achieved.

CN112634431BActive Publication Date: 2025-05-09WUHAN CRYSTAL 3D LASER TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011334189.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-11-24
Publication Date
2025-05-09
Estimated Expiration
2040-11-24

AI Technical Summary

Technical Problem

The prior art cannot use algorithms to convert texture maps into three-dimensional space point cloud data to express textures in black, white and grayscale.

Method used

By importing the obj file, obtaining texture data and parsing and binding with the MTL file, an orthogonal pixelated three-dimensional point cloud is constructed, and orthogonal 2D texture is reconstructed based on the texture coordinates, and finally converting it into engraving three-dimensional data.

Benefits of technology

It realizes the point cloud data that expresses textures in black, white and grayscale while converting texture maps into three-dimensional space. It is suitable for maps of single or multiple texture files, improving the system's adaptability and user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112634431B_ABST
    Figure CN112634431B_ABST
Patent Text Reader

Abstract

This invention proposes a method and apparatus for converting 3D texture maps into 3D point clouds. The method includes: importing an OBJ file, obtaining texture data, extracting and parsing an MTL file from the OBJ file, binding it to the texture data, and recording the bound texture data as bound texture data; extracting a 3D structural point cloud from the OBJ file, constructing an orthogonal pixelated 3D point cloud based on the 3D structural point cloud and the bound texture data; reconstructing an orthorectified 2D texture based on texture coordinates, constructing 3D pixels based on the 2D texture and the orthogonal pixelated 3D point cloud, and saving the 3D pixels as 3D data for engraving. This invention, through reconstructing orthogonal 3D textures and binarization processing, converts texture maps into point cloud data that can represent textures in 3D space while also displaying the texture in grayscale. It enables direct internal engraving of 3D texture maps and allows for the direct addition of texture characteristics to 3D internal engraved images of crystals, meeting user needs, saving user costs, and greatly improving the user experience.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer vision technology, and in particular to a method and device for converting a three-dimensional texture map into a three-dimensional point cloud. Background Art

[0002] In the application of crystal three-dimensional engraving, there is a demand that the engraved image effect needs to have texture characteristics, which vividly shows the second characteristic (texture) of a three-dimensional object, and the engraving effect is no longer a monotonous 3D structural shape.

[0003] The existing 3D model data with texture characteristics are all composed of 3D structure data + flat texture images, but this kind of mapping data cannot be directly processed for internal engraving, and the internal engraving data are all composed of three-dimensional point clouds, which are grayscale graphics represented by density. It is impossible to express the texture point cloud data in black and white grayscale when converting the texture map into three-dimensional space, so there is an urgent need to improve the existing technology.

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

[0005] In view of this, the present invention proposes a method and device for converting three-dimensional texture maps into three-dimensional point clouds, aiming to solve the technical problem that the existing technology cannot convert texture maps into point cloud data that represents texture in black and white grayscale in three-dimensional space through algorithms.

[0006] The technical solution of the present invention is achieved in this way:

[0007] In one aspect, the present invention provides a method for converting a three-dimensional texture map into a three-dimensional point cloud, wherein the method for converting a three-dimensional texture map into a three-dimensional point cloud comprises the following steps:

[0008] S1, import the obj file, obtain texture data, extract the MTL file from the obj file for parsing, bind it with the texture data, and record the bound texture data as bound texture data;

[0009] S2, extracting a three-dimensional structure point cloud from the obj file, and constructing an orthogonal pixelated three-dimensional point cloud according to the three-dimensional structure point cloud and bound texture data;

[0010] S3, reconstructing the orthophoto 2D texture according to the texture coordinates, constructing 3D pixel points according to the 2D texture and the orthogonal pixelated 3D point cloud, and saving the 3D pixel points as 3D data for engraving.

[0011] On the basis of the above technical scheme, preferably, step S1, importing the obj file, obtaining texture data, extracting the MTL file from the obj file for parsing, and binding it with the texture data, and recording the bound texture data as bound texture data, also includes the following steps: importing the obj file, obtaining texture data, extracting the texture coordinates of the 2D texture from the obj file, obtaining the texture coordinate calculation formula, calculating the corresponding three-dimensional space triangle surface texture coordinates through the texture coordinates of the 2D texture according to the texture coordinate calculation formula, binding the three-dimensional space triangle surface texture coordinates with the texture data, and recording the bound texture data as bound texture data.

[0012] On the basis of the above technical solution, preferably, the following steps are further included: the obj file defines the texture coordinates of the 2D texture corresponding to the three-dimensional space triangle (P1, P2, P3), and the texture coordinates of any point P (x, y) inside the triangle surface are found by the following relationship;

[0013] Assumptions:

[0014] The texture coordinates corresponding to P1(x1,y1) are (u1,v1);

[0015] The texture coordinates corresponding to P2(x2,y2) are (u2,v2);

[0016] The texture coordinates corresponding to P3(x3,y3) are (u3,v3);

[0017] Then the texture coordinates of any point on the triangle surface are:

[0018]

[0019] Among them, P(x,y) represents the coordinates of any point in the three-dimensional space triangle, U P(x,y) and V P(x,y) Represents the texture coordinates corresponding to the point coordinates, A u , B u , C u Represents the function corresponding to the x-direction coordinate of any point in the three-dimensional space triangle surface, A v , B v , C v The function representing the coordinate of any point in the y direction of a triangle in three-dimensional space, and the Z coordinate is calculated by the three-dimensional plane equation in three-dimensional space.

[0020] On the basis of the above technical solution, preferably, in step S3, before extracting the three-dimensional structure point cloud from the obj file and constructing the orthogonal pixelated three-dimensional point cloud according to the three-dimensional structure point cloud and the bound texture data, the following steps are also included, in which a texture coordinate binding equation is constructed according to the texture data, and a point-surface parent-child relationship is constructed according to the texture coordinate binding equation.

[0021] On the basis of the above technical scheme, preferably, in step S3, a three-dimensional structure point cloud is extracted from the obj file, and an orthogonal pixelated three-dimensional point cloud is constructed according to the three-dimensional structure point cloud and the bound texture data. The step also includes the following steps: extracting a three-dimensional structure point cloud from the obj file, searching for pixel values ​​corresponding to the texture coordinates on the 2D texture image according to the three-dimensional structure point cloud and the texture coordinates in the bound texture data, and constructing an orthogonal pixelated three-dimensional point cloud according to the pixel values.

[0022] On the basis of the above technical scheme, preferably, the following steps are also included: in step S4, the orthogonal 2D texture is reconstructed according to the texture coordinates, 3D pixel points are constructed according to the 2D texture and the orthogonal pixelated three-dimensional point cloud, and the 3D pixel points are saved as three-dimensional data for engraving; the following steps are also included: grayscale the 2D texture to obtain the grayscale 2D texture, the grayscale 2D texture is processed by image binarization to obtain the binary grayscale 2D texture, 3D pixel points are constructed according to the binary grayscale 2D texture and the orthogonal pixelated three-dimensional point cloud, and the 3D pixel points are saved as three-dimensional data for engraving.

[0023] On the basis of the above technical scheme, preferably, 3D pixel points are constructed according to the binary grayscale 2D texture and the orthogonal pixelated three-dimensional point cloud, and the 3D pixel points are saved as three-dimensional data for engraving, and the following steps are also included: obtaining crystal data, the crystal data including: crystal position information and size information, adjusting the size and position of the binary grayscale 2D texture according to the crystal data, binding the adjusted binary grayscale 2D texture with the orthogonal pixelated three-dimensional point cloud to construct 3D pixel points, and saving the 3D pixel points as three-dimensional data for engraving.

[0024] More preferably, the device for converting the three-dimensional texture map into a three-dimensional point cloud comprises:

[0025] The recording module is used to import the obj file, obtain the texture data, extract the MTL file from the obj file for parsing, bind it with the texture data, and record the bound texture data;

[0026] A point cloud construction module is used to extract a 3D structure point cloud from an obj file and construct an orthogonal pixelated 3D point cloud based on the 3D structure point cloud;

[0027] The conversion module is used to reconstruct the orthophoto 2D texture according to the texture coordinates, construct 3D pixel points according to the 2D texture and the orthogonal pixelated 3D point cloud, and save the 3D pixel points as 3D data for engraving.

[0028] In a second aspect, the method for converting a three-dimensional texture map into a three-dimensional point cloud also includes a storage device, the storage device including: a memory, a processor, and a method program for converting a three-dimensional texture map into a three-dimensional point cloud stored in the memory and executable on the processor, the method program for converting a three-dimensional texture map into a three-dimensional point cloud being configured to implement the steps of the method for converting a three-dimensional texture map into a three-dimensional point cloud as described above.

[0029] In a third aspect, the method for converting a three-dimensional texture map into a three-dimensional point cloud also includes a medium, which is a computer medium, and a method program for converting a three-dimensional texture map into a three-dimensional point cloud is stored on the computer medium. When the method program for converting a three-dimensional texture map into a three-dimensional point cloud is executed by a processor, the steps of the method for converting a three-dimensional texture map into a three-dimensional point cloud as described above are implemented.

[0030] The method of converting a three-dimensional texture map into a three-dimensional point cloud of the present invention has the following beneficial effects compared with the prior art:

[0031] (1) By reconstructing the orthographic 3D texture and performing binarization processing, the texture map can be converted into a 3D space while representing the texture point cloud data in black and white grayscale. This is not only applicable to the mapping of a single texture file, but also to the topic map of multiple texture files, thus improving the adaptability of the system and enhancing the user experience.

[0032] (2) Through the texture coordinate algorithm, the texture coordinates corresponding to each three-dimensional space point can be accurately found, which improves the accuracy of subsequent pixel value searches and improves the conversion efficiency of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 It is a schematic diagram of the structure of a device in a hardware operating environment involved in an embodiment of the present invention;

[0035] Figure 2 A schematic diagram of a flow chart of a first embodiment of a method for converting a three-dimensional texture map into a three-dimensional point cloud according to the present invention;

[0036] Figure 3 Schematic diagram of functional modules of the first embodiment of the method for converting a three-dimensional texture map into a three-dimensional point cloud according to the present invention. DETAILED DESCRIPTION

[0037] The following will be combined with the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] like Figure 1 As shown, the storage device may include: a processor 1001, such as a central processing unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Among them, the communication bus 1002 is used to realize the connection and communication between these components. The user interface 1003 may include a display screen (Display), an input unit such as a keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface and a wireless interface. The network interface 1004 may optionally include a standard wired interface and a wireless interface (such as a wireless fidelity (WIreless-FIdelity, WI-FI) interface). The memory 1005 may be a high-speed random access memory (Random Access Memory, RAM) memory, or a stable non-volatile memory (Non-Volatile Memory, NVM), such as a disk memory. The memory 1005 may also be a storage device independent of the aforementioned processor 1001.

[0039] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation of the device. In actual applications, the device may include more or fewer components than shown in the figure, or combine certain components, or arrange the components differently.

[0040] like Figure 1 As shown, the memory 1005 as a medium may include an operating system, a network communication module, a user interface module, and a method program for converting a three-dimensional texture map into a three-dimensional point cloud.

[0041] exist Figure 1In the device shown, the network interface 1004 is mainly used to establish a communication connection between the device and a server that stores all data required in the method system for converting three-dimensional texture maps into three-dimensional point clouds; the user interface 1003 is mainly used to interact with the user for data; the processor 1001 and the memory 1005 in the method device for converting three-dimensional texture maps into three-dimensional point clouds of the present invention can be set in the method device for converting three-dimensional texture maps into three-dimensional point clouds, and the method device for converting three-dimensional texture maps into three-dimensional point clouds calls the method program for converting three-dimensional texture maps into three-dimensional point clouds stored in the memory 1005 through the processor 1001, and executes the method for converting three-dimensional texture maps into three-dimensional point clouds provided by the implementation of the present invention.

[0042] Combination Figure 2 , Figure 2 Schematic diagram of the process of the first embodiment of the method for converting a three-dimensional texture map into a three-dimensional point cloud according to the present invention.

[0043] In this embodiment, the method for converting the three-dimensional texture map into a three-dimensional point cloud includes the following steps:

[0044] S10: importing the obj file, obtaining texture data, extracting the MTL file from the obj file for parsing, binding it with the texture data, and recording the bound texture data.

[0045] It should be understood that in this embodiment, the obj file is first imported to obtain texture data, the texture coordinates of the 2D texture are extracted from the obj file, and the texture coordinate calculation formula is obtained. According to the texture coordinate calculation formula, the texture coordinates of the corresponding three-dimensional space triangle surface are calculated through the texture coordinates of the 2D texture, the three-dimensional space triangle surface texture coordinates are bound to the texture data, and the bound texture data is recorded as bound texture data.

[0046] It should be understood that the general data exchange structure includes the following three types of files: 1. obj file, which describes the three-dimensional shape of 3D data, normals of three-dimensional data surfaces, texture coordinates, etc.; 2. MTL file, which is used to define the path of the texture file bound to the component in the obj file and other material information; 3. Jpg file (BMP, etc.), which saves the texture data image bound to obj, usually one file, but there are also multiple files used to save. In this embodiment, the texture coordinates are extracted from the obj file, and then the texture data image bound to obj is extracted through the Jpg file.

[0047] It should be understood that the obj file defines the texture coordinates of the 2D texture corresponding to the three-dimensional space triangle (P1, P2, P3). The texture coordinates of any point P (x, y) inside this triangle can be found by the following relationship.

[0048] Assumptions:

[0049] The texture coordinates corresponding to P1(x1,y1) are (u1,v1);

[0050] The texture coordinates corresponding to P2(x2,y2) are (u2,v2);

[0051] The texture coordinates corresponding to P3(x3,y3) are (u3,v3);

[0052] Then the texture coordinates of any point on the triangle surface are:

[0053]

[0054] Among them, P(x,y) represents the coordinates of any point in the three-dimensional space triangle, U P(x,y) and V P(x,y) Represents the texture coordinates corresponding to the point coordinates, A u , B u , C u Represents the function corresponding to the x-direction coordinate of any point in the three-dimensional space triangle surface, A v , B v , C v Represents the function corresponding to the y-coordinate of any point in the triangular surface of three-dimensional space, and the Z coordinate is calculated by the three-dimensional plane equation of three-dimensional space.

[0055] Then we have:

[0056] A u =F a (P1,P2,P3,u1,u2,u3)A v =F a (P1,P2,P3,v1,v2,v3)

[0057] B u =F b (P1,P2,P3,u1,u2,u3),B v =F b (P1,P2,P3,v1,v2,v3);

[0058] C u =F c (P1,P2,P3,u1,u2,u3)C v =F c (P1,P2,P3,v1,v2,v3)

[0059] Among them, the parameters in the Y direction only need to replace (u1,u2,u3) with (v1,v2,v3).

[0060] It should be understood that through the above texture coordinate relationship, the texture coordinate corresponding to each point in the three-dimensional space can be determined, and then the corresponding pixel value can be found on the 2D texture image through the texture coordinate. In this way, the front view can be reconstructed to prepare for the next step of image binarization.

[0061] It should be understood that this embodiment also constructs a texture coordinate binding equation based on texture data, and constructs a point-surface parent-child relationship based on the texture coordinate binding equation.

[0062] S20: extracting a three-dimensional structure point cloud from the obj file, and constructing an orthogonal pixelated three-dimensional point cloud according to the three-dimensional structure point cloud.

[0063] It should be understood that the system of this embodiment will also extract the three-dimensional structure point cloud from the obj file, find the pixel value corresponding to the texture coordinate on the 2D texture image based on the three-dimensional structure point cloud and the texture coordinates in the bound texture data, and construct an orthogonal pixelated three-dimensional point cloud based on the pixel value.

[0064] It should be understood that the specific operations are as follows: texture mapping core function, (P1, P2, P3) form a plane, there is a one-to-one correspondence between the points on the plane and the texture, since the points are taken on the triangular face, the (u, v) coordinates of the texture are actually only related to X, Y (or X, Z, or Y, Z), so the system will look for the pixel value corresponding to the texture coordinate on the 2D texture image based on the three-dimensional structure point cloud and the texture coordinates in the bound texture data, and construct an orthogonal pixelated three-dimensional point cloud based on the pixel value, where the Z coordinate is assigned by the corresponding three-dimensional structure later, and the corresponding three-dimensional structure is captured by the system.

[0065] S30: reconstructing the orthophoto 2D texture according to the texture coordinates, constructing 3D pixel points according to the 2D texture and the orthogonal pixelated 3D point cloud, and saving the 3D pixel points as 3D data for engraving.

[0066] It should be understood that the system will then grayscale the 2D texture to obtain a grayscale 2D texture, process the grayscale 2D texture through image binarization to obtain a binary grayscale 2D texture, construct 3D pixel points based on the binary grayscale 2D texture and the orthogonal pixelated three-dimensional point cloud, and save the 3D pixel points as three-dimensional data for engraving.

[0067] It should be understood that the specific operation steps for constructing 3D pixel points based on the binary grayscale 2D texture and the orthogonal pixelated three-dimensional point cloud are as follows: the system will obtain the current crystal data, and the crystal data includes: crystal position information and size information, and then adjust the position and size of the binary grayscale 2D texture according to the crystal data, and then bind it to the orthogonal pixelated three-dimensional point cloud, and then clear the texture point cloud and the background point cloud, and use the grid to fill the mesh to obtain a layer of orthogonal whiteboard cloud points, and store the whiteboard cloud points, and then remove the background point cloud that overlaps in the z direction, and pixelate the final three-dimensional point cloud, and finally generate the front view texture image and the depth image.

[0068] It should be understood that the system will then pre-process the orthographic texture map, including: mask enhancement and 3D texture point cloud generation, valid point cloud definition for the whiteboard orthogonal point cloud, and adding the second and third layer point clouds. Finally, the system saves the obtained 3D pixel point cloud as 3D data for engraving.

[0069] It should be noted that the above is only an example and does not constitute any limitation to the technical solution of the present application.

[0070] It is not difficult to find from the above description that this embodiment imports the obj file to obtain texture data, extracts the MTL file from the obj file for parsing, binds it with the texture data, and records the bound texture data as bound texture data; extracts the three-dimensional structure point cloud from the obj file, and constructs an orthogonal pixelated three-dimensional point cloud based on the three-dimensional structure point cloud and the bound texture data; reconstructs the orthogonal 2D texture based on the texture coordinates, constructs 3D pixel points based on the 2D texture and the orthogonal pixelated three-dimensional point cloud, and saves the 3D pixel points as three-dimensional data for engraving. This embodiment converts the texture map into point cloud data that can express the texture in black and white grayscale while converting it into three-dimensional space, and can directly perform internal engraving processing on the three-dimensional map, and can directly add texture characteristics to the crystal three-dimensional internal engraving image, which meets user needs, saves user costs, and greatly improves user experience.

[0071] In addition, the embodiment of the present invention also provides a device for converting a three-dimensional texture map into a three-dimensional point cloud. Figure 3 As shown, the device for converting the three-dimensional texture map into a three-dimensional point cloud includes: a recording module 10, a point cloud construction module 20, and a conversion module 30.

[0072] The recording module 10 is used to import the obj file, obtain texture data, extract the MTL file from the obj file for parsing, bind it with the texture data, and record the bound texture data;

[0073] A point cloud construction module 20 is used to extract a three-dimensional structure point cloud from an obj file, and to construct an orthogonal pixelated three-dimensional point cloud according to the three-dimensional structure point cloud;

[0074] The conversion module 30 is used to reconstruct the orthophoto 2D texture according to the texture coordinates, construct 3D pixel points according to the 2D texture and the orthogonal pixelated 3D point cloud, and save the 3D pixel points as 3D data for engraving.

[0075] In addition, it should be noted that the device embodiments described above are merely illustrative and do not limit the scope of protection of the present invention. In practical applications, technicians in this field can select some or all of the modules according to actual needs to achieve the purpose of the present embodiment, and no restrictions are made here.

[0076] In addition, for technical details not fully described in this embodiment, reference may be made to the method for converting a three-dimensional texture map into a three-dimensional point cloud provided in any embodiment of the present invention, and will not be repeated here.

[0077] In addition, an embodiment of the present invention further provides a medium, which is a computer medium, and a method program for converting a three-dimensional texture map into a three-dimensional point cloud is stored on the computer medium. When the method program for converting a three-dimensional texture map into a three-dimensional point cloud is executed by a processor, the following operations are implemented:

[0078] S1, import the obj file, obtain texture data, extract the MTL file from the obj file for parsing, bind it with the texture data, and record the bound texture data as bound texture data;

[0079] S2, extracting a three-dimensional structure point cloud from the obj file, and constructing an orthogonal pixelated three-dimensional point cloud according to the three-dimensional structure point cloud and bound texture data;

[0080] S3, reconstructing the orthophoto 2D texture according to the texture coordinates, constructing 3D pixel points according to the 2D texture and the orthogonal pixelated 3D point cloud, and saving the 3D pixel points as 3D data for engraving.

[0081] Furthermore, when the method program for converting the three-dimensional texture map into a three-dimensional point cloud is executed by the processor, the following operations are also implemented:

[0082] Import the obj file, obtain the texture data, extract the texture coordinates of the 2D texture from the obj file, obtain the texture coordinate calculation formula, calculate the corresponding three-dimensional space triangle surface texture coordinates through the 2D texture texture coordinates according to the texture coordinate calculation formula, bind the three-dimensional space triangle surface texture coordinates with the texture data, and record the bound texture data as bound texture data.

[0083] Furthermore, when the method program for converting the three-dimensional texture map into a three-dimensional point cloud is executed by the processor, the following operations are also implemented:

[0084] The texture coordinate calculation formula is:

[0085]

[0086] Among them, P(x,y) represents the coordinates of any point in the three-dimensional space triangle, U P(x,y) and V P(x,y) Represents the texture coordinates corresponding to the point coordinates, A u , B u and C u Representative, A v , B v and C v A function representing the coordinates of any point in a triangular surface in three-dimensional space.

[0087] Furthermore, when the method program for converting the three-dimensional texture map into a three-dimensional point cloud is executed by the processor, the following operations are also implemented:

[0088] A texture coordinate binding equation is constructed according to the texture data, and a point-surface parent-child relationship is constructed according to the texture coordinate binding equation.

[0089] Furthermore, when the method program for converting the three-dimensional texture map into a three-dimensional point cloud is executed by the processor, the following operations are also implemented:

[0090] Extract the 3D structure point cloud from the obj file, find the pixel value corresponding to the texture coordinate on the 2D texture image according to the 3D structure point cloud and the texture coordinates in the bound texture data, and construct an orthogonal pixelated 3D point cloud according to the pixel value.

[0091] Furthermore, when the method program for converting the three-dimensional texture map into a three-dimensional point cloud is executed by the processor, the following operations are also implemented:

[0092] The 2D texture is grayscaled to obtain a grayscale 2D texture, the grayscale 2D texture is processed by image binarization to obtain a binary grayscale 2D texture, 3D pixel points are constructed according to the binary grayscale 2D texture and an orthogonal pixelated three-dimensional point cloud, and the 3D pixel points are saved as three-dimensional data for engraving.

[0093] Furthermore, when the method program for converting the three-dimensional texture map into a three-dimensional point cloud is executed by the processor, the following operations are also implemented:

[0094] Acquire crystal data, the crystal data including: crystal position information and size information, adjust the size and position of the binary grayscale 2D texture according to the crystal data, bind the adjusted binary grayscale 2D texture with the orthogonal pixelated three-dimensional point cloud to construct a 3D pixel point, and save the 3D pixel point as three-dimensional data for engraving.

[0095] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for converting a three-dimensional texture map into a three-dimensional point cloud, characterized in that: The following steps are involved: S1, import the obj file, obtain texture data, extract the MTL file from the obj file for parsing, bind it with the texture data, and record the bound texture data as bound texture data; S2, extracting a three-dimensional structure point cloud from the obj file, and constructing an orthogonal pixelated three-dimensional point cloud according to the three-dimensional structure point cloud and bound texture data; S3, reconstructing the orthophoto 2D texture according to the texture coordinates, constructing 3D pixel points according to the 2D texture and the orthogonal pixelated 3D point cloud, and saving the 3D pixel points as 3D data for engraving; In step S1, an obj file is imported to obtain texture data, an MTL file is extracted from the obj file for parsing, and the MTL file is bound to the texture data, and the bound texture data is recorded as bound texture data. The method also includes the following steps: importing an obj file to obtain texture data, extracting texture coordinates of a 2D texture from the obj file, obtaining a texture coordinate calculation formula, calculating the texture coordinates of a corresponding three-dimensional space triangle surface through the texture coordinates of the 2D texture according to the texture coordinate calculation formula, binding the three-dimensional space triangle surface texture coordinates to the texture data, and recording the bound texture data as bound texture data; The obj file defines the texture coordinates of the 2D texture corresponding to the 3D triangle (P1, P2, P3). The texture coordinates of any point P (x, y) inside this triangle are found by the following relationship; Assumptions: The texture coordinates corresponding to P1(x1,y1) are (u1,v1); The texture coordinates corresponding to P2(x2,y2) are (u2,v2); The texture coordinates corresponding to P3(x3,y3) are (u3,v3); Then the texture coordinates of any point on the triangle surface are: Among them, P(x,y) represents the coordinates of any point in the three-dimensional space triangle, U P(x,y) and V P(x,y) Represents the texture coordinates corresponding to the point coordinates, A u , B u , C u Represents the function corresponding to the x-direction coordinate of any point in the three-dimensional space triangle surface, A v , B v , C v Represents the function corresponding to the y-direction coordinate of any point in the three-dimensional space triangle, and the Z coordinate is calculated by the three-dimensional plane equation in the three-dimensional space; Then we have:

2. The method for converting a three-dimensional texture map into a three-dimensional point cloud according to claim 1, characterized in that: In step S2, a three-dimensional structure point cloud is extracted from the obj file, and an orthogonal pixelated three-dimensional point cloud is constructed based on the three-dimensional structure point cloud and the bound texture data. The step also includes the following steps: extracting a three-dimensional structure point cloud from the obj file, searching for the pixel value corresponding to the texture coordinate on the 2D texture image based on the three-dimensional structure point cloud and the texture coordinates in the bound texture data, and constructing an orthogonal pixelated three-dimensional point cloud based on the pixel value.

3. The method for converting a three-dimensional texture map into a three-dimensional point cloud according to claim 2, characterized in that: In step S3, the orthogonal 2D texture is reconstructed according to the texture coordinates, 3D pixel points are constructed according to the 2D texture and the orthogonal pixelated three-dimensional point cloud, and the 3D pixel points are saved as three-dimensional data for engraving. The step also includes the following steps: grayscale the 2D texture to obtain the grayscale 2D texture, process the grayscale 2D texture by image binarization to obtain the binary grayscale 2D texture, construct 3D pixel points according to the binary grayscale 2D texture and the orthogonal pixelated three-dimensional point cloud, and save the 3D pixel points as three-dimensional data for engraving.

4. A device for converting a three-dimensional texture map into a three-dimensional point cloud, characterized in that: The device for converting the three-dimensional texture map into a three-dimensional point cloud comprises: The recording module is used to import the obj file, obtain the texture data, extract the MTL file from the obj file for parsing, bind it with the texture data, and record the bound texture data; A point cloud construction module is used to extract a 3D structure point cloud from an obj file and construct an orthogonal pixelated 3D point cloud based on the 3D structure point cloud; A conversion module, for reconstructing an orthophoto 2D texture according to texture coordinates, constructing 3D pixel points according to the 2D texture and an orthogonal pixelated 3D point cloud, and saving the 3D pixel points as 3D data for engraving; Among them, importing an obj file, obtaining texture data, extracting an MTL file from the obj file for parsing, and binding it with the texture data, and recording the bound texture data as bound texture data, also includes the following steps: importing an obj file, obtaining texture data, extracting texture coordinates of a 2D texture from the obj file, obtaining a texture coordinate calculation formula, calculating the texture coordinates of a corresponding three-dimensional space triangle surface through the texture coordinates of the 2D texture according to the texture coordinate calculation formula, binding the three-dimensional space triangle surface texture coordinates with the texture data, and recording the bound texture data as bound texture data; The obj file defines the texture coordinates of the 2D texture corresponding to the 3D triangle (P1, P2, P3). The texture coordinates of any point P (x, y) inside this triangle are found by the following relationship; Assumptions: The texture coordinates corresponding to P1(x1,y1) are (u1,v1); The texture coordinates corresponding to P2(x2,y2) are (u2,v2); The texture coordinates corresponding to P3(x3,y3) are (u3,v3); Then the texture coordinates of any point on the triangle surface are: Among them, P(x,y) represents the coordinates of any point in the three-dimensional space triangle, U P(x,y) and V P(x,y) Represents the texture coordinates corresponding to the point coordinates, A u , B u , C u Represents the function corresponding to the x-direction coordinate of any point in the three-dimensional space triangle surface, A v , B v , C v Represents the function corresponding to the y-coordinate of any point in the three-dimensional space triangle, and the Z coordinate is calculated by the three-dimensional plane equation in the three-dimensional space; Then we have:

5. A storage device, characterized in that: The storage device includes: a memory, a processor, and a method program for converting a three-dimensional texture map into a three-dimensional point cloud, which is stored in the memory and can be run on the processor. The method program for converting a three-dimensional texture map into a three-dimensional point cloud is configured to implement the steps of the method for converting a three-dimensional texture map into a three-dimensional point cloud as described in any one of claims 1 to 3.

6. A medium, characterized in that The medium is a computer medium, on which is stored a method program for converting a three-dimensional texture map into a three-dimensional point cloud. When the method program for converting a three-dimensional texture map into a three-dimensional point cloud is executed by a processor, the steps of the method for converting a three-dimensional texture map into a three-dimensional point cloud as described in any one of claims 1 to 3 are implemented.

Citation Information

Patent Citations

  • Dense-point-cloud-based rapid construction method of urban three-dimensional model

    CN105205866A

  • Point cloud model texture mapping method and system

    CN108280870A