Image processing method and device, medium and electronic equipment

By changing and stylizing the color channel sequence of images, the changes in the face special effect color are achieved, solving the problems of large performance overhead and high labor costs in the prior art, and improving efficiency and coverage.

CN119540032APending Publication Date: 2025-02-28BEIJING ZITIAO NETWORK TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202311088564.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-08-25
Publication Date
2025-02-28

AI Technical Summary

Technical Problem

When changing the face color of the face special effects of the prior art, it is necessary to add a new face segmentation model, resulting in large performance overhead, increased labor costs, and inability to effectively deal with non-face special effects.

Method used

By converting the original color channels of the image to be processed into the target color channel sequence, the image processing model is used to stylize the target area, and finally restore the color channels in sequence to achieve the change of the color of the target area.

Benefits of technology

Reduces performance overhead, avoids the impact on the grading and coverage of special effects model, improves the efficiency of area color change, and reduces labor costs.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119540032A_ABST
    Figure CN119540032A_ABST
Patent Text Reader

Abstract

The invention relates to an image processing method and device, a medium and electronic equipment, belongs to the technical field of computers, and can realize regional color change at low cost. The image processing method comprises the steps that a to-be-processed image is received, and the to-be-processed image comprises a target area of which the color needs to be changed; converting an original color channel sequence of the to-be-processed image into a target color channel sequence to obtain a first intermediate image; an image processing model is adopted to carry out stylization processing on an area, corresponding to the target area, in the first intermediate image, a second intermediate image is obtained, and the color of the area, corresponding to the target area, in the second intermediate image is different from the color corresponding to the target color channel sequence; the color channel sequence of the second intermediate image is restored to the original color channel sequence, a target image is obtained, and the color of an area corresponding to the target area in the target image is different from the color of the target area in the to-be-processed image.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of computer technology, and in particular, to an image processing method, device, medium and electronic device. Background Art

[0002] The usual practice for changing the facial color of face effects is as follows: first, a face segmentation model is added to the sticker package, and the algorithm runs in real time to obtain the face mask for each frame; then, the designer designs a filter and puts it into the sticker package to adjust the face color, and uses the segmented face mask to avoid changes in the user's background color.

[0003] The above-mentioned face color changing method has the following problems: (1) It is necessary to add a new face segmentation model, which has a large performance overhead, directly affecting the model classification and coverage of special effects, and ultimately affecting the launch of props; (2) Even if the effect loss can be accepted to maintain performance, the face segmentation model is used, but for some non-face special effects, ordinary face segmentation models cannot segment out accurate masks, resulting in unacceptable final effects; (3) Designers are required to design filters, which increases certain labor costs. Summary of the invention

[0004] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.

[0005] In a first aspect, the present disclosure provides an image processing method, comprising: receiving an image to be processed, the image to be processed comprising a target area whose color needs to be changed; transforming an original color channel order of the image to be processed into a target color channel order to obtain a first intermediate image; using an image processing model to perform stylization processing on an area corresponding to the target area in the first intermediate image to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel order; restoring the color channel order of the second intermediate image to the original color channel order to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed.

[0006] In a second aspect, the present disclosure provides an image processing device, including: a receiving module, used to receive an image to be processed, the image to be processed including a target area whose color needs to be changed; a channel transformation module, used to transform the original color channel order of the image to be processed into a target color channel order to obtain a first intermediate image; a stylization module, used to perform stylization processing on an area corresponding to the target area in the first intermediate image using an image processing model to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel order; and a channel restoration module, used to restore the color channel order of the second intermediate image to the original color channel order to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed.

[0007] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processing device, implements the steps of any one of the methods described in the first aspect of the present disclosure.

[0008] In a fourth aspect, the present disclosure provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any one of the methods described in the first aspect of the present disclosure.

[0009] By adopting the above technical solution, since the original color channel sequence of the image to be processed can be transformed into the target color channel sequence, a first intermediate image is obtained, and the image processing model is used to perform stylized processing on the area corresponding to the target area in the first intermediate image to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel sequence, and then the color channel sequence of the second intermediate image is restored to the original color channel sequence to obtain the target image, and the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed. In this way, by combining the image processing model capable of stylized processing with the color channel sequence transformation and restoration, the color change of the target area in the image to be processed is achieved at a low cost. Since the image processing method according to the embodiment of the present disclosure does not require a segmentation model, the performance overhead is greatly reduced, and the model grading and coverage of special effects will not be affected, and the props will not be affected, and the efficiency of regional color change is improved. Since no designer participation is required, for example, no designer is required to participate in the design of filters, the labor cost is greatly reduced.

