Texture mapping method, device, equipment, medium and system
By obtaining and stitching multiple poses on the scanner and calculating the pose information of the texture map, the texture map is automatically mapped to the three-dimensional geometric model, which solves the problem of poor texture mapping accuracy in the existing technology and achieves efficient and accurate texture mapping.
Patent Information
- Application Number
- CN202411653965.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-19
- Publication Date
- 2025-03-14
AI Technical Summary
In the prior art, the texture mapping accuracy is poor, the manual operation workload is large, and the calculated pose accuracy is low, resulting in the obtained texture model not being accurate enough.
By obtaining multiple poses on the scanner tracked by the tracking device, multi-frame 3D data are spliced under the preset tracking coordinate system, pose information of the texture map is obtained, and the texture map is automatically mapped to the three-dimensional geometric model.
Improve texture mapping efficiency and accuracy, reduce manual operations, and realize fully automated pose calculation.
Smart Images

Figure CN119625149A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of texture image technology, and in particular to a texture mapping method, device, equipment, medium and system. Background Art
[0002] When high-precision modeling is required, such as modeling of cultural relics, a 3D laser scanner is often used to obtain high-precision 3D information, and then a high-definition camera is used to take high-definition texture pictures. Later, a model with texture is obtained through a lot of manual processing. Texture mapping can map any point on a 3D object to a 2D plane. The texture is actually a 2D picture. Mapping represents a one-to-one correspondence. So texture mapping is to find the correspondence between a point on the surface of an object and every point on the texture. The premise is to calculate the pose information of the texture under the 3D model.
[0003] The existing technology obtains a three-dimensional model through laser scanning, structured light and the like, obtains a texture map by taking photos with a high-definition camera, and manually maps the texture map to the three-dimensional model to obtain a model with texture.
[0004] The following problems exist: 1. The workload of manual operation is very large; 2. The corresponding points are often difficult to find accurately, and the calculated pose accuracy is low, which will lead to the obtained texture model being not accurate enough. Summary of the invention
[0005] The purpose of the present invention is to address the deficiencies in the above-mentioned prior art and provide a texture mapping method, device, equipment, medium and system to solve the problems of poor texture mapping accuracy in the prior art.
[0006] To achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
[0007] In a first aspect, an embodiment of the present application provides a texture mapping method, the method comprising:
[0008] Acquire multiple positions and postures of a first target point on a scanner tracked by a tracking device, wherein the multiple positions and postures are tracking coordinates when the scanner collects multiple frames of three-dimensional data;
[0009] According to the multiple postures, in a preset tracking coordinate system of the tracking device, the multiple frames of three-dimensional data are stitched together to obtain a three-dimensional geometric model of the target object;
[0010] Obtaining a texture map of a target object collected by a texture image capturing device;
[0011] Based on the preset tracking coordinate system, calculating the pose of the texture map to obtain pose information of the texture map in the three-dimensional geometric model;
[0012] According to the position information of the texture map on the three-dimensional geometric model, the texture map is mapped to the three-dimensional geometric model to obtain a textured three-dimensional model of the target object.
[0013] Optionally, the performing pose calculation on the texture map based on the preset tracking coordinate system to obtain pose information of the texture map on the three-dimensional geometric model includes:
[0014] Acquire the pose of a second target point on the texture mapping device tracked by the tracking device, where the pose of the second target point is the tracking pose when the texture mapping device collects the texture map;
[0015] Acquire a first conversion relationship between a target point coordinate system of the second target point and the preset tracking coordinate system;
[0016] According to a second transformation relationship between the camera coordinate system of the texture image capturing device and the target point coordinate system, and the first transformation relationship, a target transformation relationship from the camera coordinate system to the preset tracking coordinate system is obtained;
[0017] According to the pose of the texture map in the camera coordinate system, the target transformation relationship is adopted to calculate the pose of the texture map in the preset tracking coordinate system as: pose information of the texture map in the three-dimensional geometric model.
[0018] Optionally, before obtaining a target transformation relationship from the camera coordinate system to the preset tracking coordinate system based on the second transformation relationship between the camera coordinate system of the texture mapping device and the target point coordinate system and the first transformation relationship, the method further includes:
[0019] The texture imaging device is calibrated to obtain the second conversion relationship.
[0020] Optionally, the performing coordinate system calibration on the texture image capturing device to obtain the second conversion relationship includes:
[0021] Acquire the position and posture of the first marker point on the preset calibration plate tracked by the tracking device, and the position and posture of the second target point on the texture imaging device;
[0022] Obtaining a third transformation relationship between the calibration coordinate system of the preset calibration plate and the preset tracking coordinate system according to the position and posture of the first marking point;
[0023] Obtaining a fourth transformation relationship between the target point coordinate system and the preset tracking coordinate system according to the position and posture of the second target point;
[0024] Calculating a fifth transformation relationship between the camera coordinate system and the calibration coordinate system according to a preset pose of a second marker point on the preset calibration plate captured by the texture imaging device;
[0025] The second conversion relationship is calculated according to the third conversion relationship, the fourth conversion relationship and the fifth conversion relationship.
[0026] Optionally, the calculating a fifth transformation relationship between the camera coordinate system and the calibration coordinate system according to a preset pose of the second marker point on the preset calibration plate photographed by the texture imaging device includes:
[0027] According to the preset position and posture of the second marker point, the fifth conversion relationship is calculated using a preset spatial resection method.
[0028] Optionally, the calculating a fifth transformation relationship between the camera coordinate system and the calibration coordinate system according to a preset pose of the second marker point on the preset calibration plate photographed by the texture imaging device includes:
[0029] Calculating a plurality of the fifth conversion relationships according to the preset positions and poses of the plurality of the second marker points photographed by the texture imaging device;
[0030] The calculating the second conversion relationship according to the third conversion relationship, the fourth conversion relationship and the fifth conversion relationship includes:
[0031] The second conversion relationship is obtained by using the least square method to solve the third conversion relationship, the fourth conversion relationship and a plurality of the fifth conversion relationships.
[0032] In a second aspect, an embodiment of the present application provides a texture mapping device, the device comprising:
[0033] A first acquisition module, used to acquire multiple positions and postures of a first target point on a scanner tracked by a tracking device, wherein the multiple positions and postures are respectively tracking coordinates when the scanner collects multiple frames of three-dimensional data;
[0034] A splicing module, configured to splice the multiple frames of three-dimensional data according to the multiple postures in a preset tracking coordinate system of the tracking device to obtain a three-dimensional geometric model of the target object;
[0035] The second acquisition module is used to acquire the texture map of the target object collected by the texture image capturing device;
[0036] A calculation module, used for performing pose calculation on the texture map based on the preset tracking coordinate system to obtain pose information of the texture map on the three-dimensional geometric model;
[0037] A mapping module is used to map the texture map to the three-dimensional geometric model according to the posture information of the texture map on the three-dimensional geometric model to obtain a textured three-dimensional model of the target object.
[0038] In a third aspect, an embodiment of the present application provides a computer device, comprising: a processor and a storage medium, wherein the processor and the storage medium are communicatively connected via a bus, the storage medium stores program instructions executable by the processor, and the processor calls the program stored in the storage medium to execute the steps of the texture mapping method as described in any one of the first aspects above.
[0039] In a fourth aspect, an embodiment of the present application provides a storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the texture mapping method as described in any one of the above-mentioned first aspects are executed.
[0040] In a fifth aspect, an embodiment of the present application provides a three-dimensional model acquisition system, the three-dimensional model acquisition system comprising: a computer device, a tracking device, a scanner, and a texture mapping device, wherein the tracking device, the scanner, and the texture mapping device are respectively communicatively connected to the computer device, the tracking device is used to track a first target point on the scanner and a second target point on the texture mapping device, the scanner is used to acquire three-dimensional data of a target object, and the texture mapping device is used to acquire a texture map of the target object;
[0041] The computer device is used to execute the texture mapping method described in any one of the first aspects above.
[0042] Compared with the prior art, this application has the following beneficial effects:
[0043] The present application provides a texture mapping method, device, equipment, medium and system. The method obtains multiple positions and postures of the first target point on the scanner tracked by the tracking device, and the multiple positions and postures are the tracking coordinates when the scanner collects multiple frames of three-dimensional data; according to the multiple positions and postures, in the preset tracking coordinate system of the tracking device, the multiple frames of three-dimensional data are spliced to obtain the three-dimensional geometric model of the target object; the texture map of the target object collected by the texture image capturing device is obtained; based on the preset tracking coordinate system, the texture map is calculated to obtain the position and posture information of the texture map in the three-dimensional geometric model; according to the position and posture information of the texture map in the three-dimensional geometric model, the texture map is mapped to the three-dimensional geometric model to obtain the texture three-dimensional model of the target object. Therefore, there is no need for manual pre-punctuation, which improves the efficiency of texture mapping, and the texture mapping accuracy is also improved through fully automatic position and posture calculation. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A schematic diagram of a three-dimensional model acquisition system provided in an embodiment of the present application;
[0046] Figure 2 A schematic diagram of a flow chart of a texture mapping method provided in an embodiment of the present application;
[0047] Figure 3 A schematic diagram of a process for calculating a pose of a texture map;
[0048] Figure 4 A schematic diagram of a process for calibrating a texture image capturing device coordinate system;
[0049] Figure 5 is a flow chart of a method for calculating a fifth transformation relationship between a camera coordinate system and a calibration coordinate system;
[0050] Figure 6 A schematic diagram of a texture mapping device provided in an embodiment of the present application;
[0051] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application.
[0052] Icons: 1-computer device, 2-tracking device, 3-scanner, 4-texture imaging device, 601-first acquisition module, 602-stitching module, 603-second acquisition module, 604-calculation module, 605-mapping module, 701-processor, 702-storage medium. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0054] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for protection, but merely represents selected embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present application.
[0055] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0056] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0057] It should be noted that, in the absence of conflict, the features in the embodiments of the present invention may be combined with each other.
[0058] Before explaining a texture mapping method provided in an embodiment of the present application, a three-dimensional model acquisition system to which the texture mapping method is applied is first explained. Figure 1 A schematic diagram of a three-dimensional model acquisition system provided in an embodiment of the present application.
[0059] like Figure 1 As shown, the three-dimensional model acquisition system includes: a computer device 1, a tracking device 2, a scanner 3, and a texture imaging device 4.
[0060] The tracking device, the scanner, and the texture mapping device are respectively connected to the computer device in communication, and the tracking device is used to track the first target point on the scanner and the second target point on the texture mapping device. The scanner is used to collect three-dimensional data of the target object. The texture mapping device is used to collect the texture map of the target object. The computer device is used to execute any texture mapping method provided in the embodiments of the present application.
[0061] When the three-dimensional model acquisition system performs an acquisition task, the tracking device tracks the first target point on the scanner and the second target point on the texture mapping device in real time. First, the user uses the scanner to perform an all-round scan of the target object, and uploads the scanned data to the computer device. Then, the user uses the texture mapping device to perform an all-round photo of the target object, and uploads the texture mapping data of the target object obtained by the photo to the computer device. Finally, the computer device executes any texture mapping method provided in the embodiments of the present application to obtain a textured three-dimensional model of the target object.
[0062] A texture mapping method provided in an embodiment of the present application is explained below through a specific example. Figure 2The flowchart of a texture mapping method provided in the embodiment of the present application is shown in FIG. 1 , wherein the execution subject of the method is a computer device. Figure 2 As shown, the method includes:
[0063] S101, obtaining multiple positions and postures of a first target point on a scanner tracked by a tracking device, wherein the multiple positions and postures are tracking coordinates when the scanner collects multiple frames of three-dimensional data.
[0064] During the process of the scanner scanning the target object, the tracking device tracks the first target point on the scanner in real time, obtains the three-dimensional pose of the first target point in the preset tracking coordinate system, and uploads the three-dimensional pose of the first target point in the preset tracking coordinate system to the computer device.
[0065] The scanner can scan and obtain the three-dimensional position and posture of the target object in the scanner coordinate system, and upload the three-dimensional position and posture of the target object in the scanner coordinate system to the computer device.
[0066] It should be noted that, in actual operation, the tracking device remains stationary to ensure that the overall coordinate system is unique.
[0067] Among them, pose is a term that describes the position and orientation of an object in three-dimensional space. Pose includes three degrees of freedom of displacement (Translation) and three degrees of freedom of rotation (Rotation), which are collectively called pose. Position: usually expressed by three coordinate values, such as x, y, and z. Direction: usually expressed by three angles, such as pitch, roll, and yaw.
[0068] S102 . According to the multiple postures, in a preset tracking coordinate system of the tracking device, multiple frames of three-dimensional data are spliced to obtain a three-dimensional geometric model of the target object.
[0069] According to the three-dimensional pose of the first target point in the preset tracking coordinate system, the relative position relationship of the first target relative to the tracking device can be determined. According to the three-dimensional pose of the target object in the scanner coordinate system, the relative position relationship of each point on the target object relative to the scanner can be determined. The relative position relationship between the first target point and the scanner remains fixed. Therefore, according to the three-dimensional pose of the first target point in the preset tracking coordinate system, the three-dimensional pose of the target object in the scanner coordinate system, and the relative coordinate relationship between the first target point and the scanner, the three-dimensional pose of the target object in the preset tracking coordinate system can be obtained. By splicing multiple three-dimensional poses of the target object in the preset tracking coordinate system, the three-dimensional geometric model of the target object in the preset tracking coordinate system can be obtained.
[0070] S103: Acquire a texture map of the target object collected by a texture imaging device.
[0071] When the texture image capturing device captures the target object, multiple frames of texture maps are captured so that the texture maps contain all texture information of the target object.
[0072] When collecting data, the texture image capturing device can not only capture the texture map of the target object, but also obtain the three-dimensional pose of each pixel of the texture map in the camera coordinate system of the texture image capturing device.
[0073] The texture image capturing device uploads the texture map of the target object and the three-dimensional pose of each pixel point of the texture map in the camera coordinate system of the texture image capturing device to the computer device.
[0074] S104: Based on a preset tracking coordinate system, calculate the pose of the texture map to obtain pose information of the texture map in the three-dimensional geometric model.
[0075] Based on the preset tracking coordinate system, the three-dimensional pose of each pixel point in the camera coordinate system is calculated to obtain the three-dimensional pose of each pixel point in the preset tracking coordinate system.
[0076] S105 . Map the texture map to the three-dimensional geometric model according to the position information of the texture map in the three-dimensional geometric model to obtain a textured three-dimensional model of the target object.
[0077] Each pixel point and the three-dimensional geometric model are in a preset tracking coordinate system. Based on the same coordinate system, each pixel point has a three-dimensional geometric model position with the same posture, so the texture map can be mapped.
[0078] According to the three-dimensional pose of each pixel point in the preset tracking coordinate system and the three-dimensional geometric model in the preset tracking coordinate system, the texture information corresponding to the pixel point is mapped to the corresponding position of the pixel point in the three-dimensional geometric model. After the texture information corresponding to all the pixels is mapped, the textured three-dimensional model of the target object can be obtained.
[0079] Therefore, there is no need for manual pre-marking, which improves the efficiency of texture mapping, and also improves the accuracy of texture mapping through fully automatic pose calculation.
[0080] In summary, in this embodiment, multiple postures of the first target point on the scanner tracked by the tracking device are obtained, and the multiple postures are respectively the tracking coordinates when the scanner collects multiple frames of three-dimensional data; according to the multiple postures, in the preset tracking coordinate system of the tracking device, the multiple frames of three-dimensional data are spliced to obtain the three-dimensional geometric model of the target object; the texture map of the target object collected by the texture imaging device is obtained; based on the preset tracking coordinate system, the posture of the texture map is calculated to obtain the posture information of the texture map in the three-dimensional geometric model; according to the posture information of the texture map in the three-dimensional geometric model, the texture map is mapped to the three-dimensional geometric model to obtain the texture three-dimensional model of the target object. Therefore, there is no need for manual pre-punctuation, which improves the efficiency of texture mapping, and the texture mapping accuracy is also improved through fully automatic posture calculation.
[0081] Based on the above embodiments, the embodiments of the present application also provide a method for calculating posture using texture mapping. Figure 3 The figure is a flowchart of a method for calculating the pose of a texture map. Figure 3 As shown, in S104, based on the preset tracking coordinate system, the texture map is subjected to posture calculation to obtain the posture information of the texture map in the three-dimensional geometric model, including:
[0082] S201, obtaining the position and posture of a second target point on a texture imaging device tracked by a tracking device, wherein the position and posture of the second target point is a tracking position and posture when the texture imaging device collects texture mapping.
[0083] As the texture image capturing device moves, the tracking device tracks the position and posture of the second target point on the texture image capturing device in real time, and uploads the position and posture of the second target point to the computer device. The position and posture of the second target point is a three-dimensional position and posture in a preset tracking coordinate system.
[0084] S202: Acquire a first conversion relationship between a target point coordinate system of a second target point and a preset tracking coordinate system.
[0085] According to the three-dimensional pose of the second target point in the preset tracking coordinate system, a conversion relationship between the target point coordinate system of the second target point and the preset tracking coordinate system, ie, a first conversion relationship, can be determined.
[0086] S203, obtaining a target transformation relationship from the camera coordinate system to the preset tracking coordinate system according to the second transformation relationship between the camera coordinate system of the texture imaging device and the target point coordinate system, and the first transformation relationship.
[0087] The first conversion relationship represents the relative position relationship between the target point coordinate system of the second target point and the preset tracking coordinate system.
[0088] The second transformation relationship represents the relative position relationship between the camera coordinate system of the texture imaging device and the target point coordinate system.
[0089] Furthermore, the relative position relationship between the camera coordinate system and the preset tracking coordinate system can be determined according to the first conversion relationship and the second conversion relationship, and the target conversion relationship from the camera coordinate system to the preset tracking coordinate system can be obtained.
[0090] Specifically, the first conversion relationship, the second conversion relationship, and the target conversion relationship can be represented by a three-dimensional matrix and calculated using the three-dimensional matrix.
[0091] S204 , according to the pose of the texture map in the camera coordinate system, using the target transformation relationship, calculate the pose of the texture map in the preset tracking coordinate system as: pose information of the texture map in the three-dimensional geometric model.
[0092] By using the target transformation relationship, the three-dimensional coordinates in the camera coordinate system can be converted into the three-dimensional coordinates in the preset tracking coordinate system. Therefore, by using the target transformation relationship, the three-dimensional pose of each pixel in the texture map in the camera coordinate system can be converted into the three-dimensional pose of each pixel in the preset tracking coordinate system. And the three-dimensional pose of the texture map in the preset tracking coordinate system is used as the pose information of the texture map in the three-dimensional geometric model.
[0093] In summary, in this embodiment, the pose of the second target point on the texture mapping device tracked by the tracking device is obtained, and the pose of the second target point is the tracking pose when the texture mapping device collects the texture map; the first conversion relationship between the target point coordinate system of the second target point and the preset tracking coordinate system is obtained; according to the second conversion relationship between the camera coordinate system of the texture mapping device and the target point coordinate system, and the first conversion relationship, the target conversion relationship from the camera coordinate system to the preset tracking coordinate system is obtained; according to the pose of the texture map in the camera coordinate system, the target conversion relationship is used to calculate the pose of the texture map in the preset tracking coordinate system as: the pose information of the texture map in the three-dimensional geometric model. Thus, the pose information of the texture map in the three-dimensional geometric model is accurately calculated.
[0094] In the above Figure 3 On the basis of the corresponding embodiment, in another embodiment of the present application, before obtaining the target transformation relationship from the camera coordinate system to the preset tracking coordinate system according to the second transformation relationship between the camera coordinate system and the target point coordinate system of the texture image capturing device and the first transformation relationship in S203, the method further includes:
[0095] The texture image capturing device is calibrated to obtain a second conversion relationship.
[0096] In order to improve the accuracy of texture mapping, the coordinate system of the texture imaging device can be calibrated regularly to obtain a more accurate second conversion relationship.
[0097] In summary, in this embodiment, the texture image capturing device is calibrated to obtain the second conversion relationship, thereby obtaining a more accurate second conversion relationship.
[0098] Based on the above embodiments, the embodiments of the present application also provide a method for calibrating the coordinate system of a texture imaging device. Figure 4 The present invention is a flowchart of a method for calibrating a coordinate system of a texture imaging device.
[0099] like Figure 4 As shown, the texture image capturing device is calibrated to obtain a second conversion relationship, including:
[0100] S301, obtaining the position and posture of the first marker point on the preset calibration plate tracked by the tracking device, and the position and posture of the second target point on the texture imaging device.
[0101] Among them, a first marking point and a second marking point are set on the preset calibration plate, the first marking point is used for tracking by the tracking device, and the second marking point is used for shooting by the texture imaging device.
[0102] S302: Obtain a third transformation relationship between a calibration coordinate system of a preset calibration plate and a preset tracking coordinate system according to the position and posture of the first marking point.
[0103] The pose of the first marker point is the three-dimensional pose in the preset tracking coordinate system, and after the preset calibration plate is manufactured, the three-dimensional pose of the first marker point in the calibration coordinate system is uniquely determined. According to the three-dimensional pose of the first marker point in the preset tracking coordinate system and the three-dimensional pose of the first marker point in the calibration coordinate system, the third transformation relationship between the calibration coordinate system of the preset calibration plate and the preset tracking coordinate system can be determined.
[0104] The third conversion relationship represents the relative position relationship between the tracking device and the preset calibration plate.
[0105] S303: Obtain a fourth transformation relationship between the target point coordinate system and the preset tracking coordinate system according to the position and posture of the second target point.
[0106] The pose of the second target point is a three-dimensional pose in the preset tracking coordinate system, and after the second target point is made, the three-dimensional pose of the second target point in the target point coordinate system is uniquely determined. According to the three-dimensional pose of the second target point in the preset tracking coordinate system and the three-dimensional pose of the second target point in the target point coordinate system, the fourth conversion relationship between the target point coordinate system and the preset tracking coordinate system can be determined.
[0107] The fourth conversion relationship represents the relative position relationship between the tracking device and the second target point.
[0108] S304. Calculate a fifth transformation relationship between the camera coordinate system and the calibration coordinate system according to the preset posture of the second marker point on the preset calibration plate captured by the texture imaging device.
[0109] The pose of the second marker point is the three-dimensional pose in the camera coordinate system, and after the preset calibration plate is made, the three-dimensional pose of the second marker point in the calibration coordinate system is uniquely determined. According to the three-dimensional pose of the second marker point in the camera coordinate system and the three-dimensional pose of the second marker point in the calibration coordinate system, the fifth transformation relationship between the camera coordinate system and the calibration coordinate system can be determined.
[0110] The fifth conversion relationship represents the relative position relationship between the texture imaging device and the preset calibration plate.
[0111] S305: Calculate a second conversion relationship according to the third conversion relationship, the fourth conversion relationship, and the fifth conversion relationship.
[0112] According to the relative position relationship between the tracking device and the preset calibration plate, the relative position relationship between the tracking device and the second target point, and the relative position relationship between the texture imaging device and the preset calibration plate, the relative position relationship between the texture imaging device and the second target point can be obtained, that is, the second conversion relationship is calculated.
[0113] Specifically, the second conversion relationship, the third conversion relationship, the fourth conversion relationship, and the fifth conversion relationship can be represented by a three-dimensional matrix and calculated by using the three-dimensional matrix.
[0114] In summary, in this embodiment, the position and posture of the first mark point on the preset calibration plate tracked by the tracking device and the position and posture of the second target point on the texture imaging device are obtained; according to the position and posture of the first mark point, the third transformation relationship between the calibration coordinate system of the preset calibration plate and the preset tracking coordinate system is obtained; according to the position and posture of the second target point, the fourth transformation relationship between the target point coordinate system and the preset tracking coordinate system is obtained; according to the preset position and posture of the second mark point on the preset calibration plate photographed by the texture imaging device, the fifth transformation relationship between the camera coordinate system and the calibration coordinate system is calculated; according to the third transformation relationship, the fourth transformation relationship and the fifth transformation relationship, the second transformation relationship is calculated. Thus, the second transformation relationship is accurately calibrated in advance.
[0115] On the basis of the above embodiment, in another embodiment of the present application, in S304, according to the preset pose of the second marker point on the preset calibration plate photographed by the texture imaging device, calculating the fifth transformation relationship between the camera coordinate system and the calibration coordinate system includes:
[0116] According to the preset position and posture of the second marker point, the fifth transformation relationship is calculated using the preset spatial resection method.
[0117] Based on the above embodiments, the embodiments of the present application further provide a method for calculating the fifth transformation relationship between the camera coordinate system and the calibration coordinate system. Figure 5 FIG. 4 is a flow chart of a method for calculating the fifth transformation relationship between the camera coordinate system and the calibration coordinate system. Figure 5 As shown, in S304, according to the preset posture of the second marker point on the preset calibration plate photographed by the texture imaging device, a fifth transformation relationship between the camera coordinate system and the calibration coordinate system is calculated, including:
[0118] S401. Calculate multiple fifth conversion relationships according to the preset positions and postures of multiple second marker points captured by the texture imaging device.
[0119] In order to make the calibration more accurate, the texture imaging device captures multiple second marker points, and performs calculations based on different second marker points to obtain multiple fifth conversion relationships.
[0120] Calculating the second conversion relationship according to the third conversion relationship, the fourth conversion relationship and the fifth conversion relationship in S305 includes:
[0121] S402: According to the third conversion relationship, the fourth conversion relationship and a plurality of fifth conversion relationships, a least square method is used to solve to obtain a second conversion relationship.
[0122] By fitting and solving multiple fifth conversion relationships using the least squares method, a more accurate second conversion relationship can be obtained.
[0123] In summary, in this embodiment, multiple fifth conversion relationships are calculated according to the preset positions of multiple second marker points captured by the texture image capturing device; and the third conversion relationship, the fourth conversion relationship, and multiple fifth conversion relationships are solved by the least square method to obtain the second conversion relationship. Thus, a more accurate second conversion relationship is obtained.
[0124] The following describes a texture mapping device and storage medium provided by the present application for execution. The specific implementation process and technical effects are described above and will not be repeated below.
[0125] Figure 6 A schematic diagram of a texture mapping device provided in an embodiment of the present application is shown in FIG. Figure 6 As shown, the device comprises:
[0126] The first acquisition module 601 is used to acquire multiple positions and postures of a first target point on a scanner tracked by a tracking device, and the multiple positions and postures are tracking coordinates when the scanner collects multiple frames of three-dimensional data.
[0127] The stitching module 602 is used to stitch multiple frames of three-dimensional data according to multiple postures in a preset tracking coordinate system of the tracking device to obtain a three-dimensional geometric model of the target object.
[0128] The second acquisition module 603 is used to acquire the texture map of the target object collected by the texture imaging device.
[0129] The calculation module 604 is used to calculate the position and posture of the texture map based on a preset tracking coordinate system to obtain the position and posture information of the texture map in the three-dimensional geometric model.
[0130] The mapping module 605 is used to map the texture map to the three-dimensional geometric model according to the position information of the texture map in the three-dimensional geometric model, so as to obtain a textured three-dimensional model of the target object.
[0131] Furthermore, the calculation module 604 is specifically used to obtain the pose of a second target point on the texture mapping device tracked by the tracking device, the pose of the second target point being the tracking pose when the texture mapping device collects the texture map; obtaining the first transformation relationship between the target point coordinate system of the second target point and the preset tracking coordinate system; obtaining a target transformation relationship from the camera coordinate system to the preset tracking coordinate system based on the second transformation relationship between the camera coordinate system of the texture mapping device and the target point coordinate system, and the first transformation relationship; and calculating the pose of the texture map in the preset tracking coordinate system based on the pose of the texture map in the camera coordinate system, using the target transformation relationship, as: the pose information of the texture map in the three-dimensional geometric model.
[0132] Furthermore, the calculation module 604 is specifically used to calibrate the coordinate system of the texture imaging device to obtain a second conversion relationship.
[0133] Furthermore, the calculation module 604 is specifically used to obtain the posture of the first marker point on the preset calibration plate tracked by the tracking device, and the posture of the second target point on the texture imaging device; according to the posture of the first marker point, a third transformation relationship between the calibration coordinate system of the preset calibration plate and the preset tracking coordinate system is obtained; according to the posture of the second target point, a fourth transformation relationship between the target point coordinate system and the preset tracking coordinate system is obtained; according to the preset posture of the second marker point on the preset calibration plate captured by the texture imaging device, the fifth transformation relationship between the camera coordinate system and the calibration coordinate system is calculated; according to the third transformation relationship, the fourth transformation relationship and the fifth transformation relationship, the second transformation relationship is calculated.
[0134] Furthermore, the calculation module 604 is specifically configured to calculate the fifth transformation relationship according to the preset position and posture of the second marker point by using a preset spatial resection method.
[0135] Furthermore, the calculation module 604 is specifically used to calculate multiple fifth transformation relationships based on the preset postures of multiple second marker points captured by the texture imaging device; and to use the least squares method to solve the third transformation relationship, the fourth transformation relationship and the multiple fifth transformation relationships to obtain the second transformation relationship.
[0136] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present application, which electronic device may be a device with computing and processing functions.
[0137] The electronic device includes: a processor 701 and a storage medium 702. The processor 701 and the storage medium 702 are connected via a bus.
[0138] The storage medium 702 is used to store programs, and the processor 701 calls the programs stored in the storage medium 702 to execute the above method embodiment. The specific implementation method and technical effect are similar and will not be repeated here.
[0139] Optionally, the present invention also provides a program product, such as a computer-readable storage medium, comprising a program, which is used to execute the above method embodiment when executed by a processor.
[0140] In the several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can be implemented in other ways. For example, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0141] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0142] In addition, each functional unit in each embodiment of the present invention may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of hardware plus software functional units.
[0143] The above-mentioned integrated unit implemented in the form of a software functional unit can be stored in a computer-readable storage medium. The above-mentioned software functional unit is stored in a storage medium, including a number of instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) or a processor (English: processor) to perform some steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (English: Read-Only Memory, abbreviated: ROM), random access memory (English: Random Access Memory, abbreviated: RAM), disk or optical disk and other media that can store program codes.
Claims
1. A texture mapping method, characterized in that: The method comprises: Acquire multiple positions and postures of a first target point on a scanner tracked by a tracking device, wherein the multiple positions and postures are tracking coordinates when the scanner collects multiple frames of three-dimensional data; According to the multiple postures, in a preset tracking coordinate system of the tracking device, the multiple frames of three-dimensional data are stitched together to obtain a three-dimensional geometric model of the target object; Obtaining a texture map of a target object collected by a texture image capturing device; Based on the preset tracking coordinate system, calculating the pose of the texture map to obtain pose information of the texture map in the three-dimensional geometric model; According to the position information of the texture map on the three-dimensional geometric model, the texture map is mapped to the three-dimensional geometric model to obtain a textured three-dimensional model of the target object.
2. The method according to claim 1, characterized in that The step of performing pose calculation on the texture map based on the preset tracking coordinate system to obtain pose information of the texture map on the three-dimensional geometric model includes: Acquire the pose of a second target point on the texture mapping device tracked by the tracking device, where the pose of the second target point is the tracking pose when the texture mapping device collects the texture map; Acquire a first conversion relationship between a target point coordinate system of the second target point and the preset tracking coordinate system; According to a second transformation relationship between the camera coordinate system of the texture image capturing device and the target point coordinate system, and the first transformation relationship, a target transformation relationship from the camera coordinate system to the preset tracking coordinate system is obtained; According to the pose of the texture map in the camera coordinate system, the target transformation relationship is adopted to calculate the pose of the texture map in the preset tracking coordinate system as: pose information of the texture map in the three-dimensional geometric model.
3. The method according to claim 2, characterized in that Before obtaining a target transformation relationship from the camera coordinate system to the preset tracking coordinate system based on the second transformation relationship between the camera coordinate system of the texture image capturing device and the target point coordinate system and the first transformation relationship, the method further includes: The texture imaging device is calibrated to obtain the second conversion relationship.
4. The method according to claim 3, characterized in that The step of calibrating the coordinate system of the texture image capturing device to obtain the second conversion relationship includes: Acquire the position and posture of the first marker point on the preset calibration plate tracked by the tracking device, and the position and posture of the second target point on the texture imaging device; Obtaining a third transformation relationship between the calibration coordinate system of the preset calibration plate and the preset tracking coordinate system according to the position and posture of the first marking point; Obtaining a fourth transformation relationship between the target point coordinate system and the preset tracking coordinate system according to the position and posture of the second target point; Calculating a fifth transformation relationship between the camera coordinate system and the calibration coordinate system according to a preset pose of a second marker point on the preset calibration plate captured by the texture imaging device; The second conversion relationship is calculated according to the third conversion relationship, the fourth conversion relationship and the fifth conversion relationship.
5. The method according to claim 4, characterized in that The calculating, according to the preset pose of the second marker point on the preset calibration plate photographed by the texture imaging device, a fifth transformation relationship between the camera coordinate system and the calibration coordinate system comprises: According to the preset position and posture of the second marker point, the fifth conversion relationship is calculated using a preset spatial resection method.
6. The method according to claim 4, characterized in that The calculating, according to the preset pose of the second marker point on the preset calibration plate photographed by the texture imaging device, a fifth transformation relationship between the camera coordinate system and the calibration coordinate system comprises: Calculating a plurality of the fifth conversion relationships according to the preset positions and poses of the plurality of the second marker points photographed by the texture imaging device; The calculating the second conversion relationship according to the third conversion relationship, the fourth conversion relationship and the fifth conversion relationship includes: The second conversion relationship is obtained by using the least square method to solve the third conversion relationship, the fourth conversion relationship and a plurality of the fifth conversion relationships.
7. A texture mapping device, characterized in that: The device comprises: A first acquisition module, used to acquire multiple positions and postures of a first target point on a scanner tracked by a tracking device, wherein the multiple positions and postures are respectively tracking coordinates when the scanner collects multiple frames of three-dimensional data; A splicing module, configured to splice the multiple frames of three-dimensional data according to the multiple postures in a preset tracking coordinate system of the tracking device to obtain a three-dimensional geometric model of the target object; The second acquisition module is used to acquire the texture map of the target object collected by the texture image capturing device; A calculation module, used for performing pose calculation on the texture map based on the preset tracking coordinate system to obtain pose information of the texture map on the three-dimensional geometric model; A mapping module is used to map the texture map to the three-dimensional geometric model according to the posture information of the texture map on the three-dimensional geometric model to obtain a textured three-dimensional model of the target object.
8. A computer device, characterized in that: include: A processor and a storage medium, wherein the processor and the storage medium are communicatively connected via a bus, the storage medium stores program instructions executable by the processor, and the processor calls the program stored in the storage medium to execute the steps of the texture mapping method as described in any one of claims 1 to 6.
9. A storage medium, characterized in that: The storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the texture mapping method according to any one of claims 1 to 6 are executed.
10. A three-dimensional model acquisition system, characterized in that: The three-dimensional model acquisition system comprises: a computer device, a tracking device, a scanner, and a texture mapping device, wherein the tracking device, the scanner, and the texture mapping device are respectively connected to the computer device for communication, the tracking device is used to track a first target point on the scanner and a second target point on the texture mapping device, the scanner is used to acquire three-dimensional data of a target object, and the texture mapping device is used to acquire a texture map of a target object; The computer device is used to execute the texture mapping method described in any one of claims 1 to 6.
Citation Information
Cited By
Calibration method, tracking type scanning system and storage medium
CN121702278A