Image Generation Method and Apparatus, Computer-Readable Storage Medium, and Electronic Device

By splitting the original color image in color channel and adjusting the grayscale value of the grayscale value, multiple target color images are generated, which solves the problem of insufficient training data and improves the generalization ability and accuracy of the cutout model.

CN116071390BActive Publication Date: 2025-07-25GUANGDONG OPPO MOBILE TELECOMMUNICATIONS CORP LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310093048.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-18
Publication Date
2025-07-25
Estimated Expiration
2043-01-18

AI Technical Summary

Technical Problem

In the prior art, insufficient training data for image cutting tasks leads to low accuracy in model processing.

Method used

By splitting the original color image in color channel, multiple original grayscale images are generated, and the grayscale values are adjusted using different grayscale value adjustment methods. Then add colors to generate multiple target color images as training data for the cutout model.

Benefits of technology

The training data is augmented, the generalization ability and robustness of the cutout model are enhanced, and the accuracy of model processing is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116071390B_ABST
    Figure CN116071390B_ABST
Patent Text Reader

Abstract

The present disclosure provides an image generation method, an image generation device, a computer-readable storage medium, and an electronic device, which relate to the technical field of image processing. The image generation method includes: obtaining an original color image, where the original color image includes a matte object; splitting the original color image by color channels to obtain a plurality of original grayscale images; respectively adjusting the grayscale values of the original grayscale images by different grayscale value adjustment methods to obtain a plurality of target grayscale images; adding colors to the respective target grayscale images to generate a plurality of target color images, where each target color image includes the matte object and each target color image is used as training data in the training process of a matte model. The present disclosure can expand the training data of the matte model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to the field of image processing technologies, and in particular, to an image generation method, an image generation device, a computer-readable storage medium, and an electronic device. Background Art

[0002] As an important means in the process of image processing, image matting has been widely used in scenarios such as image fusion and image correction.

[0003] The image matting task has high requirements for training data. Currently, there is generally a problem that the lack of training data leads to low accuracy of model processing. Summary of the Invention

[0004] The present disclosure provides an image generation method, an image generation device, a computer-readable storage medium, and an electronic device, thereby at least to a certain extent overcoming the problem of insufficient training data in the matting task.

[0005] According to a first aspect of the present disclosure, there is provided an image generation method, including: obtaining an original color image, the original color image including a matting object; splitting the original color image by color channels to obtain a plurality of original grayscale images; respectively adjusting the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images; adding colors to the respective target grayscale images to generate a plurality of target color images, each target color image including the matting object and each target color image being used as training data in the training process of a matting model.

[0006] According to a second aspect of the present disclosure, there is provided an image generation device, including: an original image obtaining module for obtaining an original color image, the original color image including a matting object; a channel splitting module for splitting the original color image by color channels to obtain a plurality of original grayscale images; a grayscale adjustment module for respectively adjusting the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images; an image coloring module for adding colors to the respective target grayscale images to generate a plurality of target color images, each target color image including the matting object and each target color image being used as training data in the training process of a matting model.

[0007] According to a third aspect of the present disclosure, there is provided a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the image generation method described above is implemented.

[0008] According to a fourth aspect of the present disclosure, there is provided an electronic device, including a processor; a memory for storing one or more programs, and when the one or more programs are executed by the processor, the processor implements the image generation method described above.

[0009] In the technical solutions provided by some embodiments of the present disclosure, the original color image is split into color channels to obtain a plurality of original grayscale images, the grayscale values of the original grayscale images are adjusted in different ways to obtain a plurality of target grayscale images, and colors are added to the target grayscale images to generate a plurality of target color images. On the one hand, based on an original color image including a matte object, the present disclosure can generate a plurality of target color images corresponding to the original color image and all including the matte object, realizing the augmentation of training data; on the other hand, since the plurality of target color images are all generated based on the same original color image, using them for training the matte model can enhance the generalization ability and robustness of the matte model and improve the accuracy of model processing.

