Haircut preview method, storage medium, and electronic device

By obtaining user facial images and personal information, recommending hairstyles and splicing them with facial models, the problem of poor hairstyle splicing in the existing technology is solved, and a higher quality hairstyle preview and user satisfaction improvement is achieved.

CN112785500BActive Publication Date: 2025-06-24BOE TECHNOLOGY GROUP CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110055032.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-01-15
Publication Date
2025-06-24
Estimated Expiration
2041-06-24

AI Technical Summary

Technical Problem

In the prior art, the effect of splicing of hairstyle models and video images is poor, resulting in the inability to meet the actual needs of users.

Method used

By obtaining the user's facial images and personal information, the recommended hairstyle is determined and displayed. Then the facial model and the recommended hairstyle are spliced ​​to display the splicing results, and the recommendation algorithm is optimized based on user feedback.

Benefits of technology

Improve the effect of hair stitching, so that users or barbers can understand users' hairstyle needs more clearly, thereby improving user satisfaction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112785500B_ABST
    Figure CN112785500B_ABST
Patent Text Reader

Abstract

The present disclosure provides a method for previewing hairstyles, a storage medium, and an electronic device. The method includes: obtaining a user's facial image and determining the user's personal information based on the facial information; determining M recommended hairstyles based on the personal information and displaying them, where M is a positive integer; determining a facial model of the user according to the facial image; sequentially splicing the facial model with the M recommended hairstyles to obtain M splicing results; and displaying a first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles. The present disclosure recommends personalized hairstyles for the user based on the user's facial image, and splices the recommended hairstyles with the user's three-dimensional facial model to improve the splicing effect. At the same time, both the user and the barber can freely operate such as rotating and scaling to view the hairstyle effects at various angles after splicing, which is convenient for the barber to more fully understand the user's hairstyle needs, thereby improving the user satisfaction degree.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the technical field of hair styling, and particularly to a method for previewing a hairstyle, a storage medium, and an electronic device. Background Art

[0002] Hair styling is an essential service in the daily life of most residents. However, the customer satisfaction in the hair styling industry is generally low. The main reason is that hair stylists cannot fully understand the customer's hairstyle preferences and haircut requirements. The relatively large degree of freedom in operation easily leads to a mismatch with the customer's expectations, affecting the evaluation of satisfaction.

[0003] With the development of computer technology, currently, it is possible to splice the facial video image of a user with a pre-stored hairstyle model to facilitate the user to preview the hairstyle. However, there are problems of hairstyle cutting and replacement during the process of splicing the video image with a three-dimensional hairstyle model, resulting in poor splicing effects and unable to meet the actual needs. Summary of the Invention

[0004] The purpose of the embodiments of the present disclosure is to provide a method for previewing a hairstyle, a storage medium, and an electronic device, so as to solve the problem of poor splicing effects between the hairstyle model and the video image in the prior art.

[0005] The embodiments of the present disclosure adopt the following technical solutions: A method for previewing a hairstyle, including: obtaining a user's facial image and determining the user's personal information according to the facial information; determining M recommended hairstyles based on the personal information and displaying them, where M is a positive integer; determining the user's facial model according to the facial image; sequentially splicing the facial model with the M recommended hairstyles to obtain M splicing results; and displaying the first splicing result corresponding to the recommended hairstyle selected by the user based on the user's selection result of the M recommended hairstyles.

[0006] Further, the personal information at least includes a user ID and basic user information.

[0007] Further, the determining M recommended hairstyles based on the personal information includes: according to the personal information, determining N alternative hairstyles in a hairstyle database through a recommendation algorithm; scoring the N alternative hairstyles respectively; and taking the M alternative hairstyles with the highest scores among the N alternative hairstyles as the recommended hairstyles, where N is a positive integer and M is less than or equal to N.

[0008] Further, determining the facial model of the user according to the facial image includes: detecting whether there is a facial model corresponding to the facial image in the facial model library; outputting the facial model corresponding to the facial image when there is a facial model corresponding to the facial image in the facial model library; and generating and outputting the facial model corresponding to the facial image based on the facial image when there is no facial model corresponding to the facial image in the facial model library.

