Image processing method, system and computing device
Patent Information
- Application Number
- CN202510162955.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-13
- Publication Date
- 2026-08-18
AI Technical Summary
[0004]本申请实施例提供了一种图像处理方法、系统和计算设备,以至少解决相关技术中对图像色彩进行局部编辑的准确度较低的技术问题
[0015]根据本申请实施例的另一方面,还提供了一种计算机程序产品,包括计算机程序,计算机程序在被处理器执行时实现本申请各个实施例中的方法。
Smart Images

Figure CN122597541A_ABST
Abstract
Description
Technical Field
[0001] This application relates to large model technology and the field of image editing, and more specifically, to an image processing method, system, and computing device. Background Technology
[0002] Current color editing technologies primarily focus on global color adjustments, such as color balance, enhancing or reducing color saturation, and adjusting color temperature. However, with increasing user demands for personalization and refinement, local color editing has become a critical issue that urgently needs to be addressed. While some local color editing tools exist, these tools often struggle to guarantee accuracy during local editing, especially when dealing with complex backgrounds or objects with blurred boundaries. This can easily lead to color overflow or unnatural transitions, resulting in lower accuracy in local color editing.
[0003] There is currently no effective solution to the above problems. Summary of the Invention
[0004] This application provides an image processing method, system, and computing device to at least solve the technical problem of low accuracy in local color editing of images in related technologies.
[0005] According to one aspect of the embodiments of this application, an image processing method is provided, comprising: acquiring an image to be processed and image editing information, wherein the image editing information is information obtained by color editing of a target region in the image to be processed; generating at least one mask image based on the image editing information, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: a target region, a region where a target object associated with the target region is located; and performing color editing on the target object in the image to be processed based on the at least one mask image and the image editing information to generate a target image.
[0006] According to another aspect of the embodiments of this application, an image processing method is also provided, comprising: responding to an input command applied to an operation interface, determining an image to be processed corresponding to the input command; responding to an image editing command applied to the operation interface, determining image editing information corresponding to the image editing command, wherein the image editing information is information obtained by color editing of a target region in the image to be processed; responding to a processing command applied to the operation interface, generating at least one mask image based on the image editing information, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: a target region, a region where a target object associated with the target region is located; and performing color editing on the target object in the image to be processed based on at least one mask image and the image editing information to generate a target image.
[0007] According to another aspect of the embodiments of this application, an image processing method is also provided, comprising: obtaining an image to be processed and image editing information by calling a first interface, wherein the first interface includes a first parameter, the parameter value of the first parameter includes the image to be processed and the image editing information, the image editing information being information obtained by color editing of a target region in the image to be processed; generating at least one mask image based on the image editing information, wherein different mask images are used to characterize the positions of different regions in the image to be processed, the different regions including at least one of the following: a target region, a region where a target object associated with the target region is located; performing color editing on the target object in the image to be processed based on at least one mask image and the image editing information to generate a target image; and outputting the target image by calling a second interface, wherein the second interface includes a second parameter, the parameter value of the second parameter including the target image.
[0008] According to one aspect of the embodiments of this application, an image processing apparatus is provided, comprising: an information acquisition module for acquiring an image to be processed and image editing information, wherein the image editing information is information obtained by color editing of a target region in the image to be processed; an image generation module for generating at least one mask image based on the image editing information, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: a target region, a region where a target object associated with the target region is located; and an image editing module for color editing of a target object in the image to be processed based on at least one mask image and the image editing information to generate a target image.
[0009] According to another aspect of the embodiments of this application, an image processing apparatus is also provided, comprising: a first execution module, configured to respond to an input command applied to an operation interface and determine an image to be processed corresponding to the input command; a second execution module, configured to respond to an image editing command applied to the operation interface and determine image editing information corresponding to the image editing command, wherein the image editing information is information obtained by color editing of a target region in the image to be processed; a mask generation module, configured to respond to a processing command applied to the operation interface and generate at least one mask image based on the image editing information, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: a target region, a region where a target object associated with the target region is located; and an object editing module, configured to perform color editing on a target object in the image to be processed based on at least one mask image and the image editing information to generate a target image.
[0010] According to another aspect of the embodiments of this application, an image processing apparatus is also provided, comprising: a first calling module, configured to obtain an image to be processed and image editing information by calling a first interface, wherein the first interface includes a first parameter, the parameter value of the first parameter includes the image to be processed and the image editing information, and the image editing information is information obtained by color editing of a target region in the image to be processed; an image generation module, configured to generate at least one mask image based on the image editing information, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: a target region, and a region where a target object associated with the target region is located; a color editing module, configured to perform color editing on a target object in the image to be processed based on at least one mask image and the image editing information, thereby generating a target image; and a second calling module, configured to output the target image by calling a second interface, wherein the second interface includes a second parameter, the parameter value of the second parameter includes the target image.
[0011] According to another aspect of the embodiments of this application, an image processing system is also provided, comprising: a client, configured to send an image to be processed and image editing information, wherein the image editing information is information obtained by color editing of a target region in the image to be processed; a server, connected to the client, configured to generate at least one mask image based on the image editing information, and to perform color editing on a target object in the image to be processed based on the at least one mask image and the image editing information to generate a target image, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: a target region, a region where a target object associated with the target region is located; the client is also configured to output the target image.
[0012] According to another aspect of the embodiments of this application, a computing device is also provided, including: a memory storing an executable program; and a processor for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0013] According to another aspect of the embodiments of this application, an electronic device is also provided, including: a memory storing an executable program; and a processor connected to the memory via a bus for running the program, wherein the program executes the methods in various embodiments of this application when it runs.
[0014] According to another aspect of the embodiments of this application, a computer-readable storage medium is also provided, the computer-readable storage medium including a stored executable program, wherein, when the executable program is running, it controls the device where the computer-readable storage medium is located to perform the methods of various embodiments of this application.
[0015] According to another aspect of the embodiments of this application, a computer program product is also provided, including a computer program that, when executed by a processor, implements the methods of various embodiments of this application.
[0016] According to another aspect of the embodiments of this application, a computer program product is also provided, including a non-volatile computer-readable storage medium storing a computer program, which, when executed by a processor, implements the methods in various embodiments of this application.
[0017] According to another aspect of the embodiments of this application, a computer program is also provided, which, when executed by a processor, implements the methods of the various embodiments of this application.
[0018] In this embodiment, the method involves acquiring the image to be processed and image editing information; generating at least one mask image based on the image editing information; and performing color editing on the target object in the image to be processed based on the at least one mask image and image editing information to generate the target image. By using image editing information to identify the areas in the image to be processed that need color editing, and performing local color editing on these areas according to their respective mask images and image editing information, the naturalness of the edited target image can be effectively improved, avoiding color overflow in the target area or obvious color discontinuity between the target area and other areas. This largely ensures the visual effect of the target image and solves the technical problem of low accuracy in local color editing of images in related technologies.
[0019] It is worth noting that the general description above and the detailed description that follow are merely for illustrative purposes and do not constitute a limitation on this application. Attached Figure Description
[0020] The accompanying drawings, which are included to provide a further understanding of this application and form part of this application, illustrate exemplary embodiments and are used to explain this application, but do not constitute an undue limitation of this application. In the drawings:
[0021] Figure 1 This is a flowchart illustrating an image processing scenario according to an embodiment of this application;
[0022] Figure 2 This is a flowchart illustrating an image processing method according to an embodiment of this application;
[0023] Figure 3 This is a schematic diagram illustrating a simplified image processing procedure according to an embodiment of this application;
[0024] Figure 4This is a schematic diagram illustrating a detailed image processing procedure according to an embodiment of this application;
[0025] Figure 5 This is a flowchart illustrating another image processing method according to an embodiment of this application;
[0026] Figure 6 This is a flowchart illustrating another image processing method according to an embodiment of this application;
[0027] Figure 7 This is a structural block diagram of an image processing apparatus according to an embodiment of this application;
[0028] Figure 8 This is a structural block diagram of another image processing apparatus according to an embodiment of this application;
[0029] Figure 9 This is a structural block diagram of another image processing apparatus according to an embodiment of this application;
[0030] Figure 10 This is a structural block diagram of an image processing system according to an embodiment of this application;
[0031] Figure 11 This is a structural block diagram of a computing device according to an embodiment of this application;
[0032] Figure 12 This is a structural block diagram of an electronic device according to an embodiment of this application. Detailed Implementation
[0033] To enable those skilled in the art to better understand the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present application, and not all embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of the present application.
[0034] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this application are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of this application described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.
[0035] The technical solution provided in this application is mainly implemented using large-scale model technology. Here, "large-scale model" refers to a deep learning model with a massive number of parameters, typically containing hundreds of millions, tens of billions, hundreds of billions, trillions, or even tens of trillions of parameters. Large-scale models can also be called foundational models. They are pre-trained using large-scale unlabeled corpora to produce pre-trained models with hundreds of millions of parameters. Such models can adapt to a wide range of downstream tasks and have good generalization ability. Examples include Large Language Models (LLMs) and multimodal pre-training models.
[0036] It should be noted that, in practical applications, large models can be fine-tuned using a small number of samples to adapt them to different tasks. For example, large models can be widely used in Natural Language Processing (NLP), computer vision, and speech processing. Specifically, they can be applied to computer vision tasks such as Visual Question Answering (VQA), Image Captioning (IC), and image generation, as well as NLP tasks such as text-based sentiment classification, text summarization, and machine translation. Therefore, the main application scenarios for large models include, but are not limited to, digital assistants, intelligent robots, search, online education, office software, e-commerce, and intelligent design. In this embodiment, the example of data processing using an image generation model in an image color editing scenario is used for explanation.
[0037] First, some nouns or terms that appear in the description of the embodiments of this application shall be interpreted as follows:
[0038] Image colorization: Converting a grayscale image into a color image to achieve reasonable color representation.
[0039] Color editing: Adjusts the colors of the image to improve the color quality of the picture.
[0040] According to an embodiment of this application, an image processing method is provided. It should be noted that the steps shown in the flowchart in the accompanying drawings can be executed in a computer system such as a set of computer-executable instructions. Furthermore, although a logical order is shown in the flowchart, in some cases, the steps shown or described may be executed in a different order than that shown here.
[0041] Considering the large number of model parameters in large models and the limited computing resources of mobile terminals, the method provided in this application embodiment can be applied to, for example, Figure 1 The application scenarios shown are not limited to these. Figure 1 This is a flowchart illustrating an image processing scenario according to an embodiment of this application, in which... Figure 1 In the application scenario shown, the large model is deployed on server 10. Server 10 can connect to one or more client devices 20 via a local area network (LAN), wide area network (WAN), internet connection, or other types of data network. These client devices 20 may include, but are not limited to, smartphones, tablets, laptops, PDAs, personal computers, smart home devices, and in-vehicle devices. Client devices 20 can interact with users through a graphical user interface to access the large model, thereby implementing the method provided in this embodiment.
[0042] In this embodiment, the system consisting of a client device and a server can perform the following steps: the client device acquires the image to be processed and image editing information; and outputs the target image. The server generates at least one mask image based on the image editing information; and performs color editing on the target object in the image to be processed based on the at least one mask image and the image editing information to generate the target image.
[0043] It should be noted that with the rapid development of high-performance computing units, the methods provided in this application embodiment can also be applied to model-in-machine systems in other application scenarios. In one optional embodiment, the model-in-machine system has multiple built-in models, and users can select one model to adjust as needed to obtain their own model. The high-performance computing unit built into the model-in-machine system can then directly call the adjusted model to execute the methods provided in this application embodiment. In another optional embodiment, the large model-in-machine system has a pre-trained model built-in, and the high-performance computing unit built into the model-in-machine system can then directly call that model to execute the methods provided in this application embodiment.
[0044] Furthermore, when users need to train their own models, they can upload their own datasets via the client. These datasets are then sent to the server, allowing the server to adjust the pre-trained model using the dataset to obtain the user's customized model, which can then be deployed to the production environment. To facilitate users' model adjustment needs, the server provides complete adjustment tools, development frameworks, and processes, supporting multiple adjustment strategies. This allows the adjusted model to better adapt to different application domains and achieve a high degree of customization.
[0045] Under the aforementioned operating environment, this application provides the following: Figure 2 The image processing method shown. Figure 2 This is a flowchart illustrating an image processing method according to an embodiment of this application. For example... Figure 2 As shown, the method may include the following steps:
[0046] Step S202: Obtain the image to be processed and image editing information.
[0047] Image editing information refers to the information obtained by color editing of the target area in the image to be processed.
[0048] The aforementioned image to be processed can refer to the image that currently requires color editing. It can be actively input by the user or automatically acquired by the image processing system according to pre-configured acquisition rules; the specific acquisition method is not limited. The aforementioned target area can refer to the area in the image to be processed that will undergo color editing. It can be manually defined by the user or obtained by the image processing system through object recognition and segmentation within the image; the specific method for determining the target area is not limited. The aforementioned image editing information can refer to information used for color editing of the target area, and may include, but is not limited to: editing method, editing area, editing color, color effects, etc.
[0049] In one optional embodiment, considering that when editing the color of an image to be processed, although the image processing system can perform global color editing based on the user's input editing requirements, such as adjusting the overall color balance, brightness, contrast, and exposure parameters of the image to be processed, to achieve fast and convenient color editing operations and improve the efficiency of color editing, in practical applications, the image processing system often finds it difficult to control the color changes of different areas in the image to be processed in this way. This results in some parts of the edited image being overexposed or underexposed, failing to meet the needs of complex scenarios with customized color requirements for each area. Therefore, in order to reasonably edit the color of the target area in the image to be processed, the image processing system can usually first acquire the image to be processed that needs color editing, and determine the target area for color editing from the image to be processed based on the user's input editing requirements. The user can then edit the color information of the target area according to their own needs to achieve control over the color changes of different areas in the image to be processed.
[0050] While segmenting the image to obtain the target region before color editing increases the flexibility of color editing, this method places high demands on the accuracy of image segmentation and the stitching method between images. Inaccurate segmentation or abnormalities in the stitching process can lead to editing operations affecting adjacent areas that shouldn't be edited, causing color overflow or creating unnatural color breaks between edited and non-edited areas, affecting the overall aesthetics and harmony of the image. Therefore, to reasonably perform color editing on target regions in the image and improve the visual effect of the image after local color editing, the image processing system can further detect the user's local color editing operations while acquiring the image. For example, the user can use tools to select or brush strokes to identify the target region for color editing and choose parameters such as color, brightness, and contrast for the target region according to their needs. The corresponding image processing system can generate corresponding image editing information based on the detected local color editing operations. Then, it reapplies the image editing information to the image to be processed for local color editing, instead of directly stitching the user-edited area with other unedited areas. This allows for flexible local color editing of the image to be processed, while improving the effect of local color editing, reducing the difficulty for users to perform local color editing, increasing the convenience for users to select or paint target areas, and avoiding color overflow or color banding. As a result, the image processing system can fully meet the user's needs for local color editing of the image to be processed while ensuring the rationality and visual effect of the edited target image.
[0051] Step S204: Generate at least one mask image based on the image editing information.
[0052] Different mask images are used to represent the positions of different regions in the image to be processed. The different regions include at least one of the following: the target region, the region where the target object associated with the target region is located.
[0053] The target object mentioned above can refer to the object that corresponds to the target area and needs to be color edited. For example, if the target area contains a complete tree, then the tree can be regarded as the object that needs to be color edited. Or, if the target area only contains a part of a piece of clothing, then the clothing can also be regarded as the object that needs to be color edited.
[0054] In one optional embodiment, in order to reasonably fuse image editing information on the image to be processed and avoid color overflow or banding in the fused target image, the image processing system can first determine the position of the color-edited area in the image to be processed based on the acquired image editing information, and generate a corresponding mask image based on the determined position. This allows the image processing system to fuse the image to be processed and the image editing information on the generated mask image, so that color changes are performed only in the area indicated by the mask image without affecting other areas, avoiding color overflow, and ensuring that the color of the area being color-edited and the adjacent areas can change smoothly and naturally, avoiding obvious banding.
[0055] In one optional embodiment, considering that the target area actively selected or painted by the user may include other objects besides the target object that actually needs color editing, or may not completely cover the target object that needs color editing, for example, when color editing of a tree in the image to be processed is required, the area actively selected by the user may include other objects next to the tree trunk, such as birds, vehicles, etc., or the area actively selected by the user may only include the tree trunk and not branches, leaves, etc., then editing errors may occur when color editing is performed based on the selected target area. Therefore, in order to ensure the accuracy of local color editing, when generating the above-mentioned mask image, the image processing system can identify the image editing information to determine the target object contained in the target area, and the object area where the target object is located in the image to be processed, that is, the area where the target object associated with the target area is located. Then, based on the location of the target area, object area, etc., at least one mask image is generated, thereby avoiding the situation where the generated mask image is missing. It should be noted that the target object mentioned here, which is a tree, is only an example. The target object is not limited to the whole object, but can also be a part of the object specified by the user, such as the trunk or some leaves mentioned above, rather than the whole tree. The user can decide for themselves, and there is no limitation here.
[0056] Step S206: Based on at least one mask image and image editing information, perform color editing on the target object in the image to be processed to generate a target image.
[0057] In one optional embodiment, after generating at least one mask image, the image processing system can perform color editing operations on the target object in the image to be processed that requires color editing, based on the at least one mask image and image editing information, to generate the corresponding target image. For example, the image generation system can first display the identified objects that may require color editing to the user, determine the actual target object that needs color editing based on the user's instructions, then select a target mask image that matches the target object from the generated at least one mask image, and based on the target mask image and the acquired image editing information, edit only the color information of the area where the target object is located, avoiding color overflow, so as to obtain a target image with better visual effect and achieve a high-quality local color editing effect.
[0058] In one optional embodiment, after generating the target image, the image processing system can also display the target image to the user in a preset operation interface. The user can also continue to adjust the target image according to their own needs, thereby editing an image with better visual effects.
[0059] For ease of understanding, Figure 3 This is a schematic diagram illustrating a simplified image processing procedure according to an embodiment of this application, such as... Figure 3 As shown, when performing local color editing on an image to be processed, the image processing system first acquires the image to be edited, i.e., the image to be processed. Simultaneously, the user can use the color editing tools on the interface to select editing colors and apply them to areas of the image to be processed. The image processing system generates corresponding image editing information based on the user's actions and performs local color editing on the image to be processed based on this information to generate the target image. After generating the target image, the image processing system can also display the color-edited image to the user on the interface, allowing the user to determine whether the current local color editing result meets the editing requirements. If it does, the currently edited image can be designated as the target image; otherwise, the user can either re-edit the image to be processed or reuse the currently edited image as the image to be processed for further local color editing.
[0060] In this embodiment, the method involves acquiring the image to be processed and image editing information; generating at least one mask image based on the image editing information; and performing color editing on the target object in the image to be processed based on the at least one mask image and image editing information to generate the target image. By using image editing information to identify the areas in the image to be processed that need color editing, and performing local color editing on these areas according to their respective mask images and image editing information, the naturalness of the edited target image can be effectively improved, avoiding color overflow in the target area or obvious color discontinuity between the target area and other areas. This largely ensures the visual effect of the target image and solves the technical problem of low accuracy in local color editing of images in related technologies.
[0061] In this embodiment of the application, generating at least one mask image based on image editing information includes: generating a first mask image based on the position of the target region in the image to be processed; performing semantic segmentation on the image to be processed based on the first mask image to generate a second mask image, wherein the second mask image is used to characterize the position of the region where the target object is located in the image to be processed; and determining the first mask image and / or the second mask image as at least one mask image.
[0062] The first mask image mentioned above can refer to the mask image corresponding to the target area. The second mask image mentioned above can refer to the mask image corresponding to the complete area that needs to be color edited.
[0063] In one optional embodiment, to improve the accuracy of the synthesized target image, when generating the corresponding mask image, the image processing system can first determine the position of the target region in the image to be processed, and generate a corresponding first mask image based on the position of the target region in the image to be processed. Then, based on the first mask, the image to be processed is further semantically segmented according to the position of the target object in the image to be processed to determine the second mask image corresponding to the position of the target object. Finally, the image processing system can use the first mask image as the generated mask image, or use the second mask image as the generated mask image, or use both the first mask image and the second mask image as the generated mask image to ensure the accuracy of the obtained mask image.
[0064] In this embodiment of the application, based on at least one mask image and image editing information, color editing is performed on the target object in the image to be processed to generate a target image, including: color editing is performed on different regions in the image to be processed based on the image editing information to obtain a first edited image; the first edited image and at least one mask image are input into an image generation model, and a second edited image is generated using the image generation model; the second edited image and the image to be processed are fused to obtain the target image.
[0065] In one optional embodiment, to improve the visual effect of the generated target image, when color editing the target object, the image processing system can first perform color editing on different regions of the image to be processed based on the acquired image editing information. For example, if a user paints three regions on the image to be processed using a brush, namely region 1, region 2, and region 3, these three regions can correspond to different target objects. The color parameters used by the user when painting these three regions are parameter 1, parameter 2, and parameter 3, respectively. Then, when the image editing information is acquired, the image processing system can first perform color editing on the different regions, namely region 1, region 2, and region 3, and the target objects corresponding to the different regions according to parameter 1, parameter 2, and parameter 3, to obtain the edited image to be processed, i.e., the above-mentioned... To avoid color overflow in the first edited image, after obtaining the first edited image, the image processing system can use a pre-trained image generation model, such as a diffusion model, to adjust the first edited image based on at least one generated mask image. This avoids obvious color overflow or color banding in the first edited image obtained by editing according to the image editing information, thus obtaining a second edited image with better visual effect. Finally, to further improve the visual effect of the target image displayed to the user, the image processing system can merge the image to be processed and the second edited image to make the color change in the edited area smoother, while preserving the details and textures of the non-edited area, avoiding sharp edges or loss of detail that may occur after direct color replacement.
[0066] In this embodiment of the application, color editing is performed on different regions of the image to be processed based on image editing information to obtain a first edited image, including: color editing of pixels in the target region of the image to be processed based on the color corresponding to the image editing information, and color editing of pixels in the region where the target object is located based on a preset color to obtain the first edited image.
[0067] The colors corresponding to the image editing information mentioned above can refer to the colors of the tools used by the user when selecting or painting. The preset colors mentioned above can refer to the colors used to emphasize the area where the target object is located, and can be different from the colors of other objects in the image to be processed, except for the target object; they are generally gray.
[0068] In one optional embodiment, to ensure the accuracy of local color editing of the image to be processed, when performing color editing on different regions of the image to be processed based on image editing information, the image processing system can first determine the target region and target object in the image to be processed that need color editing, and then perform color editing on the pixels of the target region according to the color corresponding to the image editing information. This ensures that the image generation model can clearly understand and execute the user's current local color editing requirements, such as specifying the color to be filled, contrast, transparency, and other color parameters. Furthermore, to ensure that the image generation model can accurately determine the region to be color edited from the image to be processed, i.e., accurately determine the region where the target object is located, and avoid the target object's own color being similar to the colors of other objects around it, thus affecting the local color editing process, the image processing system can perform color editing on the pixels of the target region according to the aforementioned preset color while performing color editing on the pixels of the target region, to obtain the corresponding first edited image.
[0069] In this embodiment of the application, the above method further includes: converting the image to be processed from a first color space to a second color space to obtain a first converted image; extracting a preset channel from the first converted image to obtain a control image; inputting a first edited image and at least one mask image into an image generation model, and using the image generation model to generate a second edited image, including: inputting the first edited image, at least one mask image and a control image into an image generation model, and using the image generation model to generate a second edited image.
[0070] The first color space mentioned above can refer to the color space of the image to be processed, such as the RGB (Red, Green, Blue) color space or the LAB (Lightness a*b*, a-channel, b-channel) color space (where the a-channel refers to the variation axis from red to green, and the b-channel refers to the variation axis from blue to yellow). The second color space mentioned above can refer to the color space used for color editing, which is different from the first color space. For example, if the first color space is the RGB color space, then the second color space can be the LAB color space; if the first color space is the LAB color space, then the second color space can be the RGB color space.
[0071] In one optional embodiment, considering that color changes in the RGB color space may appear unnatural due to changes in brightness, but color adjustments in the LAB color space are closer to the human eye's perception of color changes, making the edited colors look more natural and harmonious, the image generation system can first convert the image to be processed from the current first color space to the aforementioned second color space before using the image generation model. This involves converting the image from the RGB color space to the LAB color space to obtain the corresponding first converted image. Considering that in the LAB color space, the A and B channels represent color information, while the L channel represents brightness information, separating brightness and color information allows for more precise control of color changes during color editing without affecting brightness and contrast. This information separation method greatly enhances the effect of local color editing. Therefore, after obtaining the first converted image, the image processing system can further extract preset channels from the first converted image, such as the L channel, to obtain an image with better color processing control. After obtaining the control image, the image processing system can input the control image, combined with the first edited image and at least one mask image, into the image generation model to generate the corresponding second edited image. This allows the area where the edited target object is located to achieve a smoother color transition with other areas, thereby improving the visual effect of the generated second edited image.
[0072] In this embodiment, the image generation model includes a control module and an image generation module. Inputting a first edited image, at least one mask image, and a control image into the image generation model, and generating a second edited image using the image generation model, includes: inputting the control image into the control module and generating control information using the control module; inputting the first edited image, at least one mask image, and the control information into the image generation module and generating a second edited image using the image generation module, wherein the second edited image conforms to the control information.
[0073] In one optional embodiment, to improve the accuracy of the generated second edited image, the image generation model may include at least the aforementioned control module and image generation module. Based on this, when generating the second edited image, in order to accurately control the color changes of the image while maintaining consistency in brightness, detail, and structure, and achieving a natural and high-quality local color editing effect, the image generation system may first input a control image into the control module to generate corresponding control information, such as the brightness distribution characteristics, edge and structural features, and texture detail features of the control image. Then, the first edited image, at least one mask image, and the control information are input into the aforementioned image generation module, so that the image generation module can generate a second edited image with higher accuracy that conforms to the aforementioned control information based on these data.
[0074] In this embodiment of the application, fusing the second edited image and the image to be processed to obtain the target image includes: converting the image to be processed from a first color space to a second color space to obtain a first converted image; converting the second edited image from the first color space to the second color space to obtain a second converted image; fusing a preset channel in the first converted image with other channels in the second converted image to obtain a fused image, wherein the other channels are used to represent at least one channel other than the preset channel among the multiple channels corresponding to the second color space; and converting the fused image from the second color space to the first color space to obtain the target image.
[0075] The aforementioned other channels can refer to channels other than the preset channels in the second color space, such as channel A and channel B.
[0076] In one optional embodiment, to improve the fusion effect of the second edited image and the image to be processed, the image processing system can convert the image to be processed from the first color space to the second color space to obtain the corresponding first converted image, and simultaneously convert the second edited image from the first color space to the second color space to obtain the corresponding second converted image. In order to control brightness and color, achieve precise color adjustment, and maintain the visual naturalness and brightness consistency of the image to produce high-quality editing results, the image processing system can, after obtaining the first converted image and the second converted image, fuse the preset channel in the first converted image and other channels in the second converted image to obtain the corresponding fused image. Finally, the fused image is converted from the second color space to the first color space to obtain the target image with good local color editing effect, avoiding color overflow or color banding.
[0077] In this embodiment of the application, obtaining image editing information includes: upon receiving a color selection instruction, determining the color corresponding to the color selection instruction, wherein the color selection instruction is used to select a color to perform color editing on a target area; upon receiving a local smear instruction, determining the target area corresponding to the local smear instruction, wherein the local smear instruction is used to perform a smear operation on the target area; and generating image editing information based on the color corresponding to the color selection instruction and the target area corresponding to the local smear instruction.
[0078] In one optional embodiment, in order to accurately obtain the image editing information corresponding to the editing instruction, the image processing system can first determine the color corresponding to the color selection instruction when it detects a color selection instruction for color editing of the target area, and determine the target area to be smeared corresponding to the local smearing instruction when it detects a local smearing instruction for smearing the target area, and then generate the corresponding image editing information based on the determined color and the target area to be smeared.
[0079] For ease of understanding, Figure 4 This is a schematic diagram illustrating a detailed image processing process according to an embodiment of this application, such as... Figure 4 As shown, the image processing system first acquires the image to be processed that requires color editing and detects the target area and color applied by the user using the color editing tool on the operation interface to generate corresponding image editing information. For the image to be processed, the system first extracts the grayscale image L and inputs it into the control module to extract control information. Simultaneously, based on the image editing information, the system generates a mask image of the target area and the area containing the target object associated with it. It then performs preliminary editing on the image to be processed based on the image editing information to obtain the corresponding first edited image. After obtaining the first edited image, the mask image, and the control information, the system further inputs these three parameters into the image generation module to generate the corresponding second edited image. The second edited image is then fused with the extracted grayscale image L to perform image coloring, resulting in a visually appealing target image and avoiding color overflow or color banding in the target image. It should be noted that when generating the second edited image using the image generation module, the image processing system can also combine user-input prompts or default prompts to further ensure the degree of matching between the generated image and the user's needs.
[0080] In one optional embodiment, it should be noted that the training process of the image generation model used in this application can refer to the aforementioned image generation process. To improve the generation effect, the convolutional input channels used in the image generation model may include: received random noise (4 channels) + mask1 (1 channel) + mask2 (1 channel) + mask_image (4 channels). Furthermore, the first mask image and the second mask image generated during training can be distinguished using different characters. For example, the pixel values of the first mask image can be set to 0, and the pixel values of the second mask image can be set to 1 to improve the accuracy of the generated target image.
[0081] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of the relevant data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation portals are provided for users to choose to authorize or refuse.
[0082] It should be noted that, for the sake of simplicity, the foregoing method embodiments are all described as a series of actions. However, those skilled in the art should understand that this application is not limited to the described order of actions, as some steps may be performed in other orders or simultaneously according to this application. Furthermore, those skilled in the art should also understand that the embodiments described in the specification are preferred embodiments, and the actions and modules involved are not necessarily essential to this application.
[0083] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods according to the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, they can also be implemented by hardware. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk), and includes several instructions to cause a terminal device (which may be a mobile phone, computer, server, or network device, etc.) to execute the methods of the various embodiments of this application.
[0084] According to an embodiment of this application, another image processing method is also provided. Figure 5 This is a flowchart illustrating another image processing method according to an embodiment of this application, such as... Figure 5 As shown, the method may include the following steps:
[0085] Step S502: In response to the input command applied to the operation interface, determine the image to be processed corresponding to the input command.
[0086] Step S504: Respond to the image editing command applied to the operation interface and determine the image editing information corresponding to the image editing command.
[0087] Image editing information refers to the information obtained by color editing of the target area in the image to be processed.
[0088] Step S506: In response to the processing instructions applied to the operation interface, generate at least one mask image based on the image editing information.
[0089] Different mask images are used to represent the positions of different regions in the image to be processed. The different regions include at least one of the following: the target region, the region where the target object associated with the target region is located.
[0090] Step S508: Based on at least one mask image and image editing information, perform color editing on the target object in the image to be processed to generate a target image.
[0091] In one optional embodiment, when an input command triggered by a user on the interface is detected, the image processing system can first determine the image to be processed that requires color editing corresponding to the input command. When an image editing command triggered by a user on the interface is detected, the image processing system can further determine the image editing information obtained by the user currently performing color editing on the target area of the image to be processed. When a processing command triggered by a user on the interface is detected, the image processing system can construct a corresponding mask image based on the acquired image editing information, targeting one or more areas, including the target area and the area where the target object associated with the target area is located. Then, based on the constructed mask image and the acquired image editing information, the system performs local editing on the target object in the image to be processed to generate a target image with better visual effects, avoiding color overflow or color banding in the generated target image.
[0092] In this embodiment of the application, in response to an image editing instruction applied to the operation interface, determining the image editing information corresponding to the image editing instruction includes: in response to a color selection instruction applied to the operation interface, determining the color corresponding to the color selection instruction; in response to a local smear instruction applied to the operation interface, determining the target area corresponding to the local smear instruction; and generating image editing information based on the color corresponding to the color selection instruction and the target area corresponding to the local smear instruction.
[0093] In one optional embodiment, the image editing command triggered by the user on the operation interface may include at least a color selection command and a local smear command. In order to accurately obtain the image editing information corresponding to the editing command, the image processing system can first determine the color corresponding to the color selection command when it detects the color selection command triggered by the user on the operation interface, and determine the target area to be smeared corresponding to the local smear command when it detects the local smear command triggered by the user on the operation interface. Then, based on the determined color and smearing area, the image editing information corresponding to the image editing command is generated.
[0094] In this embodiment of the application, the method further includes: displaying a target image on an operation interface; responding to an adjustment command applied to the operation interface, determining new editing information corresponding to the adjustment command, and repeating the steps until at least one new mask image is generated based on the new editing information, and color editing of the target object in the image to be processed is performed based on at least one new mask image and the new editing information to generate a new image, until a confirmation command applied to the operation interface is obtained, wherein the confirmation command is used to indicate that the new image meets the preset requirements; and displaying the new image on the operation interface.
[0095] In one optional embodiment, to ensure that the final output image meets the user's color editing needs, after generating the target image, the image processing system can further display the target image to the user on the operation interface. If the user is satisfied with the currently displayed target image, the currently displayed target image can be the final output image. If the user is not satisfied with the currently displayed target image, the image processing system can detect the user's adjustment instruction for the image to be processed or the currently displayed target image, determine the new editing information corresponding to the adjustment instruction, and then repeat the aforementioned process. Based on the new editing information, at least one new mask image is generated, and based on at least one new mask image and the new editing information, the target object in the image to be processed is color-edited to generate a new target image, which is then displayed to the user again until the user is satisfied with the displayed image, for example, by triggering the aforementioned confirmation instruction on the operation interface. Finally, the image processing system can display the image that the user is satisfied with on the operation interface for easy viewing.
[0096] It should be noted that the above image processing process can be referred to the previous text, and will not be repeated here.
[0097] According to an embodiment of this application, another image processing method is also provided. Figure 6 This is a flowchart illustrating another image processing method according to an embodiment of this application, such as... Figure 6 As shown, the method may include the following steps:
[0098] Step S602: Obtain the image to be processed and image editing information by calling the first interface.
[0099] The first interface includes a first parameter, the value of which includes the image to be processed and image editing information. The image editing information is the information obtained by color editing of the target area in the image to be processed.
[0100] Step S604: Generate at least one mask image based on the image editing information.
[0101] Different mask images are used to represent the positions of different regions in the image to be processed. The different regions include at least one of the following: the target region, the region where the target object associated with the target region is located.
[0102] Step S606: Based on at least one mask image and image editing information, perform color editing on the target object in the image to be processed to generate a target image.
[0103] Step S608: Output the target image by calling the second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target image.
[0104] In one optional embodiment, during color editing, the image processing system first calls a first parameter through a first interface, namely, the image to be processed that needs color editing, and the image editing information obtained by the user through color editing of the target area in the image to be processed. Then, based on the image editing information, a mask image is generated for the target area painted by the user, the area where the target object associated with the target area is located, etc. The image to be processed is then color-edited based on the generated mask image and the image editing information to generate a target image with better visual effects, avoiding color overflow or color banding. Finally, the image processing system can output a second parameter, namely, the target image, through a second interface for user viewing.
[0105] It should be noted that the above image processing process can be referred to the previous text, and will not be repeated here.
[0106] According to embodiments of this application, an image processing apparatus for implementing the above-described image processing method is also provided. Figure 7 This is a structural block diagram of an image processing apparatus according to an embodiment of this application, such as... Figure 7 As shown, the device includes: an information acquisition module 702, an image generation module 704, and an image editing module 706.
[0107] The information acquisition module 702 is used to acquire the image to be processed and image editing information, wherein the image editing information is the information obtained by color editing of the target area in the image to be processed; the image generation module 704 is used to generate at least one mask image based on the image editing information, wherein different mask images are used to represent the positions of different regions in the image to be processed, and the different regions include at least one of the following: the target region, the region where the target object associated with the target region is located; the image editing module 706 is used to perform color editing on the target object in the image to be processed based on at least one mask image and image editing information to generate a target image.
[0108] In this embodiment of the application, the image generation module 704 is further configured to: generate a first mask image based on the position of the target region in the image to be processed; perform semantic segmentation on the image to be processed based on the first mask image to generate a second mask image, wherein the second mask image is used to characterize the position of the region where the target object is located in the image to be processed; and determine the first mask image and / or the second mask image as at least one mask image.
[0109] In this embodiment, the image editing module 706 is further configured to: perform color editing on different regions of the image to be processed based on image editing information to obtain a first edited image; input the first edited image and at least one mask image into an image generation model, and use the image generation model to generate a second edited image; and fuse the second edited image and the image to be processed to obtain a target image.
[0110] In this embodiment, the image editing module 706 is further configured to: perform color editing on the pixels of the target area in the image to be processed based on the color corresponding to the image editing information, and perform color editing on the pixels of the area where the target object is located based on the preset color, to obtain the first edited image.
[0111] In this embodiment of the application, the above-mentioned device further includes: a spatial conversion module, used to convert the image to be processed from a first color space to a second color space to obtain a first converted image; a channel extraction module, used to extract a preset channel in the first converted image to obtain a control image; and an image editing module 706 is further used to: input the first edited image, at least one mask image and the control image into an image generation model, and use the image generation model to generate a second edited image.
[0112] In this embodiment, the image generation model includes a control module and an image generation module; the image editing module 706 is further configured to: input a control image to the control module and generate control information using the control module; input a first edited image, at least one mask image, and control information to the image generation module and generate a second edited image using the image generation module, wherein the second edited image conforms to the control information.
[0113] In this embodiment, the image editing module 706 is further configured to: convert the image to be processed from a first color space to a second color space to obtain a first converted image; convert the second edited image from the first color space to the second color space to obtain a second converted image; fuse a preset channel in the first converted image with other channels in the second converted image to obtain a fused image, wherein the other channels are used to represent at least one channel other than the preset channel among the multiple channels corresponding to the second color space; and convert the fused image from the second color space to the first color space to obtain a target image.
[0114] In this embodiment of the application, the information acquisition module 702 is further configured to: upon receiving a color selection instruction, determine the color corresponding to the color selection instruction, wherein the color selection instruction is used to select a color to perform color editing on the target area; upon receiving a local smear instruction, determine the target area corresponding to the local smear instruction, wherein the local smear instruction is used to perform a smear operation on the target area; and generate image editing information based on the color corresponding to the color selection instruction and the target area corresponding to the local smear instruction.
[0115] It should be noted that the information acquisition module 702, image generation module 704, and image editing module 706 correspond to steps S202 to S206 in the above embodiments. The three modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules or units can be hardware or software components stored in memory and processed by one or more processors. The above modules can also run as part of the device in the server 10 provided in the above embodiments.
[0116] According to an embodiment of this application, another image processing apparatus for implementing the above-described image processing method is also provided. Figure 8 This is a structural block diagram of another image processing apparatus according to an embodiment of this application, such as... Figure 8 As shown, the device includes: a first execution module 802, a second execution module 804, a mask generation module 806, and an object editing module 808.
[0117] The first execution module 802 is used to respond to input commands applied to the operation interface and determine the image to be processed corresponding to the input command; the second execution module 804 is used to respond to image editing commands applied to the operation interface and determine the image editing information corresponding to the image editing command, wherein the image editing information is the information obtained by color editing of the target area in the image to be processed; the mask generation module 806 is used to respond to processing commands applied to the operation interface and generate at least one mask image based on the image editing information, wherein different mask images are used to represent the positions of different regions in the image to be processed, and the different regions include at least one of the following: the target region, the region where the target object associated with the target region is located; the object editing module 808 is used to perform color editing on the target object in the image to be processed based on at least one mask image and the image editing information to generate a target image.
[0118] In this embodiment of the application, the second execution module 804 is further configured to: respond to a color selection instruction applied to the operation interface and determine the color corresponding to the color selection instruction; respond to a local smear instruction applied to the operation interface and determine the target area corresponding to the local smear instruction; and generate image editing information based on the color corresponding to the color selection instruction and the target area corresponding to the local smear instruction.
[0119] In this embodiment of the application, the above-mentioned device further includes: a first display module, used to display a target image on an operation interface; a re-editing module, used to respond to an adjustment command applied to the operation interface, determine new editing information corresponding to the adjustment command, and repeat the steps until at least one new mask image is generated based on the new editing information, and the target object in the image to be processed is color-edited based on at least one new mask image and the new editing information to generate a new image, until a confirmation command applied to the operation interface is obtained, wherein the confirmation command is used to indicate that the new image meets preset requirements; and a second display module, used to display the new image on the operation interface.
[0120] It should be noted that the first execution module 802, the second execution module 804, the mask generation module 806, and the object editing module 808 mentioned above correspond to steps S502 to S508 in the above embodiments. The four modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules or units can be hardware or software components stored in memory and processed by one or more processors. The above modules can also run as part of the device in the server 10 provided in the above embodiments.
[0121] According to an embodiment of this application, another image processing apparatus for implementing the above-described image processing method is also provided. Figure 9This is a structural block diagram of another image processing apparatus according to an embodiment of this application, such as... Figure 9 As shown, the device includes: a first calling module 902, an image generation module 904, a color editing module 906, and a second calling module 908.
[0122] The first calling module 902 is used to obtain the image to be processed and image editing information by calling a first interface. The first interface includes a first parameter, the value of which includes the image to be processed and the image editing information. The image editing information is the information obtained by color editing of the target area in the image to be processed. The image generation module 904 is used to generate at least one mask image based on the image editing information. Different mask images are used to represent the positions of different regions in the image to be processed. Different regions include at least one of the following: the target region, the region where the target object associated with the target region is located. The color editing module 906 is used to perform color editing on the target object in the image to be processed based on at least one mask image and the image editing information to generate a target image. The second calling module 908 is used to output the target image by calling a second interface. The second interface includes a second parameter, the value of which includes the target image.
[0123] It should be noted that the first calling module 902, image generation module 904, color editing module 906, and second calling module 908 mentioned above correspond to steps S602 to S608 in the above embodiments. The four modules and their corresponding steps implement the same instances and application scenarios, but are not limited to the content disclosed in the above embodiments. It should be noted that the above modules or units can be hardware or software components stored in memory and processed by one or more processors. The above modules can also run as part of the device in the server 10 provided in the above embodiments.
[0124] According to embodiments of this application, an image processing system is also provided. Figure 10 This is a structural block diagram of an image processing system according to an embodiment of this application, such as... Figure 10 As shown, the system may include: client 1002 and server 1004.
[0125] The client 1002 is used to send the image to be processed and image editing information, wherein the image editing information is the information obtained by color editing of the target area in the image to be processed; the server 1004 is connected to the client and is used to generate at least one mask image based on the image editing information, and to perform color editing on the target object in the image to be processed based on at least one mask image and the image editing information to generate a target image, wherein different mask images are used to represent the positions of different regions in the image to be processed, and the different regions include at least one of the following: the target region, the region where the target object associated with the target region is located; the client 1002 is also used to output the target image.
[0126] It should be noted that the preferred embodiments involved in the above embodiments of this application are the same as the solutions, application scenarios and implementation processes provided in the above embodiments, but are not limited to the solutions provided in the above embodiments.
[0127] Embodiments of this application may provide a computing device. Figure 11 This is a structural block diagram of a computing device according to an embodiment of this application. Figure 11 As shown, the computing device 1100 may include one or more (only one is shown in the figure) processors 1102, memory 114, memory controller, and peripheral interfaces.
[0128] The aforementioned computing device can be understood as an integrated smart terminal, including but not limited to servers, desktop computers, PCs (Personal Computers), all-in-one model machines, etc., and the computing device may have the model in the above embodiments of this application pre-installed.
[0129] Specifically, this computing device can pre-install various types of models, including but not limited to models in natural language processing, visual processing, speech processing, code processing, and multimodal task processing, thus providing diverse model selection. In different product forms, this computing device can support one or more model usage methods, including but not limited to model training, model invocation, model fine-tuning, model deployment, model inference, and application. In some product forms, this computing device also supports model management, including but not limited to multi-type model management (supporting the management of discriminative, generative, and other model types), model version control (supporting the control of different model versions), and model evaluation (evaluating model performance and effectiveness based on model evaluation tools). In other product forms, this computing device can also create applications based on models, providing API calling capabilities, allowing models to be called into created applications through API interfaces, and providing application management tools to achieve application control.
[0130] Furthermore, the computing device may also include data management (supporting the creation and management of model tuning datasets), a training center (providing abundant training resources to help users learn and master AI technology), and basic control capabilities (providing enterprise-level basic control capabilities to ensure the security and efficient operation of the system). Through the above functions, it provides a comprehensive and integrated device for AI development, training, deployment, and application.
[0131] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the methods in the above embodiments. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0132] The processor can invoke an executable program stored in memory via a transmission device to execute any of the methods described in the above embodiments.
[0133] Embodiments of this application may provide an electronic device. Figure 12 This is a structural block diagram of an electronic device according to an embodiment of this application. As shown in the figure, the electronic device may include: an input / output device 1202; a memory 1204; and a processor 1206, wherein the processor 1206 is connected to the input / output device 1202 and the memory 1204 via a bus 1208.
[0134] The memory can be used to store software programs and modules, such as the program instructions / modules corresponding to the methods and apparatus in the embodiments of this application. The processor executes various functional applications and data processing by running the software programs and modules stored in the memory, thereby implementing the methods in the above embodiments. The memory may include high-speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include memory remotely located relative to the processor, and these remote memories can be connected to terminal A via a network. Examples of such networks include, but are not limited to, the Internet, corporate intranets, local area networks, mobile communication networks, and combinations thereof.
[0135] The processor can invoke an executable program stored in memory via a transmission device to execute any of the methods described in the above embodiments.
[0136] It will be understood by those skilled in the art that the structure shown in the figure is merely illustrative, and the computing device can also be a smartphone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile internet device (MID), a PAD (Personal Digital Assistant), and other terminal devices. Figure 12 This does not limit the structure of the aforementioned computing device. For example, computing device 100 may also include components that are more advanced than those described above. Figure 12 The more or fewer components shown (such as network interfaces, display devices, etc.), or having the same as the Figure 12 The different configurations shown.
[0137] Those skilled in the art will understand that all or part of the steps in the various methods of the above embodiments can be implemented by a program instructing the hardware related to the terminal device. The program can be stored in a computer-readable storage medium, which may include: flash drive, read-only memory (ROM), random access memory (RAM), disk or optical disk, etc.
[0138] Embodiments of this application also provide a computer-readable storage medium. Optionally, in this embodiment, the computer-readable storage medium can be used to store program code executed by the method provided in the above embodiments.
[0139] Optionally, in this embodiment, the storage medium may be located in a computing device.
[0140] Optionally, in this embodiment, the computer-readable storage medium is configured to store an executable program, which, when the executable program is running, controls the device where the computer-readable storage medium is located to execute any of the methods described in the above embodiments.
[0141] Embodiments of this application also provide a computer program product. Optionally, in this embodiment, the computer program product may include a computer program that, when executed by a processor, implements the methods provided in the embodiments described above.
[0142] Embodiments of this application also provide a computer program product. Optionally, the computer program product may include a non-volatile computer-readable storage medium, which can be used to store a computer program that, when executed by a processor, implements the method provided in the above embodiments.
[0143] Embodiments of this application also provide a computer program. Optionally, in this embodiment, when the computer program is executed by a processor, it implements the method provided in the above embodiments.
[0144] In the above embodiments of this application, the descriptions of each embodiment have different focuses. For parts not described in detail in a certain embodiment, please refer to the relevant descriptions of other embodiments.
[0145] In the several embodiments provided in this application, it should be understood that the disclosed technical content can be implemented in other ways. The device embodiments described above are merely illustrative; for example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Furthermore, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some interfaces; indirect couplings or communication connections between units or modules may be electrical or other forms.
[0146] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0147] Furthermore, the functional units in the various embodiments of this application can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit. The integrated unit can be implemented in hardware or as a software functional unit.
[0148] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or all or part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods of the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as a USB flash drive, read-only memory (ROM), random access memory (RAM), portable hard drive, magnetic disk, or optical disk.
[0149] The above are merely preferred embodiments of this application. It should be noted that those skilled in the art can make various improvements and modifications without departing from the principles of this application, and these improvements and modifications should also be considered within the scope of protection of this application.
Claims
1. An image processing method, characterized in that, include: The image to be processed and image editing information are obtained, wherein the image editing information is information obtained by color editing of the target area in the image to be processed; Based on the image editing information, at least one mask image is generated, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: the target region, the region where the target object associated with the target region is located; Based on the at least one mask image and the image editing information, the target object in the image to be processed is color-edited to generate a target image.
2. The method according to claim 1, characterized in that, The step of generating at least one mask image based on the image editing information includes: Based on the position of the target region in the image to be processed, a first mask image is generated; Based on the first mask image, semantic segmentation is performed on the image to be processed to generate a second mask image, wherein the second mask image is used to characterize the location of the target object in the image to be processed; The first mask image and / or the second mask image are determined as the at least one mask image.
3. The method according to claim 1, characterized in that, The step of performing color editing on the target object in the image to be processed, based on the at least one mask image and the image editing information, to generate a target image includes: Based on the image editing information, color editing is performed on different regions of the image to be processed to obtain a first edited image; The first edited image and the at least one mask image are input into the image generation model, and the second edited image is generated using the image generation model. The second edited image and the image to be processed are merged to obtain the target image.
4. The method according to claim 3, characterized in that, The step of performing color editing on different regions of the image to be processed based on the image editing information to obtain a first edited image includes: Based on the color corresponding to the image editing information, the pixels of the target region in the image to be processed are color-edited, and the pixels of the region where the target object is located are color-edited based on a preset color to obtain the first edited image.
5. The method according to claim 3, characterized in that, The method further includes: The image to be processed is converted from the first color space to the second color space to obtain the first converted image; Extract the preset channels from the first converted image to obtain the control image; Inputting the first edited image and the at least one mask image into an image generation model, and using the image generation model to generate a second edited image, includes: The first edited image, the at least one mask image, and the control image are input into the image generation model, and the second edited image is generated using the image generation model.
6. The method according to claim 5, characterized in that, The image generation model includes a control module and an image generation module; the step of inputting the first edited image, the at least one mask image, and the control image into the image generation model, and generating the second edited image using the image generation model, includes: The control image is input to the control module, and the control module generates control information. The first edited image, the at least one mask image, and the control information are input into the image generation module, and the second edited image is generated using the image generation module, wherein the second edited image conforms to the control information.
7. The method according to claim 3, characterized in that, The step of fusing the second edited image and the image to be processed to obtain the target image includes: The image to be processed is converted from the first color space to the second color space to obtain the first converted image; The second edited image is converted from the first color space to the second color space to obtain the second converted image; A preset channel in the first converted image is fused with other channels in the second converted image to obtain a fused image, wherein the other channels are used to represent at least one channel other than the preset channel among the multiple channels corresponding to the second color space; The fused image is converted from the second color space to the first color space to obtain the target image.
8. The method according to any one of claims 1 to 7, characterized in that, The acquisition of image editing information includes: Upon receiving a color selection instruction, the color corresponding to the color selection instruction is determined, wherein the color selection instruction is used to select a color to perform color editing on the target area; Upon receiving a local smear instruction, the target area corresponding to the local smear instruction is determined, wherein the local smear instruction is used to perform a smear operation on the target area; The image editing information is generated based on the color corresponding to the color selection instruction and the target area corresponding to the local smear instruction.
9. An image processing method, characterized in that, include: In response to an input command applied to the user interface, determine the image to be processed corresponding to the input command; In response to an image editing command applied to the operation interface, image editing information corresponding to the image editing command is determined, wherein the image editing information is information obtained by color editing of a target area in the image to be processed; In response to the processing instructions applied to the operation interface, at least one mask image is generated based on the image editing information. Different mask images are used to characterize the positions of different regions in the image to be processed. The different regions include at least one of the following: the target region, the region where the target object associated with the target region is located; Based on the at least one mask image and the image editing information, the target object in the image to be processed is color-edited to generate a target image.
10. The method according to claim 9, characterized in that, The response to the image editing command applied to the user interface, determining the image editing information corresponding to the image editing command, includes: In response to a color selection command applied to the operation interface, determine the color corresponding to the color selection command; In response to a local smear command applied to the operation interface, the target area corresponding to the local smear command is determined; The image editing information is generated based on the color corresponding to the color selection instruction and the target area corresponding to the local smear instruction.
11. The method according to claim 9, characterized in that, The method further includes: The target image is displayed on the user interface; In response to an adjustment command applied to the operation interface, the new editing information corresponding to the adjustment command is determined, and the process is repeated until at least one new mask image is generated based on the new editing information, and the target object in the image to be processed is color-edited based on the at least one new mask image and the new editing information to generate a new image, until a confirmation command applied to the operation interface is obtained, wherein the confirmation command is used to indicate that the new image meets the preset requirements; The new image is displayed on the user interface.
12. An image processing method, characterized in that, include: The image to be processed and image editing information are obtained by calling a first interface. The first interface includes a first parameter, the value of which includes the image to be processed and the image editing information. The image editing information is information obtained by color editing of a target area in the image to be processed. Based on the image editing information, at least one mask image is generated, wherein different mask images are used to characterize the positions of different regions in the image to be processed, and the different regions include at least one of the following: the target region, the region where the target object associated with the target region is located; Based on the at least one mask image and the image editing information, the target object in the image to be processed is color-edited to generate a target image; The target image is output by calling a second interface, wherein the second interface includes a second parameter, and the parameter value of the second parameter includes the target image.
13. An image processing system, characterized in that, include: A client is used to send an image to be processed and image editing information, wherein the image editing information is information obtained by color editing of a target area in the image to be processed; The server, connected to the client, is configured to generate at least one mask image based on the image editing information, and to perform color editing on the target object in the image to be processed based on the at least one mask image and the image editing information to generate a target image. The different mask images are used to characterize the positions of different regions in the image to be processed. The different regions include at least one of the following: the target region, the region where the target object associated with the target region is located. The client is also used to output the target image.
14. A computing device, characterized in that, include: Memory, which stores executable programs; A processor for running the program, wherein the program, when running, performs the method according to any one of claims 1 to 12.
15. An electronic device, characterized in that, include: Memory, which stores executable programs; A processor, connected to the memory via a bus, is used to run the program, wherein the program executes the method according to any one of claims 1 to 12.
16. A computer-readable storage medium, characterized in that, The computer-readable storage medium includes a stored executable program, wherein, when the executable program is executed, it controls the device on which the computer-readable storage medium is located to perform the method according to any one of claims 1 to 12.
17. A computer program product, characterized in that, It includes a computer program that, when executed by a processor, implements the method described in any one of claims 1 to 12.