[0010] It should be understood that the above general description and the following detailed description are only exemplary and explanatory, and cannot limit the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0011] The accompanying drawings herein are incorporated into the specification and constitute a part of this specification, showing embodiments consistent with the present disclosure, and are used together with the specification to explain the principles of the present disclosure. Obviously, the accompanying drawings in the following description are only some embodiments of the present disclosure, and those of ordinary skill in the art can obtain other drawings based on these drawings without creative efforts. In the drawings:

[0012] Figure 1 shows an input-output schematic diagram of the image generation scheme according to an embodiment of the present disclosure;

[0013] Figure 2 shows a schematic diagram of the image conversion process according to an embodiment of the present disclosure;

[0014] Figure 3 schematically shows a flowchart of an image generation method according to an exemplary embodiment of the present disclosure;

[0015] Figure 4 shows a schematic diagram of splitting the original color image into channels according to an embodiment of the present disclosure;

[0016] Figure 5 shows a schematic diagram of adjusting the grayscale value of the original grayscale image of the R channel to obtain a target grayscale image according to an embodiment of the present disclosure;

[0017] Figure 6 schematically shows a block diagram of an image generation device according to an exemplary embodiment of the present disclosure;

[0018] Figure 7 schematically shows a block diagram of an electronic device according to an exemplary embodiment of the present disclosure. Detailed Implementation Modes

[0019] Example embodiments will now be described more fully with reference to the accompanying drawings. However, the example embodiments can be implemented in various forms and should not be construed as limited to the examples set forth herein; rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the concept of the example embodiments to those skilled in the art. The features, structures, or characteristics described may be combined in any suitable manner in one or more embodiments. In the following description, numerous specific details are provided to give a thorough understanding of the embodiments of the present disclosure. However, those skilled in the art will realize that one or more of the specific details may be omitted in practicing the technical solutions of the present disclosure, or other methods, components, devices, steps, etc. may be adopted. In other cases, well-known technical solutions are not shown or described in detail to avoid obscuring various aspects of the present disclosure.

[0020] In addition, the accompanying drawings are only schematic illustrations of the present disclosure and are not necessarily drawn to scale. The same reference numerals in the drawings denote the same or similar parts, and thus repeated descriptions thereof will be omitted. Some of the block diagrams shown in the drawings are functional entities and do not necessarily correspond to physically or logically independent entities. These functional entities may be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.

[0021] The flowcharts shown in the accompanying drawings are only illustrative and do not necessarily include all steps. For example, some steps may be decomposed, while some steps may be combined or partially combined, so the actual execution order may change according to the actual situation.

[0022] Figure 1 An input-output schematic diagram of the image generation scheme according to the embodiment of the present disclosure is shown. Referring to Figure 1 , the input of the image generation scheme according to the embodiment of the present disclosure can be an original color image, and the output can be multiple target color images. The present disclosure places no limit on the number of target color images obtained. Additionally, in some instances where the image generation scheme of the present disclosure is applied, only one target color image may also be generated.

[0023] It should be noted that the target color images generated by using the image generation scheme of the embodiments of the present disclosure include the object to be cut out, and the target color images are used as training data in the training process of the cut-out model. Herein, the object to be cut out refers to the object to be cut out in the image, such as a specified object like a person or an animal in the image.

[0024] The image generation solution of the present disclosure embodiment can be implemented by a terminal device. That is to say, the terminal device can execute each step of the following image generation method, and the following image generation device can be configured in the terminal device. Among them, the terminal device can include but is not limited to smart phones, tablet computers, smart wearable devices, personal computers, servers, etc. The present disclosure does not limit the type of the terminal device.

[0025] In an embodiment where the terminal device is a smart phone or the like including a camera module, the original color image can be a color image captured by the smart phone with its camera module, or a color image obtained from other devices. In an embodiment where the terminal device is a server or the like that does not include a camera module, the original color image can be a color image obtained by the server from other devices. The present disclosure does not limit the source, content, and size of the original color image.

