WO2020133862A1 - 游戏角色模型的生成方法、装置、处理器及终端 - Google Patents

游戏角色模型的生成方法、装置、处理器及终端 Download PDF

Info

Publication number
WO2020133862A1
WO2020133862A1 PCT/CN2019/085235 CN2019085235W WO2020133862A1 WO 2020133862 A1 WO2020133862 A1 WO 2020133862A1 CN 2019085235 W CN2019085235 W CN 2019085235W WO 2020133862 A1 WO2020133862 A1 WO 2020133862A1
Authority
WO
WIPO (PCT)
Prior art keywords
texture
game character
user
dimensional
face
Prior art date
Application number
PCT/CN2019/085235
Other languages
English (en)
French (fr)
Inventor
陈康
张伟东
Original Assignee
网易(杭州)网络有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 网易(杭州)网络有限公司 filed Critical 网易(杭州)网络有限公司
Priority to US16/632,396 priority Critical patent/US11839820B2/en
Publication of WO2020133862A1 publication Critical patent/WO2020133862A1/zh

Links

Images

Classifications

    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/55Controlling game characters or game objects based on the game progress
    • A63F13/56Computing the motion of game characters with respect to other game characters, game objects or elements of the game scene, e.g. for simulating the behaviour of a group of virtual soldiers or for path finding
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • A63F13/65Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor automatically by game devices or servers from real world data, e.g. measurement in live racing competition
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/60Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor
    • A63F13/65Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor automatically by game devices or servers from real world data, e.g. measurement in live racing competition
    • A63F13/655Generating or modifying game content before or while executing the game program, e.g. authoring tools specially adapted for game development or game-integrated level editor automatically by game devices or servers from real world data, e.g. measurement in live racing competition by importing photos, e.g. of the player
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F13/00Video games, i.e. games using an electronically generated display having two or more dimensions
    • A63F13/80Special adaptations for executing a specific game genre or game mode
    • A63F13/822Strategy games; Role-playing games
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T15/003D [Three Dimensional] image rendering
    • G06T15/04Texture mapping
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T19/00Manipulating 3D models or images for computer graphics
    • G06T19/20Editing of 3D images, e.g. changing shapes or colours, aligning objects or positioning parts
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • AHUMAN NECESSITIES
    • A63SPORTS; GAMES; AMUSEMENTS
    • A63FCARD, BOARD, OR ROULETTE GAMES; INDOOR GAMES USING SMALL MOVING PLAYING BODIES; VIDEO GAMES; GAMES NOT OTHERWISE PROVIDED FOR
    • A63F2300/00Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game
    • A63F2300/50Features of games using an electronically generated display having two or more dimensions, e.g. on a television screen, showing representations related to the game characterized by details of game servers
    • A63F2300/55Details of game data or player data management
    • A63F2300/5546Details of game data or player data management using player registration data, e.g. identification, account, preferences, game history
    • A63F2300/5553Details of game data or player data management using player registration data, e.g. identification, account, preferences, game history user representation in the game field, e.g. avatar
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/30Subject of image; Context of image processing
    • G06T2207/30196Human being; Person
    • G06T2207/30201Face
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2219/00Indexing scheme for manipulating 3D models or images for computer graphics
    • G06T2219/20Indexing scheme for editing of 3D models
    • G06T2219/2012Colour editing, changing, or manipulating; Use of colour codes