[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings:

[0012] Figure 1 is a flowchart of an image processing method according to an embodiment of the present disclosure.

[0013] Figure 2 It is a flowchart of using an image processing model to perform stylized processing on an area corresponding to a target area in a first intermediate image according to an embodiment of the present disclosure.

[0014] Figure 3 The present invention is a flowchart of obtaining an image processing model according to an embodiment of the present invention.

[0015] Figure 4 is another flowchart of acquiring an image processing model according to an embodiment of the present disclosure.

[0016] Figure 5a and Figure 5b It is a schematic diagram of the stylized processing effect of the image processing model according to an embodiment of the present disclosure.

[0017] Figures 6a to 6d It is a schematic diagram of the image processing effect of the image processing method according to an embodiment of the present disclosure.

[0018] Figure 7 is a schematic block diagram of an image processing device according to an embodiment of the present disclosure.

[0019] Figure 8 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION

[0020] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.

[0021] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.

[0022] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.

[0023] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.

[0024] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".

[0025] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.

[0026] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.

[0027] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.

[0028] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.

[0029] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.

[0030] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.

[0031] Figure 1 FIG. 1 is a flowchart of an image processing method according to an embodiment of the present disclosure. Figure 1 As shown, the image processing method includes the following steps S11 to S14.

[0032] In step S11, an image to be processed is received, wherein the image to be processed includes a target area whose color needs to be changed.

[0033] For example, if the image to be processed is an image containing a face, and the color of the face needs to be changed, then the target area mentioned above refers to the face area.

[0034] In step S12, the original color channel order of the image to be processed is transformed into the target color channel order to obtain a first intermediate image.

[0035] In some embodiments, the original color channel order and the target color channel order are respectively one of the following color channel orders and are different from each other: RGB, RBG, GRB, GBR, BRG, BGR. For example, the original color channel order is RGB, and the target color channel order is RBG.

[0036] In step S13, an image processing model is used to perform stylization processing on the area in the first intermediate image corresponding to the target area to obtain a second intermediate image, wherein the color of the area in the second intermediate image corresponding to the target area is different from the color corresponding to the target color channel sequence.

[0037] Taking the image to be processed containing a face as an example, the face is the target area whose color needs to be changed. After the color channel sequence is transformed in step S12, the overall color of the image to be processed becomes the first color, that is, the overall color of the first intermediate image is the first color. After the image processing model is used to stylize the area corresponding to the face area in the first intermediate image, the face area in the first intermediate image becomes the second color, that is, the color of the face area in the second intermediate image is the second color, while the color of the area outside the face area in the second intermediate image is still the first color.

[0038] In some embodiments, the image processing model involved in the present disclosure may be an image processing model using a generative adversarial network (GAN), or may be other image processing models, such as an image processing model based on a neural network.

[0039] In some embodiments, when performing stylization processing, the image processing model may only change the color of the area corresponding to the target area in the first intermediate image, or may change the appearance of the area corresponding to the target area in the first intermediate image and change the color of the area corresponding to the target area at the same time. That is, the stylization processing may include deformation processing and color change processing.

[0040] Figure 2 This is a flow chart of performing stylization processing on a region corresponding to a target region in a first intermediate image using an image processing model according to an embodiment of the present disclosure. The flow includes steps S131 to S134.

[0041] In step S131, an area in the first intermediate image corresponding to the target area is identified.

[0042] In step S132, the identified area is converted into image data.

[0043] In step S133, the image data is stylized using the image processing model to obtain a regional image, wherein the color of the regional image is different from the color corresponding to the target color channel sequence.

[0044] In step S134, the area outside the area corresponding to the target area in the first intermediate image and the area image are processed to obtain the second intermediate image. For example, the area outside the area corresponding to the target area in the first intermediate image and the area image may be fused.

[0045] In addition, it should be noted that in addition to first transforming the color channel order of the image to be processed received in step S11, and then using the image processing model to perform stylized processing on the area corresponding to the target area in the image to be processed after the color channel order transformation, it is also possible to first identify the target area in the image to be processed received in step S11 to obtain data of the target area, then convert the data of the target area into image data, and then transform the color channel order of the image data into a target color channel order, and then input the image data with the color channel order as the target color channel order into the image processing model for stylized processing to obtain a second intermediate image.

[0046] In step S14, the color channel sequence of the second intermediate image is restored to the original color channel sequence to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed. That is, after the color channel sequence transformation process in step S12 and the stylization process using the image processing model in step S13, the color of the area corresponding to the target area in the obtained second intermediate image is normal, while the colors of other areas are abnormal. By restoring the color channel sequence in step S14, the color of the area outside the target area in the second intermediate image can be restored to the color of the area outside the target area in the image to be processed, and the color of the area corresponding to the target area in the second intermediate image can be changed to a color different from the color of the target area in the image to be processed. That is, the color of the area corresponding to the target area in the final target image is different from the color of the target area in the image to be processed, and the color of the area outside the area corresponding to the target area in the final target image is the same as the color of the area outside the target area in the image to be processed.

[0047] For example, if the original color channel order of the image to be processed received in step S11 is RGB, then in step S14 the color channel order of the second intermediate image will be restored to RGB.

[0048] By adopting the above technical solution, since the original color channel sequence of the image to be processed can be transformed into the target color channel sequence, a first intermediate image is obtained, and the image processing model is used to perform stylized processing on the area corresponding to the target area in the first intermediate image to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel sequence, and then the color channel sequence of the second intermediate image is restored to the original color channel sequence to obtain the target image, and the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed. In this way, by combining the image processing model capable of stylized processing with the color channel sequence transformation and restoration, the color change of the target area in the image to be processed is achieved at a low cost. Since the image processing method according to the embodiment of the present disclosure does not require a segmentation model, the performance overhead is greatly reduced, and the model grading and coverage of special effects will not be affected, and the props will not be affected, and the efficiency of regional color change is improved. Since no designer participation is required, for example, no designer is required to participate in the design of filters, the labor cost is greatly reduced.

[0049] In some embodiments, when the image processing model performs stylization processing on the area corresponding to the target area in the first intermediate image, the color channel order of the area corresponding to the target area in the first intermediate image is processed into the original color channel order of the image to be processed. For example, the color channel order of the first intermediate image obtained after the color channel order conversion in step S12 is the target color channel order, and then, the stylization processing of the image processing model in step S13 can process the color channel order of the area corresponding to the target area in the first intermediate image from the target color channel order to the original color channel order of the image to be processed, while the color channel order of the area outside the area corresponding to the target area in the first intermediate image is maintained as the target color channel order, so as to obtain a second intermediate image, and then after the color channel order restoration processing in step S14, the color channel order of the area outside the area corresponding to the target area in the second intermediate image is restored from the target color channel order to the original color channel order of the image to be processed, and the color channel order of the area corresponding to the target area in the second intermediate image is changed to the target color channel order, so as to achieve the purpose of changing the color of only the target area in the image to be processed.

[0050] Figure 3 The present invention is a flowchart of obtaining an image processing model according to an embodiment of the present invention.

[0051] like Figure 3 As shown, first in step S31, a mask of the area to be stylized of the data sample in the paired data is obtained, wherein the paired data includes the data sample and the real sample, and the real sample includes the stylized reference area. The stylized reference area is the reference of the area to be stylized of the data sample, that is, the trained image processing model can stylize the area to be stylized of the data sample so that it becomes the same as the stylized deformation reference area.

[0052] Then, in step S32, the image processing model is trained in combination with the mask of the area to be stylized and the stylized reference area to obtain the image processing model.

[0053] During the training process, the image processing model can stylize the mask of the area to be stylized, and then compare the stylized processing result with the stylized reference area in the real sample to determine the authenticity of the stylized processing result, and correct the parameters of the image processing model based on the judgment result. This process is repeated over and over again to complete the training of the image processing model.

[0054] By adopting the above technical solution, it is possible to obtain an image processing model that can perform stylized processing, such as an image processing model based on a GAN network.

[0055] Figure 4 is another flowchart of acquiring an image processing model according to an embodiment of the present disclosure.

[0056] like Figure 4 As shown, first, in step S41, the color channel order of the data samples in the paired data is changed, wherein the paired data includes the data samples and real samples, and the real samples include the stylized reference area.

[0057] In some embodiments, the order of the color channels of the data samples may be randomly shuffled.

[0058] Then, in step S42, a mask of the area to be stylized of the data sample after the color channel sequence is changed is obtained.

[0059] Then, in step S43, the image processing model is trained in combination with the mask of the area to be stylized and the stylized reference area to obtain the image processing model.

[0060] During the training process, the image processing model can stylize the mask of the area to be stylized, and then compare the stylized processing result with the stylized reference area in the real sample to determine the authenticity of the stylized processing result, and correct the parameters of the image processing model based on the judgment result. This process is repeated over and over again to complete the training of the image processing model.

[0061] By adopting the above technical solution, it is possible to obtain an image processing model that can perform stylized processing, such as an image processing model based on a GAN network. Moreover, by disrupting the color channel order of the data sample during the training process, it is ensured that the training process keeps the color unchanged, that is, no matter how the background color of the data sample changes, it is ensured that the color of the target area in the image output by the trained image processing model is the target color.

[0062] Figure 5a and Figure 5b is a schematic diagram of the stylized processing effect of the image processing model according to an embodiment of the present disclosure. Figure 5a and Figure 5b As shown, after a real face of a woman is stylized by the image processing model, the face of the output image becomes the appearance of the stylized reference area. After a real face of a man is stylized by the image processing model, the face of the output image also becomes the appearance of the stylized reference area. That is, after the stylization processing by the image processing model, the faces of the man and the woman are both transformed into the appearance of the same stylized reference area.

[0063] Figures 6a to 6dIt is a schematic diagram of the image processing effect of the image processing method according to an embodiment of the present disclosure. Figure 6a is the image to be processed. Figure 6b Yes Figure 6a A first image is obtained after the image to be processed is processed by sequentially transforming the color channels, and the face color and the background color of the first image are both changed into the first color. Figure 6c The second image is obtained by stylizing the face area of ​​the first image using an image processing model. The background color of the second image remains the first color, while the face color of the second image becomes the second color. Figure 6d The third image is obtained by restoring the color channel sequence of the second image. The background color of the third image is restored to the original background color of the image to be processed, that is, Figure 6a The background color in the third image is changed to the color of the face. Figure 6a The face color in a different third color.

[0064] Figure 7 FIG. 1 is a schematic block diagram of an image processing device according to an embodiment of the present disclosure. Figure 7 As shown, the image processing device includes: a receiving module 71, used to receive an image to be processed, wherein the image to be processed includes a target area that needs to change color; a channel conversion module 72, used to convert the original color channel sequence of the image to be processed into a target color channel sequence to obtain a first intermediate image; a stylization module 73, used to perform stylization processing on the area corresponding to the target area in the first intermediate image using an image processing model to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel sequence; a channel restoration module 74, used to restore the color channel sequence of the second intermediate image to the original color channel sequence to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed.

[0065] By adopting the above technical solution, since the original color channel sequence of the image to be processed can be transformed into the target color channel sequence, a first intermediate image is obtained, and the image processing model is used to perform stylized processing on the area corresponding to the target area in the first intermediate image to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel sequence, and then the color channel sequence of the second intermediate image is restored to the original color channel sequence to obtain the target image, and the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed. In this way, by combining the image processing model capable of stylized processing with the color channel sequence transformation and restoration, the color change of the target area in the image to be processed is achieved at a low cost. Since the image processing method according to the embodiment of the present disclosure does not require a segmentation model, the performance overhead is greatly reduced, and the model grading and coverage of special effects will not be affected, and the props will not be affected, and the efficiency of regional color change is improved. Since no designer participation is required, for example, no designer is required to participate in the design of filters, the labor cost is greatly reduced.

[0066] Optionally, the original color channel order and the target color channel order are respectively one of the following color channel orders and are different from each other: RGB, RBG, GRB, GBR, BRG, BGR.

[0067] Optionally, the stylization module 73 uses an image processing model to perform stylization processing on the area corresponding to the target area in the first intermediate image to obtain a second intermediate image, including: identifying the area corresponding to the target area in the first intermediate image; converting the identified area into image data; using the image processing model to perform stylization processing on the image data to obtain a regional image, wherein the color of the regional image is different from the color corresponding to the target color channel sequence; processing the area other than the area corresponding to the target area in the first intermediate image and the regional image to obtain the second intermediate image.

[0068] Optionally, the stylization module 73 processes the area outside the area corresponding to the target area in the first intermediate image and the regional image, including: fusing the area outside the area corresponding to the target area in the first intermediate image and the regional image.

[0069] Optionally, the image processing device also includes a model acquisition module, which is used to acquire the image processing model in the following manner: acquiring a mask of an area to be stylized of a data sample in paired data, wherein the paired data includes the data sample and a real sample, and the real sample includes a stylized reference area; and training the image processing model in combination with the mask of the area to be stylized and the stylized reference area to obtain the image processing model.

[0070] Optionally, the model acquisition module is further used to: before obtaining the mask of the area to be stylized of the data sample in the paired data, change the color channel order of the data sample; then the model acquisition module obtains the mask of the area to be stylized of the data sample in the paired data, including: obtaining the mask of the area to be stylized of the data sample after the color channel order is changed.

[0071] Optionally, the model acquisition module changes the color channel order of the data samples, including: randomly disrupting the color channel order of the data samples.

[0072] The specific implementation method of the operations performed by each module in the image processing device described in the embodiment of the present disclosure has been described in detail in the relevant method and will not be repeated here.

[0073] The present disclosure also provides a computer-readable medium having a computer program stored thereon, which implements the steps of any method described in the present disclosure when the program is executed by a processing device.

[0074] The present disclosure also provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any method described in the present disclosure.

[0075] Reference below Figure 8 , which shows a schematic diagram of the structure of an electronic device 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, laptop computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle terminals (such as vehicle navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 8 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.

[0076] like Figure 8As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0077] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 8 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.

[0078] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.

[0079] It should be noted that the computer-readable medium disclosed above may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that may be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. The computer readable signal medium may also be any computer readable medium other than a computer readable storage medium, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.

[0080] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.

[0081] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.

[0082] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: receives an image to be processed, wherein the image to be processed includes a target area whose color needs to be changed; transforms the original color channel order of the image to be processed into a target color channel order to obtain a first intermediate image; uses an image processing model to perform stylization processing on an area corresponding to the target area in the first intermediate image to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel order; restores the color channel order of the second intermediate image to the original color channel order to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed.

[0083] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages ​​or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0084] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0085] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of a module does not limit the module itself in some cases. For example, a receiving module may also be described as a "module for receiving an image to be processed".