[0009] Further, sequentially splicing the facial model with the M recommended hairstyles to obtain M splicing results includes: loading the facial model and the models of the M recommended hairstyles; obtaining first key coordinate information of the facial model and second key coordinate information of each recommended hairstyle model; sequentially splicing the facial model with each recommended hairstyle model based on the first key coordinate information and the second key coordinate information through a preset action to obtain M splicing results; and storing the action sequence of the preset action executed during the process of sequentially splicing the facial model with each recommended hairstyle model.

[0010] Further, displaying the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles includes: forming the first splicing result based on the action sequence corresponding to the recommended hairstyle selected by the user; and displaying the first splicing result.

[0011] Further, after displaying the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles, it further includes: optimizing the recommendation decision of the recommendation algorithm based on the feedback of the user on the first splicing result.

[0012] Further, the personal information further includes: the hairstyle selection history of the user; and scoring the N alternative hairstyles respectively includes: scoring the N alternative hairstyles respectively based on the hairstyle selection history.

[0013] An embodiment of the present disclosure further provides a storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the above-described hairstyle preview method are executed.

[0014] An embodiment of the present disclosure further provides an electronic device, at least including a memory and a processor, where a computer program is stored on the memory, and when the processor executes the computer program on the memory, the steps of the above-described hairstyle preview method are implemented.

[0015] The beneficial effects of the embodiments of the present disclosure are as follows: personalized hairstyles are recommended for users based on the users' facial images, and the recommended hairstyles are spliced with the three-dimensional facial models of the users to improve the splicing effect. At the same time, both users and barbers can view the hairstyle effects at various angles after splicing through free operations such as rotation and scaling, which is convenient for barbers to better understand the users' hairstyle needs and thus improve the users' satisfaction. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] In order to more clearly illustrate the technical solutions in the embodiments of the present disclosure or the prior art, the following will briefly introduce the drawings required for use in the description of the embodiments or the prior art. Obviously, the drawings in the following description are only some embodiments recorded in the present disclosure. For those of ordinary skill in the art, without creative efforts, other drawings can also be obtained based on these drawings.

[0017] Figure 1 It is a flowchart of the preview method of the hairstyle in the first embodiment of the present disclosure;

[0018] Figure 2 It is a flowchart of determining the recommended hairstyle based on personal information in the first embodiment of the present disclosure;

[0019] Figure 3 It is a schematic structural diagram of the recommendation model in the first embodiment of the present disclosure;

[0020] Figure 4 It is a flowchart of the generation of the facial model in the first embodiment of the present disclosure;

[0021] Figure 5 It is a flowchart of the splicing process between the facial model and the recommended hairstyle in the first embodiment of the present disclosure;

[0022] Figure 6 It is a schematic structural diagram of the electronic device in the third embodiment of the present disclosure. DETAILED DESCRIPTION OF THE EMBODIMENTS

[0023] Reference is made herein to the various aspects and features of the present disclosure with reference to the drawings.

[0024] It should be understood that various modifications can be made to the embodiments applied herein. Therefore, the above specification should not be regarded as a limitation, but only as an example of the embodiments. Those skilled in the art will think of other modifications within the scope and spirit of the present disclosure.

[0025] The drawings included in the specification and constituting a part of the specification illustrate the embodiments of the present disclosure, and together with the general description of the present disclosure given above and the detailed description of the embodiments given below, are used to explain the principles of the present disclosure.

[0026] These and other features of the present disclosure will become apparent from the following description of the preferred forms of the embodiments given by way of non-limiting examples with reference to the accompanying drawings.

[0027] It should also be understood that although the present disclosure has been described with reference to some specific examples, those skilled in the art can surely implement many other equivalent forms of the present disclosure, which have the features of the claims and thus are all within the scope of protection defined thereby.

[0028] The above and other aspects, features, and advantages of the present disclosure will become more apparent in view of the following detailed description when taken in conjunction with the accompanying drawings.

[0029] Specific embodiments of the present disclosure will be described hereinafter with reference to the accompanying drawings; however, it should be understood that the embodiments claimed are merely examples of the present disclosure and can be implemented in various ways. Well-known and / or repetitive functions and structures are not described in detail to avoid obscuring the present disclosure with unnecessary or redundant details. Therefore, the specific structural and functional details claimed herein are not intended to be limiting, but are merely a basis and representative basis for the claims to teach those skilled in the art to use the present disclosure in substantially any suitable detailed structure in a variety of ways.

[0030] This specification may use the phrases "in one embodiment", "in another embodiment", "in yet another embodiment", or "in other embodiments", each of which may refer to one or more of the same or different embodiments according to the present disclosure.