Definitions

  • the present disclosure relates to the field of computers, and in particular, to a method, device, processor, and terminal for generating a game character model.
  • image-based face fusion, face replacement, and face deformation are relatively common applications.
  • the operation process of these applications is mainly divided into two steps: face mapping and face fusion.
  • face fusion after performing pixel-level alignment processing on the face areas of the two images, face fusion can be performed. According to the needs of different applications, you can choose to calculate the weighted average of the pixel values of the two images for the same position according to a certain ratio, or you can use Poisson fusion to achieve a more natural edge transition effect.
  • the face mapping and face fusion provided in the related art are generally only applicable to two-dimensional face images, and the operation process usually includes the following steps:
  • the first step face detection and key point positioning, automatically detects the face area from the two-dimensional face image, and locates multiple feature points in key areas such as the edge of the face, eyebrows, eyes, nose, mouth and so on.
  • the image is Delaunay triangulated based on the located multiple feature points.
  • the third step is to calculate the face mapping relationship between the source image and the target image based on the Delaunay triangulation.
  • the calculation method is: for each pixel p in the target image, find the three vertices of the triangle to which it belongs (these The vertices belong to the multiple feature points located above), number D1, D2, and D3, and calculate the coordinates of the center of gravity of p relative to the three vertices (u, v, w); the three feature points with the same number in the source image
  • the pixels located in the position of the center of gravity coordinates (u, v, w) in the triangle formed by S1, S2, and S3 are the pixels corresponding to the pixel p.
  • the fourth step is to use the corresponding fusion method according to different application scenarios to fuse the source image into the target image.
  • At least some embodiments of the present disclosure provide a method, device, processor, and terminal for generating a game character model, so as to solve at least the face mapping and face fusion provided in the related art are generally only applicable to two-dimensional face images, But it is not suitable for the technical problems of face mapping and fusion in the three-dimensional game environment.
  • a method for generating a game character model including:
  • acquiring the user texture corresponding to the two-dimensional user image to be used includes: performing three-dimensional reconstruction of the two-dimensional user image to be used to obtain a three-dimensional model of the two-dimensional user image to be used; obtaining the user texture according to the three-dimensional model.
  • the method before mapping the user texture to the initial texture, and before obtaining the mapped texture, the method further includes: configuring a mapping relationship coding picture according to the resolution of the user texture, and storing the initial value of the game character through each pixel value in the mapping relationship coding picture The texture coordinates of the corresponding pixels in the texture.
  • mapping the user texture to the initial texture, and obtaining the mapped texture includes: for each pixel in the user texture, reading the pixel value at the corresponding position in the mapping relationship encoding map; decoding the pixel value to obtain the texture Coordinates, according to the texture coordinates, determine the pixels to be mapped of each pixel in the user texture in the initial texture to obtain the mapped texture.
  • the method before acquiring the user texture corresponding to the two-dimensional user image to be used, the method further includes: acquiring an initial two-dimensional user image; processing the portion of the initial two-dimensional user image that meets the preset image threshold to obtain the to-be-used 2D user image.
  • the method further includes: adjusting the skin color of the game character based on the user's skin color to obtain an adjustment result; and integrating the adjustment result into the mapped texture.
  • the method further includes: obtaining a makeup template matching the initial two-dimensional user image; and superimposing the makeup art resources corresponding to the makeup template to the game Role model.
  • the two-dimensional user image to be used is a two-dimensional face image to be used
  • the game character model is a game character face model
  • a device for generating a game character model including:
  • Get component set to get the user map corresponding to the two-dimensional user image to be used; map component, set to map the user map to the initial texture of the game character, get the mapped texture of the game character; generate component, set to map The post texture is merged with the game character grid to generate a game character model.
  • the acquisition component includes: a reconstruction unit configured to perform three-dimensional reconstruction of the two-dimensional user image to be used to obtain a three-dimensional model of the two-dimensional user image to be used; an acquisition unit configured to obtain a user texture according to the three-dimensional model.
  • the above device further includes: a first processing component configured to configure a mapping relationship encoding map according to the resolution of the user texture, and save each pixel value of the game character corresponding to the pixel in the initial texture of the game character through the mapping relationship encoding map Texture coordinates.
  • a first processing component configured to configure a mapping relationship encoding map according to the resolution of the user texture, and save each pixel value of the game character corresponding to the pixel in the initial texture of the game character through the mapping relationship encoding map Texture coordinates.
  • the mapping component includes: a reading unit configured to read the pixel value at a corresponding position in the mapping relationship encoding map for each pixel in the user map; a mapping unit configured to decode the pixel value to obtain For texture coordinates, the pixels to be mapped of each pixel in the user texture in the initial texture are determined according to the texture coordinates to obtain the mapped texture.
  • the above device further includes a second processing component configured to acquire an initial two-dimensional user image, and process a portion of the initial two-dimensional user image that meets a preset image threshold to obtain a two-dimensional user image to be used.
  • a second processing component configured to acquire an initial two-dimensional user image, and process a portion of the initial two-dimensional user image that meets a preset image threshold to obtain a two-dimensional user image to be used.
  • the above device further includes: a third processing component configured to adjust the skin color of the game character based on the user's skin color to obtain an adjustment result, and fuse the adjustment result to the mapped texture.
  • a third processing component configured to adjust the skin color of the game character based on the user's skin color to obtain an adjustment result, and fuse the adjustment result to the mapped texture.
  • the above device further includes: a fourth processing component, configured to obtain a makeup template matching the initial two-dimensional user image, and overlay the makeup art resources corresponding to the makeup template to the game character model.
  • a fourth processing component configured to obtain a makeup template matching the initial two-dimensional user image, and overlay the makeup art resources corresponding to the makeup template to the game character model.
  • the two-dimensional user image to be used is a two-dimensional face image to be used
  • the game character model is a game character face model
  • the storage medium includes a stored program, wherein, when the program is running, the device where the storage medium is located is controlled to execute any one of the above-mentioned game character model generation methods.
  • a processor configured to run a program, wherein when the program runs, any one of the above-mentioned game character model generation methods is executed.
  • a terminal including: one or more processors, a memory, a display device, and one or more programs, wherein the one or more programs are stored in the memory and are It is configured to be executed by one or more processors, and one or more programs are used to execute any one of the method for generating a game character model.
  • a user texture corresponding to the two-dimensional user image to be used is obtained by mapping the user texture to the initial texture of the game character to obtain the mapped texture of the game character, and the mapping The texture is merged with the game character grid to generate the game character model, which achieves the automatic modification of the appearance of the game character based on the user's two-dimensional image, so as to integrate the local features of the user's two-dimensional image (for example: the skin color of the face, Freckles, decree lines, etc.) are blended into the game characters according to a certain proportion, so as to achieve the technical effects of improving processing efficiency, optimizing visual effects, and greatly expanding the freedom of pinch face gameplay, thereby solving the problems provided in related technologies. Face mapping and face fusion are usually only applicable to two-dimensional face images, but not to the technical problems of face mapping and fusion in three-dimensional game environments.
  • FIG. 1 is a flowchart of a method for generating a game character model according to one embodiment of the present disclosure
  • FIG. 2 is a structural block diagram of a device for generating a game character model according to one embodiment of the present disclosure
  • FIG. 3 is a structural block diagram of a device for generating a game character model according to one optional embodiment of the present disclosure.
  • Face mapping refers to given two parameter spaces A and B about the face model. For each point in the parameter space A, a corresponding point can be found in the parameter space B.
  • the dimension of the parameter space has a clear physical meaning.
  • the two-dimensional parameter space corresponds to a two-dimensional image
  • the three-dimensional parameter space corresponds to a three-dimensional model. According to the different dimensions of parameter space A and parameter space B, it can be divided into the following multiple cases:
  • Case 1 2D-2D mapping, that is, parameter space A is the user's face image, and parameter space B is the image formed by the rendering of the three-dimensional game character;
  • Case 2 3D-3D mapping, that is, parameter space A is the user's three-dimensional face model, and parameter space B is the three-dimensional game character model;
  • Case 3 2D-3D mapping, that is, parameter space A is the user's face image, and parameter space B is the three-dimensional game character model.
  • Face fusion refers to the natural fusion of the face in one image into the face area of another image according to a preset ratio. If the blending ratio is 100%, it is represented as a face swap; if the process of blending the blending ratio from 0% to 100% is played in the form of frame animation, it is represented as face morphing.
  • an embodiment of a method for generating a game character model is provided. It should be noted that the steps shown in the flowchart in the drawings may be in a computer system such as a set of computer-executable instructions Execution, and although the logical order is shown in the flowchart, in some cases, the steps shown or described may be performed in an order different from here.
  • the mobile terminal may include one or more processors (processors may include but not limited to a central processing unit (CPU), a graphics processor (GPU), a digital signal processing (DSP) chip, a microcomputer A processing device such as a processor (MCU) or programmable logic device (FPGA)) and a memory set to store data.
  • processors may include but not limited to a central processing unit (CPU), a graphics processor (GPU), a digital signal processing (DSP) chip, a microcomputer A processing device such as a processor (MCU) or programmable logic device (FPGA)) and a memory set to store data.
  • the above mobile terminal may further include a transmission device set as a communication function, an input-output device, and a display device.
  • the mobile terminal may further include more or less components than the above structural description, or have a configuration different from the above structural description.
  • the memory may be configured to store computer programs, for example, software programs and components of application software, such as the computer program corresponding to the method for generating a game character model in the embodiments of the present disclosure, and the processor executes the computer program stored in the memory to execute Various functional applications and data processing, that is, the method of generating the above-mentioned game character model.
  • the memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory.
  • the memory may further include memories remotely provided with respect to the processor, and these remote memories may be connected to the mobile terminal through a network. Examples of the aforementioned network include, but are not limited to, the Internet, intranet, local area network, mobile communication network, and combinations thereof.
  • the transmission device is configured to receive or send data via a network.
  • the above-mentioned specific example of the network may include a wireless network provided by a communication provider of a mobile terminal.
  • the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through the base station to communicate with the Internet.
  • the transmission device may be a radio frequency (Radio Frequency, RF for short) component, which is configured to communicate with the Internet in a wireless manner.
  • RF Radio Frequency
  • the display device may be, for example, a touch screen liquid crystal display (LCD), which may enable a user to interact with the user interface of the mobile terminal.
  • LCD liquid crystal display
  • FIG. 1 is a flowchart of a method for generating a game character model according to one embodiment of the present disclosure. As shown in FIG. 1, The method includes the following steps:
  • Step S12 Acquire user stickers corresponding to the two-dimensional user image to be used
  • Step S14 Map the user texture to the initial texture of the game character to obtain the mapped texture of the game character;
  • step S16 the mapped texture is merged with the game character grid to generate a game character model.
  • the user texture corresponding to the two-dimensional user image to be used can be obtained by mapping the user texture to the initial texture of the game character to obtain the mapped texture of the game character, and the mapped texture and the game character
  • the grid is fused to generate a game character model, which achieves the automatic modification of the appearance of the game character based on the user's two-dimensional image, so as to localize the user's two-dimensional image's local features (such as facial skin color, freckles, decree lines) Etc.)
  • the purpose of integrating into the game characters according to a certain proportion, so as to achieve the technical effects of improving processing efficiency, optimizing visual effects, greatly expanding the freedom of pinch face gameplay, and thereby solving the face mapping and Face fusion is usually only applicable to two-dimensional face images, but not to the technical problems of face mapping and fusion in three-dimensional game environments.
  • the two-dimensional user image to be used is a two-dimensional face image to be used
  • the game character model is a face model of a game character.
  • the following only uses the two-dimensional facial image to obtain the face model of the game character as an example for illustration, but it does not constitute an undue limitation of the present disclosure.
  • the corresponding part model of the game character can also be acquired through the two-dimensional image of other parts of the user (for example, hands and legs).
  • step S12 acquiring the user texture corresponding to the two-dimensional user image to be used may include the following execution steps:
  • Step S121 Three-dimensional reconstruction of the two-dimensional user image to be used to obtain a three-dimensional model of the two-dimensional user image to be used;
  • Step S122 Obtain user stickers according to the three-dimensional model.
  • 3D face reconstruction is based on input or output data form, reconstruction accuracy requirements, etc. There are many different algorithm frameworks.
  • three-dimensional face reconstruction mainly refers to three-dimensional face reconstruction based on a single image, which collects a large amount of three-dimensional face data in advance to construct a principal component analysis base on the three-dimensional shape of the face, Then, the three-dimensional face base is used to fit the two-dimensional face in the user image to obtain the corresponding three-dimensional model.
  • the user's face in the two-dimensional face image to be used is three-dimensionally reconstructed to form a three-dimensional model of the two-dimensional face image to be used, to ensure that the two-dimensional face image to be used and the There is a known 2D-3D mapping relationship between the 3D models of the 2D face images used.
  • the texture can be regarded as a parametric representation of the three-dimensional grid on the two-dimensional plane, that is, each point on the three-dimensional model can find the corresponding pixel on the texture space according to the texture coordinates (u, v). Therefore, it is possible to obtain the corresponding face texture through the three-dimensional model of the two-dimensional face image to be used and the initial face texture of the corresponding game character through the three-dimensional model of the game character's face. Then, by mapping the human face texture to the initial face texture of the game character, the initial face texture of the game character is replaced to obtain the mapped face texture of the game character.
  • step S14 the user texture is mapped to the initial texture, and before the mapped texture is obtained, the following execution steps may also be included:
  • step S13 the mapping relationship encoding map is configured according to the resolution of the user texture, and each pixel value in the mapping relationship encoding map saves the texture coordinates of the corresponding pixel in the initial texture of the game character.
  • mapping relationship encoding map is usually determined by the resolution of the face map obtained from the three-dimensional model of the two-dimensional face image, which may be an image with the same resolution size as the face map.
  • the number of mapping maps to be constructed is usually determined by the number of game characters set in the game. In an alternative embodiment, the number of mapping relationship encoding pictures is the same as the number of game characters set in the game.
  • Each pixel of each mapping relationship encoding map may contain four channels of RGBA, which are used to encode texture coordinates of corresponding pixels in the initial face map of the game character.
  • the RG channel can be used to encode the u coordinate of the corresponding pixel in the initial face map in advance
  • the BA channel can be used to encode the v coordinate of the corresponding pixel in the initial face map, and then save the encoding result to The mapping relationship to be used in each pixel value of the map.
  • step S14 the user texture is mapped to the initial texture, and the obtained texture may include the following execution steps:
  • Step S141 For each pixel in the user's texture map, read the pixel value at the corresponding position in the mapping relationship coding map;
  • Step S142 Decode the pixel values to obtain texture coordinates, and determine the pixels to be mapped in the initial texture of each pixel in the user texture according to the texture coordinates to obtain the mapped texture.
  • For each pixel in the user's face map read and decode the pixel value at the corresponding position in the mapping relationship encoding map, and the resulting texture coordinate is the pixel to be mapped on the pixel's initial face map of the game character.
  • the pixels in the human face map are used to replace the pixels to be mapped on the initial face map to obtain the mapped map.
  • step S12 before acquiring the user texture corresponding to the two-dimensional user image to be used, the following execution steps may also be included:
  • Step S10 acquiring an initial two-dimensional user image
  • Step S11 Process a part of the initial two-dimensional user image that meets the preset image threshold to obtain a two-dimensional user image to be used.
  • the two-dimensional person can be directly All pixels in the face area of the face image are mapped into the three-dimensional model of the face of the game character. However, due to various factors such as lighting, occlusion, noise, etc., the quality of some pixels in the face area of the two-dimensional face image is poor. If all these pixels are mapped to the three-dimensional model of the face of the game character, the subsequent The fusion effect has a negative impact.
  • step S14 the user texture is mapped to the initial texture, and after the mapped texture is obtained, the following execution steps may also be included:
  • Step S15 Adjust the skin color of the game character based on the user's skin color to obtain an adjustment result, and fuse the adjustment result into the mapped texture.
  • image completion processing is also required, and the game character also needs to be based on the user's skin color Adjust the skin color to make the two colors as close as possible, and blend the adjustment result into the mapped face map by Poisson fusion.
  • step S16 after the mapped texture is merged with the game character grid to generate the game character model, the following execution steps may also be included:
  • Step S17 obtaining a makeup template matching the initial two-dimensional user image
  • step S18 the makeup art resources corresponding to the makeup template are superimposed on the game character model.
  • common makeup art resources for example: eyebrows, eye shadows, beards, lip glosses, etc.
  • a human face can be pre-configured to identify and match the initial two based on image processing and pattern recognition methods
  • the makeup template with the closest Uygur face image, and then the makeup art resources corresponding to the makeup template are further superimposed on the face model of the game character according to alpha blending to form the final display result.
  • the method according to the above embodiments can be implemented by means of software plus a necessary general hardware platform, and of course, it can also be implemented by hardware, but in many cases the former is Better implementation.
  • the technical solution of the present disclosure can be embodied in the form of a software product in essence or part that contributes to the existing technology, and the computer software product is stored in a storage medium (such as ROM/RAM, magnetic disk,
  • the CD-ROM includes several instructions to enable a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods described in the embodiments of the present disclosure.
  • a device for generating a game character model is also provided.
  • the device is configured to implement the above-mentioned embodiments and preferred embodiments, and descriptions that have already been described will not be repeated.
  • the term "component” may implement a combination of software and/or hardware that performs a predetermined function.
  • the devices described in the following embodiments are preferably implemented in software, implementation of hardware or a combination of software and hardware is also possible and conceived.
  • the device includes: an acquisition component 10 configured to acquire user stickers corresponding to a two-dimensional user image to be used
  • the mapping component 20 is set to map the user texture to the initial texture of the game character to obtain the mapped texture of the game character;
  • the generation component 30 is set to fuse the mapped texture with the game character grid to generate the game character model.
  • the acquisition component 10 includes: a reconstruction unit (not shown in the figure) configured to perform three-dimensional reconstruction of the two-dimensional user image to be used to obtain a three-dimensional model of the two-dimensional user image to be used; an acquisition unit (not shown in the figure) (Shown), set to obtain user stickers based on the three-dimensional model.
  • FIG. 3 is a structural block diagram of an apparatus for generating a game character model according to one of the optional embodiments of the present disclosure.
  • the above apparatus further includes: a first processing component 40, which is configured to follow user stickers The resolution configuration mapping relationship coding map, and each pixel value in the mapping relationship coding map saves the texture coordinates of the corresponding pixels in the initial texture of the game character.
  • the mapping component 20 includes: a reading unit (not shown in the figure), which is configured to read the pixel value at the corresponding position in the mapping relationship encoding map for each pixel in the user map; (Not shown in ), set to decode the pixel values to obtain texture coordinates, and determine the pixels to be mapped in the initial texture of each pixel in the user texture according to the texture coordinates to obtain the mapped texture.
  • a reading unit not shown in the figure
  • the mapping component 20 includes: a reading unit (not shown in the figure), which is configured to read the pixel value at the corresponding position in the mapping relationship encoding map for each pixel in the user map; (Not shown in ), set to decode the pixel values to obtain texture coordinates, and determine the pixels to be mapped in the initial texture of each pixel in the user texture according to the texture coordinates to obtain the mapped texture.
  • the above device further includes: a second processing component 50 configured to acquire an initial two-dimensional user image, and process a portion of the initial two-dimensional user image that meets a preset image threshold to obtain a pending The two-dimensional user image used.
  • a second processing component 50 configured to acquire an initial two-dimensional user image, and process a portion of the initial two-dimensional user image that meets a preset image threshold to obtain a pending The two-dimensional user image used.
  • the above device further includes: a third processing component 60 configured to adjust the skin color of the game character based on the user's skin color to obtain an adjustment result, and fuse the adjustment result to the mapped texture.
  • a third processing component 60 configured to adjust the skin color of the game character based on the user's skin color to obtain an adjustment result, and fuse the adjustment result to the mapped texture.
  • the above-mentioned device further includes: a fourth processing component 70, configured to obtain a makeup template matching the initial two-dimensional user image, and overlay the makeup art resources corresponding to the makeup template to the game character model .
  • a fourth processing component 70 configured to obtain a makeup template matching the initial two-dimensional user image, and overlay the makeup art resources corresponding to the makeup template to the game character model .
  • the two-dimensional user image to be used is a two-dimensional face image to be used
  • the game character model is a game character face model
  • the above components can be implemented by software or hardware, and the latter can be implemented by the following methods, but not limited to this: the above components are all located in the same processor; or, the above components can be combined in any combination The forms are located in different processors.
  • An embodiment of the present disclosure also provides a storage medium in which a computer program is stored, wherein the computer program is set to execute any of the steps in the above method embodiments during runtime.
  • the above storage medium may be set to store a computer program for performing the following steps:
  • the mapped texture is merged with the game character grid to generate a game character model.
  • the above storage medium may include, but is not limited to: a USB flash drive, a read-only memory (Read-Only Memory, ROM for short), a random access memory (Random Access Memory, RAM for short), Various media that can store computer programs, such as removable hard disks, magnetic disks, or optical disks.
  • An embodiment of the present disclosure also provides a processor configured to run a computer program to perform the steps in any of the above method embodiments.
  • the above processor may be configured to perform the following steps through a computer program:
  • the mapped texture is merged with the game character grid to generate a game character model.
  • the disclosed technical content may be implemented in other ways.
  • the device embodiments described above are only schematic.
  • the division of the unit may be a logical function division.
  • there may be another division manner for example, multiple units or components may be combined or may Integration into another system, or some features can be ignored, or not implemented.
  • the displayed or discussed mutual coupling or direct coupling or communication connection may be indirect coupling or communication connection through some interfaces, units or components, and may be in electrical or other forms.
  • the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, may be located in one place, or may be distributed on multiple units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
  • each functional unit in each embodiment of the present disclosure may be integrated into one processing unit, or each unit may exist alone physically, or two or more units may be integrated into one unit.
  • the above integrated unit can be implemented in the form of hardware or software function unit.
  • the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it may be stored in a computer-readable storage medium.
  • the technical solution of the present disclosure essentially or part of the contribution to the existing technology or all or part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium , Including several instructions to enable a computer device (which may be a personal computer, server, network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present disclosure.
  • the aforementioned storage media include: U disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), mobile hard disk, magnetic disk or optical disk and other media that can store program code .

Landscapes

  • Engineering & Computer Science (AREA)
  • Multimedia (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Graphics (AREA)
  • Human Computer Interaction (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Computer Hardware Design (AREA)
  • Architecture (AREA)
  • Processing Or Creating Images (AREA)
  • Image Generation (AREA)

Abstract

一种游戏角色模型的生成方法,包括:获取与待使用的二维用户图像对应的用户贴图;将用户贴图映射至游戏角色的初始贴图,得到游戏角色的映射后贴图;将映射后贴图与游戏角色网格进行融合,生成游戏角色模型。还提供了一种游戏角色模型的生成装置、存储介质、处理器及终端。该方法解决了人脸映射与人脸融合通常只适用于二维人脸图像,而无法适用于三维游戏环境的人脸映射与融合的技术问题。

Description

游戏角色模型的生成方法、装置、处理器及终端
交叉援引
本公开基于申请号为201811610934.1、申请日为2018-12-27的中国专利申请提出,并要求该中国专利申请的优先权,该中国专利申请的全部内容在此引入本公开作为参考。
技术领域
本公开涉及计算机领域,具体而言,涉及一种游戏角色模型的生成方法、装置、处理器及终端。
背景技术
目前,基于图像的人脸融合、换脸、人脸变形等是较为常见的应用。在算法层面,这些应用的操作过程主要分为人脸映射和人脸融合两个步骤。
关于人脸映射,由于两幅不同真实图像中的人脸位置会存在一定偏差,因此,如果直接将两幅图像进行融合,则难以取得预期的效果。为此,需要在两幅图像的人脸区域之间进行人脸映射,以此解决两幅不同图像中人脸区域在像素位置上的对齐问题。
关于人脸融合,则是在将两幅图像的人脸区域进行像素级对齐处理之后,便可进行人脸融合。根据不同应用的需求,既可以选择将两幅图像对于相同位置的像素值按照一定比例进行加权平均计算,也可以采用泊松融合的方式,以取得更加自然的边缘过渡效果。
然而,相关技术中所提供的人脸映射与人脸融合通常只适用于二维人脸图像,其操作过程通常包括如下执行步骤:
第一步、人脸检测和关键点定位,自动从二维人脸图像中检测人脸区域,并对人脸边缘、眉毛、眼睛、鼻子、嘴巴等关键区域的多个特征点进行定位。
第二步、基于定位到的多个特征点对图像进行Delaunay三角剖分。
第三步、基于Delaunay三角剖分计算源图像与目标图像之间的人脸映射关系,其计算方法在于:对目标图像中的每一个像素点p,查找到其所属三角形的三个顶点(这些顶点均属于上述定位到的多个特征点)的编号D1,D2和D3,并计算p相对于这三 个顶点的重心坐标(u,v,w);源图像中编号相同的三个特征点S1,S2,S3所形成的三角形中位于重心坐标(u,v,w)位置的像素,即为与像素p对应的像素。
第四步、根据不同的应用场景使用对应的融合方式,将源图像融合至目标图像中。
通过上述执行步骤,在针对二维图像的人脸融合方面可以取得较好效果,但是该解决方案本质上只适用于融合目标是二维(例如:照片、海报等)人脸的场景,而难以适用于三维环境。
如果直接将上述解决方案适用于三维游戏角色的换脸,则需要将用户的人脸融合至三维游戏角色渲染形成的二维图像中,但是这种处理方式无论是在处理效率方面还是在处理效果方面都无法取得令人满意的效果。一方面,在三维游戏中,游戏角色渲染在二维图像上的效果会随着游戏角色移动、相机朝向、光照、后处理等多种因素发生实时变化,而上述二维人脸融合算法在处理速度上无法满足实时性需求,因此无法集成至三维游戏系统中。另一方面,三维游戏往往呈现艺术化的视觉效果,无论是游戏角色的人脸造型还是游戏内的光影效果都存在一定的艺术夸张,与真人图像存在一定差距,而这些差距也会极大地破坏人脸映射和融合的效果。
针对上述的问题,目前尚未提出有效的解决方案。
发明内容
本公开至少部分实施例提供了一种游戏角色模型的生成方法、装置、处理器及终端,以至少解决相关技术中所提供的人脸映射与人脸融合通常只适用于二维人脸图像,而无法适用于三维游戏环境的人脸映射与融合的技术问题。
根据本公开其中一实施例,提供了一种游戏角色模型的生成方法,包括:
获取与待使用的二维用户图像对应的用户贴图;将用户贴图映射至游戏角色的初始贴图,得到游戏角色的映射后贴图;将映射后贴图与游戏角色网格进行融合,生成游戏角色模型。
可选地,获取与待使用的二维用户图像对应的用户贴图包括:对待使用的二维用户图像进行三维重建,得到待使用的二维用户图像的三维模型;根据三维模型获得用户贴图。
可选地,在将用户贴图映射至初始贴图,得到映射后贴图之前,还包括:按照用户贴图的分辨率配置映射关系编码图,并且通过映射关系编码图中每个像素值保存游戏角色的初始贴图中对应该像素的纹理坐标。
可选地,将用户贴图映射至初始贴图,得到映射后贴图包括:对于用户贴图中的每个像素,分别读取映射关系编码图中对应位置上的像素值;对像素值进行解码处理得到纹理坐标,根据纹理坐标确定用户贴图中每个像素在初始贴图中的待映射像素,以得到映射后贴图。
可选地,在获取与待使用的二维用户图像对应的用户贴图之前,还包括:获取初始二维用户图像;对初始二维用户图像中符合预设图像阈值的部分进行处理以得到待使用的二维用户图像。
可选地,在将用户贴图映射至初始贴图,得到映射后贴图之后,还包括:基于用户肤色对游戏角色的肤色进行调整,得到调整结果;将调整结果融合至映射后贴图。
可选地,在将映射后贴图与游戏角色网格进行融合,生成游戏角色模型之后,还包括:获取与初始的二维用户图像匹配的妆容模板;将妆容模板对应的妆容美术资源叠加至游戏角色模型。
可选地,待使用的二维用户图像为待使用的二维脸部图像,游戏角色模型为游戏角色脸部模型。
根据本公开其中一实施例,还提供了一种游戏角色模型的生成装置,包括:
获取组件,设置为获取与待使用的二维用户图像对应的用户贴图;映射组件,设置为将用户贴图映射至游戏角色的初始贴图,得到游戏角色的映射后贴图;生成组件,设置为将映射后贴图与游戏角色网格进行融合,生成游戏角色模型。
可选地,获取组件包括:重建单元,设置为对待使用的二维用户图像进行三维重建,得到待使用的二维用户图像的三维模型;获取单元,设置为根据三维模型获得用户贴图。
可选地,上述装置还包括:第一处理组件,设置为按照用户贴图的分辨率配置映射关系编码图,并且通过映射关系编码图中每个像素值保存游戏角色的初始贴图中对应该像素的纹理坐标。
可选地,映射组件包括:读取单元,设置为对于用户贴图中的每个像素,分别读取映射关系编码图中对应位置上的像素值;映射单元,设置为对像素值进行解码处理得到纹理坐标,根据纹理坐标确定用户贴图中每个像素在初始贴图中的待映射像素,以得到映射后贴图。
可选地,上述装置还包括:第二处理组件,设置为获取初始二维用户图像,并对初始二维用户图像中符合预设图像阈值的部分进行处理以得到待使用的二维用户图像。
可选地,上述装置还包括:第三处理组件,设置为基于用户肤色对游戏角色的肤色进行调整,得到调整结果,以及将调整结果融合至映射后贴图。
可选地,上述装置还包括:第四处理组件,设置为获取与初始的二维用户图像匹配的妆容模板,以及将妆容模板对应的妆容美术资源叠加至游戏角色模型。
可选地,待使用的二维用户图像为待使用的二维脸部图像,游戏角色模型为游戏角色脸部模型。
根据本公开其中一实施例,还提供了一种存储介质,存储介质包括存储的程序,其中,在程序运行时控制存储介质所在设备执行上述任意一项的游戏角色模型的生成方法。
根据本公开其中一实施例,还提供了一种处理器,处理器设置为运行程序,其中,程序运行时执行上述任意一项的游戏角色模型的生成方法。
根据本公开其中一实施例,还提供了一种终端,包括:一个或多个处理器,存储器,显示装置以及一个或多个程序,其中,一个或多个程序被存储在存储器中,并且被配置为由一个或多个处理器执行,一个或多个程序用于执行上述任意一项的游戏角色模型的生成方法。
在本公开至少部分实施例中,采用获取与待使用的二维用户图像对应的用户贴图的方式,通过将用户贴图映射至游戏角色的初始贴图以得到游戏角色的映射后贴图,以及将映射后贴图与游戏角色网格进行融合以生成游戏角色模型,达到了基于用户的二维图像对游戏角色的样貌进行自动修改,从而将用户二维图像中的局部特征(例如:脸部的肤色、雀斑、法令纹等)按照一定比例融合至游戏角色中的目的,从而实现了提升处理效率、优化视觉效果、极大地扩充了捏脸玩法自由度的技术效果,进而解决了相关技术中所提供的人脸映射与人脸融合通常只适用于二维人脸图像,而无法适用于三维游戏环境的人脸映射与融合的技术问题。
附图说明
此处所说明的附图用来提供对本公开的进一步理解,构成本申请的一部分,本公开的示意性实施例及其说明用于解释本公开,并不构成对本公开的不当限定。在附图中:
图1是根据本公开其中一实施例的游戏角色模型的生成方法的流程图;
图2是根据本公开其中一实施例的游戏角色模型的生成装置的结构框图;
图3是根据本公开其中一可选实施例的游戏角色模型的生成装置的结构框图。
具体实施方式
为了使本技术领域的人员更好地理解本公开方案,下面将结合本公开实施例中的附图,对本公开实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本公开一部分的实施例,而不是全部的实施例。基于本公开中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都应当属于本公开保护的范围。
需要说明的是,本公开的说明书和权利要求书及上述附图中的术语“第一”、“第二”等是用于区别类似的对象,而不必用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便这里描述的本公开的实施例能够以除了在这里图示或描述的那些以外的顺序实施。此外,术语“包括”和“具有”以及他们的任何变形,意图在于覆盖不排他的包含,例如,包含了一系列步骤或单元的过程、方法、系统、产品或设备不必限于清楚地列出的那些步骤或单元,而是可包括没有清楚地列出的或对于这些过程、方法、产品或设备固有的其它步骤或单元。
首先,在对本公开至少部分实施例进行描述的过程中出现的部分名词或术语适用于如下解释:
(1)人脸映射是指给定两个关于脸部模型的参数空间A和B,对于参数空间A中的每个点能够在参数空间B中查找到一个对应点。在本公开至少部分实施例中,参数空间的维度具有明确的物理意义。二维参数空间对应于二维图像,而三维参数空间对应于三维模型。根据参数空间A和参数空间B的不同维度,可以分为以下多种情形:
情形一、2D-2D映射,即参数空间A为用户的人脸图像,参数空间B为三维游戏角色渲染形成的图像;
情形二、3D-3D映射,即参数空间A为用户的三维人脸模型,参数空间B是三维游戏角色模型;
情形三、2D-3D映射,即参数空间A为用户的人脸图像,参数空间B为三维游戏角色模型。
(2)人脸融合是指将一张图像中的人脸按照预设比例自然地融合至另外一张图像的人脸区域中。如果融合比例为100%,则表现为换脸(face swap);如果将融合比例从0%-100%的过程以帧动画形式进行播放,则表现为人脸变形(face morphing)。
根据本公开其中一实施例,提供了一种游戏角色模型的生成方法的实施例,需要说明的是,在附图的流程图示出的步骤可以在诸如一组计算机可执行指令的计算机系统中执行,并且,虽然在流程图中示出了逻辑顺序,但是在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤。
该方法实施例可以在移动终端、计算机终端或者类似的运算装置中执行。以运行在移动终端上为例,移动终端可以包括一个或多个处理器(处理器可以包括但不限于中央处理器(CPU)、图形处理器(GPU)、数字信号处理(DSP)芯片、微处理器(MCU)或可编程逻辑器件(FPGA)等的处理装置)和设置为存储数据的存储器。可选地,上述移动终端还可以包括设置为通信功能的传输设备、输入输出设备以及显示装置。本领域普通技术人员可以理解,上述结构描述仅为示意,其并不对上述移动终端的结构造成限定。例如,移动终端还可包括比上述结构描述更多或者更少的组件,或者具有与上述结构描述不同的配置。
存储器可设置为存储计算机程序,例如,应用软件的软件程序以及组件,如本公开实施例中的游戏角色模型的生成方法对应的计算机程序,处理器通过运行存储在存储器内的计算机程序,从而执行各种功能应用以及数据处理,即实现上述的游戏角色模型的生成方法。存储器可包括高速随机存储器,还可包括非易失性存储器,如一个或者多个磁性存储装置、闪存、或者其他非易失性固态存储器。在一些实例中,存储器可进一步包括相对于处理器远程设置的存储器,这些远程存储器可以通过网络连接至移动终端。上述网络的实例包括但不限于互联网、企业内部网、局域网、移动通信网及其组合。
传输设备设置为经由一个网络接收或者发送数据。上述的网络具体实例可包括移动终端的通信供应商提供的无线网络。在一个实例中,传输设备包括一个网络适配器(Network Interface Controller,简称为NIC),其可通过基站与其他网络设备相连从而可与互联网进行通讯。在一个实例中,传输设备可以为射频(Radio Frequency,简称为RF)组件,其设置为通过无线方式与互联网进行通讯。
显示装置可以例如触摸屏式的液晶显示器(LCD),该液晶显示器可使得用户能够与移动终端的用户界面进行交互。
在本实施例中提供了一种运行于上述移动终端的游戏角色模型的生成方法,图1是根据本公开其中一实施例的游戏角色模型的生成方法的流程图,如图1所示,该方法包括如下步骤:
步骤S12,获取与待使用的二维用户图像对应的用户贴图;
步骤S14,将用户贴图映射至游戏角色的初始贴图,得到游戏角色的映射后贴图;
步骤S16,将映射后贴图与游戏角色网格进行融合,生成游戏角色模型。
通过上述步骤,可以采用获取与待使用的二维用户图像对应的用户贴图的方式,通过将用户贴图映射至游戏角色的初始贴图以得到游戏角色的映射后贴图,以及将映射后贴图与游戏角色网格进行融合以生成游戏角色模型,达到了基于用户的二维图像对游戏角色的样貌进行自动修改,从而将用户二维图像中的局部特征(例如:脸部的肤色、雀斑、法令纹等)按照一定比例融合至游戏角色中的目的,从而实现了提升处理效率、优化视觉效果、极大地扩充了捏脸玩法自由度的技术效果,进而解决了相关技术中所提供的人脸映射与人脸融合通常只适用于二维人脸图像,而无法适用于三维游戏环境的人脸映射与融合的技术问题。
在一个可选实施例中,上述待使用的二维用户图像为待使用的二维脸部图像,上述游戏角色模型为游戏角色脸部模型。需要说明的是,下文中仅以通过二维脸部图像获取游戏角色脸部模型为例进行示例性说明,然而其并不构成对本公开的不当限定。例如:除了通过二维脸部图像获取游戏角色脸部模型之外,还可以通过用户其他部位(例如:手部、腿部)的二维图像获取游戏角色对应部位模型。
可选地,在步骤S12中,获取与待使用的二维用户图像对应的用户贴图可以包括以下执行步骤:
步骤S121,对待使用的二维用户图像进行三维重建,得到待使用的二维用户图像的三维模型;
步骤S122,根据三维模型获得用户贴图。
三维人脸重建是根据输入或输出数据形式、重建精度要求等有很多不同的算法框架。在本公开的一个可选实施例中,三维人脸重建主要是指基于单幅图像的三维人脸重建,其通过预先采集大量三维人脸数据以构建关于人脸三维形状的主成分分析基,然后再利用三维人脸基对用户图像中的二维人脸进行拟合,从而得到对应的三维模型。
在具体实施过程中,首先,对待使用的二维人脸图像中的用户人脸进行三维重建,形成关于待使用的二维人脸图像的三维模型,确保待使用的二维人脸图像与待使用的二维人脸图像的三维模型之间存在已知的2D-3D映射关系。其次,建立待使用的二维人脸图像的三维模型与游戏角色脸部三维模型的3D-3D映射关系。考虑到每个三维模型可以由三维网格和贴图两部分组成。贴图可以看成是三维网格在二维平面上的参数 化表示,即三维模型上的每个点都可以按照纹理坐标(u,v)在贴图空间上查找到与之对应的像素。因此,可以通过待使用的二维人脸图像的三维模型获得对应的人脸贴图以及通过游戏角色脸部三维模型获得对应的游戏角色的初始脸部贴图。然后,通过将人脸贴图映射至游戏角色的初始脸部贴图,进而对游戏角色的初始脸部贴图进行替换,以得到游戏角色的映射后脸部贴图。
可选地,在步骤S14,将用户贴图映射至初始贴图,得到映射后贴图之前,还可以包括以下执行步骤:
步骤S13,按照用户贴图的分辨率配置映射关系编码图,并且通过映射关系编码图中每个像素值保存游戏角色的初始贴图中对应该像素的纹理坐标。
为了能够在上述人脸贴图与游戏角色的初始脸部贴图之间建立起人脸映射关系,需要预先构建映射关系编码图。该映射关系编码图的分辨率通常由从二维人脸图像的三维模型获得的人脸贴图的分辨率来确定,其可以是一幅与人脸贴图的分辨率大小相同的图像。映射关系编码图的构建数量通常由游戏内设置的游戏角色数量来确定。在一个可选实施例中,映射关系编码图的数量与游戏内设置的游戏角色数量相同。在建立上述人脸映射关系过程中,需要根据用户在游戏内选定的游戏角色来确定待使用的映射关系编码图。每张映射关系编码图的每个像素可以包含RGBA四个通道,其用于对游戏角色的初始脸部贴图中对应像素的纹理坐标进行编码。在一个可选实施方式中,可以预先采用RG通道来编码初始脸部贴图中对应像素的u坐标,以及采用BA通道来编码初始脸部贴图中对应像素的v坐标,然后再将编码结果保存至待使用的映射关系编码图的每个像素值中。
可选地,在步骤S14中,将用户贴图映射至初始贴图,得到映射后贴图可以包括以下执行步骤:
步骤S141,对于用户贴图中的每个像素,分别读取映射关系编码图中对应位置上的像素值;
步骤S142,对像素值进行解码处理得到纹理坐标,根据纹理坐标确定用户贴图中每个像素在初始贴图中的待映射像素,以得到映射后贴图。
对于用户的人脸贴图中的每个像素,读取映射关系编码图中对应位置的像素值进行解码,得到的纹理坐标即为该像素在游戏角色的初始脸部贴图上的待映射像素,进而采用人脸贴图中的像素替换初始脸部贴图上的待映射像素以得到映射后贴图。
可选地,在步骤S12,获取与待使用的二维用户图像对应的用户贴图之前,还可以包括以下执行步骤:
步骤S10,获取初始二维用户图像;
步骤S11,对初始二维用户图像中符合预设图像阈值的部分进行处理以得到待使用的二维用户图像。
在用户的二维人脸图像与游戏角色脸部三维模型的人脸融合过程中,基于上述二维人脸图像与游戏角色的脸部三维模型之间的映射关系,原本可以直接将二维人脸图像中人脸区域中的全部像素映射至游戏角色的脸部三维模型中。然而,由于光照、遮挡、噪声等多种因素影响,二维人脸图像中人脸区域的部分像素质量较差,如果将这些像素全部映射至游戏角色的脸部三维模型中,则会对后续的融合效果产生负面影响,因此,在执行映射之前,首先需要使用图像处理方法自动对二维人脸图像进行预处理(例如:去除高光、阴影、杂色、刘海等),分割得到质量较好的部分人脸区域,然后再基于上述构建的二维人脸图像与游戏角色的脸部三维模型之间的映射关系,将质量较好的部分人脸区域中的信息映射至游戏角色的脸部贴图中。
可选地,在步骤S14,将用户贴图映射至初始贴图,得到映射后贴图之后,还可以包括以下执行步骤:
步骤S15,基于用户肤色对游戏角色的肤色进行调整,得到调整结果,以及将调整结果融合至映射后贴图。
在一个可选实施例中,在将质量较好的部分人脸区域中的信息映射至游戏角色的脸部贴图之后,还需要进行图像补全处理,同时还需要基于用户的皮肤颜色对游戏角色的肤色进行调整以使两者颜色尽量接近,并将调整结果以泊松融合的方式融合至映射后的脸部贴图。
可选地,在步骤S16,将映射后贴图与游戏角色网格进行融合,生成游戏角色模型之后,还可以包括以下执行步骤:
步骤S17,获取与初始的二维用户图像匹配的妆容模板;
步骤S18,将妆容模板对应的妆容美术资源叠加至游戏角色模型。
在本公开的一个可选实施例中,可以预先配置人脸常见的妆容美术资源(例如:眉毛、眼影、胡须、唇彩等),以便基于图像处理和模式识别方法,识别并匹配与初始的二维人脸图像最为接近的妆容模板,然后再将妆容模板对应的妆容美术资源按照阿尔法混合(alpha blending)的方式进一步叠加至游戏角色的脸部模型,以形成最终显示结果。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到根据上述实施 例的方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端设备(可以是手机,计算机,服务器,或者网络设备等)执行本公开各个实施例所述的方法。
在本实施例中还提供了一种游戏角色模型的生成装置,该装置设置为实现上述实施例及优选实施方式,已经进行过说明的不再赘述。如以下所使用的,术语“组件”可以实现预定功能的软件和/或硬件的组合。尽管以下实施例所描述的装置较佳地以软件来实现,但是硬件,或者软件和硬件的组合的实现也是可能并被构想的。
图2是根据本公开其中一实施例的游戏角色模型的生成装置的结构框图,如图2所示,该装置包括:获取组件10,设置为获取与待使用的二维用户图像对应的用户贴图;映射组件20,设置为将用户贴图映射至游戏角色的初始贴图,得到游戏角色的映射后贴图;生成组件30,设置为将映射后贴图与游戏角色网格进行融合,生成游戏角色模型。
可选地,获取组件10包括:重建单元(图中未示出),设置为对待使用的二维用户图像进行三维重建,得到待使用的二维用户图像的三维模型;获取单元(图中未示出),设置为根据三维模型获得用户贴图。
可选地,图3是根据本公开其中一可选实施例的游戏角色模型的生成装置的结构框图,如图3所示,上述装置还包括:第一处理组件40,设置为按照用户贴图的分辨率配置映射关系编码图,并且通过映射关系编码图中每个像素值保存游戏角色的初始贴图中对应该像素的纹理坐标。
可选地,映射组件20包括:读取单元(图中未示出),设置为对于用户贴图中的每个像素,分别读取映射关系编码图中对应位置上的像素值;映射单元(图中未示出),设置为对像素值进行解码处理得到纹理坐标,根据纹理坐标确定用户贴图中每个像素在初始贴图中的待映射像素,以得到映射后贴图。
可选地,如图3所示,上述装置还包括:第二处理组件50,设置为获取初始二维用户图像,并对初始二维用户图像中符合预设图像阈值的部分进行处理以得到待使用的二维用户图像。
可选地,如图3所示,上述装置还包括:第三处理组件60,设置为基于用户肤色 对游戏角色的肤色进行调整,得到调整结果,以及将调整结果融合至映射后贴图。
可选地,如图3所示,上述装置还包括:第四处理组件70,设置为获取与初始的二维用户图像匹配的妆容模板,以及将妆容模板对应的妆容美术资源叠加至游戏角色模型。
可选地,待使用的二维用户图像为待使用的二维脸部图像,游戏角色模型为游戏角色脸部模型。
需要说明的是,上述各个组件是可以通过软件或硬件来实现的,对于后者,可以通过以下方式实现,但不限于此:上述组件均位于同一处理器中;或者,上述各个组件以任意组合的形式分别位于不同的处理器中。
本公开的实施例还提供了一种存储介质,该存储介质中存储有计算机程序,其中,该计算机程序被设置为运行时执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述存储介质可以被设置为存储用于执行以下步骤的计算机程序:
S1,获取与待使用的二维用户图像对应的用户贴图;
S2,将用户贴图映射至游戏角色的初始贴图,得到游戏角色的映射后贴图;
S3,将映射后贴图与游戏角色网格进行融合,生成游戏角色模型。
可选地,在本实施例中,上述存储介质可以包括但不限于:U盘、只读存储器(Read-Only Memory,简称为ROM)、随机存取存储器(Random Access Memory,简称为RAM)、移动硬盘、磁碟或者光盘等各种可以存储计算机程序的介质。
本公开的实施例还提供了一种处理器,该处理器被设置为运行计算机程序以执行上述任一项方法实施例中的步骤。
可选地,在本实施例中,上述处理器可以被设置为通过计算机程序执行以下步骤:
S1,获取与待使用的二维用户图像对应的用户贴图;
S2,将用户贴图映射至游戏角色的初始贴图,得到游戏角色的映射后贴图;
S3,将映射后贴图与游戏角色网格进行融合,生成游戏角色模型。
可选地,本实施例中的具体示例可以参考上述实施例及可选实施方式中所描述的示例,本实施例在此不再赘述。
上述本公开实施例序号仅仅为了描述,不代表实施例的优劣。
在本公开的上述实施例中,对各个实施例的描述都各有侧重,某个实施例中没有详述的部分,可以参见其他实施例的相关描述。
在本申请所提供的几个实施例中,应该理解到,所揭露的技术内容,可通过其它的方式实现。其中,以上所描述的装置实施例仅仅是示意性的,例如所述单元的划分,可以为一种逻辑功能划分,实际实现时可以有另外的划分方式,例如多个单元或组件可以结合或者可以集成到另一个系统,或一些特征可以忽略,或不执行。另一点,所显示或讨论的相互之间的耦合或直接耦合或通信连接可以是通过一些接口,单元或组件的间接耦合或通信连接,可以是电性或其它的形式。
所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个单元上。可以根据实际的需要选择其中的部分或者全部单元来实现本实施例方案的目的。
另外,在本公开各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本公开的技术方案本质上或者说对现有技术做出贡献的部分或者该技术方案的全部或部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质中,包括若干指令用以使得一台计算机设备(可为个人计算机、服务器或者网络设备等)执行本公开各个实施例所述方法的全部或部分步骤。而前述的存储介质包括:U盘、只读存储器(ROM,Read-Only Memory)、随机存取存储器(RAM,Random Access Memory)、移动硬盘、磁碟或者光盘等各种可以存储程序代码的介质。
以上所述仅是本公开的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本公开原理的前提下,还可以做出若干改进和润饰,这些改进和润饰也应视为本公开的保护范围。

Claims (12)

  1. 一种游戏角色模型的生成方法,包括:
    获取与待使用的二维用户图像对应的用户贴图;
    将所述用户贴图映射至游戏角色的初始贴图,得到所述游戏角色的映射后贴图;
    将所述映射后贴图与游戏角色网格进行融合,生成所述游戏角色模型。
  2. 根据权利要求1所述的方法,其中,获取与所述待使用的二维用户图像对应的所述用户贴图包括:
    对所述待使用的二维用户图像进行三维重建,得到所述待使用的二维用户图像的三维模型;
    根据所述三维模型获得所述用户贴图。
  3. 根据权利要求2所述的方法,其中,在将所述用户贴图映射至所述初始贴图,得到所述映射后贴图之前,还包括:
    按照所述用户贴图的分辨率配置映射关系编码图,并且通过所述映射关系编码图中每个像素值保存所述游戏角色的初始贴图中对应该像素的纹理坐标。
  4. 根据权利要求3所述的方法,其中,将所述用户贴图映射至所述初始贴图,得到所述映射后贴图包括:
    对于所述用户贴图中的每个像素,分别读取所述映射关系编码图中对应位置上的像素值;
    对所述像素值进行解码处理得到纹理坐标,根据所述纹理坐标确定所述用户贴图中每个像素在所述初始贴图中的待映射像素,以得到所述映射后贴图。
  5. 根据权利要求1所述的方法,其中,在获取与所述待使用的二维用户图像对应的所述用户贴图之前,还包括:
    获取初始二维用户图像;
    对所述初始二维用户图像中符合预设图像阈值的部分进行处理以得到所述待使用的二维用户图像。
  6. 根据权利要求1所述的方法,其中,在将所述用户贴图映射至所述初始贴图,得 到所述映射后贴图之后,还包括:
    基于用户肤色对所述游戏角色的肤色进行调整,得到调整结果;
    将所述调整结果融合至所述映射后贴图。
  7. 根据权利要求1所述的方法,其中,在将所述映射后贴图与所述游戏角色网格进行融合,生成所述游戏角色模型之后,还包括:
    获取与初始的二维用户图像匹配的妆容模板;
    将所述妆容模板对应的妆容美术资源叠加至所述游戏角色模型。
  8. 根据权利要求1所述的方法,其中,所述待使用的二维用户图像为待使用的二维脸部图像,所述游戏角色模型为所述游戏角色脸部模型。
  9. 一种游戏角色模型的生成装置,包括:
    获取组件,设置为获取与待使用的二维用户图像对应的用户贴图;
    映射组件,设置为将所述用户贴图映射至游戏角色的初始贴图,得到所述游戏角色的映射后贴图;
    生成组件,设置为将所述映射后贴图与游戏角色网格进行融合,生成所述游戏角色模型。
  10. 一种存储介质,所述存储介质包括存储的程序,其中,在所述程序运行时控制所述存储介质所在设备执行权利要求1至8中任意一项所述的游戏角色模型的生成方法。
  11. 一种处理器,所述处理器设置为运行程序,其中,所述程序运行时执行权利要求1至8中任意一项所述的游戏角色模型的生成方法。
  12. 一种终端,包括:一个或多个处理器,存储器,显示装置以及一个或多个程序,其中,所述一个或多个程序被存储在所述存储器中,并且被配置为由所述一个或多个处理器执行,所述一个或多个程序用于执行权利要求1至8中任意一项所述的游戏角色模型的生成方法。
PCT/CN2019/085235 2018-12-27 2019-04-30 游戏角色模型的生成方法、装置、处理器及终端 WO2020133862A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/632,396 US11839820B2 (en) 2018-12-27 2019-04-30 Method and apparatus for generating game character model, processor, and terminal

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201811610934.1 2018-12-27
CN201811610934.1A CN109675315B (zh) 2018-12-27 2018-12-27 游戏角色模型的生成方法、装置、处理器及终端

Publications (1)

Publication Number Publication Date
WO2020133862A1 true WO2020133862A1 (zh) 2020-07-02

Family

ID=66190484

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2019/085235 WO2020133862A1 (zh) 2018-12-27 2019-04-30 游戏角色模型的生成方法、装置、处理器及终端

Country Status (3)

Country Link
US (1) US11839820B2 (zh)
CN (1) CN109675315B (zh)
WO (1) WO2020133862A1 (zh)

Families Citing this family (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109675315B (zh) * 2018-12-27 2021-01-26 网易(杭州)网络有限公司 游戏角色模型的生成方法、装置、处理器及终端
CN110136236B (zh) * 2019-05-17 2022-11-29 腾讯科技(深圳)有限公司 三维角色的个性化脸部显示方法、装置、设备及存储介质
CN112057871A (zh) * 2019-06-10 2020-12-11 海信视像科技股份有限公司 一种虚拟场景生成方法及装置
CN110782419B (zh) * 2019-10-18 2022-06-21 杭州小影创新科技股份有限公司 一种基于图形处理器的三维人脸融合方法及系统
CN110992493B (zh) * 2019-11-21 2023-10-31 北京达佳互联信息技术有限公司 图像处理方法、装置、电子设备及存储介质
CN111179390B (zh) * 2019-12-27 2023-07-28 上海咔咖文化传播有限公司 高效预览cg资产的方法和装置
CN111738087B (zh) * 2020-05-25 2023-07-25 完美世界(北京)软件科技发展有限公司 一种游戏角色面部模型的生成方法和装置
CN113763527B (zh) * 2020-06-01 2023-09-26 上海米哈游天命科技有限公司 一种头发高光渲染方法、装置、设备及存储介质
CN111768478B (zh) * 2020-07-13 2023-05-30 腾讯科技(深圳)有限公司 一种图像合成方法、装置、存储介质和电子设备
CN111768479B (zh) * 2020-07-29 2021-05-28 腾讯科技(深圳)有限公司 图像处理方法、装置、计算机设备以及存储介质
CN112190935A (zh) * 2020-10-09 2021-01-08 网易(杭州)网络有限公司 动态体积云的渲染方法、装置及电子设备
CN112221145B (zh) * 2020-10-27 2024-03-15 网易(杭州)网络有限公司 游戏脸模生成方法及装置、存储介质及电子设备

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050062739A1 (en) * 2003-09-17 2005-03-24 International Business Machines Corporation Method and structure for image-based object editing
CN1797474A (zh) * 2004-12-30 2006-07-05 中国科学院自动化研究所 电子游戏中玩家快速置入方法
CN102663820A (zh) * 2012-04-28 2012-09-12 清华大学 三维头部模型重建方法
CN108765272A (zh) * 2018-05-31 2018-11-06 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备及可读存储介质
CN109675315A (zh) * 2018-12-27 2019-04-26 网易(杭州)网络有限公司 游戏角色模型的生成方法、装置、处理器及终端

Family Cites Families (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5809322A (en) * 1993-12-12 1998-09-15 Associative Computing Ltd. Apparatus and method for signal processing
US5848926A (en) * 1995-06-05 1998-12-15 Jardetzky; Alexander M. Removably adherable construction elements
JPH11154240A (ja) * 1997-11-20 1999-06-08 Nintendo Co Ltd 取込み画像を用いて画像を作成するための画像作成装置
US6894686B2 (en) * 2000-05-16 2005-05-17 Nintendo Co., Ltd. System and method for automatically editing captured images for inclusion into 3D video game play
KR100821026B1 (ko) * 2000-12-05 2008-04-08 마쯔시다덴기산교 가부시키가이샤 3차원 문자 데이터 생성 장치 및 3차원 그래픽 데이터생성 장치
CN101968892A (zh) * 2009-07-28 2011-02-09 上海冰动信息技术有限公司 根据一张人脸照片自动调整三维人脸模型的方法
US20150172637A1 (en) * 2013-12-12 2015-06-18 Electronics And Telecommunications Research Institute Apparatus and method for generating three-dimensional output data
US9691172B2 (en) * 2014-09-24 2017-06-27 Intel Corporation Furry avatar animation
US9855499B2 (en) * 2015-04-01 2018-01-02 Take-Two Interactive Software, Inc. System and method for image capture and modeling
JP6934887B2 (ja) * 2015-12-31 2021-09-15 エムエル ネザーランズ セー.フェー. 単眼カメラを用いたリアルタイム3d捕捉およびライブフィードバックのための方法およびシステム
US10055880B2 (en) * 2016-12-06 2018-08-21 Activision Publishing, Inc. Methods and systems to modify a two dimensional facial image to increase dimensional depth and generate a facial image that appears three dimensional
WO2018195485A1 (en) * 2017-04-21 2018-10-25 Mug Life, LLC Systems and methods for automatically creating and animating a photorealistic three-dimensional character from a two-dimensional image
KR102286037B1 (ko) * 2018-11-12 2021-08-05 한국전자통신연구원 기계 학습을 위한 학습 데이터 셋 생성 장치 및 방법
CN111353930B (zh) * 2018-12-21 2022-05-24 北京市商汤科技开发有限公司 数据处理方法及装置、电子设备及存储介质

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20050062739A1 (en) * 2003-09-17 2005-03-24 International Business Machines Corporation Method and structure for image-based object editing
CN1797474A (zh) * 2004-12-30 2006-07-05 中国科学院自动化研究所 电子游戏中玩家快速置入方法
CN102663820A (zh) * 2012-04-28 2012-09-12 清华大学 三维头部模型重建方法
CN108765272A (zh) * 2018-05-31 2018-11-06 Oppo广东移动通信有限公司 图像处理方法、装置、电子设备及可读存储介质
CN109675315A (zh) * 2018-12-27 2019-04-26 网易(杭州)网络有限公司 游戏角色模型的生成方法、装置、处理器及终端

Also Published As

Publication number Publication date
CN109675315A (zh) 2019-04-26
US20210291056A1 (en) 2021-09-23
US11839820B2 (en) 2023-12-12
CN109675315B (zh) 2021-01-26

Similar Documents

Publication Publication Date Title
WO2020133862A1 (zh) 游戏角色模型的生成方法、装置、处理器及终端
He et al. Arch++: Animation-ready clothed human reconstruction revisited
US11423556B2 (en) Methods and systems to modify two dimensional facial images in a video to generate, in real-time, facial images that appear three dimensional
CN107993216B (zh) 一种图像融合方法及其设备、存储介质、终端
Magnenat et al. Live texturing of augmented reality characters from colored drawings
EP3323249B1 (en) Three dimensional content generating apparatus and three dimensional content generating method thereof
WO2020108610A1 (zh) 图像处理方法、装置、计算机可读介质及电子设备
Lee et al. Fast head modeling for animation
CN110688948B (zh) 视频中人脸性别变换方法、装置、电子设备和存储介质
EP3992919B1 (en) Three-dimensional facial model generation method and apparatus, device, and medium
KR101514327B1 (ko) 얼굴 아바타 생성 장치 및 방법
US20220284679A1 (en) Method and apparatus for constructing three-dimensional face mesh, device, and storage medium
CN109325990B (zh) 图像处理方法及图像处理装置、存储介质
CN107564080B (zh) 一种人脸图像的替换系统
CN109978984A (zh) 人脸三维重建方法及终端设备
AU2018214005A1 (en) Systems and methods for generating a 3-D model of a virtual try-on product
Fyffe et al. Multi‐view stereo on consistent face topology
US20130101164A1 (en) Method of real-time cropping of a real entity recorded in a video sequence
JP2002133446A (ja) 顔画像処理方法およびシステム
JP7244810B2 (ja) 単色画像及び深度情報を使用した顔テクスチャマップ生成
KR102353556B1 (ko) 사용자 얼굴기반 표정 및 포즈 재현 아바타 생성장치
US8633926B2 (en) Mesoscopic geometry modulation
WO2023066120A1 (zh) 图像处理方法、装置、电子设备及存储介质
Li et al. 3d human avatar digitization from a single image
CN110267079B (zh) 待播放视频中人脸的替换方法和装置

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 19906555

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 19906555

Country of ref document: EP

Kind code of ref document: A1