[0086] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.

[0087] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.

[0088] According to one or more embodiments of the present disclosure, Example 1 provides an image processing method, including: receiving an image to be processed, the image to be processed including a target area whose color needs to be changed; transforming the original color channel order of the image to be processed into a target color channel order to obtain a first intermediate image; using an image processing model to perform stylization processing on an area in the first intermediate image corresponding to the target area to obtain a second intermediate image, wherein the color of the area in the second intermediate image corresponding to the target area is different from the color corresponding to the target color channel order; restoring the color channel order of the second intermediate image to the original color channel order to obtain a target image, wherein the color of the area in the target image corresponding to the target area is different from the color of the target area in the image to be processed.

[0089] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein the original color channel order and the target color channel order are respectively one of the following color channel orders and are different from each other: RGB, RBG, GRB, GBR, BRG, BGR.

[0090] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 1, wherein the use of an image processing model to perform stylized processing on the area in the first intermediate image corresponding to the target area to obtain a second intermediate image includes: identifying the area in the first intermediate image corresponding to the target area; converting the identified area into image data; using the image processing model to perform stylized processing on the image data to obtain a regional image, wherein the color of the regional image is different from the color corresponding to the target color channel sequence; and processing the area outside the area in the first intermediate image corresponding to the target area and the regional image to obtain the second intermediate image.