[0031] Hair styling is an essential service in the daily life of most residents, but the customer satisfaction in the hair styling industry is generally low. The main reason is that barbers cannot fully understand the customer's hair style preferences and haircut requirements, and the relatively large degree of freedom in operation easily leads to a mismatch with the customer's expectations, affecting the evaluation of satisfaction.

[0032] With the development of computer technology, it is currently possible to splice the user's facial video image with a pre-stored hair style model to facilitate the user's hair style preview. However, there are problems with hair style cutting and replacement during the process of splicing the video image with a three-dimensional hair style model, resulting in poor splicing effects and unable to meet the actual needs.

[0033] To solve the above problems, the first embodiment of the present disclosure provides a method for previewing a hair style, which can be implemented by any electronic device having a processing function and connected with a shooting device and a display device. Its flowchart is as Figure 1 shown, mainly including steps S1 to S5:

[0034] S1, obtaining a user facial image and determining the user's personal information according to the facial information.

[0035] In this embodiment, the user's facial image is mainly the user's frontal facial image, which can not only reflect the user's facial features information, but also be used as a unique feature of the user to serve as the user's identity information during subsequent use. In actual use, the user can pre-store their basic user information in the user database, such as gender, age, occupation, etc., and correspondingly store their frontal facial image. A unique user ID is formed in the user database and corresponds to the above stored content to form the user's user portrait. Additionally, extended information content such as the user's current geographical location, climate conditions, cultural level, etc. can be correspondingly stored as a further basis for subsequent hairstyle recommendations.

[0036] Before the user arrives at the barbershop and is about to have their hair trimmed, the barber can use the corresponding electronic device to determine the user's corresponding personal information based on the user's facial image after obtaining the user's frontal image, as a basis for subsequent hairstyle recommendations.

[0037] S2. Determine M recommended hairstyles based on the personal information and display them.

[0038] The user's personal information mainly includes the user ID and the user's basic information, that is, the user's gender, age, occupation, etc. The above information will all have an impact on the hairstyles that the user may like. For example, a user with a career as a policeman may try to choose a hairstyle that has not been permed or dyed, and teenagers may choose a hairstyle similar to that of a star; further, the user's corresponding extended information may also have an impact on hairstyle preferences. For example, users living in the north may prefer long hair in winter.

[0039] After obtaining the user's personal information, the hairstyles that the user prefers or is suitable for can be output according to the personal information through a recommendation algorithm. Specifically, Figure 2 The flowchart showing the determination of recommended hairstyles based on personal information is mainly composed of steps S21 to S23:

[0040] S21. According to the personal information, determine N alternative hairstyles in the hairstyle database through a recommendation algorithm;

[0041] S22. Score each of the N alternative hairstyles respectively;

[0042] S23. Select the M alternative hairstyles with the highest scores among the N alternative hairstyles as the recommended hairstyles.

[0043] In this embodiment, hairstyle recommendations are made through a recommendation algorithm, and this algorithm can be a recommendation model established based on the deep Q-network (DQN) of reinforcement learning. Its structural schematic diagram is as Figure 3As shown, it mainly includes an environment and an agent. Among them, the environment is a mechanism that includes a user profile (i.e., user personal information) and its feedback mechanism for hair style selection results. The agent is a recommendation decision-making mechanism. The agent makes decisions by perceiving the information of the environment, that is, based on the user's personal information, N alternative hair styles are recommended for hair style. The environment can give a score feedback on all the alternative hair styles output by the agent, and output the M alternative hair styles with the highest scores based on the score results to form a recommended hair style list. It should be noted that in this embodiment, both M and N are positive integers, and M is less than or equal to N.

[0044] Furthermore, in the subsequent interaction with the user, based on the user's preference or selection of the recommended hair styles, the score feedback of the environment and the recommendation decision-making mechanism of the agent can be improved and optimized to make the recommended hair styles more in line with the user's preferences, or increase the scores of the hair styles that meet the user's preferences during the scoring process. At the same time, the user's personal information can also include the user's previous hair style selection history. When scoring the alternative hair styles, the alternative hair styles can be scored based on the hair style selection history. For example, alternative hair styles that are the same or similar to the hair style selection history can get more scores, further ensuring that the recommended hair styles obtained based on the alternative hair styles are more in line with the user's preferences.

