A method, device, electronic device and storage medium for generating a model base
By using the texture information of the first model substrate to determine the target texture map of the second model substrate and perform texture filling, the problem of inefficient texture filling in image to three-dimensional virtual image technology is solved, efficient and low-cost model substrate generation is achieved, and visual effects are improved.
Patent Information
- Application Number
- CN202210226613.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-03-09
- Publication Date
- 2025-04-22
- Estimated Expiration
- 2042-03-09
AI Technical Summary
In image-to-three-dimensional virtual avatar technology, when generating personalized three-dimensional virtual avatars, the target texture map needs to be manually set for texture filling, resulting in inefficiency and increased cost.
By using the texture information corresponding to the first model substrate, a target texture map of the second model substrate is determined, and texture fills the second model substrate based on the target texture map to generate a target model substrate filled with texture information.
The generation efficiency of the model substrate filled with texture information is improved, the generation cost is reduced, and the generated target model substrate has a better visual effect.
Smart Images

Figure CN114581586B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of artificial intelligence, and specifically to computer vision and image processing technology, and can be specifically used in artificial intelligence fields such as augmented reality, computer vision, and deep learning. Background Art
[0002] Photo-To-Avatar (PTA), as a common avatar generation technology, can generate a personalized 3D avatar of a user based on the user's image.
[0003] In the process of generating a personalized 3D virtual image based on a user image, the user image and the generated model base need to be used to generate the user's personalized 3D virtual image. Therefore, generating the model base becomes an important part of the image-to-3D virtual image technology. Summary of the invention
[0004] The present disclosure provides a method, an apparatus, an electronic device, a readable storage medium, and a computer program product for generating a model base, so as to generate a model base filled with texture information.
[0005] According to one aspect of the present disclosure, a method for generating a model substrate is provided, and the method may include the following steps:
[0006] Determine a target texture map corresponding to a second model base using texture information corresponding to a first model base, wherein the first model base is a base model preset for the second model base;
[0007] Based on the target texture map, the second model base is texture filled to obtain the target model base.
[0008] According to a second aspect of the present disclosure, a device for generating a model substrate is provided, which may include:
[0009] A target texture map determining unit, used to determine a target texture map corresponding to a second model base using texture information corresponding to a first model base, wherein the first model base is a base model preset for the second model base;
[0010] The target model base obtaining unit is used to perform texture filling on the second model base based on the target texture map to obtain the target model base.
[0011] According to another aspect of the present disclosure, there is provided an electronic device, comprising:
[0012] at least one processor; and
[0013] a memory communicatively connected to the at least one processor; wherein,
[0014] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the method in any embodiment of the present disclosure.
[0015] According to another aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided. The computer instructions are used to enable a computer to execute the method in any embodiment of the present disclosure.
[0016] According to another aspect of the present disclosure, a computer program product is provided, including a computer program / instruction, wherein the computer program / instruction implements the method in any embodiment of the present disclosure when executed by a processor.
[0017] In the technology disclosed in the present invention, since the target model base is obtained by filling the texture based on the target texture map, the target model base is a model base filled with texture information. And since the target texture map is determined by using the texture information corresponding to the first model base, there is no need for relevant personnel to manually set the target texture map to fill the texture of the second model base, thereby improving the generation efficiency of the model base filled with texture information and reducing the generation cost of the model base filled with texture information.
[0018] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present disclosure, nor is it intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure.
[0020] Figure 1 A flowchart of a method for generating a model base is provided in an embodiment of the present disclosure;
[0021] Figure 2 A flowchart of a method for determining a target texture map provided in an embodiment of the present disclosure;
[0022] Figure 3 A flowchart of a method for determining pixel point coordinates provided in an embodiment of the present disclosure;
[0023] Figure 4 A flowchart of an interpolation processing method provided in an embodiment of the present disclosure;
[0024] Figure 5 A schematic diagram of a model substrate provided in an embodiment of the present disclosure;
[0025] Figure 6A schematic diagram of a device for generating a model substrate is provided in an embodiment of the present disclosure;
[0026] Figure 7 A schematic diagram of an electronic device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0027] The following is a description of exemplary embodiments of the present disclosure in conjunction with the accompanying drawings, including various details of the embodiments of the present disclosure to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present disclosure. Similarly, for the sake of clarity and conciseness, descriptions of well-known functions and structures are omitted in the following description.
[0028] This disclosure provides a method for generating a model base. For details, please refer to Figure 1 , which is a flowchart of a method for generating a model base according to an embodiment of the present disclosure. Figure 1 The method shown may include the following steps:
[0029] Step S101: using texture information corresponding to a first model base, determining a target texture map corresponding to a second model base, wherein the first model base is a base model preset for the second model base.
[0030] Step S102: Based on the target texture map, texture filling is performed on the second model base to obtain a target model base.
[0031] In the method for generating a model base provided in the embodiments of the present disclosure, since the target model base is obtained by filling the texture based on the target texture map, the target model base is a model base filled with texture information. And since the target texture map is determined using the texture information corresponding to the first model base, there is no need for relevant personnel to manually set the target texture map to fill the texture of the second model base, thereby improving the generation efficiency of the model base filled with texture information and reducing the generation cost of the model base filled with texture information.
[0032] In the embodiments of the present disclosure, the first model base is generally a standard model base pre-generated for the first standard model and filled with texture information. The second model base is generally a standard model base pre-generated for the second standard model and not filled with texture information.
[0033] The so-called standard model is a pre-generated standard virtual image model, which refers to a virtual image model without distinctive features and is used to display the normal image of the target object. The target object includes but is not limited to humans, animals, and even robots. Correspondingly, the virtual image includes but is not limited to a personalized three-dimensional virtual image of a person, a personalized three-dimensional virtual image of an animal, and a personalized three-dimensional virtual image of a robot.
[0034] In the embodiments of the present disclosure, the so-called standard model base is a model base with normal expressiveness generated on the basis of the standard model. Specifically, the standard model base can be a target standard model base with normal expressiveness and meeting the target requirements, which is used to show the image of the target object under the target requirements.
[0035] The target requirement is a requirement for the facial features or facial expressions of the target object, and the target requirement may include at least one of big eyes, thick eyebrows, open mouth expression, smiling expression or blinking expression, etc. Correspondingly, the standard model base may specifically be a standard model base with big eyes, a standard model base with thick eyebrows, a standard model base with blinking expression, a standard model base with an open mouth action, and a standard model base with blinking expression.
[0036] In addition, the first model base may be a style model base pre-generated for the first style model and filled with texture information. The second model base may be a style model base pre-generated for the second style model and not filled with texture information.
[0037] The target style corresponds to a preset distinctive feature. Accordingly, the so-called style model refers to a virtual image model with distinctive features, which is used to display the image of the target object under the distinctive features. The target style can refer to big eyes and small mouth, blinking eyes and crooked mouth, etc.
[0038] The style model is generally obtained by relevant designers through design tools for avatar model design, by designing a model for a target style. The style model may also be a avatar model with a target style that is pre-generated through other model generation methods. That is to say, the generation method of the style model is not specifically limited in the embodiments of the present disclosure.
[0039] The so-called style model base is a model base further generated on the basis of the style model, which is used to show the target object with distinctive characteristics under the target requirement. For example, when the style model is big eyes and big mouth, and the target requirement is open mouth, the style model base can be a base model of big eyes and big mouth style with open mouth expression.
[0040] It should be noted that when the target object is a person, before generating the standard model, the target standard model base, the style model, the target style model base, and the personalized three-dimensional virtual image, the permission and authorization of the relevant target object must be obtained. And in the above process, if the acquisition, storage and application of user personal information is involved, the acquisition, storage and application of user personal information involved shall comply with the provisions of relevant laws and regulations and shall not violate public order and good customs.
[0041] In the embodiments of the present disclosure, the texture map is an image used to represent the texture information of the model base. Specifically, each pixel of the texture map has a corresponding pixel in the model base, and the texture information of each pixel of the texture map is used to represent the texture information of the corresponding pixel of the model base.
[0042] In the embodiment of the present disclosure, the specific implementation method of using the texture information corresponding to the first model base to determine the target texture map corresponding to the second model base is as follows: Figure 2 As shown, Figure 2 The present invention is a flowchart of a method for determining a target texture map provided in an embodiment of the present invention. Figure 2 The method shown may include the following steps:
[0043] Step S201: using the first texture coordinates, obtaining a first texture map corresponding to the second model base, the first texture coordinates being texture coordinates corresponding to the pixel points of the second model base in the texture mapping coordinate system.
[0044] Step S202: determining the second pixel point coordinates corresponding to the texture information in the first pixel point coordinates, where the first pixel point coordinates are the coordinates corresponding to the pixel points of the first texture image in the pixel coordinate system.
[0045] Step S203: Based on the coordinates of the second pixel point, the texture information is assigned to the pixel point of the first texture map to obtain a second texture map corresponding to the second model base.
[0046] Step S204: Based on the second texture map, a target texture map is obtained.
[0047] On the basis of determining the coordinates of the second pixel point corresponding to the texture information, the texture information is assigned to the pixel point of the first texture map, which can ensure that the texture information is accurately assigned to the pixel point of the first texture map. Accurately assigning the texture information to the pixel point of the first texture map can ensure that a normal second texture map is generated based on the first texture map, and further ensure that a normal target texture map is obtained based on the second texture map.
[0048] The texture map is obtained by mapping the model base to texture using texture coordinates. Taking the first texture map as an example, the process of mapping the model base to texture is described in detail. The texture mapping process corresponding to the first texture map is as follows:
[0049] First, according to the texture distribution corresponding to the second model base, the texture coordinates corresponding to the pixel points of the second model base in the texture mapping coordinate system are calculated, and the texture coordinates corresponding to the pixel points of the second model base in the texture mapping coordinate system are determined as the first texture coordinates (u, v), wherein the value range of u and v is 0-1.
[0050] Secondly, the image size of the first texture image is preset, wherein the image size includes the width (w) and height (h) of the first texture image.
[0051] Again, according to the first texture coordinates and the image size, the coordinates of the pixels of the first texture map in the pixel coordinate system are calculated, and the coordinates of the pixels of the first texture map in the pixel coordinate system are determined as the first pixel coordinates.
[0052] Specifically, the first pixel coordinate x is obtained by multiplying the first texture coordinate u by the width of the first texture map, and the first pixel coordinate y is obtained by multiplying the first texture coordinate v by the height of the first texture map. Thus, the first pixel coordinate is (x=u*w, y=v*h).
[0053] Since each texture coordinate in the first texture coordinate has a corresponding pixel in the second model base, and the first pixel coordinate is calculated by the first texture coordinate and the image size, each pixel of the first texture map has a corresponding pixel in the model base, so the texture information of each pixel of the first texture map can be used to represent the texture information of the corresponding pixel of the second model base.
[0054] Finally, the texture information corresponding to the second model base is assigned to the first pixel coordinates to obtain a first texture map.
[0055] Since the second model base is not filled with texture information, initialized texture information can be pre-configured for the pixels of the second model base. In other words, the texture information of each pixel of the first texture map is used to represent the initialized texture information.
[0056] In the embodiment of the present disclosure, the specific implementation process of determining the second pixel point coordinates corresponding to the texture information in the first pixel point coordinates is as follows: Figure 3 As shown, Figure 3 The present invention is a flowchart of a method for determining pixel coordinates provided in an embodiment of the present invention. Figure 3 The method shown may include the following steps:
[0057] Step S301: based on the texture distribution corresponding to the second model base, determine the second texture coordinates, the second texture coordinates being the texture coordinates corresponding to the pixel points of the first model base in the texture mapping coordinate system.
[0058] Step S302: For the second texture coordinates, determine the second pixel coordinates using the first coordinate correspondence and the second coordinate correspondence, where the first coordinate correspondence is the correspondence between the second texture coordinates and the first texture coordinates, and the second coordinate correspondence is the correspondence between the first texture coordinates and the first pixel coordinates.
[0059] The second texture coordinates are determined based on the texture distribution corresponding to the second model base, which can ensure the consistency between the second texture coordinates and the first texture coordinates. Since the second pixel coordinates are determined for the second texture coordinates using the first coordinate correspondence and the second coordinate correspondence, when the second texture coordinates and the first texture coordinates have coordinate consistency, the determination of the second pixel coordinates can be made simpler and more direct. This improves the efficiency of determining the target texture map, and further improves the efficiency of generating the target model base.
[0060] In the embodiment of the present disclosure, the specific implementation of step S302 may be as follows:
[0061] First, for the second texture coordinate, the texture coordinate of the first texture coordinate corresponding to the second texture coordinate is obtained by using the first coordinate correspondence relationship, and the texture coordinate of the first texture coordinate corresponding to the second texture coordinate is determined as the target texture coordinate.
[0062] Then, for the target texture coordinates, the pixel coordinates corresponding to the target texture coordinates in the first pixel coordinates are obtained using the second coordinate correspondence relationship, and the pixel coordinates corresponding to the target texture coordinates in the first pixel coordinates are determined as the second pixel coordinates.
[0063] In the embodiment of the present disclosure, the target texture map may be obtained based on the second texture map by: determining the second texture map as the target texture map.
[0064] However, in actual applications, there is often a situation where the pixel points of the first model base are less than the pixel points of the second model base. Therefore, in the case of obtaining the second texture map by assigning texture information to the pixel points of the first texture map, the texture information of the pixel points of the second texture map is often sparse. At this time, if the second texture map is directly determined as the target texture map, the texture information of the pixel points of the target texture map will also be sparse, and then the texture information of the pixel points of the target model base will also be sparse.
[0065] Therefore, in order to improve the density of texture information of the pixel points of the target model base, in the embodiment of the present disclosure, texture information interpolation processing can be performed on the second texture map based on the second pixel point coordinates to obtain the target texture map.
[0066] Specifically, when the texture information includes color information, the process of interpolating the texture information of the second texture map based on the second pixel coordinates is as follows: interpolating the color information of the second texture map based on the second pixel coordinates. The color information includes the color value of each pixel in the base model, and specifically may include the color value of each pixel in the three color channels of red (R), green (G), and blue (B).
[0067] In addition, texture information may also include other information besides color information, such as shape information and pattern information.
[0068] In the embodiment of the present disclosure, the specific implementation method of performing color information interpolation processing on the second texture map based on the second pixel point coordinates is as follows: Figure 4 As shown, Figure 4 The present invention is a flowchart of an interpolation processing method provided in an embodiment of the present invention. Figure 4 The method shown may include the following steps:
[0069] Step S401: Determine the pixel points to be interpolated in the second texture map.
[0070] Step S402: using the second pixel point coordinates, determine the centroid coordinates corresponding to the pixel point to be interpolated.
[0071] Step S403: using the centroid coordinates and the color information, determine the color information to be interpolated corresponding to the pixel point to be interpolated.
[0072] Step S404: assigning the color information to be interpolated to the pixel points to be interpolated, so as to perform color information interpolation on the second texture map.
[0073] On the basis of determining the pixel points to be interpolated, the color information to be interpolated corresponding to the pixel points to be interpolated is determined based on the centroid coordinates and color information corresponding to the pixel points to be interpolated, and the color information to be interpolated is assigned to the pixel points to be interpolated, which can not only make the color information of the pixel points of the target texture map denser, but also make the transition of the color information of the pixel points smoother.
[0074] In the embodiment of the present disclosure, the pixel points to be interpolated are determined as follows:
[0075] First, among the pixels of the second texture image, any three adjacent pixels corresponding to the coordinates of the second pixel are determined.
[0076] Then, in a triangular area formed by any three adjacent pixels, a pixel is selected as a pixel to be interpolated.
[0077] In the embodiments of the present disclosure, the following formula may be used to determine the center of gravity coordinates:
[0078]
[0079] Among them, P is the centroid coordinate P = (w1, w2, w3), and the pixel coordinates corresponding to any three adjacent pixel points P1, P2 and P3.
[0080] In the embodiment of the present disclosure, when the color information is the color values of the three color channels of RGB, the following formula can be used to determine the color information to be interpolated:
[0081] tex=w1*tex1+w2*tex2+w3*tex3
[0082] Among them, tex is used to represent the color values of the three RGB color channels at P. tex1, tex2 and tex3 are used for the color values of the three RGB color channels at P1, P2 and P3 respectively.
[0083] In the embodiment of the present disclosure, after obtaining the target texture map, the second model base needs to be texture filled based on the target texture map to obtain the target model base. The specific implementation method is as follows:
[0084] First, the correspondence between the target texture map and the second model base is determined. Then, according to the target texture map, the texture information to be filled corresponding to the second model base is searched in the correspondence. Finally, according to the texture information to be filled, the second model base is texture filled to obtain the target model base.
[0085] Filling the second model base with texture to obtain the target model base can ensure that the target model base has a better visual effect. Figure 5 As shown, Figure 5 A schematic diagram of a model substrate provided in an embodiment of the present disclosure. Figure 5 The model base on the left side is the second model base, and the model base on the right side is the target model base. It can be clearly seen from the figure that the visual effect of the target model base is better than that of the second model base.
[0086] In the embodiment of the present disclosure, the pixel point correspondence relationship may be a correspondence relationship determined by the first texture coordinates. Specifically, the method for generating the pixel point correspondence relationship may include the following steps:
[0087] Firstly, according to the correspondence between each pixel point of the target texture map and the first texture coordinates, the first texture coordinates corresponding to each pixel point of the target texture map are determined.
[0088] Then, for the first texture coordinates corresponding to each pixel point of the target texture map, the pixel points corresponding to each pixel point of the target texture map in the first model base are determined according to the correspondence between the first texture coordinates and the pixel points of the first model base.
[0089] Finally, a pixel point correspondence relationship is generated according to the pixel points corresponding to each pixel point of the target texture image in the first model basis.
[0090] In the embodiment of the present disclosure, according to the pixel correspondence relationship, the specific implementation method of searching the target texture map for the texture information to be filled corresponding to the pixel of the second model base is as follows:
[0091] First, the texture information corresponding to each pixel of the target texture map is determined.
[0092] Then, according to the pixel correspondence relationship, the pixel points corresponding to the pixel points of the second model base in the target texture map are determined.
[0093] Finally, the texture information to be filled corresponding to each pixel point of the second model base is obtained according to the pixel point corresponding to the pixel point of the second model base in the target texture map and the texture information corresponding to each pixel point of the target texture map.
[0094] In the embodiment of the present disclosure, multiple target standard model bases that meet different target requirements can be obtained to obtain corresponding multiple target model bases, and virtual images can be generated for the standard model bases and the multiple target model bases.
[0095] like Figure 6 As shown, in an embodiment of the present disclosure, a device for generating a model substrate is provided, the device comprising:
[0096] A target texture map determining unit 601 is used to determine a target texture map corresponding to a second model base using texture information corresponding to a first model base, where the first model base is a base model preset for the second model base;
[0097] The target model base obtaining unit 602 is used to perform texture filling on the second model base based on the target texture map to obtain the target model base.
[0098] In one implementation, the target texture map determining unit 601 may include:
[0099] A first texture map obtaining subunit is used to obtain a first texture map corresponding to the second model base using a first texture coordinate, where the first texture coordinate is a texture coordinate corresponding to a pixel point of the second model base in a texture mapping coordinate system;
[0100] A first coordinate determination subunit is used to determine the second pixel point coordinates corresponding to the texture information in the first pixel point coordinates, where the first pixel point coordinates are the coordinates corresponding to the pixel point of the first texture image in the pixel coordinate system;
[0101] A second texture map obtaining subunit is used to assign texture information to the pixel points of the first texture map based on the second pixel point coordinates, so as to obtain a second texture map corresponding to the second model base;
[0102] The target texture map obtaining subunit is used to obtain the target texture map based on the second texture map.
[0103] In one implementation, the first coordinate determination subunit may include:
[0104] A second texture coordinate determining subunit, for determining second texture coordinates based on the texture distribution corresponding to the second model base, the second texture coordinates being texture coordinates corresponding to the pixel points of the first model base in the texture mapping coordinate system;
[0105] The second coordinate determination subunit is used to determine the second pixel point coordinates for the second texture coordinates using the first coordinate correspondence and the second coordinate correspondence, wherein the first coordinate correspondence is the correspondence between the second texture coordinates and the first texture coordinates, and the second coordinate correspondence is the correspondence between the first texture coordinates and the first pixel point coordinates.
[0106] In one implementation, when the texture information includes color information, the target texture map obtaining subunit may include:
[0107] The interpolation processing subunit is used to perform color information interpolation processing on the second texture map based on the second pixel point coordinates to obtain a target texture map.
[0108] In one implementation, the interpolation processing subunit may include:
[0109] A pixel point determination subunit, used for determining the pixel points to be interpolated in the second texture map;
[0110] A barycentric coordinate determination subunit, used to determine the barycentric coordinates corresponding to the pixel point to be interpolated using the second pixel point coordinates;
[0111] The subunit for determining the color information to be interpolated is used to determine the color information to be interpolated corresponding to the pixel point to be interpolated by using the centroid coordinates and the color information;
[0112] The color interpolation subunit is used to assign the color information to be interpolated to the pixel points to be interpolated, so as to perform color information interpolation on the second texture map.
[0113] In one implementation, the target model base obtaining unit 602 may include:
[0114] A correspondence determination subunit, used to determine a pixel correspondence, where the pixel correspondence is a correspondence between pixels of a target texture image and a second model base;
[0115] The subunit for determining texture information to be filled is used to search for texture information to be filled corresponding to the pixel points of the second model base in the target texture map according to the corresponding relationship between the pixel points;
[0116] The target model base obtaining subunit is used to perform texture filling on the second model base according to the texture information to be filled, so as to obtain the target model base.
[0117] In the technical solution disclosed herein, the acquisition, storage and application of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0118] According to an embodiment of the present disclosure, the present disclosure also provides an electronic device and a readable storage medium.
[0119] Figure 7 A schematic block diagram of an example electronic device 700 that can be used to implement an embodiment of the present disclosure is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0120] like Figure 7 As shown, the device 700 includes a computing unit 701, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 702 or a computer program loaded from a storage unit 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the device 700 can also be stored. The computing unit 701, the ROM 702, and the RAM 703 are connected to each other via a bus 704. An input / output (I / O) interface 705 is also connected to the bus 704.
[0121] A number of components in the device 700 are connected to the I / O interface 705, including: an input unit 706, such as a keyboard, a mouse, etc.; an output unit 707, such as various types of displays, speakers, etc.; a storage unit 708, such as a disk, an optical disk, etc.; and a communication unit 709, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 709 allows the device 700 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0122] The computing unit 701 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 701 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 701 performs the various methods and processes described above, such as the generation method of the model substrate. For example, in some embodiments, the generation method of the model substrate may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 708. In some embodiments, part or all of the computer program may be loaded and / or installed on the device 700 via ROM 702 and / or communication unit 709. When the computer program is loaded into RAM 703 and executed by the computing unit 701, one or more steps of the generation method of the model substrate described above may be performed. Alternatively, in other embodiments, the computing unit 701 may be configured to perform the generation method of the model substrate by any other appropriate means (e.g., by means of firmware).
[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable model substrate generation device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0125] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0127] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0128] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0130] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A method for generating a model base, comprising: Obtaining a first texture map corresponding to the second model base using the first texture coordinates, wherein the first texture coordinates are texture coordinates corresponding to a pixel point of the second model base in a texture mapping coordinate system; Determine, in the first pixel coordinates, second pixel coordinates corresponding to the texture information corresponding to the first model base, wherein the first pixel coordinates are coordinates corresponding to the pixel of the first texture map in the pixel coordinate system, and the first model base is a base model preset for the second model base; Based on the coordinates of the second pixel points, the texture information is assigned to the pixel points of the first texture map to obtain a second texture map corresponding to the second model base, and based on the second texture map, a target texture map corresponding to the second model base is determined; Based on the target texture map, texture filling is performed on the second model base to obtain a target model base.
2. The method according to claim 1, wherein: The method for determining the coordinates of the second pixel point includes: Determine a second texture coordinate based on the texture distribution corresponding to the second model base, where the second texture coordinate is the texture coordinate corresponding to the pixel point of the first model base in the texture mapping coordinate system; For the second texture coordinates, the second pixel point coordinates are determined using the first coordinate correspondence and the second coordinate correspondence, wherein the first coordinate correspondence is the correspondence between the second texture coordinates and the first texture coordinates, and the second coordinate correspondence is the correspondence between the first texture coordinates and the first pixel point coordinates.
3. The method according to claim 1 or 2, wherein: In the case where the texture information includes color information, obtaining the target texture map based on the second texture map includes: Based on the second pixel point coordinates, color information interpolation processing is performed on the second texture map to obtain the target texture map.
4. The method according to claim 3, wherein: The performing color information interpolation processing on the second texture map based on the second pixel point coordinates includes: Determining a pixel point to be interpolated in the second texture map; Determine the centroid coordinates corresponding to the pixel point to be interpolated using the second pixel point coordinates; Determine the color information to be interpolated corresponding to the pixel point to be interpolated by using the centroid coordinates and the color information; The color information to be interpolated is assigned to the pixel point to be interpolated, so as to perform color information interpolation on the second texture map.
5. The method according to claim 1 or 2, wherein: The step of performing texture filling on the second model base based on the target texture map to obtain a target model base includes: Determine a pixel point correspondence relationship, where the pixel point correspondence relationship is a pixel point correspondence relationship between the target texture map and the second model base; According to the pixel point correspondence relationship, searching in the target texture map for texture information to be filled corresponding to the pixel points of the second model base; According to the texture information to be filled, the second model base is texture filled to obtain the target model base.
6. A device for generating a model substrate, comprising: The target texture map determination unit includes: a first texture map acquisition subunit, a first coordinate determination subunit, a second texture map acquisition subunit, and a target texture map acquisition subunit, wherein: The first texture map obtaining subunit is used to obtain a first texture map corresponding to the second model base using a first texture coordinate, wherein the first texture coordinate is a texture coordinate corresponding to a pixel point of the second model base in a texture mapping coordinate system; The first coordinate determination subunit is used to determine, in the first pixel coordinates, the second pixel coordinates corresponding to the texture information corresponding to the first model base, wherein the first pixel coordinates are the coordinates corresponding to the pixel of the first texture map in the pixel coordinate system, and the first model base is a base model preset for the second model base; The second texture map obtaining subunit is used to assign the texture information to the pixel points of the first texture map based on the second pixel point coordinates, so as to obtain a second texture map corresponding to the second model base; The target texture map obtaining subunit is used to obtain the target texture map based on the second texture map; The target model base obtaining unit is used to perform texture filling on the second model base based on the target texture map to obtain the target model base.
7. The device according to claim 6, wherein: The first coordinate determination subunit comprises: A second texture coordinate determining subunit, configured to determine second texture coordinates based on the texture distribution corresponding to the second model base, wherein the second texture coordinates are texture coordinates corresponding to the pixel points of the first model base in the texture mapping coordinate system; The second coordinate determination subunit is used to determine the second pixel point coordinates for the second texture coordinates by using the first coordinate correspondence relationship and the second coordinate correspondence relationship, wherein the first coordinate correspondence relationship is the correspondence relationship between the second texture coordinates and the first texture coordinates, and the second coordinate correspondence relationship is the correspondence relationship between the first texture coordinates and the first pixel point coordinates.
8. The device according to claim 6 or 7, wherein: In the case where the texture information includes color information, the target texture map obtaining subunit includes: The interpolation processing subunit is used to perform color information interpolation processing on the second texture map based on the second pixel point coordinates to obtain the target texture map.
9. The device according to claim 8, wherein: The interpolation processing subunit includes: A pixel point determination subunit, used to determine the pixel points to be interpolated in the second texture map; A barycentric coordinate determination subunit, used to determine the barycentric coordinates corresponding to the pixel point to be interpolated using the second pixel point coordinates; A subunit for determining color information to be interpolated, used to determine the color information to be interpolated corresponding to the pixel point to be interpolated by using the centroid coordinates and the color information; The color interpolation subunit is used to assign the color information to be interpolated to the pixel point to be interpolated, so as to perform color information interpolation on the second texture map.
10. The device according to claim 6 or 7, wherein: The target model base obtaining unit comprises: A correspondence determination subunit, used to determine a pixel correspondence, where the pixel correspondence is a pixel correspondence between the target texture map and the second model base; A subunit for determining texture information to be filled, used for searching, in the target texture map, for texture information to be filled corresponding to the pixel points of the second model base according to the pixel point correspondence relationship; The target model base obtaining subunit is used to perform texture filling on the second model base according to the texture information to be filled, so as to obtain the target model base.
11. An electronic device, comprising: at least one processor; as well as a memory communicatively connected to the at least one processor; wherein, The memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 5.
12. A non-transitory computer-readable storage medium storing computer instructions, wherein: The computer instructions are used to enable a computer to execute the method according to any one of claims 1 to 5.
13. A computer program product comprising a computer program / instructions, wherein: When the computer program / instructions are executed by a processor, the method according to any one of claims 1 to 5 is implemented.
Citation Information
Patent Citations
Three-dimensional shape and texture reconstruction method and system based on single image and storage medium
CN111127631A
Texture map generation method and device, electronic equipment and storage medium
CN113963110A