[0091] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 3, wherein the processing of the area outside the area corresponding to the target area in the first intermediate image and the area image includes: fusing the area outside the area corresponding to the target area in the first intermediate image and the area image.

[0092] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 1, wherein the image processing model is acquired in the following manner: acquiring a mask of an area to be stylized of a data sample in paired data, wherein the paired data includes the data sample and a real sample, and the real sample includes a stylized reference area; and training the image processing model in combination with the mask of the area to be stylized and the stylized reference area to obtain the image processing model.

[0093] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 5, wherein the method further comprises: before obtaining a mask of a region to be stylized of the data sample in the paired data, changing a color channel order of the data sample;

[0094] The obtaining of the mask of the region to be stylized of the data sample in the paired data includes: obtaining the mask of the region to be stylized of the data sample after the color channel sequence is changed.

[0095] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein changing the color channel order of the data samples includes: randomly disrupting the color channel order of the data samples.

[0096] According to one or more embodiments of the present disclosure, Example 8 provides an image processing device, including: a receiving module, used to receive an image to be processed, wherein the image to be processed includes a target area whose color needs to be changed; a channel transformation module, used to transform the original color channel order of the image to be processed into a target color channel order, to obtain a first intermediate image; a stylization module, used to perform stylization processing on the area corresponding to the target area in the first intermediate image using an image processing model, to obtain a second intermediate image, wherein the color of the area corresponding to the target area in the second intermediate image is different from the color corresponding to the target color channel order; a channel restoration module, used to restore the color channel order of the second intermediate image to the original color channel order, to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed.