[0045] After the M recommended hair styles are generated, they can be displayed to the user through a display device. The main content of the display includes the numbers of the recommended hair styles and the three-dimensional models of the recommended hair styles. The user can perform operations such as rotating and scaling the recommended hair styles on the display device through a control device or a touch device to facilitate observing all angles of the recommended hair styles.

[0046] It should be understood that the three-dimensional models of the recommended hair styles are established and pre-stored in the hair style database in advance. An administrator (such as a barber) can perform operations such as importing, modifying, and deleting the three-dimensional models of the hair styles stored in the hair style database. The three-dimensional models of the hair styles in this embodiment are mainly represented by hair style feature vectors to achieve algorithmic language description and facilitate the agent to make recommendation decisions. For example, three features of the hair style length, color, and curl degree are selected, and each feature is represented by 3 bits. (1,0,0) represents short hair with a length less than 5 cm, (2,0,0) represents a positive red hair color, and (0,0,0) represents straight hair. Then a feature vector such as (1,0,0,2,0,0,0,0,0) can be obtained, representing short red straight hair. Of course, the above representation methods of the features are only for illustration, and the administrator can actively adjust them based on the actual situation.

[0047] S3. Determine the user's facial model according to the personal information.

[0048] The facial model of a user refers to a three-dimensional facial model reconstructed based on their two-dimensional facial images. Generally, when a user first uses the method provided in this embodiment, they can establish a three-dimensional facial model by taking facial images from multiple angles. The established facial model is stored in the facial model library and associated with information such as the user ID, personal information, and the user's frontal facial image corresponding to the user. During actual use, after obtaining the user's facial image, first detect whether there is a corresponding facial model in the facial model library. If there is a corresponding facial model in the facial model library, directly retrieve and output the corresponding facial model. If there is no corresponding facial model in the facial model library, a corresponding facial model can be generated based on the user's facial image and stored in the facial model library for subsequent applications.

[0049] Figure 4 The flowchart of facial model generation is shown. It mainly realizes the process of reconstructing a three-dimensional facial model using a two-dimensional facial image through the PRNet network of the face alignment algorithm. The PRNet network designs a texture (UV) position mapping graph, which is a two-dimensional image used to record the three-dimensional coordinates of all facial point clouds. The PRNet network adopts an encoder-decoder structure to directly regress the three-dimensional parameters of the human face from a single two-dimensional face image, output the UV position mapping graph, and then obtain the three-dimensional human face model. The specific implementation steps are as follows:

[0050] S100, call the camera to take a photo and obtain the user's frontal image as the input of the facial model; in addition, the user's side image can also be taken simultaneously, which is also used as the input of the facial model to improve the final display effect of the facial model;

[0051] S200, detect the key points of the human face, obtain the face bounding box, and crop the input image according to the face bounding box to obtain the facial image;

[0052] S300, load the PRNet network weights, load the network structure, and input the cropped facial image into the PRNet network to predict the UV position mapping graph;

[0053] S400, load the vertex index file, and directly obtain the vertex information according to this file and the UV position mapping graph; in this embodiment, the three-dimensional model is actually an abstract mesh constructed based on triangles, and the vertices are the vertices of each triangle. The vertex information mainly refers to information such as the spatial coordinates, normal vectors, and colors of each vertex;

[0054] S500, extract the texture information used to color the vertices from the UV position mapping graph. Based on the texture information and vertex information, the three-dimensional model of the user's face can be obtained, and this three-dimensional model is saved for subsequent splicing with the hairstyle model.

[0055] It should be noted that in the actual use process, the actual execution order of step S2 and step S3 may not follow the order specified in the embodiment, and the above two steps can also be carried out simultaneously. This embodiment does not limit as long as the corresponding facial model and recommended hairstyles can be output.

[0056] S4. Sequentially splice the facial model with M recommended hairstyles to obtain M splicing results.

[0057] Both the facial model and the recommended hairstyle model are three-dimensional solid models. After obtaining the facial model and the recommended hairstyle model respectively, the two can be spliced. By trying on the hairstyle model on the facial model, the presentation effect of the current user after trimming into the corresponding hairstyle can be intuitively displayed. And compared with splicing the hairstyle model with the user's video image, splicing between three-dimensional models can simplify the splicing steps, improve the splicing effect, and is more convenient for users to view the spliced model from all directions and multiple angles.

