Media data processing method and apparatus, device, medium, and program product
Patent Information
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2026-02-06
- Publication Date
- 2026-08-13
Smart Images

Figure CN2026077680_13082026_PF_FP_ABST
Abstract
Description
A media data processing method, apparatus, equipment, medium, and program product
[0001] Cross-reference to related applications
[0002] This application claims priority to Chinese Patent Application No. 202510138403.0, filed on February 7, 2025, entitled "A Media Data Processing Method, Apparatus, Device, Medium and Program Product", the entire contents of which are incorporated herein by reference. Technical Field
[0003] This disclosure relates to computer technology, and more particularly to a media data processing method, apparatus, device, medium, and program product. Background Technology
[0004] Image stylization applies a specific artistic style to images or videos, giving them a unique visual effect. Local stylization, on the other hand, embeds elements of the real world into a stylized image or video, creating a visual contrast that blends reality and virtuality, thus enhancing the visual appeal. Summary of the Invention
[0005] This disclosure provides a media data processing method, apparatus, device, medium, and program product that can optimize local stylization methods and improve image quality.
[0006] In a first aspect, embodiments of this disclosure provide a media data processing method, including:
[0007] The target interactive interface displays the media data to be stylized and a set of candidate stylized materials, wherein the set of candidate stylized materials includes the target stylized materials;
[0008] In response to the triggering operation of the target stylized material, the media data is stylized based on the target stylized material to obtain stylized data corresponding to the media data, and the stylized data is displayed in the target interactive interface, wherein at least a portion of the image region in the stylized data is a stylized region;
[0009] An editing control set is displayed in the target interactive interface. In response to the interactive operation of the editing control set, the image content of the stylized data is adjusted, and the adjustment result of the stylized data is displayed in the target interactive interface.
[0010] Secondly, embodiments of this disclosure also provide a media data processing apparatus, including:
[0011] The display module is used to display the media data to be stylized and the candidate stylization material set in the target interactive interface, wherein the candidate stylization material set includes the target stylization material;
[0012] A stylization module is used to respond to the triggering operation of the target stylization material, perform stylization processing on the media data based on the target stylization material, obtain stylization data corresponding to the media data, and display the stylization data in the target interactive interface, wherein at least a portion of the image area in the stylization data is a stylization area;
[0013] An editing module is used to display a set of editing controls in the target interactive interface, adjust the image content of the stylized data in response to the interactive operation of the set of editing controls, and display the adjustment result of the stylized data in the target interactive interface.
[0014] Thirdly, embodiments of this disclosure also provide an electronic device, the electronic device comprising:
[0015] One or more processors;
[0016] Storage device for storing one or more programs.
[0017] When the one or more programs are executed by the one or more processors, the one or more processors implement the media data processing method as described in any embodiment of this disclosure.
[0018] Fourthly, embodiments of this disclosure also provide a storage medium containing computer-executable instructions, which, when executed by a computer processor, are used to perform the media data processing method as described in any embodiment of this disclosure.
[0019] Fifthly, embodiments of this disclosure also provide a computer program product, including a computer program that, when executed by a processor, implements the media data processing method as described in any embodiment of this disclosure. Attached Figure Description
[0020] The above and other features, advantages, and aspects of the embodiments of this disclosure will become more apparent from the accompanying drawings and the following detailed description. Throughout the drawings, the same or similar reference numerals denote the same or similar elements. It should be understood that the drawings are schematic, and the originals and elements are not necessarily drawn to scale.
[0021] Figure 1 is a schematic flowchart of a media data processing method provided in an embodiment of this disclosure;
[0022] Figure 2 is a schematic diagram of a target interactive interface provided in an embodiment of this disclosure;
[0023] Figure 3 is a schematic diagram of another target interactive interface provided in an embodiment of this disclosure;
[0024] Figure 4 is a schematic flowchart of another media data processing method provided in an embodiment of this disclosure;
[0025] Figure 5 shows a stylized image with overlapping human figure outlines;
[0026] Figure 6 is a comparison diagram of the effects of the background stylized image provided in the embodiments of this disclosure;
[0027] Figure 7 is a schematic diagram of the background stylization process in a media data processing method provided in an embodiment of this disclosure;
[0028] Figure 8 is a schematic diagram of the object stylization process in a media data processing method provided in an embodiment of this disclosure;
[0029] Figure 9 is a schematic diagram of the structure of a media data processing device provided in an embodiment of this disclosure;
[0030] Figure 10 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0031] Embodiments of this disclosure will now be described in more detail with reference to the accompanying drawings. While some embodiments of this disclosure are shown in the drawings, it should be understood that this disclosure can be implemented in various forms and should not be construed as limited to the embodiments set forth herein. Rather, these embodiments are provided to provide a more thorough and complete understanding of this disclosure. It should be understood that the accompanying drawings and embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of protection of this disclosure.
[0032] It should be understood that the steps described in the method embodiments of this disclosure may be performed in different orders and / or in parallel. Furthermore, the method embodiments may include additional steps and / or omit the steps shown. The scope of this disclosure is not limited in this respect.
[0033] The term "comprising" and its variations as used herein are open-ended inclusions, meaning "including but not limited to". The term "based on" means "at least partially based 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". Definitions of other terms will be given in the description below.
[0034] It should be noted that the concepts of "first" and "second" mentioned in this disclosure are used only to distinguish different devices, modules or units, and are not used to limit the order of functions performed by these devices, modules or units or their interdependencies.
[0035] It should be noted that the terms "a" and "a plurality of" used in this disclosure are illustrative rather than restrictive, and those skilled in the art should understand that, unless otherwise expressly indicated in the context, they should be understood as "one or more".
[0036] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0037] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.
[0038] For example, upon receiving a user's active request, a prompt message is sent to the user to explicitly inform them that the requested operation 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 software or hardware, such as the electronic device, application, server, or storage medium performing the operations of this disclosed technical solution, based on the prompt message.
[0039] As an optional but non-limiting implementation, in response to a user's active request, sending a prompt message to the user can be done via a pop-up window, where the prompt message can be presented in text format. Furthermore, the pop-up window can also include a selection control allowing the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0040] It is understood that the above notification and user authorization process are merely illustrative and do not constitute a limitation on the implementation of this disclosure. Other methods that comply with relevant laws and regulations may also be applied to the implementation of this disclosure.
[0041] It is understood that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and related provisions.
[0042] Local stylization involves embedding elements of the real world into an image or video with a stylized visual effect, creating a visual contrast that blends reality and virtuality, thus enhancing the visual appeal. However, there is currently no truly effective and intelligent method for local stylization.
[0043] Figure 1 is a schematic flowchart of a media data processing method provided in an embodiment of this disclosure. This embodiment is applicable to image special effects processing, such as scenarios involving local stylization of images. The method can be executed by a media data processing device, which can be implemented in software and / or hardware, optionally through an electronic device, such as a mobile terminal, PC, or server.
[0044] As shown in Figure 1, the method includes:
[0045] S110. Display the media data to be stylized and the candidate stylization material set in the target interactive interface, wherein the candidate stylization material set includes the target stylization material.
[0046] The target interactive interface can be the editing interface of a media data editing tool. The media data to be stylized refers to images, photos, or videos that require localized stylization. For example, the media data to be stylized can be photos or videos taken using a terminal device. Alternatively, the data to be stylized can be images, photos, or videos stored on the terminal device. The candidate stylization material set includes multiple candidate stylization materials. For example, the candidate stylization materials include stylization templates of at least one style such as oil painting style, comic style, or clay style. The candidate stylization material set includes the target stylization material. The target stylization material refers to the selected candidate stylization material. The target stylization material can be selected through interactive operations on the candidate stylization material set.
[0047] For example, in response to a data import operation in the target interactive interface, the media data to be stylized is obtained, and the media data to be stylized and a set of candidate stylized materials are displayed in the target interactive interface.
[0048] Optionally, the target interactive interface includes a preview area and a media source area. The preview area displays the media data to be stylized. The media source area displays candidate stylized media from the candidate stylization media set.
[0049] In this embodiment of the disclosure, a target interactive interface is displayed in response to a click operation on the local stylization option. A data import control is displayed in the target interactive interface. In response to a click operation on the data import control, shooting options and import options are displayed. In response to a click operation on the shooting option, a photo or video is captured using the camera of the terminal device, serving as media data to be stylized, and the captured photo or video is displayed in the target interactive interface.
[0050] In other embodiments, in response to a click on the import option, a media data selection interface is displayed. The media data selection interface displays at least one of candidate photos, candidate images, and candidate videos. In response to an import operation on a candidate photo, candidate image, or candidate video, a target photo, target image, or target video is obtained. The target photo, target image, or target video is then displayed in the target interaction interface.
[0051] S120. In response to the triggering operation of the target stylized material, the media data is stylized based on the target stylized material to obtain stylized data corresponding to the media data, and the stylized data is displayed in the target interactive interface.
[0052] In this context, at least a portion of the image regions in the stylized data are stylized regions. For example, the image regions of the stylized data may include both stylized regions and real image regions, or all image regions of the stylized data may be stylized regions.
[0053] For example, stylized data includes stylized images, stylized photographs, or stylized videos. Among them, stylized videos represent a sequence of stylized video frames.
[0054] Optionally, the stylized data includes first stylized data and second stylized data, wherein the first stylized data represents the overall stylized result of the media data, and the second stylized data represents the local stylized result of the media data. The image regions of the first stylized data are all stylized regions. The image regions of the second stylized data include both stylized regions and real image regions.
[0055] For example, in response to a triggering operation of a target stylized material, the media data is stylized overall based on the target stylized material to obtain the first stylized data. A target stylized region in the media data is obtained, wherein the target stylized region includes at least a portion of the image region in the media data. The target object in the media data and the first stylized data is edited according to the target stylized region to obtain local media data and stylized local data, wherein the local media data and the stylized local data respectively represent the background and the target object. The second stylized data is generated based on the local media data and the stylized local data. The second stylized data is displayed in the target interactive interface.
[0056] For example, if local media data represents the background, then stylized local data represents the target object.
[0057] S130. Display an editing control set in the target interactive interface, adjust the image content of the stylized data in response to the interactive operation of the editing control set, and display the adjustment result of the stylized data in the target interactive interface.
[0058] The editing control set is a collection of preset controls. For example, the editing control set includes a first control, a second control, and a third control. The first control is used to trigger the smear operation detection event. The second control is used to trigger the candidate edit item display event. The third control is used to trigger the region conversion event of the image area to be edited.
[0059] For example, adjusting the image content of the stylized data in response to an interactive operation of the editing control set includes: in response to a trigger operation of a first control in the editing control set, obtaining a smearing operation in the target interactive interface; adjusting the image content of the image region to be edited in the stylized data corresponding to the smearing operation to obtain an adjustment result of the stylized data, wherein the image region to be edited includes a smeared region or an unsmeared region corresponding to the smearing operation.
[0060] Figure 2 is a schematic diagram of a target interactive interface provided in an embodiment of this disclosure. As shown in Figure 2, the target interactive interface 200 displays second stylized data 210 of media data and an editing control set 220. In response to the triggering operation of the first control 230 in the editing control set 220, a smearing operation in the target interactive interface 200 is obtained. The smearing area 240 associated with the second stylized data 210 is determined according to the smearing trajectory corresponding to the smearing operation. The image content corresponding to the smearing area 240 is adjusted to obtain the adjustment result of the second stylized data 210. The adjustment result 250 of the second stylized data 210 is displayed in the target interactive interface 200. In Figure 2, the background area of the second stylized data 210 is the real image content, while the background area of the adjustment result 250 includes both the real image content and the stylized image content, and the smearing area in the background area presents a stylized effect.
[0061] In this embodiment of the disclosure, after a smear operation detection event is triggered, interactive operations in the target interactive interface are detected. If the interactive operation is a smear operation, the image region corresponding to the smear operation in the stylized data is determined as the smeared region. The remaining image region outside the smeared region in the stylized data is taken as the unsmeared region.
[0062] In some embodiments, in response to a triggering operation of a first control, a smearing operation in the target interactive interface is acquired. The smearing area is determined based on the smearing operation. The image content of the stylized data within the smeared area is adjusted to obtain the adjusted stylized data.
[0063] In other embodiments, in response to a triggering operation of the first control, a smearing operation in the target interactive interface is acquired. The smearing area is determined based on the smearing operation. An unsmeared area is determined based on the image area of the stylized data and the smeared area. The image content of the unsmeared area in the stylized data is adjusted to obtain the adjusted result of the stylized data.
[0064] Optionally, adjusting the image content of the stylized data in response to the interactive operation of the editing control set includes: in response to the triggering operation of the second control in the editing control set, displaying a set of candidate editable items in the target interactive interface, wherein the candidate editable items in the set of candidate editable items are used to represent a first image region in the stylized data. In response to the triggering operation of the set of candidate editable items, determining a target editable item, adjusting the image content of the image region to be edited in the stylized data corresponding to the target editable item, and obtaining an adjustment result for the stylized data, wherein the image region to be edited includes either the first image region or the second image region, and the first image region and the second image region constitute the image region of the stylized data.
[0065] Figure 3 is a schematic diagram of another target interactive interface provided in an embodiment of this disclosure. As shown in Figure 3, the target interactive interface 300 displays second stylized data 310 of media data and an editing control set 320. In response to the triggering operation of the second control 330 in the editing control set 320, a candidate editing item set 340 is displayed in the target interactive interface 300. In response to the selection operation of the candidate editing item in the candidate editing item set 340, a target editing item 350 is determined. The image content in the first image area corresponding to the target editing item 350 in the second stylized data 310 is adjusted to obtain the adjustment result of the second stylized data 310. The adjustment result 360 of the second stylized data 310 is displayed in the target interactive interface 300. In Figure 3, the sky area in the second stylized data 310 presents a stylized effect, while the sky area in the adjustment result 360 presents a realistic sky effect.
[0066] In this embodiment of the disclosure, the first image region represents a preset region in the stylized data. Optionally, the first image region includes at least one image region in the target object and / or at least one image region in the background. For example, the first image region includes at least one region selected from the target object body, target object clothing, target object skin, sky, mountain peaks, etc. The remaining image regions in the image region of the stylized data other than the first image region are used as the second image region.
[0067] In some embodiments, in response to a triggering operation of a second control, a set of candidate editable items is displayed in the target interactive interface. The set of candidate editable items includes at least one candidate editable item. The candidate editable item is used to represent a first image region in the stylized data. In response to a selection operation for a candidate editable item, the selected candidate editable item is used as the target editable item. The image content in the stylized data corresponding to the first image region represented by the target editable item is adjusted to obtain the adjusted stylized data.
[0068] In other embodiments, after determining the target editable item, a second image region is determined based on the stylization data and a first image region represented by the target editable item. The image content in the second image region of the stylization data is adjusted to obtain the adjusted stylization data.
[0069] Optionally, adjusting the image content of the image region to be edited includes: converting the stylized image content in the image region to be edited from the stylized data into original image content. And / or, converting the original image content in the image region to be edited from the stylized data into stylized image content. Wherein, the original image content represents the image content corresponding to the media data to be stylized and the image region to be edited.
[0070] Optionally, in response to a triggering operation of a third control in the editing control set, a region conversion process is performed on the image region to be edited. If the currently smeared area is used as the image region to be edited, in response to a triggering operation of the third control, the image region to be edited is converted into an unsmeared area. If the currently first image region is used as the image region to be edited, in response to a triggering operation of the third control, the image region to be edited is converted into a second image region.
[0071] In this embodiment, in response to a triggering operation of a first control in the editing control set, a smearing operation in the target interactive interface is obtained. The smearing area associated with the second stylized data is determined based on the smearing trajectory corresponding to the smearing operation. If the image content within the smearing area includes stylized image content, the stylized image content within the smearing area is converted into original image content to obtain the adjustment result of the second stylized data. If the image content within the smearing area includes original image content, the original image content within the smearing area is converted into stylized image content. The adjustment result of the second stylized data is displayed in the target interactive interface.
[0072] Optionally, in response to a triggering operation of a second control in the editing control set, a set of candidate editable items is displayed in the target interactive interface. The candidate editable items in the set represent the first image region in the second stylized data. In response to a triggering operation of the candidate editable item set, a target editable item is determined. Based on the target editable item, the first image region associated with the second stylized data is determined. If the image content within the first image region includes stylized image content, the stylized image content within the first image region is converted to the original image content. If the image content within the first image region includes the original image content, the original image content within the first image region is converted to stylized image content. The adjustment result of the second stylized data is displayed in the target interactive interface.
[0073] Optionally, after displaying the adjustment result of the stylized data in the target interactive interface, the method further includes: responding to a trigger operation of a third control in the editing control set, performing a region conversion process on the image region to be edited. The image content in the stylized data corresponding to the converted image region to be edited is adjusted to update the adjustment result in the target interactive interface.
[0074] For example, if the current image area to be edited is a smeared area, in response to the triggering operation of the third control in the editing control set, the image area to be edited is converted into an unsmeared area. Then, the image content corresponding to the unsmeared area in the second stylization data is adjusted to update the adjustment result. The updated adjustment result is displayed on the target interactive interface. In the updated adjustment result, the image content of the smeared area is converted from stylized image content to original image content, and / or from original image content to stylized image content, and the image content of the unsmeared area is converted from stylized image content to original image content, and / or from original image content to stylized image content, so as to present the inverse selection effect of the image content of the smeared and unsmeared areas in the target interactive interface.
[0075] Alternatively, if the current image region to be edited is the first image region, in response to the triggering operation of the third control in the editing control set, the image region to be edited is converted into the second image region. Then, the image content corresponding to the second image region in the second stylization number is adjusted to update the adjustment result. The updated adjustment result is displayed on the target interactive interface to present the inverse selection effect of the image content of the first and second image regions in the target interactive interface.
[0076] The technical solution of this disclosure embodiment performs stylization processing on media data using target stylized material to obtain stylized data. In response to editing operations on the stylized data, the image content of the stylized data is adjusted, and the adjustment results of the stylized data are displayed in the target interactive interface. This can obtain local stylized data with richer picture effects, optimize the local stylization method, and improve the picture effect and interactive experience.
[0077] Figure 4 is a flowchart illustrating another media data processing method provided in this embodiment. Based on the above embodiments, this embodiment specifically defines the method of stylizing the media data based on the target stylized material to obtain stylized data corresponding to the media data.
[0078] As shown in Figure 4, the method includes:
[0079] S410. Display the media data to be stylized and the set of candidate stylized materials in the target interactive interface.
[0080] S420. In response to the interactive operation of the candidate stylized material set, determine the target stylized material.
[0081] S430. Based on the target stylized material, the media data is subjected to overall stylization processing to obtain the first stylized data.
[0082] In this embodiment, target stylized material and media data to be stylized are input into a generative model. The generative model uses the target stylized material as a condition to stylize the media data to be stylized, obtaining first stylized data. The generative model can be a deep learning model trained with image samples having a specific visual style. For example, visual styles include oil painting style, comic book style, or claymation style. Images, photos, or video frames are input into a pre-trained generative model. The generative model uses the target stylized material as a condition to stylize the original images, photos, or video frames, obtaining stylized images, stylized photos, or stylized video frames, etc.
[0083] S440. Obtain the target stylized region in the media data, wherein the target stylized region includes at least a portion of the image region in the media data.
[0084] The target stylized region represents the area in the media data that needs to be locally stylized. For example, the target stylized region can be the foreground, background, or an area selected by an interactive operation. In this embodiment, a background local stylization control is displayed in the target interactive interface. In response to a click operation of the background local stylization control, the target stylized region is determined to be the background. An object local stylization control is displayed in the target interactive interface. In response to a click operation of the object local stylization control, the target stylized region is determined to be the target object. Alternatively, in response to a smear operation in the target interactive interface, the target stylized region is determined based on the smeared area. Alternatively, in response to a selection operation in the target interactive interface, the target stylized region is determined based on the selected area, etc. The target object includes people, animals, or goods, etc. People include real people or virtual people, and virtual people include generated characters, comic characters, or cartoon characters, etc.
[0085] A set of stylized controls is displayed in the target interactive interface. In response to a click on the set of stylized controls, the target stylized control is identified, and the target stylized region is determined based on the target stylized control. The set of stylized controls includes background partial stylized controls and object partial stylized controls, etc. Specifically, in response to a click on a background partial stylized control, the target stylized control is identified as a background partial stylized control, and the background area in the media data is used as the target stylized region. Alternatively, in response to a click on an object partial stylized control, the target stylized control is identified as an object partial stylized control, and the area corresponding to the target object in the media data is used as the target stylized region.
[0086] S450. Edit the target object in the media data and the first stylized data according to the target stylized region to obtain local media data and stylized local data, wherein the local media data and the stylized local data respectively represent the background and the target object.
[0087] Editing the target object includes target object elimination or target object segmentation. In this embodiment, editing the target object in the media data and the first stylized data according to the target stylized region to obtain local media data and stylized local data includes: if the target stylized region represents the background, then performing a target object elimination operation on the first stylized data to obtain stylized local data; and performing a target object segmentation operation on the media data to obtain local media data.
[0088] In other embodiments, if the target stylized region represents a target object, a target object removal operation is performed on the media data to obtain local media data. A target object segmentation operation is then performed on the first stylized data to obtain stylized local data.
[0089] For example, editing the target object in the media data and the first stylized data according to the target stylized region to obtain local media data and stylized local data includes: determining a first mask image based on the target object in the media data, and determining a second mask image based on the target object in the first stylized data. Editing the target object according to the target stylized region, the first mask image, and the second mask image yields the local media data and stylized local data.
[0090] In this system, a first mask image represents the target object in the media data. A second mask image represents the target object in the first stylized data. The first and second mask images can be determined using an image segmentation algorithm. For example, the first mask image is obtained by identifying the target object in the media data and segmenting it using an image segmentation algorithm. The second mask image is generated by identifying the target object in the first stylized data and segmenting it using an image segmentation algorithm. By identifying the target objects in the media data and the first stylized data respectively, a first mask image corresponding to the contour of the target object in the media data and a second mask image corresponding to the contour of the target object in the first stylized data are generated. Editing the target objects in the media data and the first stylized data based on the first and second mask images respectively can solve the display problem around the contour of the target object in the local stylized result.
[0091] Figure 5 shows a locally stylized image with overlapping human figure contours. As shown in Figure 5, in addition to the contour 510 of the real human figure, there are also partial contours of the stylized human figure (520, 530, 540, and 550), resulting in the problem that the real human figure cannot completely occlude the stylized human figure in the local stylization result. This embodiment of the present disclosure identifies the target object in the media data and the first stylized data respectively, and generates a first mask image and a second mask image based on the identification results. Then, the stylized human figure in the stylized image is eliminated according to the second mask image to obtain a stylized background image. The real human figure is segmented from the original image according to the first mask image, and then the real human figure is superimposed on the stylized background image to obtain a background stylized image 560. Since there is no stylized human figure in the background, the problem of overlapping contours of the target object in the local stylization result is solved.
[0092] Alternatively, if the outline of the target object is smaller than the outline of the stylized target object, segmenting the target object in the stylized image using a mask image corresponding to the target object would result in an incomplete target object, thus affecting the visual effect of the stylized image. This embodiment of the present disclosure identifies the target object in the media data and the first stylized data respectively, and generates a first mask image and a second mask image based on the identification results. The target object is removed from the original image using the first mask to obtain the original background image. The target object is segmented from the stylized image using the second mask image, and then superimposed onto the original background image to obtain the stylized image. Since the second mask image is determined based on the target object identification results, it can completely segment the target object, solving the problem of incomplete target objects in the stylized image.
[0093] Optionally, editing the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data includes: if the target stylized region represents the background, then deleting the target object from the first stylized data based on the second mask image; filling the deleted region in the first stylized data corresponding to the target object with pixels to obtain the stylized local data; and segmenting the target object in the media data based on the first mask image to obtain the local media data.
[0094] Specifically, if background local stylization is chosen, the target stylized region represents the background. The second mask image and the stylized image are input into a pre-trained generative adversarial network (GAN). The GAN removes the target object from the stylized image based on the second mask image and fills the deleted area with pixels surrounding the target object, resulting in a stylized background image. The target object in the original image is then segmented based on the first mask image to obtain a target object image. For example, in the first mask image, the pixel value of the pixel region corresponding to the target object is 1, and the pixel value of the non-target object region is 0. Multiplying the first mask image by the original image achieves object masking, resulting in a target object image containing only the target object. In this target object image, the target object region is opaque, and the non-target object region is transparent.
[0095] Optionally, editing the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data includes: if the target stylized region represents the target object, then deleting the target object from the media data based on the first mask image; filling the deleted region in the media data corresponding to the target object with pixels to obtain the local media data; and segmenting the target object in the first stylized data based on the second mask image to obtain the stylized local data.
[0096] Specifically, if a target object stylization is chosen, the stylized region represents the target object. A first mask and the original image are input into a pre-trained generative adversarial network (GAN). The GAN removes the target object from the original image based on the first mask and fills the deleted region with pixels surrounding the target object, obtaining the original background image. The target object in the stylized image is then segmented using a second mask to obtain a stylized object map. For example, in the second mask, the pixel value of the pixel region corresponding to the target object is 1, and the pixel value of the non-target object region is 0. Multiplying the second mask by the stylized image achieves object masking in the stylized image, resulting in a stylized object map containing only the target object. In this stylized object map, the target object region is opaque, and the non-target object region is transparent.
[0097] S460. Generate the second stylized data based on the local media data and the stylized local data.
[0098] For example, local media data and stylized local data are fused to obtain second stylized data of the media data. In some embodiments, a stylized background image and a target object image are fused to obtain a background stylized image of the original image. The background stylized image presents a visual effect where the stylized background and the real target object blend together. Specifically, the target object image is superimposed on the stylized background image so that the stylized background area is presented in the transparent area of the target object image, and the real target object is presented in the opaque area.
[0099] In other embodiments, the original background image and the stylized object image are fused to obtain an object-stylized image of the original image. The object-stylized image presents a visual effect where the stylized target object blends seamlessly with the real background. Specifically, the object-stylized image is overlaid on the original background image, so that the real background area is presented in the transparent areas of the stylized object image, and the stylized target object is presented in the opaque areas.
[0100] For example, generating second stylized data of the media data based on the local media data and stylized local data includes: determining a semi-transparent region in the target object based on the mask of the first mask image or the second mask image; determining a target pixel value corresponding to the semi-transparent region based on the pixel values corresponding to the semi-transparent region in the second stylized data; and generating the second stylized data based on the target pixel value, the local media data, and the stylized local data.
[0101] The semi-transparent region represents the area in the first or second mask image where the mask is between (0,1). For example, if the target stylized region represents the background, the semi-transparent region is determined based on the position of the mask corresponding to the target object image that is greater than 0 and less than 1. If the target stylized region represents the target object, the semi-transparent region is determined based on the position of the mask corresponding to the stylized object image that is greater than 0 and less than 1.
[0102] In the mask image, the mask corresponding to the background area is 0, and the mask corresponding to the main object area is 1. For areas that are neither background nor main object, the mask is greater than zero and less than 1. Therefore, the semi-transparent areas in the first or second mask image can be determined based on the mask of the first or second mask image. For example, the semi-transparent areas include the edge area, shadow, reflection, or cutout area of the target object. In this embodiment, the semi-transparent area may include the outer contour area or cutout area of the target object.
[0103] Based on the pixel coordinates of the semi-transparent area, determine the pixel value corresponding to the semi-transparent area in the local media data, and determine the pixel value corresponding to the semi-transparent area in the stylized local data. Based on the pixel values corresponding to the semi-transparent area in the local media data and the stylized local data, respectively, and the transparency corresponding to the pixel values, determine the target pixel value.
[0104] The local media data and stylized local data are superimposed to obtain superimposed data. The pixels corresponding to the semi-transparent areas in the superimposed data are updated based on the target pixel value to obtain the second stylized data.
[0105] Optionally, based on the mask of the first or second mask image, semi-transparent, transparent, and opaque areas in the target object are determined. For semi-transparent areas, the target pixel value corresponding to the local stylization result and the semi-transparent area is determined based on the pixel values corresponding to the semi-transparent area and the local media data and stylized local data, respectively. For transparent and opaque areas, the local media data and stylized local data are superimposed to obtain superimposed data. Second stylized data is determined based on the target pixel value and the superimposed data. This embodiment of the present disclosure ensures that the edge areas and hollowed-out areas of the target object in the local stylization result are consistent with the background by superimposing the local media data and stylized local data with the pixel values corresponding to the semi-transparent areas based on transparency information during the superposition of local media data and stylized local data.
[0106] Figure 6 is a comparison diagram of the effects of the background stylized image provided in the embodiments of this disclosure. The left image in Figure 6 is a background stylized image obtained by directly superimposing the target object image and the stylized background image. It can be seen that the top edge 610 of the target object's head is inconsistent with the stylized background, resulting in poor fusion between the target object and the stylized background. The right image in Figure 6 is a background stylized image obtained by superimposing the local media data and stylized local data with the pixel values corresponding to the semi-transparent areas based on the transparency information. It can be seen that the top edge 620 of the target object's head is consistent with the stylized background, and presents a hollowed-out feeling of hair strands relative to the light.
[0107] In some embodiments, if the target stylized region represents the background, semi-transparent, transparent, and opaque regions in the first mask image are determined based on the first mask image. For the semi-transparent region, a first multiplication operation result is calculated between the pixel value corresponding to the semi-transparent region and the target object image, and the first transparency corresponding to the pixel value. A second multiplication operation result is also calculated between the pixel value corresponding to the semi-transparent region and the background stylized image, and the second transparency corresponding to the pixel value. The target pixel value corresponding to the semi-transparent region in the background stylized image is determined based on the first and second multiplication operation results. The first transparency is determined based on the mask of the first mask image. The second transparency is determined based on the first transparency. For example, the first transparency is x, and the second transparency is 1-x. For the transparent and opaque regions, the target object image is superimposed on the background stylized image to obtain a first superimposed image. The background stylized image of the original image is determined based on the target pixel value and the first superimposed image.
[0108] In other embodiments, if the target stylized region represents a target object, semi-transparent, transparent, and opaque regions in the second mask image are determined based on the second mask image. For semi-transparent regions, a third multiplication operation is performed on the pixel value corresponding to the semi-transparent region and the stylized object image, along with the result of a third multiplication operation on the third transparency corresponding to the pixel value. A fourth multiplication operation is also performed on the pixel value corresponding to the semi-transparent region and the original background image, along with the result of a fourth multiplication operation on the pixel value corresponding to the fourth transparency. The target pixel value corresponding to the semi-transparent region in the object stylized image is determined based on the third and fourth multiplication operation results. The third transparency is determined based on the mask of the second mask image. The fourth transparency is determined based on the third transparency. For transparent and opaque regions, the stylized object image is superimposed on the original background image to obtain a second superimposed image. The object stylized image of the original image is determined based on the target pixel value and the second superimposed image.
[0109] Figure 7 is a schematic flowchart of background stylization in a media data processing method provided in this embodiment of the present disclosure. As shown in Figure 7, the method includes: acquiring an original image 710, wherein the original image 710 includes a target object. For example, a photo is taken using a mobile terminal's camera as the original image 710. Alternatively, a photo or image is uploaded from a local album as the original image 710. The original image 710 is displayed in a target interactive interface 700. In response to a click operation of the background local stylization control 720 in the target interactive interface 700, the target stylization area is determined as the background. On one hand, the original image 710 is subjected to overall stylization processing based on the target stylization material to obtain a stylized image 730. A second mask image is determined based on the target object in the stylized image 730. The second mask image and the stylized image 730 are input into a generative adversarial network (GAN), and the target object in the stylized image 730 is eliminated through the GAN to obtain a stylized background image 740. On the other hand, the target object in the original image 710 is identified, and a first mask image is determined based on the target object in the original image 710. By multiplying the first mask image by the original image 710, the target object in the original image 710 is extracted, resulting in a target object image 750 containing only the target object. The semi-transparent areas within the target object, and the transparency of the pixels of the target object within these semi-transparent areas, are determined based on the mask of the first mask image. Since the target object area in the target object image 750 is opaque and the non-target object area is transparent, the target object image 750 is superimposed on the stylized background image 740. Based on the pixel values of the target object image 750 and the stylized background image 740 corresponding to the semi-transparent areas, and the transparency of these pixel values, the target pixel values of the background stylized image corresponding to the semi-transparent areas are determined, resulting in a background stylized image 760. For example, for the hair edge of the target object, the final color of the hair edge area is obtained by multiplying the pixel values of the hair edge area by their corresponding transparency and by multiplying the pixel values of the clouds by their corresponding transparency.
[0110] It should be noted that the stylization and object removal steps of the original image can be performed in parallel with the object segmentation step of the original image.
[0111] Figure 8 is a flowchart illustrating object stylization in a media data processing method provided in this embodiment. As shown in Figure 8, the method includes: acquiring an original image 810 in response to a data import operation in a target interactive interface 800; displaying the original image 810 in the target interactive interface 800; and determining a target stylization region as a target object in response to a click operation of an object local stylization control 820 in the target interactive interface 800. On one hand, stylizing the original image 810 based on the target stylization material yields a stylized image 830. A second mask image is determined based on the target object in the stylized image. By multiplying the second mask image by the stylized image 830, the target object in the stylized image 830 is extracted, resulting in a stylized object image 840 containing only the target object. On the other hand, the target object in the original image 810 is identified, and a first mask image is determined based on the target object in the original image 810. The first mask image and the original image 810 are input into a generative adversarial network (GAN), and the target object in the original image 810 is eliminated through the GAN, resulting in an original background image 850. Since the target object region in the stylized object image 840 is an opaque region and the non-target object region is a transparent region, the stylized object image 840 is superimposed on the original background image 850. Based on the pixel values corresponding to the semi-transparent regions in the stylized object image 840 and the original background image 850, and the transparency of the pixel values, the target pixel values corresponding to the semi-transparent regions in the object stylized image are determined, resulting in the object stylized image 860.
[0112] S470. Display the second stylized data in the target interactive interface.
[0113] S480. Display an editing control set in the target interactive interface, adjust the image content of the stylized data in response to the interactive operation of the editing control set, and display the adjustment result of the stylized data in the target interactive interface.
[0114] The technical solution of this disclosure involves performing overall stylization processing on media data based on target stylized material to obtain first stylized data. A target stylized region is then acquired from the media data. Next, the target objects in the media data and the first stylized data are edited according to the target stylized region to obtain partial media data and stylized partial data. A second stylized data for the media data is then generated based on the partial media data and stylized partial data. Since the first stylized data is obtained by stylizing the media data, and the target objects in the first stylized data are edited according to the target stylized region, a stylized background or a stylized target object is obtained. The stylized background or stylized target object, combined with the target object or background in the media data, generates background partial stylized data or target object partial stylized data, ensuring the coordination between the target object and the background environment, resolving the overlap problem at the outline of the target object, and improving the visual effect of the partial stylization result. Furthermore, only the media data to be stylized, the target stylized material, and the target stylized region need to be specified to obtain the partial stylization result, simplifying the operation of partial stylization.
[0115] Figure 9 is a schematic diagram of the structure of a media data processing device provided in an embodiment of this disclosure. The device can be implemented in the form of software and / or hardware, and optionally, it can be implemented by an electronic device, such as a mobile terminal, a PC, or a server.
[0116] As shown in Figure 9, the device includes: a display module 910, a stylization module 920, and an editing module 930.
[0117] The display module 910 is used to display the media data to be stylized and the candidate stylization material set in the target interactive interface, wherein the candidate stylization material set includes the target stylization material;
[0118] The stylization module 920 is used to respond to the triggering operation of the target stylization material, perform stylization processing on the media data based on the target stylization material, obtain stylization data corresponding to the media data, and display the stylization data in the target interactive interface, wherein at least a portion of the image area in the stylization data is a stylization area;
[0119] The editing module 930 is used to display a set of editing controls in the target interactive interface, adjust the image content of the stylized data in response to the interactive operation of the set of editing controls, and display the adjustment result of the stylized data in the target interactive interface.
[0120] Optionally, the editing module 930 is specifically used for:
[0121] In response to the triggering operation of the first control in the editing control set, the smearing operation in the target interactive interface is obtained;
[0122] Adjust the image content of the image region to be edited in the stylized data corresponding to the smearing operation to obtain the adjustment result of the stylized data, wherein the image region to be edited includes the smeared region or the unsmeared region corresponding to the smearing operation.
[0123] Optionally, the editing module 930 is specifically used for:
[0124] In response to the triggering operation of the second control in the editing control set, a set of candidate editing items is displayed in the target interactive interface, wherein the candidate editing items in the set of candidate editing items are used to characterize the first image region in the stylized data;
[0125] In response to a triggering operation of the candidate edit item set, a target edit item is determined, and the image content of the image region to be edited corresponding to the target edit item in the stylized data is adjusted to obtain the adjustment result of the stylized data. The image region to be edited includes the first image region or the second image region, and the first image region and the second image region constitute the image region of the stylized data.
[0126] Further, adjusting the image content of the image region to be edited includes:
[0127] Convert the stylized image content in the image region to be edited in the stylized data into the original image content;
[0128] And / or,
[0129] The original image content in the image region to be edited in the stylized data is converted into stylized image content.
[0130] Optionally, it also includes:
[0131] The content update module is used to perform region conversion processing on the image region to be edited in response to the triggering operation of the third control in the editing control set after displaying the adjustment result of the stylized data in the target interactive interface.
[0132] The image content corresponding to the transformed image region in the stylized data is adjusted to update the adjustment result in the target interactive interface.
[0133] Optionally, the stylized data includes first stylized data and second stylized data, wherein the first stylized data represents the overall stylized result of the media data, and the second stylized data represents the local stylized result of the media data.
[0134] Stylization module 920 is specifically used for:
[0135] Based on the target stylized material, the media data is subjected to overall stylization processing to obtain the first stylized data;
[0136] Obtain the target stylized region in the media data, wherein the target stylized region includes at least a portion of the image region in the media data;
[0137] Edit the target object in the media data and the first stylized data according to the target stylized region to obtain local media data and stylized local data, wherein the local media data and the stylized local data respectively represent the background and the target object;
[0138] The second stylized data is generated based on the local media data and the stylized local data.
[0139] Optionally, the step of editing the target object in the media data and the first stylized data according to the target stylized region to obtain local media data and stylized local data includes:
[0140] A first mask image is determined based on the target object in the media data, and a second mask image is determined based on the target object in the first stylized data;
[0141] Edit the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data.
[0142] Optionally, the step of editing the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data includes:
[0143] If the target stylized region represents the background, then the target object in the first stylized data is deleted according to the second mask image;
[0144] Pixel filling is performed on the deleted region in the first stylized data corresponding to the target object to obtain the stylized local data;
[0145] The target object in the media data is segmented based on the first mask image to obtain the local media data.
[0146] Optionally, the step of editing the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data includes:
[0147] If the target stylized region represents a target object, then the target object is deleted from the media data according to the first mask image;
[0148] The deleted region in the media data corresponding to the target object is filled with pixels to obtain the local media data;
[0149] The target object in the first stylized data is segmented according to the second mask image to obtain the stylized local data.
[0150] Optionally, generating the second stylized data based on the local media data and the stylized local data includes:
[0151] The semi-transparent area in the target object is determined based on the mask of the first mask image or the second mask image;
[0152] Based on the pixel values corresponding to the semi-transparent area in the local media data and stylized local data, respectively, determine the target pixel value corresponding to the semi-transparent area in the second stylized data;
[0153] The second stylized data is generated based on the target pixel value, the local media data, and the stylized local data.
[0154] Optionally, generating the second stylized data based on the target pixel value, the local media data, and the stylized local data includes:
[0155] The local media data and stylized local data are superimposed to obtain superimposed data. The pixels corresponding to the semi-transparent areas in the superimposed data are updated based on the target pixel value to obtain the second stylized data.
[0156] The media data processing apparatus provided in this disclosure can execute the media data processing method provided in any embodiment of this disclosure, and has the corresponding functional modules and beneficial effects for executing the method.
[0157] It is worth noting that the various units and modules included in the above-mentioned device are only divided according to functional logic, but are not limited to the above division, as long as the corresponding functions can be realized; in addition, the specific names of each functional unit are only for easy differentiation and are not used to limit the protection scope of the embodiments of this disclosure.
[0158] Figure 10 is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Referring now to Figure 10, a schematic diagram of the structure of an electronic device (e.g., the terminal device or server in Figure 10) 1000 suitable for implementing embodiments of this disclosure is shown. The terminal device in embodiments of this disclosure may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and fixed terminals such as digital TVs and desktop computers. The electronic device shown in Figure 10 is merely an example and should not impose any limitations on the functionality and scope of use of embodiments of this disclosure.
[0159] As shown in Figure 10, the electronic device 1000 may include a processing unit (e.g., a central processing unit, a graphics processing unit, etc.) 1001, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 1002 or a program loaded from a storage device 1008 into a random access memory (RAM) 1003. The RAM 1003 also stores various programs and data required for the operation of the electronic device 1000. The processing unit 1001, ROM 1002, and RAM 1003 are interconnected via a bus 1004. An edit / output (I / O) interface 1005 is also connected to the bus 1004.
[0160] Typically, the following devices can be connected to the I / O interface 1005: input devices 1006 including, for example, a touchscreen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 1007 including, for example, a liquid crystal display (LCD), speaker, vibrator, etc.; storage devices 1008 including, for example, magnetic tape, hard disk, etc.; and communication devices 1009. Communication device 1009 allows electronic device 1000 to communicate wirelessly or wiredly with other devices to exchange data. Although Figure 10 shows an electronic device 1000 with various devices, it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed alternatively.
[0161] In particular, according to embodiments of this disclosure, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program carried on a non-transitory computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via communication device 1009, or installed from storage device 1008, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of embodiments of this disclosure.
[0162] The names of messages or information exchanged between multiple devices in the embodiments of this disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
[0163] The electronic device provided in this embodiment and the media data processing method provided in the above embodiments belong to the same inventive concept. Technical details not described in detail in this embodiment can be found in the above embodiments, and this embodiment has the same beneficial effects as the above embodiments.
[0164] This disclosure provides a computer storage medium storing a computer program that, when executed by a processor, implements the media data processing method provided in the above embodiments.
[0165] It should be noted that the computer-readable medium described in this disclosure can be a computer-readable signal medium or a computer-readable storage medium, or any combination thereof. A computer-readable storage medium can be, for example,—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of a computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this disclosure, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in connection with an instruction execution system, apparatus, or device. In this disclosure, a computer-readable signal medium can include a data signal propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals can take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. A computer-readable signal medium can be any computer-readable medium other than a computer-readable storage medium, which can send, propagate, or transmit a program for use by or in connection with an instruction execution system, apparatus, or device. The program code contained on the computer-readable medium can be transmitted using any suitable medium, including but not limited to: wires, optical fibers, RF (radio frequency), etc., or any suitable combination thereof.
[0166] In some implementations, clients and servers can communicate using any currently known or future-developed network protocol such as HTTP (Hypertext Transfer Protocol), and can interconnect with digital data communication (e.g., communication networks) of any form or medium. Examples of communication networks include local area networks (“LANs”), wide area networks (“WANs”), the Internet (e.g., the Internet of Things), and end-to-end networks (e.g., ad hoc end-to-end networks), as well as any currently known or future-developed networks.
[0167] The aforementioned computer-readable medium may be included in the aforementioned electronic device; or it may exist independently and not assembled into the electronic device.
[0168] The aforementioned computer-readable medium carries one or more programs that, when executed by the electronic device, cause the electronic device to:
[0169] The target interactive interface displays the media data to be stylized and a set of candidate stylized materials, wherein the set of candidate stylized materials includes the target stylized materials;
[0170] In response to the triggering operation of the target stylized material, the media data is stylized based on the target stylized material to obtain stylized data corresponding to the media data, and the stylized data is displayed in the target interactive interface, wherein at least a portion of the image region in the stylized data is a stylized region;
[0171] An editing control set is displayed in the target interactive interface. In response to the interactive operation of the editing control set, the image content of the stylized data is adjusted, and the adjustment result of the stylized data is displayed in the target interactive interface.
[0172] Computer program code for performing the operations of this disclosure can 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, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0173] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0174] The units described in the embodiments of this disclosure can be implemented in software or hardware. The names of the units are not, in some cases, intended to limit the specific unit.
[0175] The functions described above in this document can be performed, at least in part, by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: Field Programmable Gate Arrays (FPGAs), Application-Specific Integrated Circuits (ASICs), Application Standard Products (ASSPs), System-on-Chip (SoCs), Complex Programmable Logic Devices (CPLDs), and so on.
[0176] In the context of this disclosure, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0177] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the above-described concept. For example, technical solutions formed by substituting the above features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
[0178] Furthermore, while the operations are described in a specific order, this should not be construed as requiring these operations to be performed in the specific order shown or in a sequential order. In certain environments, multitasking and parallel processing may be advantageous. Similarly, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of this disclosure. Certain features described in the context of individual embodiments may also be implemented in combination in a single embodiment. Conversely, various features described in the context of a single embodiment may also be implemented individually or in any suitable sub-combination in multiple embodiments.
[0179] Although the subject matter has been described using language specific to structural features and / or methodological logic, 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. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A media data processing method, comprising: The target interactive interface displays the media data to be stylized and a set of candidate stylized materials, wherein the set of candidate stylized materials includes the target stylized materials; In response to the triggering operation of the target stylized material, the media data is stylized based on the target stylized material to obtain stylized data corresponding to the media data, and the stylized data is displayed in the target interactive interface, wherein at least a portion of the image region in the stylized data is a stylized region; An editing control set is displayed in the target interactive interface. In response to the interactive operation of the editing control set, the image content of the stylized data is adjusted, and the adjustment result of the stylized data is displayed in the target interactive interface.
2. The method according to claim 1, wherein, The step of adjusting the image content of the stylized data in response to interactive operations of the set of editing controls includes: In response to the triggering operation of the first control in the editing control set, the smearing operation in the target interactive interface is obtained; Adjust the image content of the image region to be edited in the stylized data corresponding to the smearing operation to obtain the adjustment result of the stylized data, wherein the image region to be edited includes the smeared region or the unsmeared region corresponding to the smearing operation.
3. The method according to claim 1, wherein, The step of adjusting the image content of the stylized data in response to interactive operations of the set of editing controls includes: In response to the triggering operation of the second control in the editing control set, a set of candidate editing items is displayed in the target interactive interface, wherein the candidate editing items in the set of candidate editing items are used to characterize the first image region in the stylized data; In response to a triggering operation of the candidate edit item set, a target edit item is determined, and the image content of the image region to be edited corresponding to the target edit item in the stylized data is adjusted to obtain the adjustment result of the stylized data. The image region to be edited includes the first image region or the second image region, and the first image region and the second image region constitute the image region of the stylized data.
4. The method according to claim 2 or 3, wherein, Adjusting the image content of the area to be edited includes: Convert the stylized image content in the image region to be edited in the stylized data into the original image content; And / or, The original image content in the image region to be edited in the stylized data is converted into stylized image content.
5. The method according to claim 4, wherein, After displaying the adjustment results of the stylized data in the target interactive interface, the method further includes: In response to the triggering operation of the third control in the editing control set, the region to be edited is subjected to region conversion processing; The image content corresponding to the transformed image region in the stylized data is adjusted to update the adjustment result in the target interactive interface.
6. The method according to claim 1, wherein, The stylized data includes first stylized data and second stylized data, wherein the first stylized data represents the overall stylized result of the media data, and the second stylized data represents the local stylized result of the media data; The process of stylizing the media data based on the target stylized material to obtain stylized data corresponding to the media data includes: Based on the target stylized material, the media data is subjected to overall stylization processing to obtain the first stylized data; Obtain the target stylized region in the media data, wherein the target stylized region includes at least a portion of the image region in the media data; Edit the target object in the media data and the first stylized data according to the target stylized region to obtain local media data and stylized local data, wherein the local media data and the stylized local data respectively represent the background and the target object; The second stylized data is generated based on the local media data and the stylized local data.
7. The method according to claim 6, wherein, The step of editing the target object in the media data and the first stylized data according to the target stylized region to obtain local media data and stylized local data includes: A first mask image is determined based on the target object in the media data, and a second mask image is determined based on the target object in the first stylized data; Edit the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data.
8. The method according to claim 7, wherein, The step of editing the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data includes: If the target stylized region represents the background, then the target object in the first stylized data is deleted according to the second mask image; Pixel filling is performed on the deleted region in the first stylized data corresponding to the target object to obtain the stylized local data; The target object in the media data is segmented based on the first mask image to obtain the local media data.
9. The method according to claim 7, wherein, The step of editing the target object based on the target stylized region, the first mask image, and the second mask image to obtain the local media data and stylized local data includes: If the target stylized region represents a target object, then the target object is deleted from the media data according to the first mask image; The deleted region in the media data corresponding to the target object is filled with pixels to obtain the local media data; The target object in the first stylized data is segmented according to the second mask image to obtain the stylized local data.
10. The method according to claim 7, wherein, The step of generating the second stylized data based on the local media data and the stylized local data includes: The semi-transparent area in the target object is determined based on the mask of the first mask image or the second mask image; Based on the pixel values corresponding to the semi-transparent area in the local media data and stylized local data, respectively, determine the target pixel value corresponding to the semi-transparent area in the second stylized data; The second stylized data is generated based on the target pixel value, the local media data, and the stylized local data.
11. The method according to claim 10, wherein, The step of generating the second stylized data based on the target pixel value, the local media data, and the stylized local data includes: The local media data and stylized local data are superimposed to obtain superimposed data. The pixels corresponding to the semi-transparent areas in the superimposed data are updated based on the target pixel value to obtain the second stylized data.
12. A media data processing apparatus, comprising: The display module is used to display the media data to be stylized and the candidate stylization material set in the target interactive interface, wherein the candidate stylization material set includes the target stylization material; A stylization module is used to respond to the triggering operation of the target stylization material, perform stylization processing on the media data based on the target stylization material, obtain stylization data corresponding to the media data, and display the stylization data in the target interactive interface, wherein at least a portion of the image area in the stylization data is a stylization area; An editing module is used to display a set of editing controls in the target interactive interface, adjust the image content of the stylized data in response to the interactive operation of the set of editing controls, and display the adjustment result of the stylized data in the target interactive interface.
13. An electronic device, comprising: One or more processors; 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 media data processing method as described in any one of claims 1-11.
14. A storage medium containing computer-executable instructions, wherein, The computer-executable instructions, when executed by a computer processor, are used to perform the media data processing method as described in any one of claims 1-11.
15. A computer program product comprising a computer program, wherein, When the computer program is executed by a processor, it implements the media data processing method as described in any one of claims 1-11.