[0097] According to one or more embodiments of the present disclosure, Example 9 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-7 when executed by a processing device.

[0098] According to one or more embodiments of the present disclosure, Example 10 provides an electronic device, comprising: a storage device on which a computer program is stored; and a processing device for executing the computer program in the storage device to implement the steps of any one of the methods described in Examples 1-7.

[0099] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.

[0100] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.

[0101] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims

1. An image processing method, characterized in that: include: Receiving an image to be processed, wherein the image to be processed includes a target area that needs to change color; Converting the original color channel order of the image to be processed into the target color channel order to obtain a first intermediate image; Using an image processing model to perform stylization processing on a region in the first intermediate image corresponding to the target region to obtain a second intermediate image, wherein a color of the region in the second intermediate image corresponding to the target region is different from a color corresponding to a sequence of the target color channels; The color channel order of the second intermediate image is restored to the original color channel order to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed.

2. The method according to claim 1, characterized in that The original color channel order and the target color channel order are respectively one of the following color channel orders and are different from each other: RGB, RBG, GRB, GBR, BRG, BGR.

3. The method according to claim 1, characterized in that The step of using the image processing model to perform stylization processing on the area corresponding to the target area in the first intermediate image to obtain a second intermediate image includes: identifying an area in the first intermediate image corresponding to the target area; Convert the identified area into image data; Using the image processing model to perform stylized processing on the image data to obtain a regional image, wherein the color of the regional image is different from the color corresponding to the target color channel sequence; The area other than the area corresponding to the target area in the first intermediate image and the regional image are processed to obtain the second intermediate image.