[0058] Figure 5 The flowchart showing the splicing process between the facial model and the recommended hairstyles mainly includes the following steps:

[0059] S41. Load the facial model and the models of M recommended hairstyles; among them, both the facial model and the hairstyle model are represented based on vertex information and supporting texture information. During the process of loading the above models, the supporting texture can be fitted with the vertex coordinates of the model based on the texture coordinates in the model file to form a complete hairstyle model and facial model.

[0060] S42. Obtain the first key coordinate information of the facial model and the second key coordinate information of each recommended hairstyle model; among them, the first key coordinate information refers to the coordinate point information of each key position in the facial model, such as the head center coordinate, the maximum coordinates of the head's x-axis, y-axis, and z-axis, etc.; the second key coordinate information is the same, and actually refers to the hairstyle center coordinate of each recommended hairstyle model, the maximum coordinates of the hairstyle's x-axis, y-axis, and z-axis, etc.

[0061] S43. Based on the first key coordinate information and the second key coordinate information, respectively splice the facial model with each recommended hairstyle model through preset actions to obtain M splicing results; among them, the preset actions mainly refer to operations such as translation, rotation, and scaling. When previewing, the initial positioning between the models will be carried out according to the first key coordinate information and the second key coordinate information, and the administrator can also make fine-tuning according to actual needs to achieve a better splicing effect.

[0062] S44. Store the action sequence of the preset actions performed during the process of separately splicing the facial model with each recommended hairstyle model. In this embodiment, whether it is the automatically performed positioning or the manually performed fine-tuning, the preset actions and adjustment parameters corresponding to them during the splicing process are saved in the action sequence corresponding to the hairstyle model, so that the splicing effects of different hairstyles with the facial model are solidified for subsequent ready-to-use calls.

[0063] S5. Based on the user's selection result of the M recommended hairstyles, display the first splicing result corresponding to the recommended hairstyle selected by the user.

[0064] After the M recommended hairstyles are determined, the user can view the specific situation of each recommended hairstyle through the display device and select at least one of the recommended hairstyles as the selection result. At this time, it is necessary to correspondingly display the splicing result between the user's facial model and the hairstyle selected by the user for the user to view. Therefore, after obtaining the recommended hairstyle selected by the user, the facial model is spliced with the recommended hairstyle model based on the action sequence corresponding to the recommended hairstyle to generate the first splicing result, and then the first splicing result is displayed on the display device.

[0065] This embodiment recommends personalized hairstyles for the user based on the user's facial image and splices the recommended hairstyles with the user's three-dimensional facial model to improve the splicing effect. At the same time, both the user and the barber can view the hairstyle effects at various angles after splicing through free operations such as rotation and scaling, which is convenient for the barber to more fully understand the user's hairstyle needs and thus improve the user satisfaction.

[0066] The second embodiment of the present disclosure provides a storage medium. This storage medium can be installed in any electronic device with a processing function and connected with a photographing device and a display device. Specifically, it is a computer-readable medium storing a computer program. When the computer program is executed by a processor, it implements the method provided in any embodiment of the present disclosure, including the following steps S201 to S205:

[0067] S201. Obtain the user's facial image and determine the user's personal information according to the facial information.

[0068] S202. Based on the personal information, determine M recommended hairstyles and display them, where M is a positive integer.

[0069] S203. Determine the user's facial model according to the facial image.

[0070] S204. Splice the facial model with the M recommended hairstyles in sequence to obtain M splicing results.

[0071] S205. Based on the user's selection result of the M recommended hairstyles, display the first splicing result corresponding to the recommended hairstyle selected by the user.

[0072] Specifically, the personal information includes at least the user ID and the user's basic information.

[0073] When the computer program is executed by the processor to determine M recommended hairstyles based on personal information, the following steps are specifically executed by the processor: according to the personal information, determine N alternative hairstyles in the hairstyle database through a recommendation algorithm; score each of the N alternative hairstyles; take the M alternative hairstyles with the highest scores among the N alternative hairstyles as the recommended hairstyles, where N is a positive integer and M is less than or equal to N.

[0074] When the computer program is executed by the processor to determine the user's facial model based on the facial image, the following steps are specifically executed by the processor: detect whether there is a facial model corresponding to the facial image in the facial model library; in the case where there is a facial model corresponding to the facial image in the facial model library, output the facial model corresponding to the facial image; in the case where there is no facial model corresponding to the facial image in the facial model library, generate and output the facial model corresponding to the facial image based on the facial image.