[0026] In addition, the original color image can be an annotated image, such as an image annotated manually. It can be understood that for training samples, the annotated data can be used to train the matting model.

[0027] In some embodiments of the present disclosure, in view of the fact that the image content of the original color image is the same as that of the target color image, the same annotation information as the original color image can be configured for the target color image, that is, the annotation information of the original color image is applied to the target color image. Thus, the generated target color image also has annotation information. When the generated target color image is added to the training set of the matting model, it is equivalent to the expanded training data. Therefore, the image generation solution of the present disclosure embodiment can also solve the problems of high cost and long time consumption in annotating the training samples of the matting model.

[0028] Figure 2 shows a schematic diagram of the image conversion process of the present disclosure embodiment. Refer to Figure 2 , the image generation solution of the present disclosure embodiment includes an image conversion process from the original color image to the original grayscale image, an image conversion process from the original grayscale image to the target grayscale image, and an image conversion process from the target grayscale image to the target color image.

[0029] First, for the original color image including the matting object, the terminal device can split the original color image by color channels to obtain the original grayscale image. It can be understood that the number of original grayscale images obtained by channel splitting is usually multiple.

[0030] Next, the terminal device can adjust the grayscale values of the original grayscale image to obtain a target grayscale image. Specifically, for an original grayscale image, different grayscale value adjustment methods can be adopted. That is to say, based on an original grayscale image, multiple target grayscale images corresponding to the original grayscale image can be generated.

[0031] Then, the terminal device can add colors to the target grayscale image to generate a target color image. Specifically, the process of coloring the target grayscale image in this disclosure utilizes a deep learning-based coloring algorithm, which can color the target grayscale image naturally and robustly. Taking a portrait as an example, the coloring process can adaptively change the clothing and hair colors of the portrait and control the portrait color to appear natural and suitable.

[0032] Based on the above image generation process from the original color image to the target color image, on the one hand, based on an original color image including a matte object, multiple target color images corresponding to the original color image and all including the matte object can be generated, realizing the augmentation of training data; on the other hand, considering that multiple target color images are all generated based on the same original color image, using them to train the matte model can enhance the generalization ability and robustness of the matte model and improve the accuracy of model processing.

[0033] The following will illustrate the image processing process of this disclosure by taking the terminal device executing the image generation method of the exemplary embodiment of this disclosure as an example.

[0034] Figure 3 Schematically shows a flowchart of the image generation method of the exemplary embodiment of this disclosure. Refer to Figure 3 , the image generation method may include the following steps:

[0035] S32. Obtain an original color image, where the original color image includes a matte object.

[0036] In the exemplary embodiment of this disclosure, the matte object refers to the object to be matte out in the image, usually corresponding to the foreground image. For example, the matte object can be a real object in the real world such as a person, an animal, a car, a building, a piece of furniture, etc. Also, for example, the matte object can also be a virtual object such as an animated object or a game object in the image. This disclosure does not limit the type of the matte object.

[0037] The matte object can be an object of interest specified by the user in advance. For example, if the user is interested in a portrait, the portrait can be set as the matte object. The matte object can also be an object determined by the terminal device through image recognition. For example, if the terminal device recognizes that the image only contains a dog through image recognition, the dog can be used as the matte object.

[0038] According to some embodiments of the present disclosure, the original color image can be a color image captured by a terminal device with its equipped camera module, can also be a color image drawn by drawing software, or can also be a color image obtained from other devices. Among them, the color image is usually referred to as an RGB image. The present disclosure places no restrictions on the source, size, etc. of the original color image.

[0039] It should be noted that the original color image described in the embodiments of the present disclosure can be one of the training data for training the matting model, that is, the terminal device can obtain the original color image from the training set of the matting model. For example, the original color image can be randomly obtained from the training set.

[0040] In addition, the original color image can be an annotated image, such as an image annotated manually.

[0041] S34. Split the original color image by color channels to obtain multiple original grayscale images.

