Texture image replacement method and device, electronic equipment and storage medium
By matching and transforming the low-definition texture images of the three-dimensional model in the handheld three-dimensional scanner device with the high-definition texture images, the problem of low resolution of the built-in color camera in the device is solved, efficient and low-cost texture image replacement is achieved, and the display effect of the three-dimensional model is improved.
Patent Information
- Application Number
- CN202411799499.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-09
- Publication Date
- 2025-04-11
- Estimated Expiration
- 2044-12-09
AI Technical Summary
The existing handheld 3D scanner devices have low built-in color cameras that cannot meet the needs of users with high texture requirements. Existing solutions such as hardware upgrades or manual processing are cost-effective and inefficient.
By obtaining the low-definition texture image set from the three-dimensional model of the target object and matching it with the high-definition texture image set, determining and applying the transformation relationship for image transformation, replacing the low-definition texture image in the three-dimensional model as a new high-definition texture image.
It realizes automatic replacement of low-resolution texture maps of three-dimensional models with high-resolution texture maps, simplifies the replacement process of model textures, improves processing efficiency and reduces costs.
Smart Images

Figure CN119810389A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of image processing technology, and in particular to a texture image replacement method, device, electronic device and storage medium. Background Art
[0002] When using a handheld 3D scanner, users will collect geometric data of objects and rich color information on the surface of objects. When the data is post-processed after scanning, these rich color information will be attached to the surface of the geometric model in the form of texture images to make the details of the 3D model clearer and more realistic. However, the color cameras integrated in the handheld 3D scanners often have low resolutions and cannot meet the needs of some customers with high texture requirements. There are two solutions to this user demand: one is to equip the device with a high-definition camera or upgrade the hardware separately according to the specific needs of the user, but this method will not only increase the cost of the equipment, but also require recalibration for upgrading the hardware separately, resulting in cumbersome use of the equipment and low efficiency. Another way is to manually process each low-resolution texture image collected to obtain the corresponding high-resolution texture image, but this method requires professional processing and has high labor costs. Summary of the invention
[0003] In view of this, an object of the present invention is to provide a texture image replacement method, device, electronic device and storage medium.
[0004] In order to achieve the above object, the technical solution adopted by the present invention is as follows:
[0005] In a first aspect, the present invention provides a texture image replacement method, the texture image replacement method comprising:
[0006] Obtain a set of low-resolution texture images from a three-dimensional model of a target object;
[0007] Acquire a collected high-definition texture image set of the target object, and detect the high-definition texture image set;
[0008] When the high-definition texture image set passes the detection, the high-definition texture image set is matched with the low-definition texture image set to obtain a high-definition texture image matched with each low-definition texture image;
[0009] For each of the low-definition texture images, determining a conversion relationship between the low-definition texture image and a matching high-definition texture image, and performing image transformation on the matching high-definition texture image according to the conversion relationship to obtain a new high-definition texture image matched by the low-definition texture image;
[0010] Each of the low-definition texture images in the three-dimensional model is replaced with a new high-definition texture image that matches it to obtain a new three-dimensional model.
[0011] In an optional implementation, the step of detecting the high-definition texture image set includes:
[0012] comparing the total number of first images in the high-definition texture image set with the total number of second images in the low-definition texture image set;
[0013] When the total number of the first images is less than the total number of the second images, determining that the high-definition texture image set fails the detection;
[0014] When the total number of the first images is greater than or equal to the total number of the second images, checking detailed information of each high-definition texture image in the high-definition texture image set;
[0015] If the detailed information of any high-definition texture image does not include the shooting time, it is determined that the high-definition texture image set has failed the detection;
[0016] If the detailed information of all high-definition texture images includes the shooting time, it is determined that the high-definition texture image set passes the detection.
[0017] In an optional implementation, the step of matching the high-definition texture image set with the low-definition texture image set to obtain a high-definition texture image matched with each low-definition texture image comprises:
[0018] For each low-definition texture image in the low-definition texture image set, selecting each candidate high-definition texture image of the low-definition texture image from the high-definition texture image set according to the acquisition order of the low-definition texture images;
[0019] From all candidate high-definition texture images, a high-definition texture image that matches the low-definition texture image is selected to obtain a high-definition texture image that matches each low-definition texture image.
[0020] In an optional embodiment, all low-definition texture images in the low-definition texture image set are arranged according to shooting time and have serial numbers, and all high-definition texture images in the high-definition texture image set are arranged according to shooting time and have serial numbers;
[0021] The step of selecting each candidate high-definition texture image of the low-definition texture image from the high-definition texture image set according to the acquisition order of the low-definition texture image comprises:
[0022] Obtaining the shooting time and serial number of the low-definition texture image;
[0023] Selecting each first high-definition texture image from the high-definition texture image set according to the shooting time of the low-definition texture image; the time difference between the shooting time of the first high-definition texture image and the shooting time of the low-definition texture image is within a preset time range;
[0024] Selecting each second high-definition texture image from the high-definition texture image set according to the sequence number of the low-definition texture image; the difference between the sequence number of the second high-definition texture image and the sequence number of the low-definition texture image is within a preset sequence number range;
[0025] Each of the first high-definition texture images and each of the second high-definition texture images are taken as candidate high-definition texture images to obtain each candidate high-definition texture image of the low-definition texture image.
[0026] In an optional implementation, the step of selecting a high-definition texture image that matches the low-definition texture image from all candidate high-definition texture images includes:
[0027] Performing feature point detection on each of the candidate high-definition texture images to obtain each first feature point set;
[0028] Performing feature point detection on the low-definition texture image to obtain a second feature point set;
[0029] Matching each of the first feature point sets with the second feature point sets to obtain each set of point pairs with the same name;
[0030] The candidate high-definition texture image with the most same-name point pairs in the same-name point pair set is used as the high-definition texture image to be matched with the low-definition texture image.
[0031] In an optional implementation, the step of determining a conversion relationship between the low-definition texture image and the matching high-definition texture image includes:
[0032] Acquire a set of point pairs with the same name between the low-definition texture image and the matching high-definition texture image to obtain a target set of point pairs with the same name;
[0033] At the i-th time, k same-name point pairs are selected from all other same-name point pairs in the target same-name point pair set except the inner point pair set;
[0034] Calculate a transformation matrix based on the interior point pair set and the k point pairs with the same name;
[0035] From all other same-name point pairs in the target same-name point pair set except the inner point pair set and the k same-name point pairs, select m same-name point pairs as the same-name point pairs to be processed;
[0036] According to the transformation matrix, determining whether each of the to-be-processed same-name point pairs is an interior point pair, and saving each interior point pair to the interior point pair set;
[0037] When the current total number of inlier point pairs in the inlier point pair set does not reach n, after i+1 is taken as a new i, the step of selecting k same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inlier point pair set is re-executed at the i-th time;
[0038] When the current total number of interior point pairs in the interior point pair set reaches n, determining whether the interior point pair set meets a set condition;
[0039] If not, when i is less than the preset number of iterations, after i+1 is taken as the new i, the step of selecting k same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inner point pair set is re-executed at the i-th time;
[0040] When i is greater than or equal to the number of iterations, a transformation matrix is calculated based on all interior point pairs in the interior point pair set, and the transformation matrix is used as a final transformation matrix;
[0041] If yes, then calculating a transformation matrix based on all interior point pairs in the interior point pair set, and using the transformation matrix as the final transformation matrix;
[0042] The final transformation matrix is used as the conversion relationship between the low-definition texture image and the matching high-definition texture image; wherein k, m, and n are all positive integers and n>m>k.
[0043] In an optional implementation, the step of determining whether each of the to-be-processed same-name point pairs is an interior point pair according to the transformation matrix comprises:
[0044] For each of the to-be-processed same-name point pairs, obtain a first same-name point and a second same-name point in the to-be-processed same-name point pair; the first same-name point is a pixel point in the low-definition texture image, and the second same-name point is a pixel point in the matched high-definition texture image;
[0045] According to the transformation matrix, a transformation operation is performed on the first same-name point to obtain a transformation result, and a deviation between the transformation result and the second same-name point is calculated to obtain the deviation of the same-name point pair to be processed;
[0046] Add the deviations of all the pairs of points with the same name to be processed to obtain the total deviation;
[0047] For each of the to-be-processed homonymous point pairs, a ratio of the deviation of the to-be-processed homonymous point pair to the total deviation is calculated to obtain a first ratio, and a ratio of a preset parameter to the first ratio is calculated to obtain a confidence level of the to-be-processed homonymous point pair;
[0048] If the confidence of the to-be-processed homonymous point pair is greater than a preset confidence threshold, then the to-be-processed homonymous point pair is determined to be an interior point pair;
[0049] If the confidence of the to-be-processed homonymous point pair is less than or equal to a preset confidence threshold, it is determined that the to-be-processed homonymous point pair is not an interior point pair.
[0050] In a second aspect, the present invention provides a texture image replacement device, wherein the texture image replacement device:
[0051] An acquisition module, used for acquiring a low-definition texture image set from a three-dimensional model of a target object;
[0052] Acquire a collected high-definition texture image set of the target object, and detect the high-definition texture image set;
[0053] A transformation module, used for matching the high-definition texture image set with the low-definition texture image set when the high-definition texture image set passes the detection, so as to obtain a high-definition texture image matched with each low-definition texture image;
[0054] For each of the low-definition texture images, determining a conversion relationship between the low-definition texture image and a matching high-definition texture image, and performing image transformation on the matching high-definition texture image according to the conversion relationship to obtain a new high-definition texture image matched by the low-definition texture image;
[0055] The replacement module is used to replace each of the low-definition texture images in the three-dimensional model with a new high-definition texture image that matches it to obtain a new three-dimensional model.
[0056] In a third aspect, the present invention provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the texture image replacement method described in any one of the aforementioned embodiments is implemented.
[0057] In a fourth aspect, the present invention provides a storage medium having a computer program stored thereon, which, when executed by a processor, implements the texture image replacement method described in any one of the aforementioned embodiments.
[0058] The texture image replacement method, device, electronic device and storage medium provided by the present invention obtain a low-definition texture image set from the three-dimensional model of the target object; and obtain a high-definition texture image set of the collected target object, and detect the high-definition texture image set; when the high-definition texture image set passes the detection, the high-definition texture image set is matched with the low-definition texture image set to obtain a high-definition texture image matched by each low-definition texture image; then the conversion relationship between each low-definition texture image and the matched high-definition texture image is determined, and the matched high-definition texture image is image-transformed according to the conversion relationship to obtain a new high-definition texture image matched by each low-definition texture image; and then each low-definition texture image in the three-dimensional model is replaced with its matched new high-definition texture image to obtain a new three-dimensional model. Thus, the low-resolution texture map of the three-dimensional model is automatically replaced with the high-resolution texture map, the replacement process of the model texture is simplified, the processing efficiency is improved and the cost is reduced.
[0059] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, preferred embodiments are given below and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0060] 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.
[0061] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention is shown;
[0062] Figure 2 A schematic diagram of a process flow of a texture image replacement method provided by an embodiment of the present invention is shown;
[0063] Figure 3 One of the example diagrams of the texture image replacement method provided by an embodiment of the present invention is shown;
[0064] Figure 4 A second example diagram of a texture image replacement method provided by an embodiment of the present invention is shown;
[0065] Figure 5 A functional module diagram of a texture image replacement device provided by an embodiment of the present invention is shown.
[0066] Icons: 100 - electronic device; 110 - bus; 120 - processor; 130 - memory; 150 - I / O module; 170 - communication interface; 300 - texture image replacement device; 310 - acquisition module; 330 - transformation module; 350 - replacement module. DETAILED DESCRIPTION
[0067] The following will be combined with the accompanying drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0068] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work are within the scope of protection of the present invention.
[0069] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0070] See also Figure 1 , is a block diagram of an electronic device provided by an embodiment of the present invention. The electronic device 100 includes a bus 110 , a processor 120 , a memory 130 , an I / O module 150 and a communication interface 170 .
[0071] The bus 110 is a circuit that connects the above elements to each other and transmits signals between the above elements.
[0072] The processor 120 may receive commands from the other elements described above (eg, the memory 130 , the I / O module 150 , the communication interface 170 , etc.) through the bus 110 , may interpret the received commands, and may perform calculations or data processing according to the interpreted commands.
[0073] The processor 120 may be an integrated circuit chip with signal processing capabilities. The processor 120 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.
[0074] The memory 130 may store commands or data received from the processor 120 or other elements (eg, the I / O module 150 , the communication interface 170 , etc.) or commands or data generated by the processor 120 or other elements.
[0075] The memory 130 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), or an electrically erasable programmable read-only memory (EEPROM).
[0076] The I / O module 150 may receive commands or data input from a user via input-output means (e.g., a sensor, a keyboard, a touch screen, etc.), and may transmit the received commands or data to the processor 120 or the memory 130 via the bus 110. It is also used to display various information (e.g., multimedia data, text data) received, stored, and processed from the above elements, and may display videos, images, data, etc. to the user.
[0077] The communication interface 170 may be used to communicate signals or data with other devices.
[0078] Understandably, Figure 1 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0079] It should be understood that the electronic device is installed with three-dimensional model processing software, and the method provided by the embodiment of the present invention is implemented through the three-dimensional model processing software.
[0080] The above-mentioned electronic device will be used as an execution subject to execute each step in each method provided in the embodiment of the present invention and achieve corresponding technical effects.
[0081] See also Figure 2 , is a flow chart of a texture image replacement method provided in an embodiment of the present invention.
[0082] Step S202: acquiring a low-definition texture image set from the three-dimensional model of the target object.
[0083] Step S204: acquiring a set of high-definition texture images of the collected target object, and detecting the set of high-definition texture images.
[0084] In this embodiment, the user can collect point cloud data and high-definition texture image sets of the target object through two collection methods. The first collection method is to fix the high-definition shooting device and the handheld 3D scanning device together, and collect the high-definition texture image set of the target object through the high-definition shooting device while scanning the target object with the handheld 3D scanning device. The second collection method is to collect the high-definition texture image set of the target object through the high-definition shooting device in the scanning order after scanning the target object with the handheld 3D scanning device.
[0085] Then the user imports the collected point cloud data of the target object into the 3D model processing software, and uses the software to perform 3D modeling on the point cloud data, and performs corresponding denoising, hole filling, simplification, texture mapping and other processing to obtain the 3D model of the target object. The 3D model has a low-definition texture map, and a low-definition texture image set can be obtained from the 3D model.
[0086] In addition, the user imports the collected high-definition texture image set of the target object into the 3D model processing software. In order to ensure that the high-definition texture image set can meet the subsequent processing requirements, the high-definition texture image set will be tested. It should be understood that low-definition texture images refer to images with low resolution, low clarity, and low pixel density; high-definition texture images refer to images with high resolution, high clarity, and high pixel density.
[0087] Step S206, when the high-definition texture image set passes the detection, the high-definition texture image set is matched with the low-definition texture image set to obtain a high-definition texture image matched with each low-definition texture image.
[0088] Step S208, for each low-definition texture image, determine the conversion relationship between the low-definition texture image and the matching high-definition texture image, and perform image transformation on the matching high-definition texture image according to the conversion relationship to obtain a new high-definition texture image that matches the low-definition texture image.
[0089] In this embodiment, if the high-definition texture image set passes the test, it means that it meets the subsequent processing requirements. Then the high-definition texture image set can be matched with the low-definition texture image set to obtain a high-definition texture image that matches each low-definition texture image. Then, for each low-definition texture image, the conversion relationship between it and the matched high-definition texture image is determined, and the matched high-definition texture image is transformed according to the conversion relationship, so as to obtain a new high-definition texture image that matches each low-definition texture image.
[0090] It can be understood that the low-definition texture image is the texture image that matches the three-dimensional model. In order to ensure that the high-definition texture image can fit the three-dimensional model, it is necessary to determine the high-definition texture image that matches each low-definition texture image, and through the conversion relationship between the low-definition texture image and the matching high-definition texture image, perform image transformation on the matching high-definition texture image to improve the display effect of the three-dimensional model after the texture is replaced.
[0091] It is understandable that the HD texture image often has a high resolution, and the target object may only occupy a part of the area in the image. In order to improve the processing speed of replacing the texture image, if the HD texture image set passes the detection, the user can also crop and compress the HD texture images in the HD texture image set.
[0092] For ease of understanding, an example diagram is provided in the embodiment of the present invention. Figure 3 , the user can select a rectangular window that just covers the target object (i.e., the beverage box) by dragging the mouse and moving the mask window to crop the HD texture image. And the user can also check the compression box to compress the HD texture image. It should be noted that the user can choose whether to crop and compress the HD texture image according to the hardware performance of the electronic device used.
[0093] Step S210: Replace each low-definition texture image in the three-dimensional model with a new high-definition texture image that matches it to obtain a new three-dimensional model.
[0094] In this embodiment, based on the new high-definition texture image matched by each low-definition texture image, each low-definition texture image in the three-dimensional model is replaced with the new high-definition texture image matched thereto, thereby obtaining a new three-dimensional model. Thus, the texture image replacement of the three-dimensional model is completed, that is, the original low-resolution texture map of the three-dimensional model is replaced with a high-resolution texture map, thereby improving the display effect of the three-dimensional model.
[0095] It can be seen that based on the above steps, a low-definition texture image set is obtained from the three-dimensional model of the target object; and a high-definition texture image set of the collected target object is obtained, and the high-definition texture image set is detected; when the high-definition texture image set passes the detection, the high-definition texture image set is matched with the low-definition texture image set to obtain a high-definition texture image that matches each low-definition texture image; then the conversion relationship between each low-definition texture image and the matched high-definition texture image is determined, and the matched high-definition texture image is transformed according to the conversion relationship to obtain a new high-definition texture image that matches each low-definition texture image; and then each low-definition texture image in the three-dimensional model is replaced with its matched new high-definition texture image to obtain a new three-dimensional model. Thereby, the low-resolution texture map of the three-dimensional model is automatically replaced with the high-resolution texture map, which simplifies the replacement process of the model texture, improves the processing efficiency and reduces the cost.
[0096] Optionally, for step S204, an embodiment of the present invention provides a possible implementation method.
[0097] S204-1, comparing the total number of first images in the high-definition texture image set with the total number of second images in the low-definition texture image set.
[0098] S204-3: When the total number of the first images is less than the total number of the second images, it is determined that the high-definition texture image set has failed the detection.
[0099] S204-5: When the total number of first images is greater than or equal to the total number of second images, detailed information of each high-definition texture image in the high-definition texture image set is checked.
[0100] In this embodiment, after obtaining the high-definition texture image set and the low-definition texture image set, the total number of images in the high-definition texture image set is counted to obtain the first total number of images, and the total number of images in the low-definition texture image set is counted to obtain the second total number of images.
[0101] Then the total number of the first images is compared with the total number of the second images. If the total number of the first images is less than the total number of the second images, that is, the number of high-definition texture images is less than the number of low-definition texture images, then in the subsequent processing, some low-definition texture images of the 3D model may not have corresponding high-definition texture images to replace, which will affect the display effect of the replaced 3D model, that is, the high-definition texture image set does not meet the subsequent processing requirements, and it is determined that it has failed the test.
[0102] If the total number of first images is greater than or equal to the total number of second images, that is, the number of high-definition texture images is greater than or equal to the number of low-definition texture images, then in subsequent processing, the texture replacement of the three-dimensional model will not be affected due to the mismatch in the number of high-definition texture images and low-definition texture images, that is, the high-definition texture image set preliminarily meets the subsequent processing requirements, and the detailed information of each high-definition texture image in the high-definition texture image set is checked to further determine whether it meets the subsequent processing requirements.
[0103] It should be understood that other judgment criteria can also be set for certain objects with more regular shapes, such as spheres. For example, when the number of high-definition texture images is N less than the number of low-definition texture images, such as 3, the high-definition texture image set is determined to have failed the test; when the number of high-definition texture images is N-1 less than the number of low-definition texture images, such as 2, or when the number of high-definition texture images is greater than or equal to the number of low-definition texture images, the detailed information of each high-definition texture image in the high-definition texture image set is checked. The value of N can be set according to actual conditions.
[0104] S204-7A, if the detailed information of any high-definition texture image does not include the shooting time, it is determined that the high-definition texture image set has failed the detection.
[0105] S204-7B, if the detailed information of all high-definition texture images includes the shooting time, it is determined that the high-definition texture image set passes the detection.
[0106] It is understandable that when users import high-definition texture image sets into 3D model processing software, they may lose information of high-definition texture images due to improper operation. For example, if users first transfer high-definition texture image sets from high-definition shooting equipment to social software such as WeChat in electronic devices, and then import them from social software into 3D model processing software, the resolution of high-definition texture images will be reduced or some information will be lost.
[0107] If the user connects the high-definition shooting device to the electronic device via USB (Universal Serial Bus) or Bluetooth, and then imports it into the 3D model processing software, the resolution reduction and partial information loss of the high-definition texture image can be avoided. Since the information of the high-definition texture image is very important for matching high-definition and low-definition texture images, the embodiment of the present invention also checks the detailed information of the high-definition texture image.
[0108] In this embodiment, it is checked whether the detailed information of each high-definition texture image in the high-definition texture atlas contains the shooting time. If the detailed information of any high-definition texture image does not contain the shooting time, it may affect the matching of the high-definition texture image set with the low-definition texture image set in subsequent processing, that is, the high-definition texture image set does not meet the subsequent processing requirements, and it is determined that it has failed the test.
[0109] If the detailed information of all high-definition texture images includes the shooting time, then the high-definition texture image set can be matched with the low-definition texture image set normally in the subsequent processing, that is, the high-definition texture image set meets the subsequent processing requirements and is determined to have passed the detection.
[0110] Optionally, for step S206, an embodiment of the present invention provides a possible implementation method.
[0111] Step S206 - 1 : for each low-definition texture image in the low-definition texture image set, each candidate high-definition texture image of the low-definition texture image is selected from the high-definition texture image set according to the collection order of the low-definition texture images.
[0112] Step S206 - 3 , selecting a high-definition texture image that matches the low-definition texture image from all candidate high-definition texture images, and obtaining a high-definition texture image that matches each low-definition texture image.
[0113] It can be understood that the embodiment of the present invention processes each low-definition texture image in the low-definition texture image set in a similar manner. For the sake of brevity, a low-definition texture image is used as an example for description below.
[0114] In this embodiment, according to the acquisition order of the low-definition texture image, a high-definition texture image whose acquisition order is close to that of the low-definition texture image is selected from the high-definition texture image set, and each candidate high-definition texture image of the low-definition texture image is obtained; then, a high-definition texture image that matches the low-definition texture image is selected from all the candidate high-definition texture images.
[0115] By processing each low-definition texture image in a similar manner, a high-definition texture image matching each low-definition texture image can be obtained.
[0116] Optionally, for step S206-1, an embodiment of the present invention provides a possible implementation method.
[0117] Step S206-1-1, obtaining the shooting time and serial number of the low-definition texture image.
[0118] Step S206-1-3, selecting each first high-definition texture image from the high-definition texture image set according to the shooting time of the low-definition texture image; the time difference between the shooting time of the first high-definition texture image and the shooting time of the low-definition texture image is within a preset time range.
[0119] Step S206-1-5, selecting each second high-definition texture image from the high-definition texture image set according to the sequence number of the low-definition texture image; the difference between the sequence number of the second high-definition texture image and the sequence number of the low-definition texture image is within a preset sequence number range.
[0120] Step S206-1-7: taking each first high-definition texture image and each second high-definition texture image as a candidate high-definition texture image, and obtaining each candidate high-definition texture image of the low-definition texture image.
[0121] It can be understood that all low-definition texture images in the low-definition texture image set are arranged according to shooting time and have serial numbers, and all high-definition texture images in the high-definition texture image set are arranged according to shooting time and have serial numbers.
[0122] In this embodiment, the shooting time and serial number of the low-definition texture image are first obtained, that is, the shooting time and serial number can reflect the acquisition order of a texture image. Then, since the user may collect high-definition texture images according to the first acquisition method mentioned above, a time range can be set in advance, and the time difference corresponding to each candidate high-definition texture image is calculated according to the shooting time of each candidate high-definition texture image and the shooting time of the low-definition texture image, and each candidate high-definition texture image with a time difference within the time range is used as each first high-definition texture image.
[0123] Then, since the user may collect high-definition texture images according to the second collection method mentioned above, a serial number range can be set in advance, and the difference corresponding to each candidate high-definition texture image is calculated according to the serial number of each candidate high-definition texture image and the serial number of the low-definition texture image, and each candidate high-definition texture image with a difference within the serial number range is used as each second high-definition texture image. Finally, each first high-definition texture image and each second high-definition texture image are used as candidate high-definition texture images, and each candidate high-definition texture image of the low-definition texture image is obtained.
[0124] It should be noted that the time range and the sequence number range can be set according to actual conditions, and the embodiment of the present invention does not limit this.
[0125] Optionally, for step S206-3, an embodiment of the present invention provides a possible implementation method.
[0126] Step S206-3-1, performing feature point detection on each candidate high-definition texture image to obtain each first feature point set.
[0127] Step S206-3-3, perform feature point detection on the low-definition texture image to obtain a second feature point set.
[0128] Step S206-3-5, matching each first feature point set with the second feature point set to obtain each set of point pairs with the same name.
[0129] Step S206-3-7, taking the candidate high-definition texture image with the most same-name point pairs in the same-name point pair set as the high-definition texture image for matching the low-definition texture image.
[0130] It is understandable that in order to improve the accuracy and efficiency of texture image matching, the low-definition texture image and each of its candidate high-definition texture images may be preprocessed in advance. For example, the low-definition texture image and each of its candidate high-definition texture images may be corrected to correct the distortion of the texture image content caused when the handheld three-dimensional scanning device and the high-definition shooting device shoot the target object. In addition, the low-definition texture image and each of its candidate high-definition texture images may be scaled so that the difference in the height-to-width ratio between the low-definition texture image and each of its candidate high-definition texture images is within a preset range.
[0131] In this embodiment, a preset feature detection algorithm such as the SIFT (Scale Invariant Feature Transform) algorithm can be used to perform feature point detection on each candidate high-definition texture image to obtain each first feature point set, and to perform feature point detection on the low-definition texture image to obtain a second feature point set.
[0132] Then, each first feature point set is matched with the second feature point set to obtain each set of same-name point pairs. For ease of understanding, a first feature point set is used as an example for explanation. For example, the first feature point set includes multiple first feature points and their feature descriptors, and the second feature point set includes multiple second feature points and their feature descriptors.
[0133] For each second feature point, the distance between the second feature point and each first feature point is calculated according to the feature descriptor of the second feature point and the feature descriptor of each first feature point, and the ratio of the nearest distance to the second nearest distance is calculated. If the ratio is less than or equal to a preset threshold, the second feature point and the first feature point of the nearest distance are regarded as a pair of points of the same name. By processing each second feature point in a similar manner, a set of point pairs of the same name can be obtained.
[0134] By processing each first feature point set in a similar manner, each set of same-name point pairs can be obtained. It should be understood that a preset feature matching algorithm such as the AdaLAM algorithm (Adaptive Locally AffineMatching) can also be used to obtain each set of same-name point pairs.
[0135] Finally, the candidate high-definition texture image with the most same-name point pairs in the same-name point pair set is obtained, that is, the candidate high-definition texture image has the most similar features to the low-definition texture image, and then the candidate high-definition texture image is used as the high-definition texture image to match the low-definition texture image.
[0136] Optionally, for the process of determining the conversion relationship between the low-definition texture image and the matching high-definition texture image in step S208, an embodiment of the present invention provides a possible implementation manner.
[0137] Step S208 - 1 , obtaining a set of same-name point pairs between a low-definition texture image and a matching high-definition texture image, and obtaining a target set of same-name point pairs.
[0138] Step S208-2, at the i-th time, k same-name point pairs are selected from all other same-name point pairs in the target same-name point pair set except the inner point pair set.
[0139] Step S208-3, calculating the transformation matrix based on the interior point pair set and k points with the same name.
[0140] Step S208-4: Select m same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inner point pair set and k same-name point pairs as the same-name point pairs to be processed.
[0141] Step S208-5: determine whether each to-be-processed point pair with the same name is an interior point pair according to the transformation matrix, and save each interior point pair into an interior point pair set.
[0142] Step S208-6, when the current total number of inlier pairs in the inlier pair set has not reached n, i+1 is used as the new i and step S208-2 is re-executed.
[0143] Step S208-7, when the current total number of inlier pairs in the inlier pair set reaches n, determine whether the inlier pair set meets the set condition.
[0144] Step S208-8: If not, when i is less than the preset number of iterations, i+1 is used as the new i and step S208-2 is re-executed.
[0145] Step S208-9, when i is greater than or equal to the number of iterations, a transformation matrix is calculated based on all the interior point pairs in the interior point pair set, and the transformation matrix is used as the final transformation matrix.
[0146] Step S208-10: If yes, then a transformation matrix is calculated based on all the interior point pairs in the interior point pair set, and the transformation matrix is used as the final transformation matrix.
[0147] Step S208-11, using the final transformation matrix as the conversion relationship between the low-definition texture image and the matching high-definition texture image; wherein k, m, and n are all positive integers and n>m>k. In this embodiment, a set of same-name point pairs between the low-definition texture image and the matching high-definition texture image is obtained to obtain a target set of same-name point pairs.
[0148] In this embodiment, firstly, a set of same-name point pairs between a low-definition texture image and a matching high-definition texture image is obtained to obtain a target same-name point pair set. Then, through multiple iterations, same-name point pairs that meet the requirements are selected from the target same-name point pair set as inliers to obtain an inlier set, and then a final transformation matrix is calculated based on all inliers in the inlier set, so that the final transformation matrix is used as a conversion relationship between the low-definition texture image and the matching high-definition texture image.
[0149] For ease of understanding, an iterative process is used as an example for explanation. In the i-th time, based on the previously determined inlier point pair set and the target same-name point pair set, k same-name point pairs are selected from all other same-name point pairs in the target same-name point pair set except the inlier point pair set. And based on the inlier point pair set and these k same-name point pairs, the transformation matrix is calculated.
[0150] Then, m same-name point pairs are selected from all other same-name point pairs in the target same-name point pair set except the inner point pair set and k same-name point pairs as the same-name point pairs to be processed. And according to the transformation matrix, it is determined whether each same-name point pair to be processed meets the requirements. If it meets the requirements, the same-name point pair to be processed is regarded as an inner point pair and saved in the inner point pair set.
[0151] Next, the current total number of inlier pairs in the inlier pair set is counted, and it is determined whether the current total number reaches the set number, that is, n. If the current total number does not reach n, it means that the same-name point pairs need to be selected as inlier pairs, and then the process returns to step S208-2. If the current total number reaches n, it is further determined whether the inlier pair set meets the set condition.
[0152] When the inlier point pair set meets the set conditions, the transformation matrix is calculated based on all the inlier point pairs in the inlier point pair set, and the transformation matrix is used as the final transformation matrix, that is, the conversion relationship between the low-definition texture image and the matching high-definition texture image is obtained.
[0153] In the case that the set of inlier pairs does not meet the set condition, the current iteration number i is compared with the preset total number of iterations, such as d. If i < d, it means that the iteration end condition has not been met, and then the execution returns to step S208-2. If i ≥ d, it means that the iteration end condition has been met, then the transformation matrix is calculated based on all the inlier pairs in the inlier pair set, and the transformation matrix is used as the final transformation matrix, that is, the conversion relationship between the low-definition texture image and the matching high-definition texture image is obtained.
[0154] Optionally, for step S208-5, an embodiment of the present invention provides a possible implementation method.
[0155] Step S208-5-1, for each pair of like-named points to be processed, obtain the first and second like-named points in the pair of like-named points to be processed; the first like-named point is a pixel point in the low-definition texture image, and the second like-named point is a pixel point in the matching high-definition texture image.
[0156] Step S208-5-2, according to the transformation matrix, the first point with the same name is transformed to obtain a transformation result, and the deviation between the transformation result and the second point with the same name is calculated to obtain the deviation of the pair of points with the same name to be processed.
[0157] Step S208-5-3, adding the deviations of all the pairs of points with the same name to be processed to obtain the total deviation.
[0158] Step S208-5-4, for each to-be-processed homonymous point pair, calculate the ratio of the deviation amount of the to-be-processed homonymous point pair to the total deviation amount to obtain a first ratio, and calculate the ratio of the preset parameter to the first ratio to obtain the confidence of the to-be-processed homonymous point pair.
[0159] Step S208-5-5: If the confidence of the to-be-processed homonymous point pair is greater than a preset confidence threshold, the to-be-processed homonymous point pair is determined to be an inner point pair.
[0160] Step S208-5-6: If the confidence of the to-be-processed homonymous point pair is less than or equal to the preset confidence threshold, it is determined that the to-be-processed homonymous point pair is not an interior point pair.
[0161] It can be understood that the embodiment of the present invention processes each to-be-processed same-name point pair in a similar manner. For the sake of brevity, a to-be-processed same-name point pair is used for illustration below.
[0162] In this embodiment, the first and second like-named points in the like-named point pair to be processed are obtained, and the first like-named point is a pixel point in the low-definition texture image, and the second like-named point is a pixel point in the matching high-definition texture image. Then, based on the calculated transformation matrix, the rotation matrix and the translation vector can be obtained from the transformation matrix by singular value decomposition, i.e., SVD (Singular Value Decomposition). For example, the transformation matrix can be expressed as E=UΣVT, where E is the transformation matrix; Σ is a diagonal matrix whose non-zero elements are 1; U and V are orthogonal matrices. The rotation matrix R can be constructed from U and V, and the translation vector t can be obtained from the last column of U or V.
[0163] According to the rotation matrix and translation vector obtained by the transformation matrix, the first point of the same name in the same name point pair to be processed is transformed, i.e. rotated and translated, to obtain the transformation result; and the deviation between the transformation result and the second point of the same name in the same name point pair to be processed is calculated to obtain the deviation of the same name point pair to be processed. In a similar manner, each pair of same name point to be processed is processed to obtain the deviation of each pair of same name point to be processed. The deviations of all the pairs of same name point to be processed are added together to obtain the total deviation.
[0164] Next, for each to-be-processed homonymous point pair, the ratio of the deviation amount of the to-be-processed homonymous point pair to the total deviation amount is calculated to obtain a first ratio, and the ratio of the preset parameter to the first ratio is calculated to obtain the confidence of the to-be-processed homonymous point pair. If the confidence of the to-be-processed homonymous point pair is greater than the preset confidence threshold, it means that the to-be-processed homonymous point pair meets the requirements, and then it is determined that the to-be-processed homonymous point pair is an inlier pair. If the confidence of the to-be-processed homonymous point pair is less than or equal to the preset confidence threshold, it means that the to-be-processed homonymous point pair does not meet the requirements, and then it is determined that the to-be-processed homonymous point pair is not an inlier pair.
[0165] Optionally, for the process of determining whether the set of inlier pair meets the set conditions in step S208-7, an embodiment of the present invention provides a possible implementation method, namely: obtaining the deviation of each inlier pair in the set of inlier pair; calculating the standard deviation based on the deviations of all inlier pairs; if the standard deviation is greater than a preset threshold, determining that the set of inlier pair does not meet the set conditions; if the standard deviation is less than or equal to the preset threshold, determining that the set of inlier pair meets the set conditions.
[0166] For ease of understanding, the embodiments of the present invention are based on the above Figure 3 The example shown also provides an example diagram. Figure 4 , which is an image of a new three-dimensional model obtained by replacing the high-resolution image with the low-resolution texture image of the three-dimensional model using the method of an embodiment of the present invention.
[0167] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing a texture image replacement device is given below. Figure 5 , is a functional module diagram of a texture image replacement device 300 provided in an embodiment of the present invention. It should be noted that the basic principle and technical effects of the texture image replacement device 300 provided in this embodiment are the same as those of the above embodiment. For the sake of brief description, for matters not mentioned in this embodiment, reference may be made to the corresponding contents in the above embodiment. The texture image replacement device 300 includes:
[0168] The acquisition module 310 is used to acquire a low-definition texture image set from the three-dimensional model of the target object; acquire a collected high-definition texture image set of the target object, and detect the high-definition texture image set.
[0169] The transformation module 330 is used to match the high-definition texture image set with the low-definition texture image set when the high-definition texture image set passes the detection, so as to obtain a high-definition texture image that matches each low-definition texture image; for each low-definition texture image, determine the conversion relationship between the low-definition texture image and the matched high-definition texture image, and perform image transformation on the matched high-definition texture image according to the conversion relationship to obtain a new high-definition texture image that matches the low-definition texture image.
[0170] The replacement module 350 is used to replace each low-definition texture image in the three-dimensional model with a new high-definition texture image that matches it to obtain a new three-dimensional model.
[0171] Optionally, the acquisition module 310 is also used to: compare the total number of first images in the high-definition texture image set with the total number of second images in the low-definition texture image set; when the total number of first images is less than the total number of second images, determine that the high-definition texture image set has not passed the test; when the total number of first images is greater than or equal to the total number of second images, check the detailed information of each high-definition texture image in the high-definition texture image set; if the detailed information of any high-definition texture image does not include the shooting time, determine that the high-definition texture image set has not passed the test; if the detailed information of all high-definition texture images includes the shooting time, determine that the high-definition texture image set has passed the test.
[0172] Optionally, the transformation module 330 is also used to: for each low-definition texture image in the low-definition texture image set, select each candidate high-definition texture image of the low-definition texture image from the high-definition texture image set according to the acquisition order of the low-definition texture images; select the high-definition texture image that matches the low-definition texture image from all the candidate high-definition texture images, and obtain the high-definition texture image that matches each low-definition texture image.
[0173] Optionally, the transformation module 330 is further used to: obtain the shooting time and serial number of the low-definition texture image; select each first high-definition texture image from the high-definition texture image set according to the shooting time of the low-definition texture image; the time difference between the shooting time of the first high-definition texture image and the shooting time of the low-definition texture image is within a preset time range; select each second high-definition texture image from the high-definition texture image set according to the serial number of the low-definition texture image; the difference between the serial number of the second high-definition texture image and the serial number of the low-definition texture image is within a preset serial number range; take each first high-definition texture image and each second high-definition texture image as a candidate high-definition texture image to obtain each candidate high-definition texture image of the low-definition texture image.
[0174] Optionally, the transformation module 330 is also used to: perform feature point detection on each candidate high-definition texture image to obtain each first feature point set; perform feature point detection on the low-definition texture image to obtain a second feature point set; match each first feature point set with the second feature point set to obtain each set of same-name point pairs; and use the candidate high-definition texture image with the most same-name point pairs in the set of same-name point pairs as the high-definition texture image for matching the low-definition texture image.
[0175] Optionally, the transformation module 330 is further used to: obtain a set of same-name point pairs between the low-definition texture image and the matching high-definition texture image to obtain a target same-name point pair set; at the i-th time, select k same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inlier point pair set; calculate the transformation matrix based on the inlier point pair set and the k same-name point pairs; select m same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inlier point pair set and the k same-name point pairs as the same-name point pairs to be processed; determine whether each of the same-name point pairs to be processed is an inlier point pair based on the transformation matrix, and save each inlier point pair to the inlier point pair set; when the current total number of inlier point pairs in the inlier point pair set does not reach n, take i+1 as the new i, and re-execute at the i-th time, select all the same-name point pairs in the target same-name point pair set except the inlier point pair set. Select k same-name point pairs from other same-name point pairs; when the current total number of inner point pairs in the inner point pair set reaches n, determine whether the inner point pair set meets the set conditions; if not, when i is less than the preset number of iterations, take i+1 as the new i, and re-execute at the i-th time, select k same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inner point pair set; when i is greater than or equal to the number of iterations, calculate the transformation matrix based on all the inner point pairs in the inner point pair set, and use the transformation matrix as the final transformation matrix; if yes, calculate the transformation matrix based on all the inner point pairs in the inner point pair set, and use the transformation matrix as the final transformation matrix; use the final transformation matrix as the conversion relationship between the low-definition texture image and the matching high-definition texture image; wherein k, m, and n are all positive integers and n>m>k.
[0176] Optionally, the transformation module 330 is further used to: for each pair of same-name points to be processed, obtain the first and second same-name points in the pair of same-name points to be processed; the first same-name point is a pixel point in the low-definition texture image, and the second same-name point is a pixel point in the matching high-definition texture image; according to the transformation matrix, perform a transformation operation on the first same-name point to obtain a transformation result, and calculate the deviation between the transformation result and the second same-name point to obtain the deviation of the same-name point pair to be processed; and convert the first same-name point into a pixel point in the low-definition texture image; the second same-name point is a pixel point in the matching high-definition texture image; according to the transformation matrix, perform a transformation operation on the first same-name point to obtain a transformation result, and calculate the deviation between the transformation result and the second same-name point to obtain the deviation of the same-name point pair to be processed; The deviations are added to obtain a total deviation; for each to-be-processed homonymous point pair, a ratio of the deviation of the to-be-processed homonymous point pair to the total deviation is calculated to obtain a first ratio, and a ratio of a preset parameter to the first ratio is calculated to obtain a confidence of the to-be-processed homonymous point pair; if the confidence of the to-be-processed homonymous point pair is greater than a preset confidence threshold, the to-be-processed homonymous point pair is determined to be an inlier pair; if the confidence of the to-be-processed homonymous point pair is less than or equal to the preset confidence threshold, the to-be-processed homonymous point pair is determined not to be an inlier pair.
[0177] An embodiment of the present invention further provides an electronic device, including a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the texture image replacement method disclosed in the embodiment of the present invention is implemented.
[0178] The embodiment of the present invention further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the texture image replacement method disclosed in the embodiment of the present invention is implemented.
[0179] In several embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0180] In addition, the functional modules in the various embodiments of the present invention may be integrated together to form an independent part, or each module may exist independently, or two or more modules may be integrated to form an independent part.
[0181] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present invention. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0182] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A texture image replacement method, characterized in that: The texture image replacement method comprises: Obtain a set of low-resolution texture images from a three-dimensional model of a target object; Acquire a collected high-definition texture image set of the target object, and detect the high-definition texture image set; When the high-definition texture image set passes the detection, the high-definition texture image set is matched with the low-definition texture image set to obtain a high-definition texture image matched with each low-definition texture image; For each of the low-definition texture images, determining a conversion relationship between the low-definition texture image and a matching high-definition texture image, and performing image transformation on the matching high-definition texture image according to the conversion relationship to obtain a new high-definition texture image matched by the low-definition texture image; Each of the low-definition texture images in the three-dimensional model is replaced with a new high-definition texture image that matches it to obtain a new three-dimensional model.
2. The texture image replacement method according to claim 1, characterized in that: The step of detecting the high-definition texture image set includes: comparing the total number of first images in the high-definition texture image set with the total number of second images in the low-definition texture image set; When the total number of the first images is less than the total number of the second images, determining that the high-definition texture image set fails the detection; When the total number of the first images is greater than or equal to the total number of the second images, checking detailed information of each high-definition texture image in the high-definition texture image set; If the detailed information of any high-definition texture image does not include the shooting time, it is determined that the high-definition texture image set has failed the detection; If the detailed information of all high-definition texture images includes the shooting time, it is determined that the high-definition texture image set passes the detection.
3. The texture image replacement method according to claim 1, characterized in that: The step of matching the high-definition texture image set with the low-definition texture image set to obtain a high-definition texture image matched with each low-definition texture image comprises: For each low-definition texture image in the low-definition texture image set, selecting each candidate high-definition texture image of the low-definition texture image from the high-definition texture image set according to the acquisition order of the low-definition texture images; From all candidate high-definition texture images, a high-definition texture image that matches the low-definition texture image is selected to obtain a high-definition texture image that matches each low-definition texture image.
4. The texture image replacement method according to claim 3, characterized in that: All low-definition texture images in the low-definition texture image set are arranged according to shooting time and have serial numbers, and all high-definition texture images in the high-definition texture image set are arranged according to shooting time and have serial numbers; The step of selecting each candidate high-definition texture image of the low-definition texture image from the high-definition texture image set according to the acquisition order of the low-definition texture image comprises: Obtaining the shooting time and serial number of the low-definition texture image; Selecting each first high-definition texture image from the high-definition texture image set according to the shooting time of the low-definition texture image; the time difference between the shooting time of the first high-definition texture image and the shooting time of the low-definition texture image is within a preset time range; Selecting each second high-definition texture image from the high-definition texture image set according to the sequence number of the low-definition texture image; the difference between the sequence number of the second high-definition texture image and the sequence number of the low-definition texture image is within a preset sequence number range; Each of the first high-definition texture images and each of the second high-definition texture images are taken as candidate high-definition texture images to obtain each candidate high-definition texture image of the low-definition texture image.
5. The texture image replacement method according to claim 3, characterized in that: The step of selecting a high-definition texture image that matches the low-definition texture image from all candidate high-definition texture images comprises: Performing feature point detection on each of the candidate high-definition texture images to obtain each first feature point set; Performing feature point detection on the low-definition texture image to obtain a second feature point set; Matching each of the first feature point sets with the second feature point sets to obtain each set of point pairs with the same name; The candidate high-definition texture image with the most same-name point pairs in the same-name point pair set is used as the high-definition texture image to be matched with the low-definition texture image.
6. The texture image replacement method according to claim 1, characterized in that: The step of determining the conversion relationship between the low-definition texture image and the matching high-definition texture image comprises: Acquire a set of point pairs with the same name between the low-definition texture image and the matching high-definition texture image to obtain a target set of point pairs with the same name; At the i-th time, k same-name point pairs are selected from all other same-name point pairs in the target same-name point pair set except the inner point pair set; Calculate a transformation matrix based on the interior point pair set and the k point pairs with the same name; From all other same-name point pairs in the target same-name point pair set except the inner point pair set and the k same-name point pairs, select m same-name point pairs as the same-name point pairs to be processed; According to the transformation matrix, determining whether each of the to-be-processed same-name point pairs is an interior point pair, and saving each interior point pair to the interior point pair set; When the current total number of inlier point pairs in the inlier point pair set does not reach n, after i+1 is taken as a new i, the step of selecting k same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inlier point pair set is re-executed at the i-th time; When the current total number of interior point pairs in the interior point pair set reaches n, determining whether the interior point pair set meets a set condition; If not, when i is less than the preset number of iterations, after i+1 is taken as the new i, the step of selecting k same-name point pairs from all other same-name point pairs in the target same-name point pair set except the inner point pair set is re-executed at the i-th time; When i is greater than or equal to the number of iterations, a transformation matrix is calculated based on all interior point pairs in the interior point pair set, and the transformation matrix is used as a final transformation matrix; If yes, then calculating a transformation matrix based on all interior point pairs in the interior point pair set, and using the transformation matrix as the final transformation matrix; The final transformation matrix is used as the conversion relationship between the low-definition texture image and the matching high-definition texture image; wherein k, m, and n are all positive integers and n>m>k.
7. The texture image replacement method according to claim 6, characterized in that: The step of judging whether each of the to-be-processed same-name point pairs is an interior point pair according to the transformation matrix comprises: For each of the to-be-processed same-name point pairs, obtain a first same-name point and a second same-name point in the to-be-processed same-name point pair; the first same-name point is a pixel point in the low-definition texture image, and the second same-name point is a pixel point in the matched high-definition texture image; According to the transformation matrix, a transformation operation is performed on the first same-name point to obtain a transformation result, and a deviation between the transformation result and the second same-name point is calculated to obtain the deviation of the same-name point pair to be processed; Add the deviations of all the pairs of points with the same name to be processed to obtain the total deviation; For each of the to-be-processed homonymous point pairs, a ratio of the deviation of the to-be-processed homonymous point pair to the total deviation is calculated to obtain a first ratio, and a ratio of a preset parameter to the first ratio is calculated to obtain a confidence level of the to-be-processed homonymous point pair; If the confidence of the to-be-processed homonymous point pair is greater than a preset confidence threshold, then the to-be-processed homonymous point pair is determined to be an interior point pair; If the confidence of the to-be-processed homonymous point pair is less than or equal to a preset confidence threshold, it is determined that the to-be-processed homonymous point pair is not an interior point pair.
8. A texture image replacement device, characterized in that: The texture image replacement device: An acquisition module, used for acquiring a low-definition texture image set from a three-dimensional model of a target object; Acquire a collected high-definition texture image set of the target object, and detect the high-definition texture image set; A transformation module, used for matching the high-definition texture image set with the low-definition texture image set when the high-definition texture image set passes the detection, so as to obtain a high-definition texture image matched with each low-definition texture image; For each of the low-definition texture images, determining a conversion relationship between the low-definition texture image and a matching high-definition texture image, and performing image transformation on the matching high-definition texture image according to the conversion relationship to obtain a new high-definition texture image matched by the low-definition texture image; The replacement module is used to replace each of the low-definition texture images in the three-dimensional model with a new high-definition texture image that matches it to obtain a new three-dimensional model.
9. An electronic device, characterized in that: The invention comprises a processor and a memory, wherein the memory stores a computer program, and when the processor executes the computer program, the texture image replacement method according to any one of claims 1 to 7 is implemented.
10. A storage medium, characterized in that: The storage medium stores a computer program, which, when executed by a processor, implements the texture image replacement method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Image processing method and device, electronic equipment and readable storage medium
CN108765272A
Texture mapping method and device of grid model and three-dimensional scanning system
CN117974868A
Cited By
Three-dimensional scanning method, three-dimensional scanning equipment and three-dimensional scanning system
CN120825568A