[0075] When the computer program is executed by the processor to sequentially splice the facial model with M recommended hairstyles, the following steps are specifically executed by the processor: load the facial model and the models of the M recommended hairstyles; obtain the first key coordinate information of the facial model and the second key coordinate information of each recommended hairstyle model; based on the first key coordinate information and the second key coordinate information, splice the facial model with each recommended hairstyle model respectively through a preset action to obtain M splicing results; store the action sequence of the preset action executed during the process of splicing the facial model with each recommended hairstyle model respectively.

[0076] When the computer program is executed by the processor to display the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles, the following steps are specifically executed by the processor: form the first splicing result based on the action sequence corresponding to the recommended hairstyle selected by the user; display the first splicing result.

[0077] After the computer program is executed by the processor to display the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles, the following steps are further executed by the processor: optimize the recommendation decision of the recommendation algorithm based on the user's feedback on the first splicing result.

[0078] This embodiment recommends personalized hairstyles for the user based on the user's facial image, and splices the recommended hairstyles with the user's three-dimensional facial model to improve the splicing effect. At the same time, both the user and the barber can view the hairstyle effects at various angles after splicing through free operations such as rotation and scaling, which is convenient for the barber to more fully understand the user's hairstyle needs, thereby improving the user satisfaction.

[0079] The third embodiment of the present disclosure provides an electronic device, which is connected to a photographing device and a display device, or has a photographing function and a display screen by itself. The schematic structural diagram is as follows Figure 6 shown, and it includes at least a memory 100 and a processor 200. A computer program is stored on the memory 100, and when the processor 200 executes the computer program on the memory 100, the method provided by any embodiment of the present disclosure is implemented. Exemplarily, the computer program steps of the electronic device are as follows S301 to S305:

[0080] S301, obtain a user face image and determine the user's personal information according to the face information;

[0081] S302, determine M recommended hairstyles based on the personal information and display them, where M is a positive integer;

[0082] S303, determine the user's face model according to the face image;

[0083] S304, sequentially splice the face model with the M recommended hairstyles to obtain M splicing results;

[0084] S305, display the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles.

[0085] Specifically, the personal information at least includes a user ID and user basic information.

[0086] When the processor executes the computer program for determining M recommended hairstyles stored on the memory based on the personal information, it specifically executes the following computer program: according to the personal information, determine N alternative hairstyles in the hairstyle database through a recommendation algorithm; score each of the N alternative hairstyles; use the M alternative hairstyles with the highest scores among the N alternative hairstyles as the recommended hairstyles, where N is a positive integer and M is less than or equal to N.

[0087] When the processor executes the computer program for determining the user's face model according to the face image stored on the memory, it specifically executes the following computer program: detect whether there is a face model corresponding to the face image in the face model library; in the case where there is a face model corresponding to the face image in the face model library, output the face model corresponding to the face image; in the case where there is no face model corresponding to the face image in the face model library, generate a face model corresponding to the face image based on the face image and output it.

[0088] When the processor executes the computer program stored in the memory to sequentially splice the facial model with M recommended hairstyles to obtain M splicing results, it specifically executes the following computer program: load the facial model and the models of M recommended hairstyles; obtain the first key coordinate information of the facial model and the second key coordinate information of each recommended hairstyle model; based on the first key coordinate information and the second key coordinate information, splice the facial model with each recommended hairstyle model respectively through a preset action to obtain M splicing results; store the action sequence of the preset action executed during the process of splicing the facial model with each recommended hairstyle model respectively.

[0089] When the processor executes the computer program stored in the memory to display the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for M recommended hairstyles, it specifically executes the following computer program: form the first splicing result based on the action sequence corresponding to the recommended hairstyle selected by the user; display the first splicing result.

[0090] After the processor executes the computer program stored in the memory to display the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for M recommended hairstyles, it also executes the following computer program: optimize the recommendation decision of the recommendation algorithm based on the feedback of the user on the first splicing result.

[0091] This embodiment recommends personalized hairstyles for the user based on the user's facial image, and splices the recommended hairstyles with the user's three-dimensional facial model to improve the splicing effect. At the same time, both the user and the barber can view the hairstyle effects at various angles after splicing through free operations such as rotation and scaling, which is convenient for the barber to more fully understand the user's hairstyle needs, thereby improving the user satisfaction.

