Texture mapping method and device of grid model and three-dimensional scanning system
By obtaining multiple texture image sets and determining the grid model area, using texture image sets from different areas for mapping, the problem of poor texture image quality obtained by the 3D scanner's own camera is solved, and the calculation amount and difficulty of texture replacement are reduced. Improved the texture effect of 3D digital models.
Patent Information
- Application Number
- CN202410649783.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-22
- Publication Date
- 2024-09-06
AI Technical Summary
During the real-time scanning process of existing 3D scanners, due to the poor quality of the texture images acquired by the built-in camera, the effect of the texture mapped 3D digital model is not good, and the existing texture replacement method performs texture replacement on the complete mesh model, and calculates The quantity is large and the difficulty is high.
By obtaining multiple texture image sets of the target object, collecting texture images of different devices respectively, determining multiple areas in the grid model, and using different texture image sets for texture mapping according to different areas, the texture mapping of the target object is achieved. .
It reduces the calculation amount and shooting difficulty of texture replacement, improves the efficiency and quality of texture mapping, and solves the problem of poor mapping effect of mesh models.
Smart Images

Figure CN118608672A
Abstract
Description
Technical Field
[0001] The present application relates to the field of image processing technology, and in particular to a texture mapping method and device for a grid model and a three-dimensional scanning system. Background Art
[0002] During real-time scanning, the 3D scanner uses its built-in camera to obtain the image of the object as a texture image set, and implements texture mapping of the object mesh model through a texture mapping algorithm to reconstruct a 3D digital model with realistic textures. Since the 3D scanner's built-in camera obtains the image of the object, different shooting angles will cause the texture image to have reflective areas and color differences due to different fill lights, resulting in poor results of the 3D digital model presented by the mapping. The resolution of the 3D scanner's built-in camera is not high, resulting in poor image quality of the acquired texture image set, which will also result in poor results of the 3D digital model presented by the mapping.
[0003] In this regard, the current practice is to use a third-party image acquisition device with better performance to obtain a high-quality texture image set, perform texture replacement on the texture images in the two image texture sets, and perform texture mapping on the mesh model based on the replaced texture image set.
[0004] The existing mapping method of mapping replacement is to perform mapping replacement on the complete mesh model of the target object. However, mapping replacement on the complete mesh model has relatively high requirements on calculation efficiency and shooting difficulty, which leads to a large amount of calculation for mapping replacement. Summary of the invention
[0005] In this embodiment, a texture mapping method, device and three-dimensional scanning system for a mesh model are provided to solve the problem of large amount of calculation in texture replacement in the prior art.
[0006] In a first aspect, a texture mapping method for a mesh model is provided in this embodiment, the method comprising:
[0007] Obtaining a first mesh model of a target object;
[0008] Acquire multiple texture image sets of the target object; the multiple texture image sets are sets of texture images collected by different devices;
[0009] Determine a plurality of regions in the first grid model; the plurality of regions are texture mapped using different texture image sets;
[0010] The first mesh model is texture mapped according to the multiple texture image sets and the multiple areas.
[0011] In some embodiments, the step of performing texture mapping on the first mesh model according to the plurality of texture image sets and the plurality of regions comprises:
[0012] Obtaining correspondence between multiple texture image sets and multiple regions;
[0013] According to the corresponding relationship, determining a target image set and a target area;
[0014] The target area is texture mapped according to the target image set.
[0015] In some embodiments, the multiple texture image sets include a first texture image set, the multiple regions include a first region, the first texture image set corresponds to the first region, and performing texture mapping on the target region according to the target image set includes:
[0016] Texture mapping is performed on a first area of the first mesh model according to a first texture image set, a first transformation matrix set of the first texture image set relative to the first mesh model, and a first camera parameter set of the first texture image set.
[0017] In some embodiments, the multiple texture image sets include a second texture image set, the multiple regions include a second region, the second texture image set corresponds to the second region, and performing texture mapping on the target region according to the target image set includes:
[0018] Texture mapping is performed on a second area of the first mesh model according to the second texture image set, a second transformation matrix set of the second texture image set relative to the first mesh model, and a second camera parameter set of the second texture image set.
[0019] In some embodiments, the method further comprises:
[0020] Obtaining a first transformation matrix set of the first texture image set relative to the first mesh model;
[0021] Obtain a first camera parameter set of the first texture image set;
[0022] performing image matching on the second texture image set and the first texture image set;
[0023] A second transformation matrix set of the second texture image set relative to the first mesh model and a second camera parameter set of the second texture image set are determined according to the matching result, the first transformation matrix set and the first camera parameter set.
[0024] In some embodiments, the method further comprises:
[0025] The second area is determined according to the user's selection.
[0026] In some embodiments, the step of performing texture mapping on the first mesh model according to the plurality of texture image sets and the plurality of regions comprises:
[0027] The multiple regions are globally calibrated to obtain a texture mapping image of the first mesh model.
[0028] In a second aspect, a texture mapping device for a mesh model is provided in this embodiment, and the device includes:
[0029] A mesh model acquisition module, used to acquire a first mesh model of a target object;
[0030] A texture image acquisition module, used to acquire multiple texture image sets of the target object; the multiple texture image sets are collections of texture images collected by different devices;
[0031] A determination module, used for determining a plurality of regions in the first grid model; the plurality of regions are texture mapped using different texture image sets;
[0032] A mapping module is used to perform texture mapping on the first mesh model according to the multiple texture image sets and multiple areas.
[0033] In a third aspect, in this embodiment, a three-dimensional scanning system is provided, the system comprising: a first three-dimensional scanning device, an image acquisition device, and a processor;
[0034] The first three-dimensional scanning device is used to scan the target object to obtain a first mesh model, a first texture image set, and a first transformation matrix set of the first texture image set relative to the first mesh model;
[0035] The image acquisition device is used to acquire a second texture image set;
[0036] The processor is configured to run a computer program to execute the texture mapping method for a mesh model according to the first aspect.
[0037] In a fourth aspect, a three-dimensional scanning system is provided in this embodiment, the system comprising: a first three-dimensional scanning device, a second three-dimensional scanning device, an image acquisition device, and a processor;
[0038] The first three-dimensional scanning device is used to scan the target object to obtain a second mesh model, a first texture image set, and a third transformation matrix set of the first texture image set relative to the second mesh model;
[0039] The second three-dimensional scanning device is used to scan the target object to obtain a first grid model;
[0040] The image acquisition device is used to acquire a second texture image set;
[0041] The processor determines a first transformation matrix set of the first texture image set relative to the first mesh model based on the third transformation matrix set and the transformation matrices of the first mesh model and the second mesh model, and the processor is also configured to run a computer program to execute the texture mapping method for the mesh model described in the first aspect.
[0042] In a fifth aspect, in this embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the texture mapping method for the mesh model described in the first aspect are implemented.
[0043] Compared with the prior art, the present embodiment provides a method, device, three-dimensional scanning system and computer-readable storage medium for texture mapping of a grid model, which obtains multiple texture image sets of a target object; the multiple texture image sets are sets of texture images collected by different devices; multiple regions in a first grid model are determined; different texture image sets are used for texture mapping of the multiple regions; and the first grid model is texture mapped according to the multiple texture image sets and the multiple regions. Different texture image sets are used for texture mapping of different regions, which solves the problem that the existing mapping method of texture replacement is to perform texture replacement on the complete grid model of the target object, but the mapping replacement of the complete grid model has relatively high requirements on the calculation efficiency and shooting difficulty, which leads to the problem of large amount of calculation for the mapping replacement.
[0044] Details of one or more embodiments of the present application are set forth in the following drawings and description to make other features, objects, and advantages of the present application more readily apparent. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0046] Figure 1 It is a hardware structure block diagram of a terminal for executing a texture mapping method for a grid model according to an embodiment of the present application;
[0047] Figure 2 is a flow chart of a texture mapping method for a mesh model in an embodiment of the present application;
[0048] Figure 3is a flow chart of performing texture mapping on a first mesh model according to multiple texture image sets and multiple regions in an embodiment of the present application;
[0049] Figure 4 is a flow chart of another method for texture mapping of a mesh model according to an embodiment of the present application;
[0050] Figure 5 is a flow chart of another method for texture mapping of a mesh model according to an embodiment of the present application;
[0051] Figure 6 is a structural schematic diagram of a three-dimensional scanning system according to an embodiment of the present application;
[0052] Figure 7 is a structural schematic diagram of another three-dimensional scanning system according to an embodiment of the present application;
[0053] Figure 8 It is a structural block diagram of a texture mapping device for a grid model in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to more clearly understand the purpose, technical solutions and advantages of the present application, the present application is described and illustrated below in conjunction with the accompanying drawings and embodiments.
[0055] Unless otherwise defined, the technical terms or scientific terms involved in this application shall have the general meaning understood by people with ordinary skills in the technical field to which this application belongs. The words "one", "a", "a", "the", "these" and the like in this application do not represent quantitative restrictions, and they can be singular or plural. The terms "include", "comprise", "have" and any variants thereof involved in this application are intended to cover non-exclusive inclusions; for example, a process, method and system, product or device comprising a series of steps or modules (units) is not limited to the listed steps or modules (units), but may include unlisted steps or modules (units), or may include other steps or modules (units) inherent to these processes, methods, products or devices. The words "connect", "connected", "coupled" and the like involved in this application are not limited to physical or mechanical connections, but may include electrical connections, whether directly or indirectly. The "multiple" involved in this application refers to two or more. "And / or" describes the association relationship of associated objects, indicating that there can be three relationships. For example, "A and / or B" can mean: A exists alone, A and B exist at the same time, and B exists alone. Usually, the character " / " indicates that the objects associated with each other are in an "or" relationship. The terms "first", "second", "third", etc. involved in this application are only used to distinguish similar objects and do not represent a specific ordering of the objects.
[0056] The method embodiment provided in this embodiment can be executed in a terminal, a computer or a similar computing device. For example, running on a terminal, Figure 1 1 is a hardware structure block diagram of a terminal for executing a texture mapping method for a mesh model according to an embodiment of the present application. Figure 1 As shown, the terminal may include one or more ( Figure 1 Only one is shown in the figure) processor 102 and memory 104 for storing data, wherein processor 102 may include but is not limited to a processing device such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device 106 and an input and output device 108 for communication functions. It can be understood by those skilled in the art that Figure 1 The structure shown is for illustration only and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0057] The memory 104 can be used to store computer programs, for example, software programs and modules of application software, such as a computer program corresponding to a texture mapping method of a grid model in this embodiment. The processor 102 executes various functional applications and data processing by running the computer program stored in the memory 104, that is, to implement the above method. The memory 104 may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory 104 may further include a memory remotely arranged relative to the processor 102, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0058] The transmission device 106 is used to receive or send data via a network. The above network includes a wireless network provided by the communication provider of the terminal. In one example, the transmission device 106 includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device 106 can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0059] This embodiment provides a texture mapping method for a mesh model. Figure 2 is a flow chart of a texture mapping method for a mesh model in an embodiment of the present application, such as Figure 2 As shown, the process includes the following steps:
[0060] Step S210, obtaining a first mesh model of the target object.
[0061] In this step, the processor obtains a first mesh model of the target object. Here, the target object is an object to be texture mapped. The processor here may be a processor of a three-dimensional scanning system, and the three-dimensional scanning system includes a three-dimensional scanning device. The three-dimensional scanning device performs a three-dimensional scan on the target object, obtains a first mesh model of the target object, and sends the first mesh model to the processor. The processor here may also be a processor independent of the three-dimensional scanning system, and the three-dimensional scanning system sends the obtained first mesh model of the target object to a processor independent of the three-dimensional scanning system. The processor may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA.
[0062] Step S220, obtaining multiple texture image sets of the target object; the multiple texture image sets are collections of texture images collected by different devices.
[0063] In this step, the processor acquires multiple texture image sets of the target object, and the multiple texture image sets are sets of texture images collected by different devices. The multiple texture image sets are acquired by using multiple different image acquisition devices. For example, if the multiple texture image sets include 4 texture image sets, 4 texture image sets are acquired by using 4 different image acquisition devices. If the multiple texture image sets include 5 texture image sets, 5 texture image sets are acquired by using 5 different image acquisition devices. No specific limitation is made here. Taking the multiple texture image sets including the first texture image set and the second texture image set as an example, the first texture image set and the second texture image set of the target object are acquired, wherein the first texture image set and the second texture image set are sets of texture images collected by different devices. The first texture image set and the second texture image set here can be sets of texture images with different image qualities or image resolutions, and the first texture image set and the second texture image set can also be sets of texture images at different angles of the target object or different areas of the target object. Different texture image sets are acquired through different devices, such as using an image acquisition device of a three-dimensional scanning system and a three-dimensional scanning device of the three-dimensional scanning system to acquire a texture image set of a target object to generate a first texture image set and a second texture image set; or using two different image acquisition devices of a three-dimensional scanning system to acquire a texture image set of a target object to generate a first texture image set and a second texture image set.
[0064] Step S230, determining a plurality of regions in the first mesh model; and using different texture image sets for texture mapping of the plurality of regions.
[0065] In this step, the processor determines multiple regions in the first grid model. During the three-dimensional scanning process, the grid model of the target object is acquired by the three-dimensional scanning device, and the texture image of the target object is acquired by using the image acquisition function of the three-dimensional scanning device or an image acquisition device independent of the three-dimensional scanning device to generate multiple texture image sets. The multiple regions here can be understood as the grid regions to be processed in the first grid model, and the grid regions to be processed can be the grid regions to be mapped or the grid regions to be replaced.
[0066] Step S240: performing texture mapping on the first mesh model according to the multiple texture image sets and the multiple regions.
[0067] In this step, the processor performs texture mapping on the first mesh model according to multiple texture image sets and multiple regions. According to the correspondence between the texture image sets and the mesh regions to be processed, the texture image sets corresponding to each of the multiple regions are determined, and the texture image sets corresponding to each region are used to perform texture mapping on the corresponding regions, thereby completing the texture mapping of the first mesh model of the target object. The correspondence between the texture image sets and the mesh regions to be processed here can be determined according to the user's input, or can be determined according to the characteristics of the target object, and is not specifically limited here.
[0068] In some of the embodiments, the multiple texture image sets include a first texture image set and a second texture image set, the multiple regions include a first region and a second region, the first texture image set corresponds to the first region, and the second texture image set corresponds to the second region. When the first mesh model has not been texture mapped, the first region of the first mesh model can be texture mapped using the first texture image set, and the second region of the first mesh model can be texture mapped using the second texture image set. When the first mesh model has been texture mapped, the texture mapping effect is not good or the user has proposed a replacement requirement for the mapping of a specific region among the multiple regions, the first region of the first mesh model can be texture replaced using the first texture image set, or the second region of the first mesh model can be texture replaced using the second texture image set.
[0069] Through the above steps, multiple texture image sets of the target object are obtained; the multiple texture image sets are sets of texture images collected by different devices; multiple regions in the first grid model are determined; different texture image sets are used for texture mapping in the multiple regions; and the first grid model is texture mapped according to the multiple texture image sets and the multiple regions. Using different texture image sets for texture mapping in different regions solves the problem that the existing mapping method of mapping replacement is to perform mapping replacement on the complete grid model of the target object, but mapping replacement on the complete grid model has relatively high requirements on calculation efficiency and shooting difficulty, which leads to the problem of large amount of calculation for mapping replacement.
[0070] In some of the embodiments, Figure 3 As shown, step S240, performing texture mapping on the first mesh model according to the multiple texture image sets and the multiple regions, includes the following steps:
[0071] Step S310: Obtaining a correspondence between a plurality of texture image sets and a plurality of regions.
[0072] Among them, the correspondence between multiple texture image sets and multiple regions can be preset by the user, or can be set by the processor according to the image quality of the texture image set, or can be set by the processor according to the characteristics of the target object, or can be set by the processor according to the parameters of the device for collecting texture images and the characteristics of the target object, or can be set by the processor according to the image quality of the texture image set and the characteristics of the target object. If the multiple regions include the front area of the target object, the processor sets the multiple texture image sets including the texture image set with image quality higher than the preset value and the front area of the target object into a correspondence relationship, that is, the front area of the target object needs to use the texture image set with image quality higher than the preset value for mapping or mapping replacement.
[0073] Step S320: determining a target texture image set and a target area according to the corresponding relationship.
[0074] It should be noted that, when multiple texture image sets include a first texture image set and a second texture image set, and multiple regions include a first region and a second region, the correspondence is that the first texture image set corresponds to the first region and the second texture image set corresponds to the second region. Then, when the first texture image set is determined as the target texture image set, the corresponding first region is determined as the target region, and when the second texture image set is determined as the target texture image set, the corresponding second region is determined as the target region. Continuing to refer to the example in step S310, the processor sets multiple texture image sets including a texture image set with an image quality higher than a preset value and a front region of the target object as a correspondence, and the processor determines the front region of the target object as the target region, and determines the texture image set with an image quality higher than the preset value as the target texture image set.
[0075] Step S330: texture mapping the target area according to the target texture image set.
[0076] In this step, the processor performs texture mapping on the target area according to the target texture image set.
[0077] In this embodiment, a target texture image set and a target area are determined according to the correspondence between multiple texture image sets and multiple areas, and texture mapping is performed on the target area according to the target texture image set. Different texture image sets are used for texture mapping in different areas, which solves the problem that the existing mapping method of mapping replacement is to perform mapping replacement on the complete mesh model of the target object, but mapping replacement on the complete mesh model has relatively high requirements on calculation efficiency and shooting difficulty, thereby resulting in a large amount of calculation for mapping replacement.
[0078] In some of the embodiments, a first region of the first mesh model is texture mapped based on a first texture image set, a first transformation matrix set of the first texture image set relative to the first mesh model, and a first camera parameter set of the first texture image set.
[0079] In some of the embodiments, a second region of the first mesh model is texture mapped based on a second texture image set, a second transformation matrix set of the second texture image set relative to the first mesh model, and a second camera parameter set of the second texture image set.
[0080] In some of the embodiments, Figure 4 As shown, the texture mapping method of the mesh model also includes the following steps:
[0081] Step S410: Obtain a first transformation matrix set of a first texture image set relative to a first mesh model.
[0082] Step S420: Obtain a first camera parameter set of a first texture image set.
[0083] Among them, the first camera parameter set is the camera parameter of the device obtained for obtaining the first texture image set. The camera parameters include camera intrinsic parameters and camera extrinsic parameters. The camera intrinsic parameters are the internal parameters of the camera. The camera intrinsic parameters include exposure, distortion, white balance, focal length, depth of field, the position of the principal point p, and the size ratio of the pixel to the real environment. Camera extrinsic parameters refer to parameters that are not related to the internal software / hardware configuration of the camera. These parameters include but are not limited to the spatial position of the camera, the rotation direction of the camera, the rotation matrix R and the translation matrix T, etc. The camera extrinsic parameters can be obtained by calibration.
[0084] Step S430: performing image matching on the second texture image set and the first texture image set.
[0085] The second texture image set and the first texture image set are image matched to obtain the second texture image set that needs to be replaced and the images that need to be replaced in the first texture image set.
[0086] Step S440: Determine a second camera parameter set for the second texture image set relative to a second transformation matrix set and a second texture image set of the first mesh model according to the matching result, the first transformation matrix set and the first camera parameter set.
[0087] Among them, the images in the second texture image set are subjected to texture feature recognition and matching with the images in the first texture image set, and the pose matrix set of the images in the second texture image set and the corresponding images in the first texture image set is calculated. Assuming that N images in the second texture image set are successfully matched with the images in the first texture image set (N images in the second texture image set are matched to the images in the first texture image set, and successfully), these N images are used as the first target images, and the pose matrix set of the N first target images in the second texture image set relative to the first mesh model is calculated, that is, the second transformation matrix set and the second camera parameter set.
[0088] In some of the embodiments, the texture mapping method for the mesh model further includes: determining a second area according to a user's selection.
[0089] In this embodiment, a mesh area to be replaced is manually selected from the first mesh model, and the mesh area to be replaced is used as the second area, thereby determining the second area and replacing the original texture image of the second area with a texture image in the second texture image set.
[0090] In some of the embodiments, texture mapping is performed on the first mesh model according to the multiple texture image sets and the multiple regions, including: globally calibrating the multiple regions to obtain a texture mapping image of the first mesh model.
[0091] In this embodiment, operations such as global color calibration are performed on multiple regions or multiple texture image sets corresponding to the multiple regions to obtain a final texture mapping image, thereby improving the mapping quality.
[0092] This embodiment also provides a texture mapping method for a mesh model. Figure 5 is a flowchart of another method for texture mapping of a mesh model according to an embodiment of the present application. Figure 5 As shown, the process includes the following steps:
[0093] Step S510, importing a first texture image set, a first conversion matrix set, a first camera parameter set, and a model file of a first mesh model.
[0094] The processor is connected to the three-dimensional scanning device, and after the three-dimensional scanning device scans the target object, it generates a first texture image set, a first conversion matrix set, a first camera parameter set, and a model file of the first mesh model, and the processor imports the model file of the first texture image set, the first conversion matrix set, the first camera parameter set, and the first mesh model from the three-dimensional scanning device. The first conversion matrix set is a set of conversion matrices of the texture images in the first texture image set relative to the first mesh model. The first camera parameter set is a set of camera parameters of the three-dimensional scanning device.
[0095] Step S520: importing a second texture image set.
[0096] The processor is connected to an image acquisition device, and the image acquisition device acquires images of the target object to generate a second texture image set. The processor imports the second texture image set from the image acquisition device. The first texture image set may be a low-resolution image set, and the second texture image set may be a high-definition image set.
[0097] Step S530: selecting a mesh area to be replaced for the first mesh model.
[0098] The mesh area to be replaced can be manually selected for the first mesh model, such as the selected mesh area is recorded as the second area and the second texture image set is used for texture mapping or texture replacement, and the unselected mesh area is recorded as the first area and the first texture image set is used for texture mapping or texture replacement.
[0099] Step S540: using the second texture image set to replace the first texture image set according to the texture replacement method, and calculating a second conversion matrix set and a second camera parameter set.
[0100] Among them, the images in the second texture image set are subjected to texture feature recognition and matching with the images in the first texture image set, and the pose matrix set of the images in the second texture image set and the corresponding images in the first texture image set is calculated. Assuming that N images in the second texture image set are successfully matched with the images in the first texture image set (N images in the second texture image set are matched to the images in the first texture image set, and successfully), these N images are used as the first target images, and the pose matrix set of the N first target images in the second texture image set relative to the first grid model, i.e., the second transformation matrix set and the second camera parameter set, are calculated. The second transformation matrix set is a set of transformation matrices of the texture images in the second texture image set relative to the first grid model. The second camera parameter set is a set of camera parameters of the image acquisition device. The second camera parameter set can also be generated when the image acquisition device acquires images of the target object.
[0101] Step S550: Use the second texture image set, the second conversion matrix set, and the second camera parameter set to perform texture mapping on the second area.
[0102] Among them, the second texture image set, the second transformation matrix set, and the second camera parameter set are used to perform visibility judgment, best view selection and other operations in the texture mapping step on the second area of the first mesh model, and the second area of the first mesh model is controlled to only be able to perform image mapping selection in the second texture image set.
[0103] Step S560: Use the first texture image set, the first conversion matrix set, and the first camera parameter set to perform texture mapping on the first area.
[0104] Among them, the first texture image set, the first transformation matrix set, and the first camera parameter set are used to perform visibility judgment, best view selection and other operations in the texture mapping step on the first area, and the first area of the first mesh model is controlled to only be able to perform image mapping selection in the first texture image set.
[0105] The texture mapping step is generally divided into visibility judgment, weight calculation of patches or vertices, initialization calculation of the best view, optimization of the best view, vertex global color calibration, image color calibration, edge gap color calibration, etc. Compared with the traditional method, in step S550 and step S560, the grid is divided into the second area and the first area, and the grids in different parts perform visibility judgment, patch or vertex weight calculation, initialization calculation of the best view, and optimization of the best view for different input image sets to ensure that the patches in the second area can only select images in the second texture image set, and the patches in the first area can only select images in the first texture image set, so as to achieve the effect of mapping the grids in different areas with different image data sets.
[0106] Step S570: performing global color calibration and other operations on the first region and the second region together to obtain a final texture mapping image of the first mesh model.
[0107] The third party high-resolution image set includes a second texture image set, a second transformation matrix set relative to the first mesh model, and a second camera parameter set for each image in the second texture image set. The low-resolution image set includes a first texture image set, a first transformation matrix set relative to the first mesh model, and a first camera parameter set for each image in the first texture image set. The first texture image set can be a data set obtained by scanning the first mesh model with a 3D scanning device or a 3D scanner.
[0108] This embodiment uses local texture replacement. The success rate, robustness and efficiency of local texture replacement are significantly higher than those of the complete object. Some areas that cannot be replaced or are unimportant use the original texture to ensure the fine texture of the main area and the texture integrity of the complete data. If all replacement textures are used, some areas may not be replaced successfully or the replacement effect is very poor, resulting in poor texture effect of the complete model. This embodiment also provides a three-dimensional scanning system. Figure 6 is a schematic diagram of the structure of a three-dimensional scanning system according to an embodiment of the present application. Figure 6 As shown, the system includes: a first three-dimensional scanning device 610, an image acquisition device 620 and a processor 102, and the first three-dimensional scanning device 610 and the image acquisition device 620 are connected to the processor 102 respectively. The first three-dimensional scanning device 610 is used to scan the target object to obtain a first grid model, a first texture image set, and a first transformation matrix set between the first texture image in the first texture image set and the first grid model; the image acquisition device 620 is used to acquire a second texture image and generate a second texture image set; the processor 102 is configured to run a computer program to execute the texture mapping method of the grid model in the aforementioned embodiment. Among them, the first three-dimensional scanning device 610 includes but is not limited to a handheld three-dimensional scanner, a tracking three-dimensional scanner, etc., which has a built-in camera, and can obtain the first grid model of the target object, the first texture image set, and the first transformation matrix set between the first texture image in the first texture image set and the first grid model in real time when the first three-dimensional scanning device 610 scans the target object. During the scanning process, the camera of the first three-dimensional scanning device 610 captures one or more first texture images under each corresponding camera parameter, and the collection of all first texture images and camera parameters is the first texture image set and the first camera parameter set. The image acquisition device 620 is a device such as a mobile phone or a professional camera that can obtain high-quality images. The image acquisition device 620 takes one or more second texture images under each corresponding camera parameter. The collection of all second texture images and camera parameters is the second texture image set and the second camera parameter set.
[0109] The three-dimensional scanning system provided in this embodiment obtains multiple texture image sets of the target object; the multiple texture image sets are sets of texture images collected by different devices; multiple regions in the first grid model are determined; different texture image sets are used for texture mapping in the multiple regions; and texture mapping is performed on the first grid model according to the multiple texture image sets and the multiple regions. Different texture image sets are used for texture mapping in different regions, which solves the problem that the existing mapping method of mapping replacement is to perform mapping replacement on the complete grid model of the target object, but mapping replacement on the complete grid model has relatively high requirements on calculation efficiency and shooting difficulty, which leads to the problem of large amount of calculation for mapping replacement.
[0110] This embodiment also provides a three-dimensional scanning system. Figure 7 is a schematic diagram of the structure of another three-dimensional scanning system according to an embodiment of the present application. Figure 7 As shown, the system includes: a first three-dimensional scanning device 610, a second three-dimensional scanning device 630, an image acquisition device 620 and a processor 102, and the first three-dimensional scanning device 610, the second three-dimensional scanning device 630, and the image acquisition device 620 are respectively connected to the processor 102.
[0111] The first three-dimensional scanning device 610 is used to scan the target object to obtain the second mesh model, the first texture image set, and the third conversion matrix set between the first texture image in the first texture image set and the second mesh model; the second three-dimensional scanning device 630 is used to scan the target object to obtain the first mesh model; the image acquisition device 620 is used to acquire the second texture image and generate the second texture image set; the processor determines the first conversion matrix set of the first texture image set relative to the first mesh model according to the third conversion matrix set and the conversion matrix of the first mesh model and the second mesh model, and the processor 102 is configured to run a computer program to execute the texture mapping method of the mesh model in the aforementioned embodiment. The processor first calculates the conversion matrix between the first mesh model and the second mesh model, recorded as the fourth conversion matrix, and then determines the first conversion matrix set of the first texture image set relative to the first mesh model according to the fourth matrix and the third conversion matrix set. Here, the fourth conversion matrix is the conversion matrix between the first grid model and the second grid model. For example, the fourth conversion matrix can be calculated by manual N-point alignment and ICP (Iterative Closest Point) fine registration, or by automatic grid feature extraction and matching for rough registration and ICP fine registration. The first three-dimensional scanning device 610 includes but is not limited to a handheld three-dimensional scanner, a tracking three-dimensional scanner, etc., which has a built-in camera, and can obtain the second grid model of the target object, the first texture image set, and the first texture image in the first texture image set and the third conversion matrix set of the second grid model in real time when the first three-dimensional scanning device 610 scans the target object. During the scanning process, the camera of the first three-dimensional scanning device 610 captures one or more first texture images under each corresponding camera parameter, and the collection of all first texture images and camera parameters is the first texture image set and the first camera parameter set. The second three-dimensional scanning device 630 includes but is not limited to a handheld three-dimensional scanner, a tracking three-dimensional scanner, etc., when the first three-dimensional scanning device 610 scans the target object, obtains the first grid model of the target object. The first grid model has better local details than the second grid model. The image acquisition device 620 is a device such as a mobile phone or a professional camera that can obtain high-quality images. The image acquisition device 620 takes one or more second texture images under each corresponding camera parameter. The collection of all second texture images and camera parameters is the second texture image set and the second camera parameter set.
[0112] The three-dimensional scanning system provided in this embodiment obtains multiple texture image sets of the target object; the multiple texture image sets are sets of texture images collected by different devices; multiple regions in the first grid model are determined; different texture image sets are used for texture mapping in the multiple regions; and texture mapping is performed on the first grid model according to the multiple texture image sets and the multiple regions. Different texture image sets are used for texture mapping in different regions, which solves the problem that the existing mapping method of mapping replacement is to perform mapping replacement on the complete grid model of the target object, but mapping replacement on the complete grid model has relatively high requirements on calculation efficiency and shooting difficulty, which leads to the problem of large amount of calculation for mapping replacement.
[0113] It should be noted that the steps shown in the above process or the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0114] In this embodiment, a texture mapping device for a grid model is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated hereafter. The terms "module", "unit", "subunit", etc. used below can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.
[0115] Figure 8 is a structural block diagram of a texture mapping device for a grid model in an embodiment of the present application, such as Figure 8 As shown, the device comprises:
[0116] A mesh model acquisition module 810 is used to acquire a first mesh model of a target object;
[0117] The texture image acquisition module 820 is used to acquire multiple texture image sets of the target object; the multiple texture image sets are sets of texture images collected by different devices;
[0118] A determination module 830 is used to determine a plurality of regions in the first grid model; the plurality of regions are texture mapped using different texture image sets;
[0119] The mapping module 840 is used to perform texture mapping on the first mesh model according to the multiple texture image sets and the multiple areas.
[0120] In some of the embodiments, the mapping module 840 is further used to: obtain the correspondence between multiple texture image sets and multiple regions; determine the target image set and the target region according to the correspondence; and perform texture mapping on the target region according to the target image set.
[0121] In some of the embodiments, the multiple texture image sets include a first texture image set, the multiple regions include a first region, and the mapping module 840 is further used to: perform texture mapping on the first region of the first mesh model according to the first texture image set, a first transformation matrix set of the first texture image set relative to the first mesh model, and a first camera parameter set of the first texture image set.
[0122] In some of the embodiments, the multiple texture image sets include a second texture image set, the multiple regions include a second region, the second texture image set corresponds to the second region, and the mapping module 840 is further used to: perform texture mapping on the second region of the first mesh model according to the second texture image set, a second transformation matrix set of the second texture image set relative to the first mesh model, and a second camera parameter set of the second texture image set.
[0123] In some of the embodiments, the device includes a matching module, which is used to obtain a first transformation matrix set of the first texture image set relative to the first mesh model; obtain a first camera parameter set of the first texture image set; perform image matching on the second texture image set and the first texture image set; and determine a second transformation matrix set of the second texture image set relative to the first mesh model and a second camera parameter set of the second texture image set based on the matching result, the first transformation matrix set and the first camera parameter set.
[0124] In some of the embodiments, the mapping module 840 is further used to: perform global calibration on the multiple regions to obtain a texture mapping image of the first mesh model.
[0125] It should be noted that the above modules can be functional modules or program modules, and can be implemented by software or hardware. For modules implemented by hardware, the above modules can be located in the same processor; or the above modules can be located in different processors in any combination.
[0126] In this embodiment, an electronic device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor is configured to run the computer program to execute the steps in any one of the above method embodiments.
[0127] Optionally, the electronic device may further include a transmission device and an input / output device, wherein the transmission device is connected to the processor, and the input / output device is connected to the processor.
[0128] Optionally, in this embodiment, the processor may be configured to perform the following steps through a computer program:
[0129] S1, obtaining a first mesh model of a target object;
[0130] S2, obtaining a plurality of texture image sets of the target object; the plurality of texture image sets are sets of texture images collected by different devices;
[0131] S3, determining a plurality of regions in the first grid model; the plurality of regions are texture mapped using different texture image sets;
[0132] S4: Perform texture mapping on the first mesh model according to the multiple texture image sets and the multiple areas.
[0133] It should be noted that the specific examples in this embodiment can refer to the examples described in the above embodiments and optional implementation modes, and will not be repeated in this embodiment.
[0134] In addition, in combination with the texture mapping method for the mesh model provided in the above embodiments, a storage medium can also be provided in this embodiment to implement the method. The storage medium stores a computer program; when the computer program is executed by a processor, any of the texture mapping methods for the mesh model in the above embodiments is implemented.
[0135] It should be understood that the specific embodiments described herein are only used to explain the application, rather than to limit it. Based on the embodiments provided in this application, all other embodiments obtained by ordinary technicians in this field without creative work are within the protection scope of this application.
[0136] Obviously, the drawings are only some examples or embodiments of the present application. For ordinary technicians in the field, the present application can also be applied to other similar situations based on these drawings without creative work. In addition, it is understandable that although the work done in this development process may be complicated and lengthy, for ordinary technicians in the field, certain changes in design, manufacturing or production based on the technical content disclosed in this application are only conventional technical means and should not be regarded as insufficient content disclosed in this application.
[0137] The term "embodiment" in this application refers to a specific feature, structure or characteristic described in conjunction with the embodiment that can be included in at least one embodiment of the present application. The appearance of this phrase in various locations in the specification does not necessarily mean the same embodiment, nor does it mean that it is mutually exclusive with other embodiments and is independent or optional. It is clearly or implicitly understood by those of ordinary skill in the art that the embodiments described in this application can be combined with other embodiments without conflict.
[0138] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of patent protection. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the scope of protection of the present application. Therefore, the scope of protection of the present application shall be subject to the attached claims.
Claims
1. A texture mapping method for a mesh model, characterized in that: The method comprises: Obtaining a first mesh model of a target object; Acquire multiple texture image sets of the target object; the multiple texture image sets are sets of texture images collected by different devices; Determine a plurality of regions in the first grid model; the plurality of regions are texture mapped using different texture image sets; The first mesh model is texture mapped according to the multiple texture image sets and the multiple areas.
2. The texture mapping method for a mesh model according to claim 1, characterized in that: The step of performing texture mapping on the first mesh model according to the plurality of texture image sets and the plurality of regions comprises: Obtaining correspondence between multiple texture image sets and multiple regions; According to the corresponding relationship, determining a target image set and a target area; The target area is texture mapped according to the target image set.
3. The texture mapping method for a mesh model according to claim 2, characterized in that: The multiple texture image sets include a first texture image set, the multiple regions include a first region, the first texture image set corresponds to the first region, and performing texture mapping on the target region according to the target image set includes: Texture mapping is performed on a first area of the first mesh model according to a first texture image set, a first transformation matrix set of the first texture image set relative to the first mesh model, and a first camera parameter set of the first texture image set.
4. The texture mapping method for a mesh model according to claim 2, characterized in that: The multiple texture image sets include a second texture image set, the multiple regions include a second region, the second texture image set corresponds to the second region, and performing texture mapping on the target region according to the target image set includes: Texture mapping is performed on a second area of the first mesh model according to the second texture image set, a second transformation matrix set of the second texture image set relative to the first mesh model, and a second camera parameter set of the second texture image set.
5. The texture mapping method for a mesh model according to claim 3 or 4, characterized in that: The method further comprises: Obtaining a first transformation matrix set of the first texture image set relative to the first mesh model; Obtain a first camera parameter set of the first texture image set; performing image matching on the second texture image set and the first texture image set; A second transformation matrix set of the second texture image set relative to the first mesh model and a second camera parameter set of the second texture image set are determined according to the matching result, the first transformation matrix set and the first camera parameter set.
6. The texture mapping method for a mesh model according to claim 5, characterized in that: The method further comprises: The second area is determined according to the user's selection.
7. The texture mapping method for a mesh model according to claim 1, characterized in that: The step of performing texture mapping on the first mesh model according to the plurality of texture image sets and the plurality of regions comprises: The multiple regions are globally calibrated to obtain a texture mapping image of the first mesh model.
8. A texture mapping device for a mesh model, characterized in that: The device comprises: A mesh model acquisition module, used to acquire a first mesh model of a target object; A texture image acquisition module, used to acquire multiple texture image sets of the target object; the multiple texture image sets are collections of texture images collected by different devices; A determination module, used for determining a plurality of regions in the first grid model; the plurality of regions are texture mapped using different texture image sets; A mapping module is used to perform texture mapping on the first mesh model according to the multiple texture image sets and multiple areas.
9. A three-dimensional scanning system, characterized in that: The system comprises: a first three-dimensional scanning device, an image acquisition device and a processor; The first three-dimensional scanning device is used to scan the target object to obtain a first mesh model, a first texture image set, and a first transformation matrix set of the first texture image set relative to the first mesh model; The image acquisition device is used to acquire a second texture image set; The processor is configured to run a computer program to execute the texture mapping method for a mesh model according to any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the texture mapping method for a mesh model according to any one of claims 1 to 7 are implemented.