[0042] In the exemplary embodiment of the present disclosure, the original color image includes multiple color channels. Specifically, these color channels usually include the R (red) channel, the G (green) channel, and the B (blue) channel.

[0043] After obtaining the original color image, the terminal device can split the original color image by color channels to obtain multiple original grayscale images. It can be understood that each original grayscale image corresponds one-to-one to the color channel of the original color image.

[0044] Refer to Figure 4 , for the original color image of RGB, after channel splitting, the original grayscale image of the R channel, the original grayscale image of the G channel, and the original grayscale image of the B channel can be obtained.

[0045] S36. Adjust the grayscale values of the original grayscale images respectively using different grayscale value adjustment methods to obtain multiple target grayscale images.

[0046] In the exemplary embodiment of the present disclosure, the grayscale value adjustment method can include any algorithm operation that can change the grayscale value, including one or a combination of adding grayscale noise, increasing or decreasing the overall grayscale value, smoothing, and sharpening.

[0047] In one embodiment, the terminal device can perform an overall increase or decrease operation on the grayscale value of the original grayscale image to obtain a target grayscale image corresponding to the original grayscale image. For example, the grayscale value is increased or decreased by 10 overall to obtain the target grayscale image. Refer to Figure 5 , Image a is Figure 4The original grayscale image of the R channel, Image b is the target grayscale image obtained by adding 10 to the overall grayscale value of Image a, and Image c is the target grayscale image obtained by subtracting 10 from the overall grayscale value of Image a.

[0048] In another embodiment, the terminal device may add grayscale noise to the original grayscale image to obtain a target grayscale image corresponding to the original grayscale image. For example, the grayscale noise may be added randomly. The present disclosure places no restrictions on the degree and manner of adding grayscale noise. Refer to Figure 5 , Image d is the target grayscale image obtained by adding grayscale noise to Image a.

[0049] In yet another embodiment, the terminal device may perform smoothing and / or sharpening processing on the original grayscale image to obtain a target grayscale image corresponding to the original grayscale image. Refer to Figure 5 , Figure e is the target grayscale image obtained by performing smoothing processing on Image a, and Figure f is the target grayscale image obtained by performing sharpening processing on Image a.

[0050] It should be understood that, on the one hand, the target grayscale images in the above embodiments are different target grayscale images determined by experiencing different grayscale value adjustment methods; on the other hand, the above grayscale value adjustment methods can be arbitrarily combined, and after the combined grayscale adjustment method is applied to the original grayscale image, a target grayscale image can also be obtained.

[0051] According to some embodiments of the present disclosure, for the multiple original grayscale images determined in step S34, the above grayscale value adjustment can be performed on each original grayscale image. If there are three grayscale value adjustment methods, then for the three original grayscale images of the R channel, G channel, and B channel, a total of 9 (3×3) target grayscale images can be obtained.

[0052] According to other embodiments of the present disclosure, for the multiple original grayscale images determined in step S34, the above grayscale value adjustment can be performed on some of the original grayscale images. For example, only the original grayscale image of the R channel is subjected to the above grayscale value adjustment. If there are five grayscale value adjustment methods, a total of 5 target grayscale images can be obtained. For another example, if the original grayscale images of the R channel and the B channel are subjected to the above grayscale value adjustment, and if there are four grayscale value adjustment methods, a total of 8 (2×4) target grayscale images can be obtained.

[0053] It should be noted that the number of original grayscale images for which the grayscale value adjustment is performed and the number of grayscale value adjustment methods can be determined in combination with the training accuracy requirements of the matting model and the processing capabilities of the terminal device.

[0054] S38. Add colors to each target grayscale image to generate multiple target color images. Each target color image includes a matte object and is used as training data in the training process of the matte model.

[0055] For each target grayscale image obtained in step S36, colorization (or coloring) processing can be performed, that is, adding colors to the target grayscale image to generate a target color image corresponding to the target grayscale image.

