Image stylization processing method and apparatus, device, storage medium and program product
By obtaining the original image and conditional constraint information input by the user, generating target condition features and generating target images, the problem that stylized models in the prior art can only generate one style and are uncontrollable, and the quality of style images and users are improved Experience.
Patent Information
- Application Number
- PCT/CN2024/094930
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-05-24
- Filing Date
- 2024-05-23
- Publication Date
- 2024-11-28
AI Technical Summary
The existing image stylized model can only generate images of one style, and the user cannot control the generated style images, resulting in low quality of style images, which cannot meet user needs and affects user experience.
By obtaining the original image and conditional constraint information input by the user, the target condition features are generated, and the target image is generated using the stylized model to achieve constraint control of the stylized image content and improve image quality.
Improve the quality of style images, meet users' personalized needs, and improve user experience.
Smart Images

Figure CN2024094930_28112024_PF_FP_ABST
Abstract
Description
Image stylization processing method, device, equipment, storage medium and program product
[0001] CROSS-REFERENCE TO RELATED APPLICATIONS
[0002] This application claims priority to the Chinese patent application filed with the State Intellectual Property Office of China on May 24, 2023, with application number 202310596812.6 and invention name “Image stylization processing method, device, equipment, storage medium and program product”, the entire contents of which are incorporated by reference into this application. Technical Field
[0003] The present disclosure relates to the field of image processing technology, and in particular to an image stylization processing method, apparatus, device, storage medium, and program product. Background Art
[0004] With the continuous development of image processing technology, image style transfer has become a new and interesting way to play in the field of image applications. Specifically, image style refers to the conversion of an image from one style to another.
[0005] In related technologies, users can use stylization models to convert an input image into an image of a target style. However, a stylization model can often only generate images of a single style, and users cannot control the style images generated by the stylization model. This results in low-quality style images that fail to meet user needs and lead to a poor user experience.
[0006] Summary of the Invention
[0007] In order to solve the above technical problems, the embodiments of the present disclosure provide an image stylization processing method, apparatus, device, storage medium and program product to improve the quality of style images, meet user needs and enhance user experience.
[0008] In a first aspect, an embodiment of the present disclosure provides an image stylization processing method, comprising:
[0009] Get the original image input by the user;
[0010] Display at least one condition constraint information;
[0011] In response to an operation on the at least one condition constraint information, generating a target condition feature based on the condition constraint information corresponding to the operation;
[0012] Generate a target image based on the target condition features
[0013] In a second aspect, an embodiment of the present disclosure provides an image stylization processing apparatus, comprising:
[0014] The original image acquisition module is used to obtain the original image input by the user;
[0015] A condition constraint information display module, configured to display at least one condition constraint information;
[0016] a target condition feature generating module, configured to generate a target condition feature based on the condition constraint information corresponding to the operation in response to the operation on the at least one condition constraint information;
[0017] The target image generation module is used to generate a target image based on the target condition characteristics.
[0018] In a third aspect, an embodiment of the present disclosure provides an electronic device, the electronic device comprising:
[0019] one or more processors;
[0020] a storage device for storing one or more programs;
[0021] When the one or more programs are executed by the one or more processors, the one or more processors implement the image stylization processing method as described in any one of the first aspects above.
[0022] In a fourth aspect, an embodiment of the present disclosure provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the image stylization processing method as described in any one of the above-mentioned first aspects.
[0023] In a fifth aspect, an embodiment of the present disclosure provides a computer program product, which includes a computer program or instructions, and when the computer program or instructions are executed by a processor, implements the image stylization processing method as described in any one of the first aspects above. BRIEF DESCRIPTION OF THE DRAWINGS
[0024] The above and other features, advantages, and aspects of the various embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and that the originals and elements are not necessarily drawn to scale.
[0025] FIG1 is a schematic diagram of a flow chart of an image stylization processing method according to an embodiment of the present disclosure;
[0026] FIG2 is a block diagram of an image stylization process according to an embodiment of the present disclosure;
[0027] FIG3a is a schematic diagram of an original image in an embodiment of the present disclosure;
[0028] FIG3 b is a schematic diagram of a conditional constraint image in an embodiment of the present disclosure;
[0029] FIG3 c is a schematic diagram of another conditional constraint image in an embodiment of the present disclosure;
[0030] FIG3 d is a schematic diagram of a target image corresponding to constraint condition 1 in an embodiment of the present disclosure;
[0031] FIG3e is a schematic diagram of a target image corresponding to constraint condition 2 in an embodiment of the present disclosure;
[0032] FIG3 f is a schematic diagram of a target image corresponding to the case where the weight of constraint condition 1 is 0.5 and the weight of constraint condition 2 is 0.5 in an embodiment of the present disclosure;
[0033] FIG4 is a schematic structural diagram of an image stylization processing device according to an embodiment of the present disclosure;
[0034] FIG5 is a schematic structural diagram of an electronic device according to an embodiment of the present disclosure. DETAILED DESCRIPTION
[0035] The following describes embodiments of the present disclosure in more detail with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as limited to the embodiments described herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of protection of the present disclosure.
[0036] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0037] As used herein, the term "including" and its variations are open-ended, i.e., "including but not limited to." The term "based on" means "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," and the term "some embodiments" means "at least some embodiments." Other terms are defined in the following description.
[0038] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0039] It should be noted that the modifications of "one" and "multiple" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, they should be understood as "one or more".
[0040] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0041] Before further describing the embodiments of the present disclosure in detail, the nouns and terms involved in the embodiments of the present disclosure are explained. The nouns and terms involved in the embodiments of the present disclosure are subject to the following interpretations.
[0042] In response, it is used to indicate the conditions or states on which the executed operations depend. When the dependent conditions or states are met, one or more operations executed can be in real time or with a set delay. Unless otherwise specified, there is no restriction on the order of execution of the multiple operations executed.
[0043] It is understandable that before using the technical solutions disclosed in the various embodiments of this disclosure, the type, scope of use, usage scenarios, etc. of the personal information involved in this disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0044] For example, in response to a user's active request, a prompt message is sent to the user to clearly inform the user that the operation requested will require the acquisition and use of the user's personal information. This allows the user to independently choose whether to provide personal information to the electronic device, application, server, storage medium, or other software or hardware that performs the operations of the disclosed technical solution based on the prompt message.
[0045] As an optional but non-limiting implementation method, in response to receiving the user's active request, the method of sending a prompt message to the user can be, for example, a pop-up window, and the prompt message can be presented in the form of text in the pop-up window. In addition, the pop-up window can also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device. It is understandable that the above notification and the process of obtaining user authorization are only illustrative and do not constitute a limitation on the implementation method of the present disclosure. Other methods that meet relevant laws and regulations can also be applied to the implementation method of the present disclosure.
[0046] It is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) must comply with the requirements of relevant laws, regulations and relevant provisions.
[0047] With the continuous development of image processing technology, image style transfer has become a new and interesting way to play in the field of image applications. Specifically, image style refers to the conversion of an image from one style to another.
[0048] In related technologies, users can use stylization models to convert user-input images into images with a target style. Specifically, a client receives the user-input image and feeds it into the stylization model. The stylization model then performs style transfer processing on the input image and outputs the target style image.
[0049] However, a stylized model can often only generate images of one style. For example, if a stylized model is trained to generate images in a classical style, then the model can only generate images in that style. If a stylized model is trained to generate images in anime style, then the model can only generate images in anime style. If a stylized model is trained to generate images in a lineart style, then the model can only generate images in that style.
[0050] Furthermore, once a stylization model is successfully trained and put into use, its processing of the input image is controlled solely by its internal network structure, and the generated style image cannot be manually controlled externally. In other words, the user has no control over the style image generated by the stylization model. This results in low-quality style images that fail to meet user needs and lead to a poor user experience.
[0051] To solve at least one of the above-mentioned technical problems, an embodiment of the present disclosure provides an image stylization processing method, which includes: obtaining an original image input by a user; displaying at least one conditional constraint information; in response to an operation on the at least one conditional constraint information, generating a target condition feature based on the conditional constraint information corresponding to the operation; and generating a target image based on the target condition feature.
[0052] In the implementation of the present disclosure, by adding conditional constraint information during the stylization process of the original image, the conditional constraint information can be used to constrain and control the content in the style image, thereby improving the quality of the style image, meeting user needs, and improving the user experience.
[0053] The image stylization processing method provided in the embodiments of the present disclosure is described in detail below with reference to the embodiments and drawings.
[0054] FIG1 is a flowchart of an image stylization processing method in an embodiment of the present disclosure. This embodiment is applicable to situations where stylization processing is performed on an image. The method can be executed by an image stylization processing device, which can be implemented in software and / or hardware.
[0055] As shown in FIG1 , the image stylization processing method provided by the embodiment of the present disclosure mainly includes steps S101 - S104 .
[0056] S101: Obtain an original image input by a user.
[0057] In the embodiment of the present disclosure, the original image refers to the image input by the user whose style is desired to be changed. The original image can be a photo taken by the user, a picture downloaded from the Internet, or a video frame captured from a video.
[0058] In a specific implementation scenario, in a video production client, a user can select a style identifier. In response to a selection operation on the style identifier, a stylized model corresponding to the style identifier is obtained, and an image input control is displayed. In response to an operation on the image input control, the original image input by the user is obtained.
[0059] In a specific implementation scenario, in a video production client, an image input control is displayed, and in response to an operation on the image input control, an original image input by a user is obtained, and then a style identifier is selected.
[0060] S102: Display at least one condition constraint information.
[0061] In the disclosed embodiments, the conditional constraint information may refer to a conditional constraint image. Specifically, the conditional constraint image may be a character pose diagram represented by line segments, wherein the character refers to the image of a person in the image. The conditional constraint image may also be a character outline diagram composed of line drawings. The conditional constraint image may also be a key point image including key points of the character and formed by connecting the key points.
[0062] In one embodiment of the present disclosure, as shown in FIG3a , the conditional constraint image can be a character posture diagram represented by line segments. Alternatively, as shown in FIG3b , the conditional constraint image can be a character outline diagram composed of line drawings.
[0063] In one embodiment of the present disclosure, the conditional constraint information includes: conditional information obtained by performing feature extraction on a conditional image; wherein the conditional image includes the original image and / or a reference image corresponding to the original image, and the feature extraction method includes at least one of the following: edge extraction, key point detection, and posture detection.
[0064] In the disclosed embodiment, the constraint image can be obtained by extracting features from the original image or from a reference image. The reference image can be a user-input reference image or an image provided by the platform for user selection. The reference image can be understood as an image used as a reference by the stylized model, so that the target image output by the stylized model has the style of the reference image.
[0065] In the embodiment of the present disclosure, when the reference image is input by the user, the method for obtaining the reference image is the same as the method for obtaining the original image. Detailed descriptions can be made in the above embodiment, which will not be repeated in the embodiment of the present disclosure.
[0066] In one embodiment of the present disclosure, edge extraction refers to the process of extracting the edges of objects in a digital image. The basic principle of edge detection is to use an edge enhancement operator to highlight local edges in the image, then define the "edge strength" of pixels and extract edge point sets by setting a threshold. Through edge extraction, a constraint image, including a contour map, can be obtained.
[0067] In one embodiment of the present disclosure, the basic principle of keypoint detection is to find significant feature points in an image that are not easily affected by image transformations. Keypoint detection is used to obtain a constraint image containing keypoints. This keypoint detection includes detecting keypoints on the human body, such as various joints.
[0068] In one embodiment of the present disclosure, posture detection refers to the process of identifying human postures and movements in a fixed scene using feature information such as video image sequences, human silhouettes, and multiple perspectives, and identifying human movements based on changes in the positions of human joints. Through posture detection, a constraint image containing human postures and movements can be obtained.
[0069] In one embodiment of the present disclosure, the condition constraint information may also be a constraint condition picture provided and displayed by the system.
[0070] In one embodiment of the present disclosure, the response to the operation on the at least one conditional constraint information and the generation of the target condition feature based on the conditional constraint information corresponding to the operation include: in response to the selection operation on the conditional constraint information, selecting at least one conditional constraint information from the multiple constraint information as the target conditional constraint information; for each target conditional constraint information, in response to the setting operation on the control information corresponding to the target conditional constraint information, obtaining the target control information corresponding to the target conditional constraint information; and generating the target condition feature based on at least one target conditional constraint information and the target control information corresponding to the target conditional constraint information.
[0071] In one embodiment of the present disclosure, at least one conditional constraint image is displayed on a terminal interface for selection by a user. In response to a selection operation on a conditional constraint image, the selected conditional constraint image is used as a target conditional constraint image. In one possible embodiment, the conditional constraint image shown in FIG3a and the conditional constraint image shown in FIG3b are used as target conditional constraint images.
[0072] In one possible implementation, the user can select multiple conditional constraint information at once, or can select multiple conditional constraint information in batches through multiple selection operations. The specific selection method is not limited in the embodiments of the present disclosure.
[0073] In one embodiment of the present disclosure, the target condition feature is generated based on at least one of the target condition constraint information and the target control information corresponding to the target condition constraint information, including: for each target condition constraint information, the target condition constraint information is input into the corresponding condition model for feature extraction to obtain an initial condition feature; based on the initial condition feature and the target control information, the target condition feature is generated.
[0074] In the disclosed embodiment, each target condition constraint image is input into the condition model for feature extraction to obtain initial condition features, where the initial condition features refer to representing the image in the form of a multidimensional feature vector. The disclosed embodiment does not specifically limit the method of feature extraction.
[0075] In one embodiment of the present disclosure, the target control information includes the target condition weight, and generating the target condition feature based on the initial condition feature and the target control information includes: performing weighted calculation based on at least one of the initial condition features and the target condition weight corresponding to the initial condition feature to obtain the target condition feature.
[0076] In one embodiment of the present disclosure, the control information corresponding to the target condition constraint information can be understood as controlling the weight of the target condition constraint information corresponding to the target condition constraint information among multiple target condition constraint information. It should be noted that the sum of the weights corresponding to the multiple target condition constraint information is equal to 1.
[0077] In the embodiment of the present disclosure, each target condition constraint information is a control information, and the user can set the control information by operating the terminal. The setting operation is mainly used to determine the proportion of the control information in multiple control information.
[0078] In one embodiment of the present disclosure, the setting operation may be to slide a weight ratio bar displayed on the terminal to set specific control information, and use the set control information as the target control information. The setting operation may also be to receive a ratio value input by the user and directly use the ratio value as the target control information.
[0079] In the embodiment of the present disclosure, feature extraction is performed on each target condition constraint image to obtain its corresponding initial condition feature, wherein the initial condition feature refers to representing the target condition constraint image in the form of a multi-dimensional vector.
[0080] In the embodiments of the present disclosure, any feature extraction method may be within the protection scope of the embodiments of the present disclosure, and the feature extraction method is no longer specifically limited in the embodiments of the present disclosure.
[0081] In one embodiment of the present disclosure, when the target control information is a target condition weight, the target condition weight is multiplied by its corresponding initial feature vector to obtain a condition feature corresponding to the target condition constraint image. The condition features corresponding to multiple target condition constraint images are added together to obtain the target condition feature.
[0082] In one possible implementation, the initial condition feature 1 and the initial condition feature 2 are denoted as c1 and c2 respectively, the target condition weight a1 corresponding to the initial condition feature 1, and the target condition weight a2 corresponding to the initial condition feature are weighted and calculated to obtain the condition c = a1*c1+(a2)*c2.
[0083] In one embodiment of the present disclosure, the target control information includes the target condition mask, and generating the target condition feature based on the initial condition feature and the target control information includes: applying the target condition mask to at least one of the initial condition features to generate the target condition feature.
[0084] In one embodiment of the present disclosure, when the target control information is a target condition mask, the target condition mask is multiplied by its corresponding initial feature vector to obtain a conditional feature corresponding to the target condition constraint image. The conditional features corresponding to multiple target condition constraint images are added together to obtain the target condition feature.
[0085] In one possible implementation, initial condition feature 1 and initial condition feature 2 are denoted as c1 and c2, respectively. Initial condition feature 1 corresponds to target condition mask m1, and initial condition feature corresponds to target condition mask m2. After weighted calculation, the condition c = m1*c1+(m2)*c2 is obtained. Here, m1 is a feature vector with the same dimension as c1, and m2 is a feature vector with the same dimension as c2. For locations with an eigenvalue of 1 in target condition mask m1, the corresponding eigenvalue is 0 in target condition mask m2. For locations with an eigenvalue of 0 in target condition mask m1, the corresponding eigenvalue is 1 in target condition mask m2.
[0086] In one embodiment of the present disclosure, the eigenvalue corresponding to the human body region in the target condition mask m1 is 1, and the eigenvalue corresponding to the position other than the human body region is 0. Correspondingly, the eigenvalue corresponding to the human body region in the target condition mask m2 is 0, and the eigenvalue corresponding to the position other than the human body region is 1.
[0087] In one embodiment of the present disclosure, when the feature value corresponding to the human body region position in the target condition mask m1 is 1, the stylized model is controlled to retain the features of the human body region in the original image in the output target image as much as possible.
[0088] In one embodiment of the present disclosure, in response to the setting operation of the control information for the target condition constraint information, the target control information corresponding to the target condition constraint information is obtained, including: displaying multiple candidate condition masks, and in response to the selection operation for the candidate condition mask, using the selected candidate condition mask as the target condition mask corresponding to the target condition constraint information; and / or, in response to detecting that the sliding operation forms a closed area, masking the closed area and using it as the target condition mask corresponding to the target condition constraint information.
[0089] In one possible embodiment, the candidate conditional masks may be multiple mask images pre-set in the system, or they may be grinding images obtained by processing the original image or the conditional image. The multiple candidate conditional masks are displayed on the terminal interface for user selection. Furthermore, in response to a selection operation on a candidate conditional mask, the selected candidate conditional mask is used as the target conditional mask.
[0090] In one embodiment of the present disclosure, a condition image is displayed in a terminal interface. In response to a user sliding operation on the condition image, and the sliding operation forms a closed area, the closed area is masked and used as a target condition mask.
[0091] S104: Generate a target image based on the target condition features.
[0092] In one embodiment of the present disclosure, generating a target image based on the target condition features includes: inputting the original image into a target stylization model; inputting the target condition features as constraints into the target stylization model; and generating a target image using the target stylization model.
[0093] Among them, the target image is determined based on the target condition feature and the original image, the target condition feature is used to constrain the target image information in the target image to have a correlation with the target image information in the original image, and the target image information refers to the image information indicated by the target condition feature.
[0094] In the disclosed embodiment, the target condition feature is used to constrain the target stylization model to retain the image information corresponding to the target condition feature as much as possible during the process of processing the original image, or to control the image information in the target image to tend to the target condition feature as much as possible.
[0095] The disclosed embodiments provide a method for stylizing an image, comprising: obtaining an original image input by a user; displaying at least one conditional constraint information; generating a target conditional feature based on the conditional constraint information corresponding to the operation in response to an operation on the at least one conditional constraint information; and generating a target image based on the target conditional feature. In the implementation of the disclosed embodiments, by incorporating conditional constraint information into the stylized processing of the original image, the conditional constraint information can be used to constrain and control the content of the stylized image, thereby improving the quality of the stylized image, meeting user needs, and enhancing the user experience.
[0096] Based on the above embodiments, a block diagram of image stylization processing is provided in the embodiments of the present disclosure. As shown in FIG2 , after the original image is subjected to noise processing, it is input into the stylization model. At the same time, after edge detection is performed on the original image or the reference image, conditional constraint information 1 is extracted. After posture detection is performed on the original image or the reference image, conditional constraint information 2 is extracted. After key point detection is performed on the original image or the reference image, conditional constraint information 3 is extracted. Conditional constraint information 1 is input into conditional model 1 to obtain initial conditional feature 1. Conditional constraint information 2 is input into conditional model 2 to obtain initial conditional feature 2. Conditional constraint information 3 is input into conditional model 3 to obtain initial conditional feature 3.
[0097] Furthermore, control information (condition weight or condition mask) corresponding to each condition constraint information can be set. The condition processing module performs weighted calculation based on initial condition feature 1, initial condition feature 2, initial condition feature 3, and their corresponding control information to obtain the target condition feature.
[0098] Furthermore, the stylization model performs stylization processing on the original image based on the target condition features to obtain the target image.
[0099] On the basis of the above-mentioned embodiments, a specific implementation effect is provided in the embodiments of the present disclosure. When the original image is as shown in Figure 3c, key point detection is performed on the original image to obtain conditional constraint information 1, as shown in Figure 3a. Edge detection is performed on the original image to obtain conditional constraint information 2, as shown in Figure 3b. When the conditional weight corresponding to conditional constraint information 1 is 1 and the conditional weight corresponding to conditional constraint information 2 is 0, the generated target image is shown in Figure 3d, and the target image includes the key point information in the original image. When the conditional weight corresponding to conditional constraint information 1 is 0 and the conditional weight corresponding to conditional constraint information 2 is 1, the generated target image is shown in Figure 3e, and the target image includes the contour information in the original image. When the conditional weight corresponding to conditional constraint information 1 is 0.5 and the conditional weight corresponding to conditional constraint information 2 is 0.5, the generated target image is shown in Figure 3e, and the key point features and contour information in the original image are mixed in the target image.
[0100] FIG4 is a flowchart of an image stylization processing apparatus in an embodiment of the present disclosure. This embodiment is applicable to situations where stylization processing is performed on an image. The image stylization processing apparatus may be implemented in software and / or hardware.
[0101] As shown in FIG4 , the image stylization processing device 40 provided by the embodiment of the present disclosure includes: an original image acquisition module 41 , a condition constraint information display module 42 , a target condition feature generation module 43 and a target image generation module 44 .
[0102] The original image acquisition module 41 is used to acquire the original image input by the user;
[0103] The condition constraint information display module 42 is used to display at least one condition constraint information;
[0104] a target condition feature generating module 43, configured to generate a target condition feature based on the condition constraint information corresponding to the operation in response to the operation on the at least one condition constraint information;
[0105] The target image generation module 44 is configured to generate a target image based on the target condition characteristics.
[0106] In one embodiment of the present disclosure, the target condition feature generation module 43 includes: a target condition constraint information selection unit, which is used to select at least one condition constraint information from the multiple constraint information as target condition constraint information in response to a selection operation on the condition constraint information; a target control information acquisition unit, which is used to obtain the target control information corresponding to the target condition constraint information for each target condition constraint information in response to a setting operation on the control information corresponding to the target condition constraint information; and a target condition feature generation unit, which is used to generate a target condition feature based on at least one target condition constraint information and the target control information corresponding to the target condition constraint information.
[0107] In one embodiment of the present disclosure, the target condition feature generation unit includes: an initial condition feature extraction subunit, which is used to input the target condition constraint information into the corresponding condition model for feature extraction for each target condition constraint information to obtain the initial condition feature; and a target condition feature generation subunit, which is used to generate the target condition feature based on the initial condition feature and the target control information.
[0108] In one embodiment of the present disclosure, the target control information includes the target condition weight, and the target condition feature generation subunit is specifically used to perform weighted calculation based on at least one of the initial condition features and the target condition weight corresponding to the initial condition feature to obtain the target condition feature.
[0109] In one embodiment of the present disclosure, the target control information includes the target condition mask, and the target condition feature generation subunit is specifically configured to apply the target condition mask to at least one of the initial condition features to generate a target condition feature.
[0110] In one embodiment of the present disclosure, the target control information acquisition unit includes: a candidate condition mask display subunit, which is used to display multiple candidate condition masks; a target condition mask determination unit, which is used to respond to a selection operation on the candidate condition mask and use the selected candidate condition mask as the target condition mask corresponding to the target condition constraint information; and / or, in response to detecting that a sliding operation forms a closed area, the closed area is masked and used as the target condition mask corresponding to the target condition constraint information.
[0111] In one embodiment of the present disclosure, the conditional constraint information includes: conditional information obtained by performing feature extraction on a conditional image; wherein the conditional image includes the original image and / or a reference image corresponding to the original image, and the feature extraction method includes at least one of the following: edge extraction, key point detection, and posture detection.
[0112] In one embodiment of the present disclosure, the target image generation module 44 is specifically configured to input the original image into a target stylization model; input the target condition features as constraints into the target stylization model; and generate a target image using the target stylization model.
[0113] The image stylization processing device provided in the embodiment of the present disclosure can execute the steps executed in the image stylization processing method provided in the method embodiment of the present disclosure. The execution steps and beneficial effects are not repeated here.
[0114] Figure 5 is a schematic diagram of the structure of an electronic device in an embodiment of the present disclosure. Specific reference is made below to Figure 5, which shows a schematic diagram of the structure of an electronic device 500 suitable for implementing an embodiment of the present disclosure. The electronic device 500 in the embodiment of the present disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), wearable terminal devices, and the like, as well as fixed terminals such as digital TVs, desktop computers, smart home devices, and the like. The electronic device shown in Figure 5 is merely an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.
[0115] As shown in Figure 5, the electronic device 500 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 501, which can perform various appropriate actions and processes to implement the image stylization processing method of the embodiment described in the present disclosure according to the program stored in the read-only memory (ROM) 502 or the program loaded from the storage device 508 into the random access memory (RAM) 503. In the RAM 503, various programs and data required for the operation of the terminal device 500 are also stored. The processing device 501, ROM 502, and RAM 503 are connected to each other via a bus 504. An input / output (I / O) interface 505 is also connected to the bus 504.
[0116] Typically, the following devices may be connected to the I / O interface 505: an input device 506 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 507 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 508 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 509. The communication device 509 may allow the terminal device 500 to communicate with other devices wirelessly or by wire to exchange data. Although FIG. 5 illustrates the terminal device 500 with various devices, it should be understood that not all of the illustrated devices are required to be implemented or present. More or fewer devices may alternatively be implemented or present.
[0117] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart, thereby implementing the image stylization processing method described above. In such an embodiment, the computer program can be downloaded and installed from the network through the communication device 509, or installed from the storage device 508, or installed from the ROM 502. When the computer program is executed by the processing device 501, the above-mentioned functions defined in the method of the embodiment of the present disclosure are performed.
[0118] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium, or any combination of the two. A computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or component, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, 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 above. In the present disclosure, a computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, device, or component. In the present disclosure, a computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, which carries computer-readable program code. Such a propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. A computer-readable signal medium may also be any computer-readable medium other than a computer-readable storage medium that can transmit, propagate, or transport a program for use by or in conjunction with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium may be transmitted using any suitable medium, including but not limited to wires, optical cables, RF (radio frequency), etc., or any suitable combination thereof.
[0119] In some embodiments, the client and server can communicate using any currently known or later developed network protocol, such as HTTP (HyperText Transfer Protocol), and can be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or later developed network.
[0120] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0121] The above-mentioned computer-readable medium carries one or more programs. When the above-mentioned one or more programs are executed by the terminal device, the terminal device: obtains the original image input by the user; displays at least one conditional constraint information; in response to an operation on the at least one conditional constraint information, generates a target condition feature based on the conditional constraint information corresponding to the operation; and generates a target image based on the target condition feature.
[0122] Optionally, when the above one or more programs are executed by the terminal device, the terminal device may also execute other steps described in the above embodiment.
[0123] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages, or a combination thereof, including, but not limited to, object-oriented programming languages such as Java, Smalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a stand-alone software package, partially on the user's computer and partially on a remote computer, or entirely on the remote computer or server. In cases involving a remote computer, the remote computer may 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 may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0124] The flowcharts and block diagrams in the accompanying drawings illustrate the possible implementation architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flowchart or block diagram can represent a module, program segment, or a part of code, and the module, program segment, or a part of code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order than that marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of the boxes in the block diagram and / or flowchart, can be implemented with a dedicated hardware-based system that performs the specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0125] The units involved in the embodiments described in this disclosure may be implemented in software or hardware, wherein the name of a unit does not necessarily limit the unit itself.
[0126] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.
[0127] 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 an instruction execution system, device or equipment or used in combination 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.
[0128] 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.
[0129] In addition, although each operation is described in a specific order, this should not be required to require these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details have been included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, 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 mode.
[0130] Although the subject matter has been described in language specific to structural features and / or methodological logical acts, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are merely example forms of implementing the claims.
Claims
1. A method for image stylization processing, comprising: Get the original image input by the user; Display at least one condition constraint information; In response to an operation on the at least one condition constraint information, generating a target condition feature based on the condition constraint information corresponding to the operation; Based on the target condition features, a target image is generated.
2. The method according to claim 1, wherein: The step of generating a target condition feature based on the condition constraint information corresponding to the operation in response to the operation on the at least one condition constraint information includes: In response to a selection operation on the conditional constraint information, selecting at least one conditional constraint information from the plurality of constraint information as target conditional constraint information; For each of the target condition constraint information, in response to a setting operation on the control information corresponding to the target condition constraint information, obtaining the target control information corresponding to the target condition constraint information; A target condition feature is generated based on at least one of the target condition constraint information and the target control information corresponding to the target condition constraint information.
3. The method according to claim 2, wherein: The generating a target condition feature based on at least one target condition constraint information and target control information corresponding to the target condition constraint information includes: For each target condition constraint information, input the target condition constraint information into a corresponding condition model for feature extraction to obtain initial condition features; Based on the initial condition feature and the target control information, a target condition feature is generated.
4. The method according to claim 3, wherein: The target control information includes the target condition weight, The generating a target condition feature based on the initial condition feature and the target control information includes: A target condition feature is obtained by performing a weighted calculation based on at least one of the initial condition features and a target condition weight corresponding to the initial condition feature.
5. The method according to claim 3, wherein: The target control information includes the target condition mask, The generating a target condition feature based on the initial condition feature and the target control information includes: The target condition mask is applied to at least one of the initial condition features to generate a target condition feature.
6. The method according to claim 5, wherein: The step of obtaining target control information corresponding to the target condition constraint information in response to the setting operation of the control information for the target condition constraint information includes: Displaying a plurality of candidate conditional masks, and in response to a selection operation on the candidate conditional masks, using the selected candidate conditional mask as the target conditional mask corresponding to the target condition constraint information; and / or, In response to detecting that the sliding operation forms a closed area, the closed area is masked and used as a target condition mask corresponding to the target condition constraint information.
7. The method according to claim 1, wherein: The condition constraint information includes: condition information obtained by extracting features from the condition image; Wherein, the conditional image includes the original image and / or a reference image corresponding to the original image, and the feature extraction method includes at least one of the following: edge extraction, key point detection, and posture detection.
8. The method according to claim 1, wherein: The step of generating a target image based on the target condition feature comprises: Inputting the original image into a target stylized model; Inputting the target condition features as constraint conditions into a target stylization model; A target image is generated using the target stylization model.
9. An image stylization processing device, comprising: The original image acquisition module is used to acquire the original image input by the user; A condition constraint information display module, used to display at least one condition constraint information; A target condition feature generating module, configured to generate a target condition feature based on the condition constraint information corresponding to the operation in response to the operation on the at least one condition constraint information; The target image generation module is used to generate a target image based on the target condition characteristics.
10. An electronic device, comprising: one or more processors; A storage device for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the image stylization processing method according to any one of claims 1 to 8.
11. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the image stylization processing method according to any one of claims 1 to 8 is implemented.
Citation Information
Patent Citations
Learning network-based image stylization
CN108205813A
Image fusion method and device
CN111311480A
Image obtaining method and device
CN113223102A
Image processing method and device, storage medium and electronic equipment
CN114332334A
Image processing method and device, electronic equipment and storage medium
CN114937192A