[0092] The above has described multiple embodiments of the present disclosure in detail, but the present disclosure is not limited to these specific embodiments. Those skilled in the art can make various variations and modifications to the embodiments based on the concept of the present disclosure, and these variations and modifications should fall within the scope of protection required by the present disclosure.

Claims

1. A preview method for a hairstyle, characterized in that, Including: Obtain a user's facial image and determine the user's personal information based on the facial information; Determine M recommended hairstyles based on the personal information and display them, where M is a positive integer; Determine the facial model of the user according to the facial image; Sequentially splice the facial model with the M recommended hairstyles to obtain M splicing results; both the facial model and the recommended hairstyle model are three-dimensional solid models; the facial model is a three-dimensional facial model reconstructed based on its two-dimensional facial image, and the three-dimensional model of the recommended hairstyle is pre-established and stored in the hairstyle database in advance; both the facial model and the recommended hairstyle model are three-dimensional solid models. After obtaining the facial model and the recommended hairstyle model respectively, perform a splicing process on the two to try on the hairstyle model on the facial model, so as to display the presentation effect of the current user after trimming into the corresponding hairstyle; Sequentially splice the facial model with the M recommended hairstyles to obtain M splicing results, including: Load the facial model and the models of the M recommended hairstyles; Obtain the first key coordinate information of the facial model and the second key coordinate information of each recommended hairstyle model; Based on the first key coordinate information and the second key coordinate information, splice the facial model with each recommended hairstyle model respectively through a preset action to obtain M splicing results, and the preset action includes any one of translation, rotation, and scaling; Store the action sequence of the preset action executed during the process of respectively splicing the facial model with each recommended hairstyle model; the preset actions and adjustment parameters executed during the splicing process are saved in the action sequence corresponding to the hairstyle model, so as to solidify the splicing effects of different hairstyles and facial models for subsequent calling at any time; Based on the user's selection result of the M recommended hairstyles, display the first splicing result corresponding to the recommended hairstyle selected by the user; After obtaining the recommended hairstyle selected by the user, splice the facial model with the recommended hairstyle model based on the action sequence corresponding to the selected recommended hairstyle to generate the first splicing result, and then display the first splicing result on the display device.

2. The preview method according to claim 1, wherein The personal information at least includes a user ID and user basic information.

3. The preview method according to claim 2, wherein The determining of the M recommended hairstyles based on the personal information includes: According to the personal information, determine N alternative hairstyles in the hairstyle database through a recommendation algorithm; Score the N alternative hairstyles respectively; Take the M alternative hairstyles with the highest scores among the N alternative hairstyles as the recommended hairstyles, where N is a positive integer and M is less than or equal to N.

4. The preview method according to claim 1, wherein The determining of the facial model of the user according to the facial image includes: Detect whether there is a facial model corresponding to the facial image in the facial model library; In the case where there is a facial model corresponding to the facial image in the facial model library, output the facial model corresponding to the facial image; In the case where there is no facial model corresponding to the facial image in the facial model library, generate and output the facial model corresponding to the facial image based on the facial image.

5. The preview method according to claim 1, characterized in that Displaying a first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles, including: Forming the first splicing result based on the action sequence corresponding to the recommended hairstyle selected by the user; Displaying the first splicing result.

6. The preview method according to claim 3, wherein After displaying the first splicing result corresponding to the recommended hairstyle selected by the user based on the selection result of the user for the M recommended hairstyles, it further includes: Optimizing the recommendation decision of the recommendation algorithm based on the feedback of the user on the first splicing result.

7. The preview method according to claim 3, wherein The personal information further includes: the user's hairstyle selection history; respectively scoring the N alternative hairstyles, including: Respectively scoring the N alternative hairstyles based on the hairstyle selection history.

8. A storage medium stores a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the hairstyle preview method described in any one of claims 1 to 7.

9. An electronic device, at least comprising a memory and a processor, wherein a computer program is stored on the memory, characterized in that, When the processor executes the computer program on the memory, it implements the steps of the hairstyle preview method described in any one of claims 1 to 7.

Citation Information

Patent Citations

  • Generation method and generation system of hair style effect pictures

    CN103065360A

  • Hairstyle recommendation method, system, terminal and medium

    CN108664569A