[0056] The terminal device can add colors to the target grayscale image according to the grayscale value of the target grayscale image. Specifically, the terminal device can input the target grayscale image into a deep learning network, and use the non-linear mapping operation of the deep learning network to convert the grayscale value of the target grayscale image to generate a target color image corresponding to the target grayscale image. The deep learning-based colorization algorithm of the embodiments of the present disclosure can colorize the target grayscale image naturally and robustly. Taking a portrait as an example, the colorization process can adaptively change the color of the portrait's clothing and hair, and control the portrait color to appear natural and suitable.

[0057] The target color image determined in the embodiments of the present disclosure corresponds to the original color image and both include the matte object. The generated target color image can be used as training data in the training process of the matte model. That is to say, the terminal device can put the target color image into the training set of the matte model to expand the training set. Thus, the image generation method of the embodiments of the present disclosure can also solve the problems of high cost and long time consumption in the annotation of training samples of the matte model.

[0058] It should be noted that although the steps of the methods in the present disclosure are described in a specific order in the drawings, this does not require or imply that these steps must be performed in that specific order, or that all the steps shown must be performed to achieve the desired result. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step for execution, and / or one step may be decomposed into multiple steps for execution, etc.

[0059] Furthermore, an image generation device is also provided in the exemplary embodiment of the present disclosure.

[0060] Figure 6 A block diagram of an image generation device according to an exemplary embodiment of the present disclosure is schematically shown. Refer to Figure 6 , the image generation device 6 according to the exemplary embodiment of the present disclosure may include an original image acquisition module 61, a channel splitting module 63, a grayscale adjustment module 65, and an image coloring module 67.

[0061] The original image acquisition module 61 can be used to acquire an original color image, and the original color image includes a cutout object; the channel splitting module 63 can be used to split the original color image by color channels to obtain a plurality of original grayscale images; the grayscale adjustment module 65 can be used to adjust the grayscale values of the original grayscale images respectively by using different grayscale value adjustment methods to obtain a plurality of target grayscale images; the image coloring module 67 can be used to add colors to each target grayscale image to generate a plurality of target color images, each target color image includes a cutout object and each target color image is used as training data in the training process of the cutout model.

[0062] According to an exemplary embodiment of the present disclosure, the image coloring module 67 can be configured to perform: adding colors to the target grayscale image according to the grayscale value of the target grayscale image to generate a target color image corresponding to the target grayscale image.

[0063] According to an exemplary embodiment of the present disclosure, the image coloring module 67 can be configured to perform: inputting the target grayscale image into a deep learning network, and using the non-linear mapping operation of the deep learning network to convert the grayscale value of the target grayscale image to generate a target color image corresponding to the target grayscale image.

[0064] According to an exemplary embodiment of the present disclosure, the grayscale adjustment module 65 can be configured to perform: adjusting the grayscale values of some or all of the original grayscale images among the plurality of original grayscale images respectively by using different grayscale value adjustment methods to obtain a plurality of target grayscale images.

[0065] According to an exemplary embodiment of the present disclosure, the grayscale adjustment module 65 can be configured to perform: performing an overall increase or decrease operation on the grayscale value of the original grayscale image to obtain a target grayscale image corresponding to the original grayscale image.

[0066] According to an exemplary embodiment of the present disclosure, the grayscale adjustment module 65 can also be configured to perform: adding grayscale noise to the original grayscale image to obtain a target grayscale image corresponding to the original grayscale image.

[0067] According to an exemplary embodiment of the present disclosure, the grayscale adjustment module 65 can also be configured to perform: performing smoothing and / or sharpening processing on the original grayscale image to obtain a target grayscale image corresponding to the original grayscale image.

[0068] Since each functional module of the image generation device according to the embodiment of the present disclosure is the same as that in the above method embodiment, it will not be described in detail here.

[0069] Figure 7 The figure shows a schematic diagram of an electronic device suitable for implementing the exemplary embodiment of the present disclosure. The terminal device according to the exemplary embodiment of the present disclosure can be configured asFigure 7 in the form of. It should be noted that Figure 7 The electronic device shown is only an example and should not impose any limitations on the functions and scope of use of the embodiments of the present disclosure.