4. The method according to claim 3, characterized in that The processing of the area other than the area corresponding to the target area in the first intermediate image and the regional image includes: The region other than the region corresponding to the target region in the first intermediate image is fused with the regional image.

5. The method according to claim 1, characterized in that The image processing model is obtained in the following way: Obtaining a mask of a region to be stylized of a data sample in paired data, wherein the paired data includes the data sample and a real sample, and the real sample includes a stylized reference region; The image processing model is trained in combination with the mask of the area to be stylized and the stylized reference area to obtain the image processing model.

6. The method according to claim 5, characterized in that The method further comprises: before obtaining a mask of a region of the data sample to be stylized in the paired data, changing the color channel order of the data sample; The obtaining of the mask of the region to be stylized of the data sample in the paired data includes: obtaining the mask of the region to be stylized of the data sample after the color channel sequence is changed.

7. The method according to claim 6, characterized in that The changing the color channel order of the data sample comprises: The color channel order of the data samples is randomly shuffled.

8. An image processing device, characterized in that: include: A receiving module, used for receiving an image to be processed, wherein the image to be processed includes a target area that needs to change color; A channel conversion module, used for converting the original color channel sequence of the image to be processed into a target color channel sequence to obtain a first intermediate image; a stylization module, configured to perform stylization processing on the region corresponding to the target region in the first intermediate image by using an image processing model to obtain a second intermediate image, wherein a color of the region corresponding to the target region in the second intermediate image is different from a color corresponding to a sequence of the target color channels; A channel restoration module is used to restore the color channel order of the second intermediate image to the original color channel order to obtain a target image, wherein the color of the area corresponding to the target area in the target image is different from the color of the target area in the image to be processed.

9. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processing device, the steps of the method described in any one of claims 1 to 7 are implemented.

10. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 7.