Special effect prop generation and application method, device, equipment and medium
Patent Information
- Application Number
- CN202111664536.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-31
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2041-12-31
AI Technical Summary
Existing head special effects props are prone to clipping when the user's head size does not match, affecting the shooting effect and fun.
By establishing a multi-point binding relationship between the head special effects props and the head model, the head special effects props corresponding to the target head item are generated to achieve dynamic adaptation.
提高了头部特效道具的逼真程度和趣味性,解决了穿模问题,增强了用户体验。
Smart Images

Figure CN114299270B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present disclosure relates to the technical field of computer, and particularly relates to a special effect prop generation and application method, device, equipment and medium. BACKGROUND
[0002] With the development of computer technology, at present, there are many virtual special effect props based on augmented reality, such as virtual head special effect props, to enrich the interestingness of image / video shooting.
[0003] However, the current head special effect props have the problem of model penetration. For example, for the hat special effect prop shown in (a), when the user's head size is basically consistent with the hat size of the hat special effect prop, it has a good augmented reality effect. However, when the user's head size is larger than the hat size of the hat special effect prop, the display effect is as shown in (b), that is, part of the user's head will penetrate the hat range and show the model penetration phenomenon. Such virtual headwear props will inevitably affect the shooting effect of the obtained image / video and reduce the shooting interestingness. Figure 1 Figure 1 In order to solve the above technical problems, the present disclosure provides a special effect prop generation and application method, device, equipment and medium. SUMMARY
[0004] In order to solve the above technical problems, the present disclosure provides a special effect prop generation and application method, device, equipment and medium.
[0005] In a first aspect, the present disclosure provides a special effect prop generation method, which comprises:
[0006] displaying a prop making interface; the prop making interface comprises a prop display area;
[0007] in response to a material import operation, importing an initial head model and an initial object model corresponding to a target head object, and displaying the initial head model and the initial object model in the prop display area;
[0008] in response to an adjustment operation on the initial head model and the initial object model, displaying an adjusted head model and an adjusted object model in the prop display area;
[0009] establishing a mapping relationship between a target object point in the adjusted object model and at least one head point in the adjusted head model corresponding to the target object point, and generating a head special effect prop corresponding to the target head object based on the adjusted object model and the mapping relationship.
[0010] In a second aspect, the present disclosure also provides a special effect prop application method, which comprises:
[0011] obtaining a face image, and determining head key points based on the face image;
[0012] in response to an application trigger operation of a head special effect prop, determining an initial head special effect prop, and determining prop key points based on the head key points and a mapping relationship contained in the initial head special effect prop, wherein the mapping relationship is used to record a corresponding relationship between a head point in a head model and an article point in an article model corresponding to the initial head special effect prop;
[0013] adjusting the initial head special effect prop based on the prop key points, generating a target head special effect prop, and generating a head special effect image based on the target head special effect prop and the face image and displaying.
[0014] In a third aspect, the present disclosure further provides a special effect prop generation device, which comprises:
[0015] a prop making interface display module, configured to display a prop making interface; the prop making interface comprises a prop display area;
[0016] a model import module, configured to, in response to a material import operation, import an initial head model and an initial article model corresponding to a target head article, and display the initial head model and the initial article model in the prop display area;
[0017] a model adjustment module, configured to, in response to an adjustment operation on the initial head model and the initial article model, display an adjusted head model and an adjusted article model in the prop display area;
[0018] a head special effect prop generation module, configured to establish a mapping relationship between a target article point in the adjusted article model and at least one head point in the adjusted head model corresponding to the target article point, and generate a head special effect prop corresponding to the target head article based on the adjusted article model and the mapping relationship.
[0019] In a fourth aspect, the present disclosure further provides a special effect prop application device, which comprises:
[0020] a head key point determination module, configured to obtain a face image, and determine head key points based on the face image;
[0021] a prop key point determination module, configured to, in response to an application trigger operation of a head special effect prop, determine an initial head special effect prop, and determine prop key points based on the head key points and a mapping relationship contained in the initial head special effect prop, wherein the mapping relationship is used to record a corresponding relationship between a head point in a head model and an article point in an article model corresponding to the initial head special effect prop;
[0022] The head special effect image generation module is configured to adjust the initial head special effect prop based on the prop key points, generate a target head special effect prop, and generate and display a head special effect image based on the target head special effect prop and the face image.
[0023] In a fifth aspect, the present disclosure provides an electronic device, which comprises:
[0024] a processor;
[0025] a memory configured to store executable instructions;
[0026] The processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the special effect prop generation method described in any of the embodiments of the present disclosure, or implement the special effect prop application method described in any of the embodiments of the present disclosure.
[0027] In a sixth aspect, the present disclosure provides a computer-readable storage medium storing a computer program, when the computer program is executed by a processor, the processor implements the special effect prop generation method described in any of the embodiments of the present disclosure, or implements the special effect prop application method described in any of the embodiments of the present disclosure.
[0028] The special effect prop generation method, device, equipment and medium of the embodiments of the present disclosure can display a prop making interface containing a prop display area in the generation process of a head special effect prop; in response to a material import operation, import an initial head model and an initial prop model corresponding to a target head prop, and display the initial head model and the initial prop model in the prop display area; in response to an adjustment operation on the initial head model and the initial prop model, display an adjusted head model and an adjusted prop model in the prop display area; establish a mapping relationship between a target prop point in the adjusted prop model and at least one head point in the adjusted head model corresponding to the target prop point, and generate a head special effect prop corresponding to the target head prop based on the adjusted prop model and the mapping relationship. The point-to-point binding between the head model and the head special effect prop is realized, the problem that the head special effect prop is not adapted to the head model due to the establishment of binding as a whole is solved, the dynamic adaptability of the head special effect prop to the head model is improved, and thus the realism and interestingness of the head special effect prop are improved.
[0029] The special effect prop application method, device, equipment and medium provided by the embodiments of the present disclosure can obtain a real user's face image, and determine head key points based on the face image; in response to an application trigger operation of a head special effect prop, an initial head special effect prop is determined, and prop key points are determined based on the head key points and a mapping relationship contained in the initial head special effect prop; the initial head special effect prop is adjusted based on the prop key points to generate a target head special effect prop, and a head special effect image is generated based on the target head special effect prop and the face image and displayed. The problem of non-adaptation of special effect props such as a pass-through model to a user's head in the application process of a head special effect prop is solved, dynamic adaptation of a head special effect prop to a user's head size and head action is realized, the degree of reality enhancement and the interest in the application process of a head special effect prop are improved, and thus the user experience and user stickiness are improved. BRIEF DESCRIPTION OF DRAWINGS
[0030] The above and other features, advantages, and aspects of the present disclosure will become more apparent by describing in detail the embodiments thereof with reference to the attached drawings. Throughout the drawings, the same or similar reference numerals refer to the same or similar elements. It should be understood that the drawings are schematic and elements and features are not necessarily to scale.
[0031] Figure 1 A display schematic diagram of a hat special effect prop in the prior art;
[0032] Figure 2 A flowchart of a special effect prop generation method provided by the embodiments of the present disclosure;
[0033] Figure 3 A display schematic diagram of a prop making interface provided by the embodiments of the present disclosure;
[0034] Figure 4 A flowchart of a special effect prop application method provided by the embodiments of the present disclosure;
[0035] Figure 5 A structural schematic diagram of a special effect prop generation device provided by the embodiments of the present disclosure;
[0036] Figure 6 A structural schematic diagram of a special effect prop application device provided by the embodiments of the present disclosure;
[0037] Figure 7 A structural schematic diagram of an electronic device provided by the embodiments of the present disclosure. DETAILED DESCRIPTION
[0038] Embodiments of the present disclosure will be described below in greater detail with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is understood that the present disclosure can be embodied in various forms and should not be construed as being limited to the embodiments set forth herein, but rather should be construed to encompass all modifications equivalent in meaning and scope. It is understood that the drawings and embodiments of the present disclosure are for exemplary purposes only and are not intended to limit the scope of the present disclosure.
[0039] It should be understood that each step recited in the method embodiments of the present disclosure can be performed in different orders and / or in parallel. In addition, the method embodiments can include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0040] The term "comprising" and variations thereof as used herein are used inclusively, i.e., "comprising, but not limited to". The term "based on" is "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Related definitions will be given in the description below.
[0041] It should be noted that the terms "first", "second", and the like in the present disclosure are merely used to distinguish different devices, modules or units, and do not imply the order or interdependence of the functions performed by these devices, modules or units.
[0042] It should be noted that the terms "one", "multiple" in the present disclosure are illustrative and not restrictive, and those skilled in the art should understand that unless otherwise explicitly stated in the context, it should be understood as "one or more".
[0043] The names of the messages or information exchanged between the devices in the embodiments of the present disclosure are merely for illustrative purposes, and are not intended to limit the scope of the messages or information.
[0044] In the current production process of head special effect props, a virtual head ornament is often established as a whole with a binding relationship with a head model, which makes the produced head special effect props very easy to have the phenomenon that the virtual head ornament cannot be well dynamically adapted to the size of the user's head and the movement of the user's head in the application process. For example, the phenomenon of the user's head penetrating the virtual head ornament, the phenomenon of the virtual head ornament being too large or too small in proportion relative to the user's head, and the phenomenon of the movement distance and direction of the virtual head ornament not matching the movement distance and direction of the user's head.
[0045] Based on the above, the embodiment of the present disclosure provides a special effect prop generation scheme and a special effect prop application scheme to establish a multi-point binding relationship between the head special effect prop and the head model, and to dynamically adapt the head special effect prop to the user's head based on the multi-point binding relationship, thereby solving the problem of head special effect props not adapting to the head model, such as wearing a mold, improving the dynamic adaptability of the head special effect prop to the user's head, and thereby improving the realism and interest of the head special effect prop.
[0046] Firstly, the following will be described in combination with Figures 2-3 The special effect prop generation method provided by the embodiment of the present disclosure will be described.
[0047] In the embodiment of the present disclosure, the special effect prop generation method is applicable to the case of making a special effect prop, and is particularly applicable to the case of making a head special effect prop. For example, making a hat special effect prop, making a headpin, a head comb, a crown, a hair clip, and other non-hat head special effect props. The special effect prop generation method can be executed by a special effect prop generation device, which can be realized by software and / or hardware. The device can be integrated in an electronic device capable of installing special effect prop making software. The electronic device can include but is not limited to smart phones, tablet computers, notebook computers, desktop computers, etc.
[0048] Figure 2 A flowchart of a special effect prop generation method provided by the embodiment of the present disclosure is shown. As shown in the figure, the special effect prop generation method can include the following steps: Figure 2
[0049] S210, display the prop making interface.
[0050] Specifically, when the user needs to make a head special effect prop, he needs to start a special effect prop making tool, such as starting a special effect prop making application in an electronic device. In this way, the electronic device can display the application interface, i.e. the prop making interface for making a special effect prop. The prop making interface at least includes a material operation area and a prop display area. The material operation area is used to display and operate the materials (i.e. special effect materials) required for making a head special effect prop, such as head model materials, head object model materials, object material quality materials, object style materials, etc. The prop display area is used to display the effect of various special effect materials combined together, so that the user can more intuitively see the head special effect prop and adjust it.
[0051] As Figure 3 As shown, the electronic device displays a prop making interface 300, a material operation area 310 is displayed on the left side of the prop making interface 300, a prop display area 320 is displayed in the middle part, and a parameter setting area 330 is displayed on the right side. Two sub-areas of "special effect material" and "resource management" are displayed in the material operation area 310, which are respectively the areas corresponding to the material editing function and the material import function.
[0052] S220, in response to the material import operation, importing an initial head model and an initial object model corresponding to the target head object, and displaying the initial head model and the initial object model in the prop display area.
[0053] The material import operation refers to the operation of importing special effect materials required for making special effect props from outside the special effect prop making application (such as local storage medium, external storage medium, network end, etc.). The initial head model is a pre-constructed standard static model of the head, which can be a three-dimensional mesh model of the head, for example. The initial object model is a pre-constructed standard static model of the target head object, which can be a three-dimensional mesh model of the object, for example. The target head object refers to the object to be made as a head-wearing special effect prop, such as a hat, a headpin, a headpin, a crown, a hairpin, etc.
[0054] Specifically, the user can perform the material import operation by operating the control related to the material import function set in the special effect prop making application. For example, in the upper right corner of the "resource management" sub-area in the Figure 3 The import function controls, i.e. the import file control 311 and the import folder control 312, are set in the upper right corner of the "resource management" sub-area. The user can click the import file control 311 or the import folder control 312 to perform the material import operation. Alternatively, a reminder message such as "drag the material here" is set at a certain position in the "resource management" sub-area to prompt the user to directly drag the special effect material he wants to import to the "resource management" sub-area, so that the user can also perform the material import operation by dragging the material.
[0055] During the user's material import operation, the user will select the special effect material corresponding to the part (head) of the special effect prop he wants to make and the special effect material required for the target head object. After the electronic device detects the user's material import operation, it receives the special effect material imported in the material import operation and displays it in the material operation area.
[0056] In some embodiments, the material operation area 310 is divided into two sub-areas, i.e., a "special effect material" sub-area and a "resource management" sub-area. When the user wants to make a hat special effect prop, the user selects the head try-on function and the hat related special effect material provided in the special effect prop making application when performing the material import operation, so that the electronic device can receive the head and hat related special effect material. In addition, the head model is displayed in the "special effect material" sub-area, and the imported "hat material package" is displayed in the "resource management" sub-area.
[0057] After that, in order to facilitate the visual operation, the loading trigger operation of the user can be further detected, and in response to the loading trigger operation, the special effect material to be loaded is loaded from the "resource management" sub-area to the "special effect material" sub-area. The loading trigger operation can include a double-click operation, a right-click operation, or a drag operation, etc. For example, the user double-clicks the "hat material package" in the "resource management" sub-area, and after the electronic device detects the double-click operation, the special effect material is displayed according to the model structure of the article model material, that is, the "hat material package" is loaded below the "head article" in the "special effect material" sub-area, and the special effect material contained in the "hat material package" is displayed, as shown in the following figure. Figure 3 For another example, the user right-clicks the "hat material package" in the "resource management" sub-area and selects the corresponding function option, which can also achieve the function of loading the "hat material package" below the "head article" in the "special effect material" sub-area and displaying it. For another example, the user drags the "hat material package" in the "resource management" sub-area to below the "head article" in the "special effect material" sub-area, and then the electronic device can display the special effect material contained in the "hat material package" below the "head article" in the "special effect material" sub-area.
[0058] In other embodiments, when the material operation area is one area, the user can directly load all the special effect materials corresponding to the target head article into the material operation area through the above-mentioned material import operation, and display the special effect materials according to the model structure of the article model material.
[0059] In order to make the user more intuitive to make head special effect props, the electronic device can display the imported initial head model and initial article model in the prop display area 320 according to the default position and orientation parameters when they are imported.
[0060] S230, in response to the adjustment operation of the initial head model and the initial article model, displaying the adjusted head model and the adjusted article model in the prop display area.
[0061] Specifically, the user can adjust the initial head model and / or the initial item model in dimensions such as size, position and orientation according to his / her own needs. For example, the user can perform the adjustment operation by dragging the initial head model and / or the initial item model. For another example, the user can select the initial head model and / or the initial item model by a selection operation on the initial head model and / or the initial item model, and then display a parameter setting sub-region (i.e., a first parameter setting sub-region) of the selected model in the parameter setting region 330 shown in FIG. 3B, and perform the adjustment operation by setting the relevant parameters in the first parameter setting sub-region. Figure 3
[0062] After detecting the above adjustment operation performed by the user, the electronic device can obtain the execution result of the adjustment operation, such as the size, position and orientation of the model after being dragged, the parameter value after being set, etc. Then, the electronic device obtains the adjusted head model and / or the adjusted item model according to the above execution result, and displays the same in real time in the item display region 320 shown in FIG. 3C. Figure 3
[0063] In some embodiments, for the case that the prop making interface includes a parameter setting region, the above S230 can be specifically implemented as: displaying a first parameter setting sub-region corresponding to the target model in the parameter setting region; in response to a parameter setting operation on a first target parameter displayed in the first parameter setting sub-region, determining a first target parameter value, and determining an adjusted target model based on the first target parameter value and displaying the same.
[0064] wherein the target model is a standard static model selected by the user and to be adjusted, which can be one or both of the initial head model and the initial item model. The first target parameter refers to a parameter that can be adjusted in the target model.
[0065] Specifically, the electronic device can provide the parameters required for adjusting the model, i.e., display the first parameter setting sub-region corresponding to the target model in the prop making interface, and display the first target parameter in the first parameter setting sub-region.
[0066] In an example, because the parameter setting of the target model is relatively important, the first parameter setting sub-region of the target model can be displayed by default in the prop making interface, i.e., the first parameter setting sub-region corresponding to the target model is displayed when the prop making interface is displayed.
[0067] In another example, because the content that can be displayed in the parameter setting region is limited, the first parameter setting sub-region corresponding to the target model can not be displayed when the prop making interface is displayed. In this way, the user can perform a selection operation such as clicking on the target model. After detecting the selection operation, the electronic device displays the first parameter setting sub-region in the parameter setting region.
[0068] In some embodiments, when the target model comprises an initial head model and an initial item model, the first target parameter is a relative position, a relative scale and a relative orientation between the initial head model and the initial item model. Specifically, in order to improve the model adjustment efficiency, the first target parameter can be set as a linkage adjustment parameter between the initial head model and the initial item model, i.e., the relative position, the relative scale and the relative orientation. As shown in FIG. 3, the electronic device displays the relative position, the relative scale and the relative orientation in the first parameter setting sub-area.
[0069] As shown in FIG. 3, when the user selects the head model and the hat model displayed in the material operation area 310, the electronic device displays a first parameter setting sub-area 331 corresponding to model adjustment in the parameter setting area 330 in response to the selection operation. The relative position option, the relative scale option and the relative orientation option are displayed in the first parameter setting sub-area 331. Figure 3
[0070] When the user wants to adjust the target model, the user can perform parameter setting on the first target parameter displayed in the first parameter setting sub-area. For example, the user performs parameter setting operations such as selection, parameter value filling, parameter value changing, etc. on the first target parameter. After detecting the above parameter setting operation, the electronic device obtains the parameter value of the first target parameter (i.e., the first target parameter value) from the parameter setting operation. Then, the electronic device adjusts the target model according to the first target parameter value, obtains the adjusted target model, and displays it in the prop display area in real time for the user to view the adjustment result.
[0071] For example, the user can fill in the parameter values of the relative position option, the relative scale option and the relative orientation option displayed in the first parameter setting sub-area 331 in FIG. 3. After receiving the filled first target parameter values, the electronic device synchronously adjusts the initial head model and the initial item model according to the first target parameter values, obtains the adjusted head model and the adjusted item model, and displays them in the prop display area 320. Figure 3
[0072] S240, establishing a mapping relationship between a target item point in the adjusted item model and at least one head point in the adjusted head model corresponding to the target item point, and generating a head special effect prop corresponding to the target head item based on the adjusted item model and the mapping relationship.
[0073] The target item point refers to a point in the item model that is selected to establish the binding relationship (i.e., the mapping relationship) between the head model and the item model. The head point refers to a point in the head model that is used to establish the mapping relationship between the head model and the item model.
[0074] Exemplarily, in order to avoid the problem that the head special effect prop cannot be well dynamically adapted to the head model due to the mapping relationship being established for the article model as a whole in the related art, the number of the target article points in the embodiment of the present disclosure is at least two. In this way, the electronic device can establish a multi-point binding relationship between the head model and the article model, so that the subsequently generated head special effect prop can be adjusted and constrained in multiple points following the movement of the head model, thereby achieving the effect that the head special effect prop dynamically adapts to the head model. Considering that the more the number of target article points is, the better the dynamic adaptation between the subsequently generated head special effect prop and the head model is, and that too many target article points may cause excessive deformation of the head special effect prop and large consumption of computing resources, the embodiment of the present disclosure can balance the dynamic adaptation effect and the amount of resource consumption to determine a suitable number of target article points.
[0075] Specifically, the electronic device detects whether the model adjustment for the head model and the article model is ended. For example, the electronic device determines whether the above adjustment operation is not detected within a preset time length, or the electronic device detects whether a trigger operation of a related control for ending the adjustment by the user is received. If the detection result is no, it indicates that the model adjustment has not been ended, and the electronic device can continue to adjust the model in response to the adjustment operation of the model. If the detection result is yes, it indicates that the model adjustment has been ended. At this time, the electronic device can determine the target article points from the adjusted article model. For example, the electronic device selects the article points satisfying the above conditions from the article points in the adjusted article model as the target article points according to a pre-set point distance threshold or a mesh granularity of the mesh model. Then, the electronic device determines at least one head point corresponding to each target article point from the adjusted head model. For example, the electronic device calculates the distances between the target article points and the head points in the corresponding regions of the adjusted head model, and selects the head points satisfying a pre-set third distance threshold or a pre-set number of head points with smaller distances as the head points corresponding to the corresponding target article points. Similarly, the more the number of head points is, the more stable the mapping relationship is, and the more the computing resource consumption demand is, so a suitable third distance threshold or a pre-set number can be determined to balance the stability of the mapping relationship and the amount of resource consumption, thereby determining the head points corresponding to each target article point.
[0076] Subsequently, for each target article point, the electronic device can construct a related conversion relationship according to the article point information (such as the article point position and the article point orientation) of the target article point and the head point information (such as the head point position and the head point orientation) of each head point corresponding to the target article point, and solve the conversion coefficient matrix of the conversion relationship, so as to obtain the information conversion relationship between the target article point and the head points corresponding to the target article point, and determine the mapping relationship corresponding to the target article point.
[0077] The mapping relationship corresponding to each target object point can be obtained according to the above process. Then, the electronic device can package the adjusted object model and the associated mapping relationship obtained above together to generate the head special effect prop corresponding to the target head object.
[0078] It should be noted that the mapping relationship contains information in addition to the information conversion relationship, and can also contain the distance value between the target object point and the corresponding head point, so as to further constrain the information conversion relationship and optimize the head special effect prop.
[0079] In some embodiments, after generating the head special effect prop corresponding to the target head object based on the adjusted object model and the mapping relationship, the method further includes: exporting the head special effect prop to configure the head in the original shooting data.
[0080] Specifically, after the user completes the head special effect prop, the user can use the export function of the special effect prop provided by the electronic device to export the completed head special effect prop as a special effect prop product. In this way, during the process of special effect shooting / special effect synthesis, the user can select the special effect prop product to configure the head in the image / video.
[0081] The special effect prop generation method provided by the above embodiments of the present disclosure can display a prop making interface containing a prop display area during the generation of the head special effect prop; in response to a material import operation, import an initial head model and an initial object model corresponding to a target head object, and display the initial head model and the initial object model in the prop display area; in response to an adjustment operation on the initial head model and the initial object model, display an adjusted head model and an adjusted object model in the prop display area; establish a mapping relationship between a target object point in the adjusted object model and at least one head point in the adjusted head model corresponding to the target object point, and generate a head special effect prop corresponding to the target head object based on the adjusted object model and the mapping relationship. The point-to-point binding between the head model and the head special effect prop is realized, the problem of special effect prop not adapting to the head model caused by establishing binding as a whole is solved, the dynamic adaptability of the head special effect prop to the head model is improved, and thus the realism and interest of the head special effect prop are improved.
[0082] In some embodiments, after S220, the special effect prop generation method further includes the steps of partition rendering the head special effect prop and determining the distance value in the mapping relationship, which can be implemented as steps A-C.
[0083] Step A, in response to a trigger operation on the partition rendering function in the parameter setting area contained in the prop making interface, a target distance threshold is determined.
[0084] The partition rendering function is a function pre-set for partition rendering of the object model. The target distance threshold is a distance value for partitioning the object model, which can be one distance value or multiple distance values.
[0085] Specifically, through the description of the above embodiments, the electronic device can establish the binding relationship between the plurality of target object points in the object model and the head model, so as to solve the problem that the head special effect prop cannot be well adapted to the head model. On this basis, further considering that the target head object and the head model are not in contact all the time, that is, at least a part of the target head object does not need to move with the same amplitude as the head moves. Therefore, the disclosure further provides a partition rendering function in the embodiment to divide the object model corresponding to the target head object into different regions, each region has different degrees of association with the head model, so that different regions in the head special effect prop have different degrees of deformation in the movement process of the head model, and further make the head special effect prop more realistic in the movement process and have better augmented display effect.
[0086] In specific implementation, the electronic device pre-sets the partition rendering function in the parameter setting region in the prop making interface, for example, pre-sets a function control of the partition rendering function. The user only needs to trigger the function control of the partition rendering function by selection or clicking, etc. At this time, the electronic device can detect the triggering operation of the partition rendering function, and further determine the target distance threshold. For example, the electronic device determines the default distance threshold pre-set in the partition rendering function as the target distance threshold; for another example, the electronic device determines the distance value input by the user through the partition rendering function as the target distance threshold.
[0087] In some embodiments, step A can be implemented as: in response to the triggering operation of the partition rendering function, displaying a second parameter setting sub-region corresponding to the partition rendering function in the parameter setting region; in response to the parameter setting operation of the second target parameter displayed in the second parameter setting sub-region, determining the target distance threshold.
[0088] The second target parameter is a parameter for setting the distance threshold in the partition rendering function.
[0089] Specifically, referring to Figure 3After the user selects the "partition rendering" function, the electronic device can detect the triggering operation of the partition rendering function. Then, the electronic device displays a second parameter setting sub-area 332 corresponding to the partition rendering function in the parameter setting area 330. The second parameter setting sub-area 332 displays parameter setting options of a second target parameter, such as distance threshold setting options 333 corresponding to "first distance threshold" and "second distance threshold" respectively. The user can perform a numerical input parameter setting operation on the distance threshold setting options 333. The electronic device receives the input value and determines it as the target distance threshold. In this way, the user can set the partition result by himself, and subsequently obtain a head special effect prop that is more in line with the user's needs.
[0090] It should be noted that, referring to Figure 3 The electronic device can display the numerical reference range corresponding to each second target parameter in the peripheral area thereof to prompt the user's parameter setting operation accordingly.
[0091] Step B, based on the target distance threshold and the distance between the object points in the target object model and the target head model, the target object model is divided into at least two display ranges.
[0092] The target object model includes an initial object model or an adjusted object model, and the target head model includes an initial head model or an adjusted head model.
[0093] Specifically, different parts of the target object model are different distances from the target head model, and the degree of deformation of the head model is also different. Therefore, the electronic device can calculate the distance between the object points in the target object model and the target head model. For example, the distance between each object point and each head point in the target head model is calculated, and the minimum distance among the distances is determined as the distance between the object point and the target head model. Then, the electronic device classifies the distances using the target distance threshold, and classifies the object points. Then, the electronic device divides the target object model into different areas according to the categories of the object points in the target object model, that is, each area corresponds to a display range.
[0094] If the target distance threshold is only one distance threshold, the target object model can be divided into two display ranges according to the above process. If the target distance threshold is two distance thresholds, the target object model can be divided into three display ranges according to the above process, and so on.
[0095] Step C, based on the display ranges and the display styles corresponding to the display ranges, updating the target object model, and displaying the target head model and the updated target object model in the prop display area.
[0096] The number of display styles is at least two.
[0097] Specifically, the electronic device updates the target item model according to the divided display ranges and the display styles (such as display colors, display transparencies, display textures, etc.) corresponding to each display range. At this time, the model-related parameters (such as model size, position, orientation, and rotation angle, etc.) of the target item model are not changed, and only the display styles of different display ranges are updated. Then, the electronic device refreshes the display of the updated target item model in the prop display area, while displaying the target head model that is not updated. In order to enable the user to more intuitively determine the relationship between each part of the target item model and each part of the target head model, thereby assisting the user to better make the head special effect prop, the display styles corresponding to the above-mentioned display ranges can be different. For example, the display styles of the display ranges corresponding to the same category are the same, and the display styles of the display ranges corresponding to different categories can be different.
[0098] Referring to Figure 4 In the case where the target distance threshold is two distance thresholds, the target hat model 321 can be divided into three different display ranges according to the above process. The three display ranges are the main body display range 3211, the transition display range 3212, and the brim display range 3213. Among them, the distances between each item point in the main body display range 3211 and the target head model 322 are the smallest, which belong to the part that produces the largest deformation with the movement of the head model; the distances between each item point in the transition display range 3212 and the target head model 322 are the second smallest, which belong to the part that produces a smaller degree of deformation with the movement of the head model; the distances between each item point in the brim display range 3213 and the target head model 322 are the largest, which belong to the part that hardly produces deformation with the movement of the head model.
[0099] It should be noted that the execution order between S230 and steps A-C above can not be limited. That is, the adjustment of the two models and the adjustment of the partition display of the item model are not limited in the order, and they can also be adjusted in a cross manner until the user is satisfied with the adjustment result.
[0100] On the basis of the above-mentioned embodiment of the target item model divided into different display ranges, the mapping relationship established in S240 can include the distance values between the above-mentioned target item points and the corresponding head points, which can be implemented as the following steps D and E:
[0101] Step D, determining the target distance corresponding to each target item point based on the distance corresponding to the target item point.
[0102] The target distance is used to construct the distance value of the above-mentioned mapping relationship.
[0103] Specifically, according to the above description, the electronic device can calculate the distance between each item point in the target item model and the target head model, and the target item point is selected from each item point, so the distance between each target item point and the target head model can also be obtained. Then, the electronic device determines the distance as the target distance corresponding to the target item point. Alternatively, in order to facilitate calculation and denoising, the electronic device can process the distance corresponding to the target item point, and determine the processing result as the target distance corresponding to the target item point.
[0104] Step E, for each target item point, the information conversion relationship between the target item point and the head point corresponding to the target item point is established, and the information conversion relationship and the target distance corresponding to the target item point are determined as the mapping relationship corresponding to the target item point.
[0105] Among them, the information conversion relationship includes a position conversion relationship and an orientation conversion relationship.
[0106] Specifically, for each target item point, the electronic device can calculate the conversion relationship between the item point information of the target item point and the head point information of each head point corresponding thereto, to obtain the information conversion relationship. Then, the electronic device determines the information conversion relationship corresponding to each target item point together with the target distance as the mapping relationship corresponding to the corresponding target item point, to optimize the mapping relationship between the head model and the item model, and further optimize the subsequently generated head special effect props.
[0107] In some embodiments, the above-mentioned step D can be implemented as: based on the first distance threshold and the second distance threshold in the target distance threshold, the distance corresponding to the target item point is normalized to obtain the target distance corresponding to each target item point.
[0108] Specifically, according to the above description, each target item point has a mapping relationship with each head point corresponding thereto, and then multiple mapping relationships exist in the entire head special effect props, which may cause the deformation degree between adjacent points in the head special effect props to be different in the application process, and further cause the display abnormality of the head special effect props. Therefore, in the embodiments of the present disclosure, the item point information corresponding to the target item point is further added in the mapping relationship, so as to fuse the item point information and the result calculated by using the mapping relationship in the prop application process, to achieve the effect of smoothing the result obtained by each mapping relationship, and further ensure the display fidelity degree in the application process of the head special effect props. The way of fusing the item point information and the result calculated by using the mapping relationship can be weighted, and the weight can be determined according to the target distance corresponding to the target item point.
[0109] Based on the above description, in order to simplify the calculation process and make the target distance participate in the calculation as a weight, in the embodiment, two distance thresholds with different values in the target distance threshold, i.e., a first distance threshold and a second distance threshold, are used to normalize the distance corresponding to each target object point, and the obtained result is the target distance corresponding to the corresponding target object point.
[0110] For example, in the case where the first distance threshold is less than the second distance threshold, the electronic device can normalize the distance greater than the second distance threshold to a target distance with a value of 1, normalize the distance less than the first distance threshold to a target distance with a value of 0, and normalize the distance between the first distance threshold and the second distance threshold to a target distance with a value between 0 and 1.
[0111] Based on the embodiment of the above normalization process to obtain the target distance, the determination of the information conversion relationship and the target distance corresponding to the target object point as the mapping relationship corresponding to the target object point in step E includes: determining the information conversion relationship, the target distance corresponding to the target object point, and the object point information as the mapping relationship corresponding to the target object point; wherein the object point information includes the object point position and the object point orientation.
[0112] Specifically, the electronic device takes the information conversion relationship, the target distance, and the object point information corresponding to each target object point as the mapping relationship of the corresponding target object point.
[0113] First, the specific effect prop application method provided by the embodiments of the present disclosure will be described in combination with Figure 4 The specific effect prop application method provided by the embodiments of the present disclosure will be described in combination with
[0114] In the embodiments of the present disclosure, the specific effect prop application method is applicable to the use scenario of head-specific effect props, such as the scenario of applying head-specific effect props for image / video shooting or the scenario of applying head-specific effect props for image / video post-synthesis, etc. The specific effect prop application method can be executed by a specific effect prop application device, which can be implemented in a software and / or hardware manner, and the device can be integrated in an electronic device capable of using head-specific effect props. The electronic device can include but is not limited to, for example, a smart phone, a tablet computer, a notebook computer, a desktop computer, etc.
[0115] Figure 4 A flowchart of a specific effect prop application method provided by the embodiments of the present disclosure is shown. As shown in the figure, Figure 5 The specific effect prop application method can include the following steps:
[0116] S410, obtaining a face image, and determining head key points based on the face image.
[0117] Specifically, the electronic device obtains a face image by camera shooting, or reads a face image from a storage medium, or loads a face image from a network end. Then, the electronic device constructs a user head model according to the face image, and further extracts points from the user head model as head key points.
[0118] In some embodiments, determining the head key points based on the face image comprises: determining face key points, forehead key points and ear key points based on the face image; generating a user head model based on the face key points, the forehead key points and the ear key points, and determining at least two head key points based on the user head model.
[0119] Specifically, because the head special effect prop is applied, and the head special effect prop is related to multiple parts such as the face, forehead and ear of the user, in order to more accurately construct the user head model, the electronic device can recognize face key points, forehead key points and ear key points according to the face image. Then, the electronic device adjusts the initial head model according to the face key points, the forehead key points and the ear key points to obtain a user head model adapted to the face image. Subsequently, the electronic device extracts multiple points from the user head model as head key points according to the information of the head points selected when constructing the mapping relationship, such as the position and number of the head points in the head model.
[0120] S420, in response to the application trigger operation of the head special effect prop, determining an initial head special effect prop, and determining prop key points based on the head key points and the mapping relationship contained in the initial head special effect prop.
[0121] The mapping relationship is used to record the correspondence between the head points in the head model and the article points in the article model corresponding to the initial head special effect prop.
[0122] Specifically, the user can select a provided head special effect prop, and the electronic device can detect the application trigger operation of the head special effect prop, and then determine the triggered head special effect prop as the initial head special effect prop. The initial head special effect prop is a special effect prop product exported by the prop making application program, which may not be adapted to the user head model. Therefore, the electronic device can use the head key points obtained above and the mapping relationship contained in the initial head special effect prop to calculate the points in the head special effect prop corresponding to the head key points, i.e. the prop key points.
[0123] For example, when the mapping relationship is the information conversion relationship between the head model and the article model, the electronic device can substitute the position and orientation information of each head key point into the information conversion relationship, and the calculated result is the prop key point corresponding to the head key point.
[0124] It should be noted that if one target object point corresponds to multiple head points in the process of generating the head special effect prop, the electronic device also needs to substitute the same number of head points at the same position into the information conversion relationship to obtain one prop key point corresponding to these head points when calculating the prop key point based on the mapping relationship in this step.
[0125] In some embodiments, the mapping relationship can include an information conversion relationship between the head points and the object points and a target distance between the object points and the head points; wherein the information conversion relationship includes a position conversion relationship and an orientation conversion relationship.
[0126] Correspondingly, the determination of the at least two prop key points based on the head key points and the mapping relationship included in the initial head special effect prop in S420 includes: determining at least two initial prop points based on the head key points and the information conversion relationship; and correcting the prop point information of each initial prop point based on the target distance corresponding to the object point matched by the initial prop point to obtain the prop key point corresponding to the initial prop point.
[0127] Specifically, the position and orientation information of the head key points are substituted into the information conversion relationship, and the position and orientation of the prop point, i.e., the initial prop point, can be obtained through preliminary calculation. Then, the electronic device corrects the initial prop point according to the target distance corresponding to each initial prop point in the mapping relationship. For example, when the absolute value of the difference between the distance from the initial prop point to the user head model and the target distance is greater than a fourth distance threshold, the initial prop point can be adjusted until the distance corresponding thereto falls within the range of (target distance ± fourth distance threshold). The result obtained through the above correction process is the prop key point corresponding to the initial prop point. In this way, the prop key point can be smoothed to a certain extent, the accuracy of the prop key point can be improved, the problem of poor adaptability between the head special effect prop and the user head model can be avoided, and the degree of realism of the subsequent target head special effect prop can be improved.
[0128] On the basis of the above embodiments, the mapping relationship can also include the object point information of the object points.
[0129] Correspondingly, the correction of the prop point information of the initial prop point based on the target distance corresponding to the object point matched by the initial prop point to obtain the prop key point corresponding to the initial prop point includes: determining a first weight and a second weight corresponding to the prop point information and the object point information, respectively, based on the target distance; and performing weighted processing on the prop point information and the object point information based on the first weight and the second weight to obtain the prop key point.
[0130] Specifically, in order to further smooth the prop key points, and further improve the fitting degree between the head special effect prop and the user head model, the target distance can be used to weight the initial prop points and the object point information of the target object points in the adjusted object model corresponding to the initial prop points, so as to obtain more accurate prop key points.
[0131] According to the above description, the target distance is the result of normalization using the first distance threshold and the second distance threshold, and its value range is [0, 1], so it can be directly used as a weight. That is, the target distance is determined as the second weight corresponding to the object point information, and (1-target distance) is determined as the first weight corresponding to the initial prop point. Then, the electronic device weights the initial prop point using the first weight, weights the object point information using the second weight, and adds the two weighted results to obtain the prop key point corresponding to the initial prop point.
[0132] S430, adjusting the initial head special effect prop based on the prop key points, generating a target head special effect prop, and generating and displaying a head special effect image based on the target head special effect prop and the face image.
[0133] Specifically, because the prop key points are calculated according to the head key points and the mapping relationship, they are the prop points obtained by dynamically adapting the user head model. In this way, the electronic device can adjust the initial head special effect prop using these prop key points to obtain the target head special effect prop that dynamically adapts the user head model. For example, the initial head special effect prop corresponds to a mesh model, and the mesh model can be adjusted by using the interpolation calculation of the grid points of each prop key point to obtain the adjusted mesh model, and the target head special effect prop is obtained.
[0134] Then, the electronic device synthesizes the target head special effect prop and the face image to obtain a head special effect image, and then displays the head special effect image. Because the target head special effect prop is a head special effect prop obtained by multi-dimensional adaptation and adjustment of size, position, orientation, etc. of the user head model, the effect presented by the head special effect image is consistent with the effect of the user wearing the target head object, and has high fidelity.
[0135] The special effect prop application method provided by the above-mentioned embodiments of the present disclosure can obtain a real user's face image, and determine head key points based on the face image; in response to an application trigger operation of a head special effect prop, an initial head special effect prop is determined, and prop key points are determined based on the head key points and a mapping relationship contained in the initial head special effect prop; the initial head special effect prop is adjusted based on the prop key points, a target head special effect prop is generated, and a head special effect image is generated based on the target head special effect prop and the face image and displayed. The problem of special effect props such as model penetration not adapting to the user's head in the application process of the head special effect prop is solved, the head special effect prop is dynamically adapted to follow the user's head size and head action, the real enhancement degree and the interestingness of the head special effect prop in the application process are improved, and thus the user experience and the user stickiness are improved.
[0136] Figure 5 A structure schematic diagram of a special effect prop generation device provided by an embodiment of the present disclosure is shown. As shown in the figure, Figure 5 The special effect prop generation device 500 can include:
[0137] The prop making interface display module 510 is configured to display a prop making interface; the prop making interface includes a prop display area;
[0138] The model import module 520 is configured to, in response to a material import operation, import an initial head model and an initial prop model corresponding to a target head prop, and display the initial head model and the initial prop model in the prop display area;
[0139] The model adjustment module 530 is configured to, in response to an adjustment operation on the initial head model and the initial prop model, display an adjusted head model and an adjusted prop model in the prop display area;
[0140] The head special effect prop generation module 540 is configured to establish a mapping relationship between a target prop point in the adjusted prop model and at least one head point in the adjusted head model corresponding to the target prop point, and generate a head special effect prop corresponding to the target head prop based on the adjusted prop model and the mapping relationship.
[0141] The special effect prop generation device provided in the embodiments of the present disclosure can display a prop making interface containing a prop display area during the generation of the head special effect prop; in response to a material import operation, an initial head model and an initial object model corresponding to a target head object are imported, and the initial head model and the initial object model are displayed in the prop display area; in response to an adjustment operation on the initial head model and the initial object model, the adjusted head model and the adjusted object model are displayed in the prop display area; a mapping relationship between a target object point in the adjusted object model and at least one head point in the adjusted head model corresponding to the target object point is established, and a head special effect prop corresponding to the target head object is generated based on the adjusted object model and the mapping relationship. The point-to-point binding between the head model and the head special effect prop is realized, the problem that the head special effect prop is not adapted to the head model due to the binding of the head special effect prop as a whole, such as the mold penetration, is solved, the dynamic adaptability of the head special effect prop to the head model is improved, and thus the realism and the interestingness of the head special effect prop are improved.
[0142] In some embodiments, the number of target object points is at least two.
[0143] In some embodiments, the prop making interface further contains a parameter setting area;
[0144] Correspondingly, the model adjustment module 530 comprises:
[0145] The first parameter setting sub-area display sub-module is configured to display a first parameter setting sub-area corresponding to the target model in the parameter setting area; wherein the target model comprises the initial head model and / or the initial object model.
[0146] The model adjustment sub-module is configured to, in response to a parameter setting operation on a first target parameter displayed in the first parameter setting sub-area, determine a first target parameter value, and determine an adjusted target model based on the first target parameter value and display the adjusted target model.
[0147] Further, in the case where the target model comprises the initial head model and the initial object model, the first target parameter is a relative position, a relative proportion, and a relative orientation between the initial head model and the initial object model.
[0148] In some embodiments, the special effect prop generation device 500 further comprises a partition rendering module configured to:
[0149] The target distance threshold value determination sub-module is configured to, after the initial head model and the initial object model are displayed in the prop display area in response to the material import operation and the import of the object model corresponding to the target head object in response to the material import operation, determine a target distance threshold value in response to a trigger operation on a partition rendering function in the parameter setting area contained in the prop making interface.
[0150] The display range division sub-module is configured to divide the target item model into at least two display ranges based on a target distance threshold and a distance between an item point in the target item model and a target head model.
[0151] The partition rendering display sub-module is configured to update the target item model based on each display range and a display style corresponding to the display range, and display the target head model and the updated target item model in the prop display area, where the number of display styles is at least two.
[0152] In some embodiments, the head special effect prop generation module 540 is specifically configured to:
[0153] Determine a target distance corresponding to each target item point based on a distance corresponding to the target item point.
[0154] For each target item point, establish an information conversion relationship between the target item point and a head point corresponding to the target item point, and determine the information conversion relationship and the target distance corresponding to the target item point as a mapping relationship corresponding to the target item point, where the information conversion relationship includes a position conversion relationship and an orientation conversion relationship.
[0155] Further, the head special effect prop generation module 540 is specifically configured to:
[0156] Based on a first distance threshold and a second distance threshold in the target distance threshold, normalize the distance corresponding to the target item point to obtain a target distance corresponding to each target item point.
[0157] The information conversion relationship and the target distance corresponding to the target item point are determined as the mapping relationship corresponding to the target item point, including:
[0158] The information conversion relationship, the target distance corresponding to the target item point, and item point information are determined as the mapping relationship corresponding to the target item point, where the item point information includes an item point position and an item point orientation.
[0159] In some embodiments, the target distance threshold determination sub-module is specifically configured to:
[0160] In response to a trigger operation of the partition rendering function, display a second parameter setting sub-area corresponding to the partition rendering function in the parameter setting area.
[0161] In response to a parameter setting operation on a second target parameter displayed in the second parameter setting sub-area, determine the target distance threshold.
[0162] In some embodiments, the special effect prop generation apparatus 500 further comprises a special effect prop export module, configured to:
[0163] After generating the head special effect prop corresponding to the target head prop based on the adjusted prop model and the mapping relationship, the head special effect prop is exported to perform special effect configuration on the head in the original shooting data.
[0164] It should be noted that, Figure 6 The special effect prop generation apparatus 500 shown can perform each step in the special effect prop generation method provided by any embodiment of the present disclosure, and realize each process and effect in the special effect prop generation method provided by any embodiment of the present disclosure, which will not be described here.
[0165] Figure 6 A structure schematic diagram of a special effect prop application apparatus provided by an embodiment of the present disclosure is shown. As shown in Figure 6 The special effect prop application apparatus 600 can comprise:
[0166] A head key point determination module 610 is configured to acquire a face image, and determine head key points based on the face image;
[0167] A prop key point determination module 620 is configured to, in response to an application trigger operation of the head special effect prop, determine an initial head special effect prop, and determine prop key points based on the head key points and a mapping relationship contained in the initial head special effect prop; wherein the mapping relationship is used to record a corresponding relationship between head points in the head model and prop points in the prop model corresponding to the initial head special effect prop;
[0168] A head special effect image generation module 630 is configured to adjust the initial head special effect prop based on the prop key points, generate a target head special effect prop, and generate and display a head special effect image based on the target head special effect prop and the face image.
[0169] The special effect prop application apparatus provided by the above embodiment of the present disclosure can acquire a face image of a real user, and determine head key points based on the face image; in response to an application trigger operation of the head special effect prop, determine an initial head special effect prop, and determine prop key points based on the head key points and a mapping relationship contained in the initial head special effect prop; adjust the initial head special effect prop based on the prop key points, generate a target head special effect prop, and generate and display a head special effect image based on the target head special effect prop and the face image. The problem of special effect prop misfitting the user's head, such as wearing a model, in the head special effect prop application process is solved, the head special effect prop dynamically adapts to the user's head size and head action, the real enhancement degree and the interest of the head special effect prop in the application process are improved, and thus the user experience and the user stickiness are improved.
[0170] In some embodiments, the mapping relationship includes an information conversion relationship between the head point and the item point, and a target distance between the item point and the head point; wherein the information conversion relationship includes a position conversion relationship and an orientation conversion relationship.
[0171] Correspondingly, the prop key point determination module 620 includes:
[0172] An initial prop point determination sub-module, configured to determine at least two initial prop points based on the head key points and the information conversion relationship;
[0173] A prop key point obtaining sub-module, configured to, for each initial prop point, correct prop point information of the initial prop point based on a target distance corresponding to an item point matched with the initial prop point, to obtain a prop key point corresponding to the initial prop point.
[0174] Further, the mapping relationship further includes item point information of the item point, and the item point information includes an item point position and an item point orientation;
[0175] Correspondingly, the prop key point obtaining sub-module is specifically configured to:
[0176] determine first and second weights corresponding to the prop point information and the item point information respectively based on the target distance;
[0177] perform weighted processing on the prop point information and the item point information based on the first and second weights, to obtain the prop key point.
[0178] In some embodiments, the head key point determination module 610 is specifically configured to:
[0179] determine a face key point, a forehead key point, and an ear key point based on the face image;
[0180] generate a user head model based on the face key point, the forehead key point, and the ear key point, and determine at least two head key points based on the user head model.
[0181] It should be noted that, Figure 7 The special effect prop application apparatus 600 shown can perform each step in the special effect prop application method provided by any embodiment of the present disclosure, and realize each process and effect in the special effect prop application method provided by any embodiment of the present disclosure, which will not be repeated here.
[0182] The embodiments of the present disclosure further provide an electronic device, which can include a processor and a memory. The memory can be used to store executable instructions. The processor can be used to read the executable instructions from the memory and execute the executable instructions to implement the special effect prop generation method or the special effect prop application method in any embodiment of the present disclosure.
[0183] Figure 7 A structural diagram of an electronic device is shown. It should be noted that Figure 7 The electronic device 700 shown is merely an example and should not bring any limitation to the functions and usage scope of the embodiments of the present disclosure.
[0184] As Figure 7 shown, the electronic device 700 can include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 701, which can perform various appropriate actions and processes according to programs stored in a read-only memory (ROM) 702 or programs loaded from a storage device 708 into a random access memory (RAM) 703. In the RAM 703, various programs and data required for the operation of the information processing device 700 are also stored. The processing device 701, the ROM 702, and the RAM 703 are connected to each other through a bus 704. An input / output interface (I / O interface) 705 is also connected to the bus 704.
[0185] Generally, the following devices can be connected to the I / O interface 705: an input device 706 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 707 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 708 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 709. The communication device 709 can allow the electronic device 700 to communicate with other devices wirelessly or by wire to exchange data. Although The electronic device 700 with various devices is shown, but it should be understood that it is not required to implement or have all the devices shown. More or fewer devices can be implemented or possessed instead.
[0186] The embodiments of the present disclosure also provide a computer readable storage medium, which stores a computer program. When the computer program is executed by a processor, the processor implements the special effect prop generation method or the special effect prop application method in any of the embodiments of the present disclosure.
[0187] In particular, according to the embodiments of the present disclosure, the processes described above with reference to the flowcharts can be implemented as a computer software program. For example, the embodiments of the present disclosure include a computer program product including a computer program carried on a non-transitory computer readable medium, which contains program codes for executing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network through the communication device 709, or installed from the storage device 708, or installed from the ROM 702. When the computer program is executed by the processing device 701, the above-mentioned functions defined in the special effect prop generation method or the special effect prop application method in any of the embodiments of the present disclosure are executed.
[0188] Note that the computer readable medium described above in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination thereof. The computer readable storage medium may, for example and without limitation, be an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus or device, or any suitable combination of the foregoing. More specific examples of the computer readable storage medium can include, but are not limited to, an electrical connection having one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, the computer readable storage medium can be any tangible medium that contains or stores a program used or produced by an instruction execution system, apparatus or device. In the present disclosure, the computer readable signal medium can include a data signal propagated in baseband or propagated as a carrier wave in a propagated data signal, in which the computer readable program code is embodied. Such propagated data signal can take a variety of forms, including but not limited to electro-magnetic, optical or any suitable combination thereof. The computer readable signal medium can also be any computer readable medium that is not a storage medium and that can communicate, transmit or transmit programs for use by or in connection with an instruction execution system, apparatus or device. The program code contained in the computer readable medium can be transmitted using any suitable medium, including but not limited to wire, cable, RF (radio frequency), or the like, or any suitable combination of the foregoing.
[0189] In some embodiments, the client, server, or both can communicate using any current known or future developed network protocol, such as HTTP, and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include local area networks ("LAN"), wide area networks ("WAN"), the Internet, and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any current known or future developed networks.
[0190] The computer readable medium described above can be included in the electronic device described above; or can exist separately from the electronic device and be not assembled in the electronic device.
[0191] The computer readable medium described above carries one or more programs, which, when executed by the electronic device, cause the electronic device to perform the steps of the special effect prop generation method or the special effect prop application method in any embodiment of the present disclosure.
[0192] Computer program code for carrying out operations of the present disclosure can be written in any one or more of a variety of programming languages or combinations of languages including an object oriented programming language such as Java, Smalltalk, C++ or the like and conventional procedural programming languages such as C or similar programming languages. The program code can execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection can be made to an external computer (for example, through the Internet using an Internet Service Provider).
[0193] The flow diagrams and the block diagrams in the drawings are illustrations of architectures, functionalities, and operations of possible implementations of devices, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flow diagrams or block diagrams can represent a module, a procedure, or a part of code, which comprises one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions noted in the blocks can occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently or in the reverse order, depending on the functionality involved. Also, each block in the block diagrams and / or flow diagrams, and combinations of blocks in the block diagrams and / or flow diagrams can be implemented by special-purpose hardware-based systems that perform the specified functions or operations, or combinations of hardware and computer program code.
[0194] The units described in the embodiments of the present disclosure can be implemented by software, or by hardware. In some cases, the name of the unit does not constitute a limitation on the unit itself.
[0195] The functions described in this specification can be implemented in part or in whole by one or more hardware logic components. For example, and without limitation, illustrative types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Program-specific Integrated Circuits (ASICs), Program-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0196] In the context of the present disclosure, a machine-readable medium can be a tangible medium that can contain or store a program for use by or in conjunction with an instruction execution system, device or equipment. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium can include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0197] The above description is merely a preferred embodiment of the present disclosure and an illustration of the technical principles employed. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by the specific combination of the above-mentioned technical features, but also includes other technical solutions formed by any combination of the above-mentioned technical features or their equivalents without departing from the above-mentioned disclosed concepts. For example, a technical solution formed by replacing the above-mentioned features with (but not limited to) technical features with similar functions disclosed in this disclosure.
[0198] In addition, although the operations are described in a specific order, this should not be understood as requiring that these operations be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of this disclosure. Certain features described in the context of separate embodiments can also be implemented in a single embodiment in combination. Conversely, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination. Although the subject matter has been described in language specific to structural features and / or method logical actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims.
Claims
1. A special effect prop generation method characterized by, The method comprises: displaying a prop making interface; the prop making interface comprises a prop display area; in response to a material import operation, importing an initial head model and an initial object model corresponding to a target head object, and displaying the initial head model and the initial object model in the prop display area; the initial object model is divided into different areas, and each area has a different degree of association with the initial head model; in response to an adjustment operation on the initial head model and the initial object model, displaying an adjusted head model and an adjusted object model in the prop display area; establishing a mapping relationship between a target object point in the adjusted object model and at least one head point in the adjusted head model corresponding to the target object point, and generating a head special effect prop corresponding to the target head object based on the adjusted object model and the mapping relationship.
2. The method of claim 1, wherein, The number of target object points is at least two.
3. The method of claim 1, wherein, The prop making interface further comprises a parameter setting area; the response to the adjustment operation on the initial head model and the initial object model, displaying the adjusted head model and the adjusted object model in the prop display area comprises: displaying a first parameter setting sub-area corresponding to a target model in the parameter setting area; wherein the target model comprises the initial head model and / or the initial object model; in response to a parameter setting operation on a first target parameter displayed in the first parameter setting sub-area, determining a first target parameter value, and determining an adjusted target model based on the first target parameter value and displaying it.
4. The method of claim 3, wherein, In the case where the target model comprises the initial head model and the initial object model, the first target parameter is the relative position, relative proportion and relative orientation between the initial head model and the initial object model.
5. The method according to any one of claims 1 to 3, characterized in that, After the response to the material import operation, importing the head model and the object model corresponding to the target head object, and displaying the initial head model and the initial object model in the prop display area, the method further comprises: in response to a trigger operation on a partition rendering function in the parameter setting area included in the prop making interface, determining a target distance threshold; based on the target distance threshold and the distance between the object points in the target object model and the target head model, dividing the target object model into at least two display ranges; wherein the target object model comprises the initial object model or the adjusted object model, and the target head model comprises the initial head model or the adjusted head model; based on each display range and the display style corresponding to the display range, updating the target object model, and displaying the target head model and the updated target object model in the prop display area; wherein the number of display styles is at least two.
6. The method of claim 5, wherein, the establishment of the mapping relationship between the target object point in the adjusted object model and at least one head point in the adjusted head model corresponding to the target object point comprises: determine a target distance corresponding to each of the target object points based on the distance corresponding to the target object point; establish an information conversion relationship between the target object point and the head point corresponding to the target object point for each of the target object points, and determine the information conversion relationship and the target distance corresponding to the target object point as the mapping relationship corresponding to the target object point; the information conversion relationship includes a position conversion relationship and an orientation conversion relationship.
7. The method of claim 6, wherein, The determination of the target distance corresponding to each of the target object points based on the distance corresponding to the target object point includes: normalizing the distance corresponding to the target object point based on a first distance threshold and a second distance threshold in the target distance threshold to obtain the target distance corresponding to each of the target object points; The determination of the mapping relationship corresponding to the target object point based on the information conversion relationship and the target distance corresponding to the target object point includes: determining the information conversion relationship, the target distance corresponding to the target object point, and object point information as the mapping relationship corresponding to the target object point; the object point information includes an object point position and an object point orientation.
8. The method of claim 5, wherein, The determination of the target distance threshold in response to the triggering operation of the partition rendering function in the parameter setting region included in the prop making interface includes: In response to the triggering operation of the partition rendering function, display a second parameter setting sub-region corresponding to the partition rendering function in the parameter setting region; In response to the parameter setting operation of the second target parameter displayed in the second parameter setting sub-region, determine the target distance threshold.
9. The method of claim 1, wherein, After generating the head special effect prop corresponding to the target head object based on the adjusted object model and the mapping relationship, the method further includes: exporting the head special effect prop to configure the head with special effects in the original shooting data.
10. A method for applying a special effect prop, comprising: It includes: acquire a face image, and determine a head key point based on the face image; In response to the application triggering operation of the head special effect prop, determine an initial head special effect prop, and determine a prop key point based on the head key point and the mapping relationship included in the initial head special effect prop; the mapping relationship is used to record the correspondence between the head point in the head model and the object point in the object model corresponding to the initial head special effect prop, and the object model is divided into different regions, and the association degree between each region and the head model is different; adjust the initial head special effect prop based on the prop key point to generate a target head special effect prop, and generate a head special effect image based on the target head special effect prop and the face image and display the head special effect image.
11. The method of claim 10, wherein, The mapping relationship includes an information conversion relationship between the head point and the object point and a target distance between the object point and the head point; the information conversion relationship includes a position conversion relationship and an orientation conversion relationship; The determination of the prop key point based on the head key point and the mapping relationship included in the initial head special effect prop includes: Determine at least two initial prop points based on the head key points and the information conversion relationship; For each initial prop point, correct the prop point information of the initial prop point based on the target distance corresponding to the article point matched by the initial prop point, to obtain the prop key point corresponding to the initial prop point.
12. The method of claim 11, wherein, The mapping relationship further includes article point information of the article point, and the article point information includes article point position and article point orientation; The correction of the prop point information of the initial prop point based on the target distance corresponding to the article point matched by the initial prop point to obtain the prop key point corresponding to the initial prop point includes: Based on the target distance, determine first and second weights corresponding to the prop point information and the article point information, respectively; Based on the first and second weights, perform weighted processing on the prop point information and the article point information to obtain the prop key point.
13. The method of claim 10, wherein, The determination of the head key points based on the face image includes: Based on the face image, determine face key points, forehead key points, and ear key points; Based on the face key points, the forehead key points, and the ear key points, generate a user head model, and determine at least two head key points based on the user head model.
14. A special effect prop generating apparatus, characterized by comprising: It includes: A prop making interface display module for displaying a prop making interface; the prop making interface includes a prop display area; A model import module for importing an initial article model corresponding to a target head article in response to a material import operation, and displaying the initial head model and the initial article model in the prop display area; the initial article model is divided into different regions, and each region has different degrees of association with the initial head model; A model adjustment module for displaying an adjusted head model and an adjusted article model in the prop display area in response to an adjustment operation on the initial head model and the initial article model; A head special effect prop generation module for establishing a mapping relationship between a target article point in the adjusted article model and at least one head point in the adjusted head model corresponding to the target article point, and generating a head special effect prop corresponding to the target head article based on the adjusted article model and the mapping relationship.
15. A special effects prop application apparatus, comprising: It includes: A head key point determination module for obtaining a face image and determining head key points based on the face image; A prop key point determination module for determining an initial head special effect prop in response to an application trigger operation of a head special effect prop, and determining a prop key point based on the head key points and a mapping relationship included in the initial head special effect prop; wherein the mapping relationship is used to record the correspondence between a head point in a head model and an article point in an article model corresponding to the initial head special effect prop, and the article model is divided into different regions, and each region has different degrees of association with the head model; The head special effect image generation module is configured to adjust the initial head special effect prop based on the prop key points, generate a target head special effect prop, generate a head special effect image based on the target head special effect prop and the face image, and display the head special effect image.
16. An electronic device, comprising: The method comprises the following steps: a processor; a memory for storing executable instructions; wherein the processor is configured to read the executable instructions from the memory and execute the executable instructions to implement the special effect prop generation method of any one of claims 1-9, or implement the special effect prop application method of any one of claims 10-13.
17. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, and when the computer program is executed by the processor, the processor implements the special effect prop generation method of any one of claims 1-9, or implements the special effect prop application method of any one of claims 10-13.
Citation Information
Patent Citations
Methods and systems for constructing an animated 3D facial model from a 2d facial image
US20200020173A1