[0070] The electronic device of the present disclosure at least includes a processor and a memory. The memory is used to store one or more programs. When the one or more programs are executed by the processor, the processor can implement the image generation method of the exemplary embodiments of the present disclosure.

[0071] Specifically, as Figure 7 shown, the electronic device 70 may include: a processor 710, an internal memory 721, an external memory interface 722, a Universal Serial Bus (USB) interface 730, a charging management module 740, a power management module 741, a battery 742, antenna 1, antenna 2, a mobile communication module 750, a wireless communication module 760, an audio module 770, a sensor module 780, a display screen 790, a camera module 791, an indicator 792, a motor 793, a button 794, and a Subscriber Identification Module (SIM) card interface 795, etc. The sensor module 780 may include a depth sensor, a pressure sensor, a gyroscope sensor, a barometric pressure sensor, a magnetic sensor, an acceleration sensor, a distance sensor, a proximity light sensor, a fingerprint sensor, a temperature sensor, a touch sensor, an ambient light sensor, and a bone conduction sensor, etc.

[0072] It can be understood that the structure schematically shown in the embodiments of the present disclosure does not constitute a specific limitation on the electronic device 70. In other embodiments of the present disclosure, the electronic device 70 may include more or fewer components than shown, or combine certain components, or split certain components, or have different component arrangements. The components shown may be implemented in hardware, software, or a combination of software and hardware.

[0073] The processor 710 may include one or more processing units. For example, the processor 710 may include an Application Processor (AP), a modem processor, a Graphics Processing Unit (GPU), an Image Signal Processor (ISP), a controller, a video codec, a Digital Signal Processor (DSP), a baseband processor, and / or a Neural-network Processing Unit (NPU), etc. Among them, different processing units may be independent devices or integrated in one or more processors. In addition, a memory may be provided in the processor 710 for storing instructions and data.

[0074] The electronic device 70 may implement a shooting function through the ISP, the camera module 791, the video codec, the GPU, the display screen 790, the application processor, etc. In some embodiments, the electronic device 70 may include 1 or N camera modules 791, where N is a positive integer greater than 1. If the electronic device 70 includes N cameras, one of the N cameras is the main camera.

[0075] The internal memory 721 may be used to store computer-executable program code, and the executable program code includes instructions. The internal memory 721 may include a program storage area and a data storage area. The external memory interface 722 may be used to connect to an external memory card, such as a Micro SD card, to implement the storage capacity expansion of the electronic device 70.

[0076] The present disclosure also provides a computer-readable storage medium, which may be included in the electronic device described in the above embodiments; or may exist alone without being assembled into the electronic device.

[0077] The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the above. More specific examples of the computer-readable storage medium 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, the computer-readable storage medium may be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0078] A computer-readable storage medium can 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 storage medium can be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical fiber, RF, etc., or any suitable combination of the above.

[0079] The computer-readable storage medium carries one or more programs, and when the above one or more programs are executed by an electronic device, the electronic device implements the method as described in the embodiments of the present disclosure.

[0080] The flowcharts and block diagrams in the accompanying drawings illustrate the possible architectures, functions, and operations of systems, methods, and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the above module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order than marked in the accompanying drawings. For example, two consecutive blocks shown may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram or flowchart, and the combination of blocks in the block diagram or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or operations, or can be implemented by a combination of dedicated hardware and computer instructions.

[0081] The units described in the embodiments of the present disclosure can be implemented in software or in hardware, and the described units can also be provided in a processor. Among them, the names of these units do not constitute a limitation to the unit itself in some cases.

[0082] Through the description of the above embodiments, those skilled in the art can easily understand that the example embodiments described herein can be implemented by software or by a combination of software and necessary hardware. Therefore, the technical solutions according to the embodiments of the present disclosure can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the embodiments of the present disclosure.

[0083] In addition, the above-mentioned drawings are only schematic illustrations of the processes included in the method according to the exemplary embodiments of the present disclosure, rather than for limiting purposes. It is easy to understand that the processes shown in the above-mentioned drawings do not indicate or limit the chronological order of these processes. Additionally, it is also easy to understand that these processes can be executed synchronously or asynchronously in, for example, multiple modules.

[0084] It should be noted that although several modules or units of the device for action execution are mentioned in the above detailed description, such a division is not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of the two or more modules or units described above can be embodied in one module or unit. Conversely, the features and functions of one module or unit described above can be further divided and embodied by multiple modules or units.

[0085] Those skilled in the art will readily conceive of other embodiments of the present disclosure after considering the specification and practicing the content disclosed herein. This application is intended to cover any variations, uses, or adaptations of the present disclosure that follow the general principles of the present disclosure and include known common knowledge or conventional technical means in the technical field not disclosed in the present disclosure. The specification and embodiments are only regarded as exemplary, and the true scope and spirit of the present disclosure are pointed out by the claims.

[0086] It should be understood that the present disclosure is not limited to the exact structures already described and shown in the drawings, and various modifications and changes can be made without departing from its scope. The scope of the present disclosure is only limited by the appended claims.

Claims

1. An image generation method, characterized in that, including: obtaining an original color image, where the original color image includes a keying object; splitting the original color image by color channels to obtain a plurality of original grayscale images; respectively adjusting the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images; adding colors to each of the target grayscale images to generate a plurality of target color images, each of the target color images includes the keying object and each of the target color images is used as training data in the training process of the keying model.

2. The image generation method according to claim 1, wherein adding colors to each of the target grayscale images to generate a plurality of target color images, including: adding a color to the target grayscale image according to the grayscale value of the target grayscale image to generate the target color image corresponding to the target grayscale image.

3. The image generation method according to claim 2, wherein adding a color to the target grayscale image according to the grayscale value of the target grayscale image to generate the target color image corresponding to the target grayscale image, including: inputting the target grayscale image into a deep learning network, and using the non-linear mapping operation of the deep learning network to convert the grayscale value of the target grayscale image to generate the target color image corresponding to the target grayscale image.

4. The image generation method according to claim 1, wherein respectively adjusting the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images, including: respectively adjusting the grayscale values of some or all of the original grayscale images among the plurality of original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images.

5. The image generation method according to claim 1, wherein respectively adjusting the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images, including: performing an overall increase or decrease operation on the grayscale value of the original grayscale image to obtain the target grayscale image corresponding to the original grayscale image.

6. The image generation method according to claim 1, characterized in that, respectively adjusting the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images, including: adding grayscale noise to the original grayscale image to obtain the target grayscale image corresponding to the original grayscale image.

7. The image generation method according to claim 1, characterized in that, respectively adjusting the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images, including: performing smoothing and / or sharpening processing on the original grayscale image to obtain the target grayscale image corresponding to the original grayscale image.

8. An image generation device, characterized in that, including: an original image acquisition module, configured to obtain an original color image, where the original color image includes a keying object; a channel splitting module, configured to split the original color image by color channels to obtain a plurality of original grayscale images; a grayscale adjustment module, configured to respectively adjust the grayscale values of the original grayscale images by using different grayscale value adjustment methods to obtain a plurality of target grayscale images; an image coloring module, configured to add colors to each of the target grayscale images to generate a plurality of target color images, each of the target color images includes the keying object and each of the target color images is used as training data in the training process of the keying model.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the described program is executed by a processor, it implements the image generation method according to any one of claims 1 to 7.

10. An electronic device, characterized in that, Including: A processor; A memory for storing one or more programs, which, when executed by the processor, cause the processor to implement the image generation method according to any one of claims 1 to 7.

Citation Information

Patent Citations

  • Training image expansion method, training method and related device

    CN110781976A

  • Automatic matting model establishment method

    CN113706372A