Color adjustment method, device, electronic device and storage medium

By determining the key areas in the image and performing mixing operations, the problem of color toning scheme destroying image composition and color use in the prior art is solved, and color information protection and image information retention are achieved.

CN112233195BActive Publication Date: 2025-02-11BEIJING DAJIA INTERNET INFORMATION TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202011104791.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-10-15
Publication Date
2025-02-11
Estimated Expiration
2041-02-11

AI Technical Summary

Technical Problem

The color toning scheme in the prior art will destroy the composition and color use of the image as a whole, resulting in the original information loss of the image.

Method used

By obtaining the image to be colored and its corresponding color palette, color adjustment is performed to obtain the intermediate image, and the key areas that require color protection are determined in the image, the key area image and the intermediate image are mixed with the key area mask image using the key area mask image Operation to obtain the target image.

Benefits of technology

It effectively avoids distortion of the color of the key area during the color adjustment process, and realizes the protection of the color information of the key area. The final target image retains the original information of the image.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112233195B_ABST
    Figure CN112233195B_ABST
Patent Text Reader

Abstract

The present disclosure relates to a color adjustment method, device, electronic device and storage medium. The method obtains an image to be color adjusted and a color adjustment template corresponding to the image to be color adjusted; and adjusts the image to be color adjusted with the color adjustment template as the target to obtain an intermediate image; then, considering the color information and authenticity of the image itself, a key area that needs color protection is determined in the image to be color adjusted, and a mask image of the key area is obtained; through the mask image of the key area, the key area image and the intermediate image are mixed to retain the color of the key area in the image to be color adjusted. The color of the key area is prevented from being distorted during the color adjustment process, and the color information of the key area is protected. The target image finally obtained retains the original information of the 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 a color adjustment method, device, electronic device and storage medium. Background Art

[0002] With the continuous development of computer technology, more and more applications are installed and applied in electronic devices. Among them, multimedia resource playback applications or live broadcast applications are important applications on electronic devices, and color coordination is of great significance to the images displayed during video playback or live broadcast.

[0003] In related technologies, with the development of machine learning technology, machine learning has been applied to image color schemes. Machine learning models are trained by constructing samples of various image styles, and the trained models are used to adjust the image colors. However, the current color schemes will destroy the overall composition and color of the image, resulting in the loss of the original information of the image. Summary of the invention

[0004] The present disclosure provides a color adjustment method, device, electronic device and storage medium to at least solve the problem in the related art that the color adjustment scheme will destroy the overall composition and color of the image, resulting in the loss of the original information of the image. The technical solution of the present disclosure is as follows:

[0005] According to a first aspect of an embodiment of the present disclosure, a color adjustment method is provided, comprising:

[0006] Acquire an image to be color-adjusted and a color-adjusting template corresponding to the image to be color-adjusted;

[0007] Taking the color adjustment template as a target, adjusting the image to be adjusted to obtain an intermediate image;

[0008] Determining a key area that needs color protection in the image to be toned, and obtaining a key area image and a mask image of the key area;

[0009] The target image is obtained by performing a blending operation on the key area image and the intermediate image through the mask image of the key area.

[0010] In one embodiment, the determination of the color palette template includes:

[0011] Acquire a plurality of candidate templates and a hue histogram of the image to be toned, each of the candidate templates comprising a sector-shaped area;

[0012] Determining color evaluation information of each candidate template according to the hue histogram of the image to be color-adjusted and the boundary of the fan-shaped area in each candidate template;

[0013] The color adjustment template is determined from among the candidate templates according to the color adjustment evaluation information of each candidate template.

[0014] In one embodiment, the step of coloring the image to be color-coded with the color-coding template as a target to obtain an intermediate image includes:

[0015] Performing image segmentation and accelerated guided filtering on the image to be color-adjusted to determine classification label information of the image to be color-adjusted;

[0016] Taking the color adjustment template as a target, the image to be color adjusted is adjusted according to the classification mark information of the image to be color adjusted to obtain an intermediate image.

[0017] In one embodiment, the step of adjusting the image to be adjusted according to the classification mark information of the image to be adjusted to obtain an intermediate image includes:

[0018] By means of a graphics processor (GPU), adjusting the hue in the hue histogram of the image to be adjusted according to the classification mark information of the image to be adjusted;

[0019] The to-be-adjusted hue is compressed into the sector-shaped region to obtain the intermediate image, wherein the to-be-adjusted hue is the hue in the hue histogram excluding the sector-shaped region.

[0020] In one of the embodiments, before performing image segmentation and accelerated guided filtering on the image to be toned and determining classification label information of the image to be toned, the method further includes:

[0021] When the number of the sector-shaped regions is greater than one, obtaining the distance between the to-be-adjusted hue and the boundary of each of the sector-shaped regions and the saturation corresponding to the to-be-adjusted hue;

[0022] The step of performing image segmentation and accelerated guided filtering on the image to be color-adjusted to determine classification label information of the image to be color-adjusted includes:

[0023] When the distances between the to-be-adjusted hue and the boundaries of each of the sector-shaped regions are equal, and the saturation is less than a saturation threshold, image segmentation and accelerated guided filtering are performed on the to-be-adjusted image to determine classification label information of the to-be-adjusted image.

[0024] In one embodiment, the step of performing image segmentation and accelerated guided filtering on the image to be color-adjusted to determine classification label information of the image to be color-adjusted includes:

[0025] Performing downsampling and image segmentation on the image to be toned to obtain a thumbnail segmentation result;

[0026] The thumbnail segmentation result is subjected to accelerated guided filtering and up-sampling processing to obtain classification label information of the image to be toned.

[0027] In one embodiment, the step of performing accelerated guided filtering and upsampling processing on the thumbnail segmentation result to obtain classification label information of the image to be toned includes:

[0028] Performing YUV sampling on the image to be toned to obtain component Y, using component Y as a guide map, and performing guided filtering on the thumbnail segmentation result;

[0029] The result of the guided filtering is up-sampled by a sampler of a graphics processing unit (GPU) to obtain classification label information of the image to be toned.

[0030] In one embodiment, determining a key area requiring color protection in the image to be toned and obtaining a key area image and a mask image of the key area includes:

[0031] Performing target image segmentation on the image to be toned, and converting the obtained target image from the first color space to the second color space, wherein the target image is a partial image of the image to be toned including the key area;

[0032] Determining the key area in the target image according to a preset parameter range in the second color space, and obtaining the key area image;

[0033] The key area image is binarized to obtain a mask image of the key area.

[0034] In one embodiment, the step of performing a blending operation on the key area image and the intermediate image through the mask image of the key area to obtain the target image includes:

[0035] Restoring the intermediate image to the first color space;

[0036] The target image is obtained by performing a blending operation on the key area image and the intermediate image restored to the first color space through the mask image of the key area.

[0037] According to a second aspect of an embodiment of the present disclosure, a color adjustment device is provided, comprising:

[0038] A first acquisition module is configured to execute acquisition of an image to be color-adjusted and a color-adjusting template corresponding to the image to be color-adjusted;

[0039] A color adjustment module is configured to perform color adjustment on the image to be color adjusted with the color adjustment template as a target to obtain an intermediate image;

[0040] A key area determination module is configured to determine a key area that needs color protection in the image to be toned, and obtain a key area image and a mask image of the key area;

[0041] The blending operation module is configured to perform a blending operation on the key area image and the intermediate image through the mask image of the key area to obtain a target image.

[0042] In one of the embodiments, the color adjustment device also includes a color adjustment template determination module, which is configured to execute the acquisition of a plurality of candidate templates and a hue histogram of the image to be colored, each of the candidate templates including a fan-shaped area; determine the color adjustment evaluation information of each of the candidate templates according to the hue histogram of the image to be colored and the boundaries of the fan-shaped areas in each of the candidate templates; and determine the color adjustment template in each of the candidate templates according to the color adjustment evaluation information of each of the candidate templates.

[0043] In one embodiment, the color adjustment module includes a classification marking unit and a color adjustment unit; wherein:

[0044] The classification marking unit is configured to perform image segmentation and acceleration guided filtering on the image to be toned, and determine classification marking information of the image to be toned;

[0045] The color adjustment unit is configured to perform color adjustment on the image to be color adjusted based on the classification mark information of the image to be color adjusted with the color adjustment template as the target, so as to obtain an intermediate image.

[0046] In one of the embodiments, the color adjustment unit is further configured to execute, through a graphics processor GPU, adjustment of the hue in the hue histogram of the image to be colored according to the classification mark information of the image to be colored; compressing the hue to be adjusted into the sector-shaped area to obtain the intermediate image, wherein the hue to be adjusted is the hue in the hue histogram excluding the sector-shaped area.

[0047] In one embodiment, the color adjustment device further includes a second acquisition module, wherein the second acquisition module is configured to acquire the distance between the to-be-adjusted hue and the boundary of each of the to-be-adjusted hue and the saturation corresponding to the to-be-adjusted hue when the number of the sector-shaped regions is greater than one;

[0048] The color adjustment unit is further configured to perform image segmentation and acceleration guided filtering on the image to be color adjusted when the distance between the hue to be adjusted and the boundary of each of the sector-shaped areas is equal and the saturation is less than a saturation threshold, so as to determine the classification mark information of the image to be color adjusted.

[0049] In one of the embodiments, the color adjustment unit is further configured to perform downsampling processing and image segmentation on the image to be color adjusted to obtain a thumbnail segmentation result; and perform accelerated guided filtering and upsampling processing on the thumbnail segmentation result to obtain classification labeling information of the image to be color adjusted.

[0050] In one of the embodiments, the color adjustment unit is further configured to perform YUV sampling on the image to be colored to obtain component Y, and use the component Y as a guide map to perform guided filtering on the thumbnail segmentation result; upsample the result of the guided filtering through a sampler of a graphics processor GPU to obtain classification labeling information of the image to be colored.

[0051] In one of the embodiments, the key area determination module is further configured to perform target image segmentation on the image to be colored, convert the obtained target image from a first color space to a second color space, the target image being a partial image of the image to be colored that includes the key area; determine the key area in the target image according to a preset parameter range in the second color space, and obtain the key area image; and binarize the key area image to obtain a mask image of the key area.

[0052] In one of the embodiments, the blending operation module is further configured to restore the intermediate image to the first color space; and perform a blending operation on the key area image and the intermediate image restored to the first color space through the mask image of the key area to obtain the target image.

[0053] According to a third aspect of an embodiment of the present disclosure, there is provided an electronic device, including:

[0054] processor;

[0055] a memory for storing instructions executable by the processor;

[0056] The processor is configured to execute the instructions to implement the audio processing method described in any one of the embodiments of the first aspect.

[0057] According to a fourth aspect of the embodiments of the present disclosure, a storage medium, when instructions in the storage medium are executed by a processor of an electronic device, enables the electronic device to execute the audio processing method as described in any one of the embodiments of the first aspect.

[0058] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided, the program product comprising a computer program, the computer program being stored in a readable storage medium, at least one processor of a device reading and executing the computer program from the readable storage medium, so that the device executes the color adjustment method described in any one of the embodiments of the first aspect.

[0059] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:

[0060] By obtaining the image to be adjusted and the color adjustment template corresponding to the image to be adjusted; and taking the color adjustment template as the target, adjusting the image to be adjusted to obtain an intermediate image; then considering the color information and authenticity of the image itself, determining the key area that needs color protection in the image to be adjusted, and obtaining the mask image of the key area; through the mask image of the key area, mixing the key area image with the intermediate image, retaining the color of the key area in the image to be adjusted. Avoiding the color distortion of the key area during the color adjustment process, protecting the color information of the key area, and finally obtaining the target image retains the original information of the image.

[0061] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS

[0062] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.

[0063] Figure 1 The figure is a diagram showing an application environment of a color adjustment method according to an exemplary embodiment.

[0064] Figure 2a The figure is a flow chart of a color adjustment method according to an exemplary embodiment.

[0065] Figure 2b 8 templates suitable for color adjustment are shown according to an exemplary embodiment.

[0066] Figure 3 The following is a flowchart of determining a color palette template according to an exemplary embodiment.

[0067] Figure 4 is a flowchart of step S220 according to an exemplary embodiment.

[0068] Figure 5a is a flowchart of step S420 according to an exemplary embodiment.

[0069] Figure 5b The figure is a flow chart of a color adjustment method according to an exemplary embodiment.

[0070] Figure 6 is a flowchart of step S410 according to an exemplary embodiment.

[0071] Figure 7 is a flowchart of step S620 according to an exemplary embodiment.

[0072] Figure 8 is a flowchart of step S230 according to an exemplary embodiment.

[0073] Fig. 9 is a flowchart of step S240 according to an exemplary embodiment.

[0074] Fig.10 The figure is a flow chart of a color adjustment method according to an exemplary embodiment.

[0075] Fig.11 is a block diagram of a color adjustment device according to an exemplary embodiment.

[0076] Fig.12 The figure is a diagram showing the internal structure of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0077] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.

[0078] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.

[0079] The color adjustment method provided in the present disclosure can be applied to Figure 1In the application environment shown. Among them, the terminal 110 interacts with the server 120 through the network. An application or applet with a short video or live broadcast function is installed on the terminal 110. In response to the operation instruction of shooting or live broadcast, the terminal 110 obtains an image, a video file or a live video stream, and sends the obtained image, video file or live video stream to the server 120. Since color coordination is of great significance to video image restoration and image display, the server 120 can perform color coordination processing on the received image, video file or live video stream. However, if the image is adjusted by simply changing the hue abruptly, it will greatly destroy the overall composition and color of the image. In the scheme disclosed in the present invention, the server 120 obtains the image to be adjusted and the color adjustment template corresponding to the image to be adjusted; with the color adjustment template as the target, the image to be adjusted is adjusted to obtain an intermediate image; the key area that needs color protection is determined in the image to be adjusted, and the mask image of the key area is obtained; through the mask image of the key area, the key area image and the intermediate image are mixed to obtain the target image. It can be seen that: first, the image to be colored is adjusted by using the color adjustment template to obtain an intermediate image; then, considering the color information and authenticity of the image itself, the key area that needs color protection is determined in the image to be colored, and the mask image of the key area is obtained; finally, the mask image of the key area is mixed with the intermediate image to retain the color of the key area in the image to be colored, so as to avoid the color distortion of the key area during the color adjustment process, realize the protection of the color information of the key area, and finally obtain the target image that retains the original information of the image.

[0080] The terminal 110 may be, but is not limited to, various personal computers, laptop computers, smart phones, tablet computers, and portable wearable devices, and the server 120 may be implemented as an independent server or a server cluster consisting of multiple servers.

[0081] Figure 2a is a flow chart of a color adjustment method according to an exemplary embodiment. Figure 2a As shown, the color adjustment method is used in the server 120, and includes the following steps:

[0082] In step S210, the image to be toned and the toning template corresponding to the image to be toned are obtained.

[0083] Among them, the image to be color-adjusted refers to an image in which the colors in the image are not harmonious and need to be harmonized. From an aesthetic point of view, harmonious colors refer to a set of colors that can give people a visual sense of beauty. This set of colors is not composed of a few specific colors, but is determined by their relative position in the color space. There are many definitions of harmonious colors, but the most widely used one is the color wheel model proposed by Matsuda in the document "Color Design" in 1995. In this document, the author represents the hue as a circle, and the hue of the harmonious color is defined as 8 templates composed of sectors of different sizes, such as Figure 2b shown.

[0084] Specifically, the terminal obtains an image or a video in response to the shooting instruction, and the image can be sent to the server as the image to be adjusted, and the server obtains the image to be adjusted. A frame of image can be obtained from the video as the image to be adjusted and sent to the server, or the video is sent to the server, and the server obtains a frame of image from the video as the image to be adjusted. The server can also obtain a frame of image from the received live video stream as the image to be adjusted. If the image to be adjusted is adjusted to make its color coordinated, it is necessary to obtain a color adjustment template corresponding to the image to be adjusted, and the color adjustment template matches the image to be adjusted. The color of the image to be adjusted is adjusted by the color adjustment template to make its color coordinated.

[0085] In step S220, the image to be toned is toned with the toning template as a target to obtain an intermediate image.

[0086] The hue represented by the fan-shaped area in each template represents the hue of the coordinated color that conforms to this template. The size and relative position relationship of the fan-shaped area in each template are fixed. This relative position relationship defines a set of coordinated colors that can be represented by this template, and this set of coordinated colors can be generated by rotating the fan-shaped area in the color wheel. Each time it rotates to a position, a new coordinated color will be generated. Specifically, with the color adjustment template as the target, the hue histogram of the image to be adjusted is rotated at an appropriate angle, and the hue of the pixels outside the fan-shaped area is compressed into the fan-shaped area to obtain the intermediate image.

[0087] In step S230, a key area that needs color protection is determined in the image to be toned, and an image of the key area and a mask image of the key area are obtained.

[0088] Specifically, when the image to be toned is toned, the areas in the image to be toned that are not of coordinated colors will be toned. However, in the face of different scenes, not all colors need to be adjusted, and the colors of some areas in the image need to be protected to avoid information loss. For example, if the skin color or sky color in an image is toned, the skin color or sky color will be distorted. Therefore, it is necessary to determine the key areas that need color protection in the image to be toned. Further, in order to retain the color information of the key area, the image to be toned is detected to obtain a key area image. The key area image is an image of the same size as the image to be toned. The other areas in the image to be toned except the key area can be set to the corresponding transparency according to actual needs, and the original chroma, saturation and brightness of the key area are retained to obtain the key area image. For example, other areas are set to be completely transparent. In order to block or protect the key area, the key area image is further processed to obtain a mask image of the key area.

[0089] In step S240, the key area image and the intermediate image are blended by using the mask image of the key area to obtain a target image.

[0090] Specifically, the image blending operation can be a linear blending operation such as a binary pixel operation, which traverses the corresponding pixel points in the key area image and the intermediate image, multiplies the corresponding color value by the corresponding weight and then adds them. The weight of each pixel point in the key area image and the weight of the corresponding pixel point in the intermediate image are determined by the color value of the corresponding pixel point in the mask image of the key area. Therefore, the weight of each pixel point in the two images during the blending operation is determined by the color value of each pixel point in the mask image of the key area, so that the key area image and the intermediate image are blended according to the weight of each pixel point in the two images to obtain the target image.

[0091] For example, the specific formula is as follows:

[0092]

[0093] Among them, g(x) is the color value of each pixel in the target image obtained after the blending operation, c1 is the color value of each pixel in the key area image, and c2 is the color value of each pixel in the intermediate image. is the pixel value corresponding to each pixel in the mask image of the key area, indicating the weight of the corresponding pixel in the intermediate image; Represents the weight of the corresponding pixel in the key area image.

[0094] In the above color adjustment method, the image to be adjusted is firstly adjusted by using a color adjustment template to obtain an intermediate image; then, considering the color information and authenticity of the image itself, the key area that needs color protection is determined in the image to be adjusted, and a mask image of the key area is obtained; finally, the mask image of the key area is mixed with the intermediate image to retain the color of the key area in the image to be adjusted, so as to avoid distortion of the color of the key area during the color adjustment process, realize the protection of the color information of the key area, and finally obtain the target image that retains the original information of the image.

[0095] In an exemplary embodiment, if Figure 3 As shown, the determination of the color template can be achieved through the following steps:

[0096] In step S310, a plurality of candidate templates and a hue histogram of the image to be toned are obtained.

[0097] Among them, Figure 2b As shown in the figure, the hue of the coordinated color is defined as 8 candidate templates composed of sectors of different sizes, and each candidate template includes a sector area. HSV space is the most commonly used color space for histograms. Its three components represent hue, saturation, and value. Hue refers to the relative brightness of an image, which is expressed as color on a color image and is measured by angle. The value range is 0° to 360°, starting from red and calculated in a counterclockwise direction. Red is 0°, green is 120°, and blue is 240°. The lightness value indicates the brightness of the color. Colors with the same hue may have different brightness. For example, both crimson and pink contain red, but the former is dark and the latter is bright. Usually the lightness value ranges from 0% (black) to 100% (white). Specifically, to calculate the hue histogram, the HSV color space needs to be divided into several small color intervals, and each small interval becomes a bin of the histogram. Then, the hue histogram can be obtained by counting the number of pixels whose colors fall in each small interval.

[0098] In step S320, the color adjustment evaluation information is determined according to the hue histogram of the image to be adjusted and the boundaries of the fan-shaped regions in each candidate template.

[0099] The color evaluation information of the candidate template is exemplarily in the form of calculating the score of the candidate template. Specifically, the hue and saturation of the image to be colored can be obtained through the hue histogram of the image to be colored. Each candidate template has a sector area, and the sector area has a boundary. The distance between the hue of each pixel in the image to be colored and the boundary of the sector area is calculated. The score of each candidate template is calculated by the distance and the saturation of the image to be colored. Exemplarily, the calculation is performed according to the following formula:

[0100]

[0101] in, is the score of the candidate template, X represents the image, p represents the pixel in the image, H(p) represents the hue value (Hue) of each pixel in the image, S(p) represents the saturation value (Saturation) of each pixel in the image, Represents the boundary of each pixel's hue value closest to the fan-shaped area. Represents the distance between the hue of each pixel in the to-be-toned image and the boundary of the fan-shaped area.

[0102] In step S330 , a color adjustment template is determined from among the candidate templates according to the color adjustment evaluation information of the candidate templates.

[0103] Specifically, by calculating the score of each candidate template, and determining whether the candidate template matches the hue histogram of the image to be toned according to the score of each candidate template, the toning template is determined in each candidate template. The image to be toned is toned by the toning template to obtain a target image. Exemplarily, the scores of each candidate template represent the degree of matching, and by comparison, the candidate template with the highest score can be determined as the toning template.

[0104] In the above-mentioned embodiment of determining the color adjustment template, a plurality of candidate templates and the hue histogram of the image to be adjusted are obtained; the color adjustment evaluation information of each candidate template is determined according to the hue histogram of the image to be adjusted and the boundary of the fan-shaped area in each candidate template; and the color adjustment template is determined according to the color adjustment evaluation information of each candidate template. The color adjustment template provides a reference basis for the subsequent color adjustment process, and the image to be adjusted is adjusted through the color adjustment template, and the color of the image to be adjusted is initially improved to make the color of the image to be adjusted harmonious.

[0105] In an exemplary embodiment, if Figure 4 As shown, in step S220, the to-be-toned image is toned with the toning template as the target to obtain an intermediate image, which can be specifically achieved by the following steps:

[0106] In step S410, image segmentation and acceleration-guided filtering are performed on the image to be toned to determine classification label information of the image to be toned.

[0107] Among them, the classification labeling information of the image to be adjusted is the labeling information obtained by labeling the category of each pixel in the image to be adjusted. In order to solve the problem of discontinuity of pixels in isolated areas after color adjustment, the image to be adjusted is segmented (graph-cut algorithm), and the image to be adjusted is classified and labeled. For example, the pixels in the image to be adjusted can be marked as 0 or 1. However, image segmentation has the problem of scaling and restoring image boundaries. In order to solve the problem of uneven edges and hard boundaries caused by classification in image segmentation, an accelerated guide filter is used to guide the image segmentation result. In this way, in the process of image segmentation and accelerated guide filtering of the image to be adjusted, the category labeling of each pixel in the image to be adjusted is completed, and the foreground area is marked as one category and the background area is marked as another category.

[0108] In step S420, the to-be-toned image is toned based on the classification mark information of the to-be-toned image with the to-be-toned template as the target, to obtain an intermediate image.

[0109] Specifically, there is a fan-shaped area in the color adjustment template, and the color tone within the fan-shaped area is a coordinated color. The color tone outside the fan-shaped area in the image to be adjusted is adjusted, and the image to be adjusted is placed in the corresponding fan-shaped area according to the classification mark information of the image to be adjusted, and the image to be adjusted is adjusted to obtain an intermediate image.

[0110] In the above color adjustment method, the classification mark information of the image to be adjusted is determined by performing image segmentation and acceleration guided filtering on the image to be adjusted; thus, the image to be adjusted is adjusted according to the classification mark information of the image to be adjusted with the color adjustment template as the target to obtain an intermediate image. The classification of each pigment in the image to be adjusted is achieved, and the continuity of pixel color and the smoothness and neatness of the boundary are ensured.

[0111] In an exemplary embodiment, if Figure 5a As shown, in step S420, the to-be-toned image is toned based on the classification mark information of the to-be-toned image with the to-be-toned template as the target, to obtain an intermediate image, which can be specifically achieved by the following steps:

[0112] In step S510a, the color tone in the color tone histogram of the image to be toned is adjusted according to the classification mark information of the image to be toned by the graphics processor GPU.

[0113] In step S520a, the to-be-adjusted tone is compressed into a sector-shaped area to obtain an intermediate image.

[0114] Among them, the to-be-adjusted hue is the hue in the hue histogram except for the fan-shaped area. A graphics processor GPU is a microprocessor that is specifically used for image computing on personal computers, workstations, game consoles, and some mobile devices (such as tablet computers, smart phones, etc.). Its purpose is to convert and drive the display information required by the computer system, and to provide a row scanning signal to the display to control the correct display of the display. It is an important component that connects the display and the main board of the electronic device. Specifically, after obtaining the classification mark information of the image to be adjusted, it can be known to which fan-shaped area the hue of each pixel is compressed, and the to-be-adjusted image is adjusted by a color coordination model (Color Harmoniztion). In order to realize real-time color adjustment and batch color adjustment of video files, the color coordination model is deployed on the graphics processor GPU. Through the graphics processor GPU, according to the classification mark information of the image to be adjusted, it is determined that the hue of each pixel in the image to be adjusted is compressed into the fan-shaped area closest to it, and an intermediate image is obtained. In this way, not only the compression distance is minimized, but also the color difference change will not be too large. Exemplarily, the hue of each pixel is compressed into the corresponding fan-shaped area according to the following formula:

[0115]

[0116] Among them, H′(p) represents the hue value (Hue) of each pixel of the adjusted image, C(p) represents the center of the fan-shaped area, ω represents the width of the fan-shaped area, and G σ represents a standard Gaussian function with a mean of 0 and a variance of σ, which can be equal to

[0117] In the above color adjustment method, the color tone in the color tone histogram of the image to be adjusted is adjusted according to the classification mark information of the image to be adjusted by the graphics processor GPU, and the color tone to be adjusted is compressed into the fan-shaped area to obtain an intermediate image. Real-time color adjustment through the server and batch color adjustment of video files are realized.

[0118] In an exemplary embodiment, if Figure 5b As shown, before step S410, the color adjustment method further includes:

[0119] In step S510b, when the number of the sector-shaped regions is greater than one, the distance between the to-be-adjusted hue and the boundary of each sector-shaped region and the saturation corresponding to the to-be-adjusted hue are obtained.

[0120] Specifically, the distance between the hue to be adjusted and the boundary of the sector area is the angle between the hue to be adjusted and the boundary. When the number of sector areas in the color adjustment template is greater than one, it is necessary to consider into which sector area the hue to be adjusted is compressed. In order to ensure the coordination of the image to be adjusted and the retention of the original color information at the same time, the color difference before and after the color adjustment is required to be as small as possible, and the distance to be compressed is also as small as possible. Therefore, it is necessary to determine how to compress the image to be adjusted based on the distance between the hue to be adjusted and the boundary of each sector area, and then obtain the distance between the hue to be adjusted and the boundary of each sector area. Furthermore, the saturation corresponding to the hue to be adjusted also affects the color adjustment of the image to be adjusted, so the saturation corresponding to the hue to be adjusted is obtained.

[0121] In step S410, image segmentation and acceleration-guided filtering are performed on the image to be toned to determine classification label information of the image to be toned, which can be specifically achieved by the following steps:

[0122] In step S520b, when the distances between the to-be-adjusted hue and the boundaries of each sector-shaped region are equal and the saturation is less than the saturation threshold, image segmentation and acceleration-guided filtering are performed on the to-be-adjusted image to determine the classification mark information of the to-be-adjusted image.

[0123] Specifically, when the color adjustment template has two symmetrical sector-shaped areas, the two sector-shaped areas represent complementary colors, that is, the hue difference in the sector-shaped areas is very large. When the hue to be adjusted is adjusted to the sector-shaped area, there are some hues to be adjusted that are equal to the distance between the boundaries of each sector-shaped area or the distance difference between the two is within a preset distance threshold (such as 10°). If the pixels in this area are compressed into different sector-shaped areas, the color difference in this area will increase. Furthermore, "saturation" refers to the vividness of the color. Usually the saturation value ranges from 0% to 100%. The larger the value, the more saturated the color. If the saturation in a certain area is lower than the saturation threshold (such as 10%), the difference between the hues with lower saturation is not large. If it is compressed into a completely different sector-shaped area, the color difference in the area will also increase. Therefore, when the distance between the to-be-adjusted hue and the boundary of each sector-shaped area is equal, and the saturation is less than the saturation threshold, image segmentation and acceleration-guided filtering are performed on the image to be adjusted, and the classification mark information of the image to be adjusted is determined. According to the classification mark information of the image to be adjusted, these to-be-adjusted hues are compressed into the same sector-shaped area, which can ensure the color continuity in the area and avoid the appearance of two tones with a large color difference in adjacent areas or in the same area.

[0124] In the above color adjustment method, when the number of sector-shaped areas is greater than 1, the distance between the to-be-adjusted hue and the boundary of each sector-shaped area and the saturation corresponding to the to-be-adjusted hue are obtained. When the distance between the to-be-adjusted hue and the boundary of each sector-shaped area is equal, and the saturation is less than the saturation threshold, the image to be adjusted is subjected to image segmentation and accelerated guided filtering to determine the classification label information of the image to be adjusted. By setting the prerequisite, the image processing work is reduced, the processing speed is accelerated, and the continuity of the color in the area is guaranteed, so as to avoid the appearance of two tones with a large color difference in adjacent areas or in the same area.

[0125] In an exemplary embodiment, if Figure 6 As shown, in step S410, image segmentation and accelerated guided filtering are performed on the image to be toned to determine the classification mark information of the image to be toned, which can be specifically achieved by the following steps:

[0126] In step S610, down-sampling and image segmentation are performed on the image to be toned to obtain a thumbnail segmentation result.

[0127] In step S620, the thumbnail segmentation result is subjected to accelerated guided filtering and up-sampling processing to obtain classification label information of the image to be toned.

[0128] Specifically, the image to be toned is first downsampled to obtain a reduced image, and the image is segmented by an interactive graph-cut algorithm to segment the reduced image into foreground and background to obtain a thumbnail segmentation result of the image to be toned. The reduced image needs to be restored, and the hard boundaries caused by the segmentation are processed. The thumbnail segmentation result is accelerated guided filtering, and upsampling is performed to complete linear interpolation to obtain the classification label information of the image to be toned.

[0129] In the above color adjustment method, the image to be adjusted is downsampled and segmented to obtain a thumbnail segmentation result; the thumbnail segmentation result is then accelerated by guided filtering and upsampling to obtain classification labeling information of the image to be adjusted. The image to be adjusted is downsampled, cutout is performed on a small image, and then upsampled, thereby speeding up the image processing speed.

[0130] In an exemplary embodiment, if Figure 7 As shown, in step S620, the thumbnail segmentation result is subjected to accelerated guided filtering and upsampling processing to obtain classification label information of the image to be toned, which can be specifically achieved by the following steps:

[0131] In step S710, YUV sampling is performed on the image to be toned to obtain component Y, and component Y is used as a guide map to perform guided filtering on the thumbnail segmentation result.

[0132] In step S720, the result of the guided filtering is up-sampled by a sampler of a graphics processing unit (GPU) to obtain classification label information of the image to be toned.

[0133] Among them, YUV refers to a pixel format in which the brightness parameter and the chrominance parameter are represented separately. Three arrays can be used to store the three components of YUV separately. The sampling rate of the chrominance channel can be lower than that of the Y channel without significantly reducing the visual quality. There is a representation that can be used to describe the sampling frequency ratio of U and V to Y, which is called the A:B:C representation. The YUV sampling formats are YCbCr4:2:0, YCbCr4:2:2, YCbCr4:1:1 and YCbCr4:4:4. Specifically, YUV sampling is performed on the image to be toned to obtain component Y. Since image segmentation leads to hard boundaries, the thumbnail segmentation result is processed using a guided filter with edge preservation function. Guided filtering requires a guide map, so component Y is used as the guide map to perform guided filtering on the thumbnail segmentation result.

[0134] In an exemplary embodiment, if Figure 8 As shown, in step S230, a key area that needs color protection is determined in the image to be toned, and a key area image and a mask image of the key area are obtained, which can be specifically achieved by the following steps:

[0135] In step S810, target image segmentation is performed on the image to be toned, and the obtained target image is converted from the first color space to the second color space.

[0136] In step S820, a key area is determined in the target image according to a preset parameter range in the second color space, and a key area image is obtained.

[0137] In step S830, the key area image is binarized to obtain a mask image of the key area.

[0138] Among them, the target image is a partial image of the image to be adjusted including the key area. Specifically, in order to avoid the influence of the background area, the image to be adjusted is segmented, the target image is extracted therefrom, and the target image is converted from the first color space to the second color space. In the second color space, the key area is determined in the target image according to the preset parameter range, and according to the determined key area, the color information corresponding to the key area is retained in the image to be adjusted, and the color information of the area other than the key area is removed to obtain the key area image. The key area image has the same size as the image to be adjusted. The key area image is binarized to obtain a mask image of the key area, and the pixel value corresponding to the mask image ranges from 0 to 1. That is, the pixel value corresponding to the key area is 1, and the pixel value corresponding to other areas is 0. It should be noted that in order to ensure the smoothness and neatness of the edge, the pixel value corresponding to the edge of the key area may be 0.3, 0.5 or 0.7.

[0139] Exemplarily, the image to be adjusted includes a portrait, the partial image corresponding to the portrait is the target image, and the skin area exposed in the portrait is the key area. In the process of adjusting the color of the image to be adjusted, the authenticity of the skin color needs to be guaranteed. The portrait image is extracted from the image to be adjusted. Since the skin color of a person follows the elliptical model, and the elliptical model runs in the CYCM space, in order to extract the skin color area image from the portrait image, the portrait image is converted from the RGB color space to the CYCM space. Therefore, according to the constraint that the skin color of a person follows the rules of the elliptical model, the skin area is determined in the portrait image according to the parameter range of the skin color area, the original color of the skin area is retained, and the color information of the area outside the skin area is removed to obtain the skin area image. The skin area image is binarized to obtain a mask image of the skin area, and the pixel value corresponding to the mask image ranges from 0 to 1.

[0140] The above color adjustment method determines the key area from the image to be color adjusted, and obtains the key area image and the mask image of the key area, which not only provides a data basis for the mixing operation in the subsequent color adjustment process, but also accurately determines the range that needs color protection in the image to be color adjusted based on the key area.

[0141] In an exemplary embodiment, if Fig. 9 As shown, in step S240, the key area image and the intermediate image are mixed by the mask image of the key area to obtain the target image, which can be specifically achieved by the following steps:

[0142] In step S910, the intermediate image is restored to the first color space.

[0143] In step S920, a blending operation is performed on the key area image and the intermediate image restored to the first color space by using the mask image of the key area to obtain a target image.

[0144] Specifically, since the intermediate image is in the HSV space and the key area image is in the first color space, if a mixing operation (mix operation) is performed on the two, the intermediate image needs to be restored to the first color space. After restoring the intermediate image to the first color space, the mask image of the key area is used to mix the key area image with the intermediate image restored to the first color space to obtain the target image. For example, the specific formula is as follows:

[0145]

[0146] Among them, g(x) is the pixel value of each pixel in the target image obtained after the blending operation, color1 is the pixel value of each pixel in the key area image in the first color space, and color2 is the pixel value of each pixel in the intermediate image in the first color space. is the pixel value corresponding to each pixel in the mask image of the key area, indicating the weight of the corresponding pixel in the intermediate image; represents the weight of the corresponding pixel in the key area image. Furthermore, in order to preserve the color information of the key area, The value is 0, g(x) = color1, that is, the color of the key area image is used to restore the toned color in this area. In other areas except the key area, The value is 1, g(x) = color2, that is, the adjusted color is used in this area to make the color of the image harmonious.

[0147] Fig.10 is a flow chart of a color adjustment method according to an exemplary embodiment. Fig.10 As shown, the color adjustment method is used in the server 120, and includes the following steps:

[0148] In step S1002, an image to be toned is obtained.

[0149] In step S1004, a plurality of candidate templates and a hue histogram of the image to be toned are obtained, and each candidate template includes a sector-shaped region.

[0150] In step S1006, the score of each candidate template is determined according to the hue histogram of the image to be toned and the boundary of the fan-shaped area in each candidate template.

[0151] In step S1008, a color adjustment template is determined from among the candidate templates according to the scores of the candidate templates.

[0152] In step S1010, image segmentation and acceleration-guided filtering are performed on the image to be toned to determine classification label information of the image to be toned.

[0153] When the number of the sector-shaped regions is greater than 1, the distance between the to-be-adjusted hue and the boundary of each sector-shaped region and the saturation corresponding to the to-be-adjusted hue are obtained. When the distance between the to-be-adjusted hue and the boundary of each sector-shaped region is equal, and the saturation is less than the saturation threshold, the image to be toned is downsampled and segmented to obtain a thumbnail segmentation result. The thumbnail segmentation result is accelerated guided filtering and upsampling to obtain classification label information of the image to be toned.

[0154] Furthermore, the thumbnail segmentation result is subjected to accelerated guided filtering and upsampling processing to obtain classification labeling information of the image to be colored, which can be specifically achieved through the following steps: YUV sampling is performed on the image to be colored to obtain component Y, component Y is used as a guide map, and guided filtering is performed on the thumbnail segmentation result; the result of the guided filtering is upsampled by the sampler of the graphics processor GPU to obtain classification labeling information of the image to be colored.

[0155] In step S1012, the color tone in the color tone histogram of the image to be toned is adjusted according to the classification mark information of the image to be toned by the graphics processor GPU.

[0156] In step S1014, the to-be-adjusted tone is compressed into a sector-shaped area to obtain an intermediate image.

[0157] In step S1016, target image segmentation is performed on the image to be toned, and the obtained target image is converted from the first color space to the second color space.

[0158] The target image is a partial image including a key area in the image to be toned.

[0159] In step S1018, a key area is determined in the target image according to a preset parameter range in the second color space, and a key area image is obtained.

[0160] In step S1020, the key area image is binarized to obtain a mask image of the key area.

[0161] In step S1022, the intermediate image is restored to the first color space.

[0162] In step S1024, the key area image and the intermediate image restored to the first color space are blended using the mask image of the key area to obtain a target image.

[0163] It should be understood that, although the various steps in the above flowchart are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear description in this article, the execution of these steps is not strictly limited in order, and these steps can be executed in other orders. Moreover, at least a part of the steps in the above flowchart may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.

[0164] Fig.11 is a block diagram of a color adjustment device according to an exemplary embodiment. Fig.11 The device includes a first acquisition module 1102, a color adjustment module 1104, a key area determination module 1106 and a blending operation module 1108.

[0165] The first acquisition module 1102 is configured to acquire the image to be color-adjusted and the color-adjusting template corresponding to the image to be color-adjusted;

[0166] A color adjustment module 1104 is configured to perform color adjustment on the image to be color adjusted based on the color adjustment template to obtain an intermediate image;

[0167] The key area determination module 1106 is configured to determine the key area that needs color protection in the image to be toned, and obtain a key area image and a mask image of the key area;

[0168] The blending operation module 1108 is configured to perform a blending operation on the key area image and the intermediate image through the mask image of the key area to obtain a target image.

[0169] In an exemplary embodiment, the color adjustment device also includes a color adjustment template determination module, which is configured to execute the acquisition of several candidate templates and the hue histogram of the image to be colored, each of the candidate templates including a fan-shaped area; determine the color adjustment evaluation information of each of the candidate templates according to the hue histogram of the image to be colored and the boundaries of the fan-shaped areas in each of the candidate templates; and determine the color adjustment template in each of the candidate templates according to the color adjustment evaluation information of each of the candidate templates.

[0170] In an exemplary embodiment, the color adjustment module includes a classification marking unit and a color adjustment unit; wherein:

[0171] The classification marking unit is configured to perform image segmentation and acceleration guided filtering on the image to be toned, and determine classification marking information of the image to be toned;

[0172] The color adjustment unit is configured to perform color adjustment on the image to be color adjusted based on the classification mark information of the image to be color adjusted with the color adjustment template as the target, so as to obtain an intermediate image.

[0173] In an exemplary embodiment, the color adjustment unit is further configured to execute, through a graphics processor GPU, adjustment of the hue in the hue histogram of the image to be colored according to the classification mark information of the image to be colored; compressing the hue to be adjusted into the fan-shaped area to obtain the intermediate image, wherein the hue to be adjusted is the hue in the hue histogram excluding the fan-shaped area.

[0174] In an exemplary embodiment, the color adjustment device further includes a second acquisition module, wherein the second acquisition module is configured to acquire the distance between the to-be-adjusted hue and the boundary of each of the to-be-adjusted hue and the saturation corresponding to the to-be-adjusted hue when the number of the fan-shaped regions is greater than one;

[0175] The color adjustment unit is further configured to perform image segmentation and acceleration guided filtering on the image to be color adjusted when the distance between the hue to be adjusted and the boundary of each of the sector-shaped areas is equal and the saturation is less than a saturation threshold, so as to determine the classification mark information of the image to be color adjusted.

[0176] In an exemplary embodiment, the color adjustment unit is further configured to perform downsampling processing and image segmentation on the image to be color adjusted to obtain a thumbnail segmentation result; and perform accelerated guided filtering and upsampling processing on the thumbnail segmentation result to obtain classification labeling information of the image to be color adjusted.

[0177] In an exemplary embodiment, the color adjustment unit is further configured to perform YUV sampling on the image to be colored to obtain component Y, and use the component Y as a guide map to perform guided filtering on the thumbnail segmentation result; upsample the result of the guided filtering through a sampler of a graphics processor GPU to obtain classification labeling information of the image to be colored.

[0178] In an exemplary embodiment, the key area determination module is further configured to perform target image segmentation on the image to be colored, convert the obtained target image from a first color space to a second color space, the target image being a partial image of the image to be colored that includes the key area; determine the key area in the target image according to a preset parameter range in the second color space, and obtain the key area image; and binarize the key area image to obtain a mask image of the key area.

[0179] In an exemplary embodiment, the blending operation module is further configured to restore the intermediate image to the first color space; and perform a blending operation on the key area image and the intermediate image restored to the first color space through the mask image of the key area to obtain the target image.

[0180] Regarding the device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.

[0181] Fig.12 1 is a block diagram of a device 1200 for color matching according to an exemplary embodiment. For example, the device 1200 may be a server. Fig.12 The device 1200 includes a processing component 1220, which further includes one or more processors, and a memory resource represented by a memory 1222 for storing instructions executable by the processing component 1220, such as an application. The application stored in the memory 1222 may include one or more modules, each corresponding to a set of instructions. In addition, the processing component 1220 is configured to execute the instructions to perform the above-mentioned color adjustment method.

[0182] The device 1200 may also include a power component 1224 configured to perform power management of the device 1200, a wired or wireless network interface 1226 configured to connect the device 1200 to a network, and an input / output (I / O) interface 1228. The device 1200 may operate based on an operating system stored in the memory 1222, such as Windows Server, Mac OSX, Unix, Linux, FreeBSD, or the like.

[0183] In an exemplary embodiment, a storage medium including instructions is also provided, such as a memory 1222 including instructions, and the instructions can be executed by a processor of the device 1200 to perform the above color adjustment method. The storage medium can be a non-transitory computer-readable storage medium, for example, the non-transitory computer-readable storage medium can be a ROM, a random access memory (RAM), a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0184] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention 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 common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The specification and examples are intended to be exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.

[0185] It should be understood that the present disclosure is not limited to the exact structures that have been described above and shown in the drawings, and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims

1. A color adjustment method, characterized in that: include: Acquire a plurality of candidate templates and a hue histogram of the image to be toned, each of the candidate templates comprising a sector-shaped area; Determining color evaluation information of each candidate template according to the hue histogram of the image to be color-adjusted and the boundary of the fan-shaped area in each candidate template; Determining a color adjustment template from among the candidate templates according to the color adjustment evaluation information of the candidate templates; Performing image segmentation and accelerated guided filtering on the image to be color-adjusted to determine classification label information of the image to be color-adjusted; Taking the color grading template as a target, adjusting the hue in the hue histogram of the image to be grading according to the classification mark information of the image to be grading through a graphics processor (GPU), compressing the hue to be adjusted into the sector-shaped area, and obtaining an intermediate image, wherein the hue to be adjusted is the hue in the hue histogram excluding the sector-shaped area; Determining a key area that needs color protection in the image to be toned, and obtaining a key area image and a mask image of the key area; The target image is obtained by performing a blending operation on the key area image and the intermediate image through the mask image of the key area.

2. The color adjustment method according to claim 1, characterized in that: Before performing image segmentation and accelerated guided filtering on the image to be color-adjusted to determine classification label information of the image to be color-adjusted, the method further includes: When the number of the sector-shaped regions is greater than one, obtaining the distance between the to-be-adjusted hue and the boundary of each of the sector-shaped regions and the saturation corresponding to the to-be-adjusted hue; The step of performing image segmentation and accelerated guided filtering on the image to be color-adjusted to determine classification label information of the image to be color-adjusted includes: When the distances between the to-be-adjusted hue and the boundaries of each of the sector-shaped regions are equal, and the saturation is less than a saturation threshold, image segmentation and accelerated guided filtering are performed on the to-be-adjusted image to determine classification label information of the to-be-adjusted image.

3. The color adjustment method according to claim 1, characterized in that: The step of performing image segmentation and accelerated guided filtering on the image to be color-adjusted to determine classification label information of the image to be color-adjusted includes: Performing downsampling and image segmentation on the image to be toned to obtain a thumbnail segmentation result; The thumbnail segmentation result is subjected to accelerated guided filtering and up-sampling processing to obtain classification label information of the image to be toned.

4. The color adjustment method according to claim 3, characterized in that: The step of performing accelerated guided filtering and upsampling processing on the thumbnail segmentation result to obtain classification label information of the image to be toned includes: Performing YUV sampling on the image to be toned to obtain component Y, using component Y as a guide map, and performing guided filtering on the thumbnail segmentation result; The result of the guided filtering is up-sampled by a sampler of a graphics processing unit (GPU) to obtain classification label information of the image to be toned.

5. The color matching method according to any one of claims 1 to 4, characterized in that: The step of determining a key area requiring color protection in the image to be toned and obtaining a key area image and a mask image of the key area includes: Performing target image segmentation on the image to be toned, and converting the obtained target image from the first color space to the second color space, wherein the target image is a partial image of the image to be toned including the key area; Determining the key area in the target image according to a preset parameter range in the second color space, and obtaining the key area image; The key area image is binarized to obtain a mask image of the key area.

6. The color adjustment method according to claim 5, characterized in that: The step of performing a blending operation on the key area image and the intermediate image through the mask image of the key area to obtain a target image includes: Restoring the intermediate image to the first color space; The target image is obtained by performing a blending operation on the key area image and the intermediate image restored to the first color space through the mask image of the key area.

7. A color adjustment device, characterized in that: include: The coloring template determination module is configured to obtain a plurality of candidate templates and a hue histogram of the image to be color-toned, each of the candidate templates including a sector-shaped area; and determine the coloring evaluation information of each of the candidate templates according to the hue histogram of the image to be color-toned and the boundaries of the sector-shaped areas in each of the candidate templates; Determining the color adjustment template from among the candidate templates according to the color adjustment evaluation information of each candidate template; A first acquisition module is configured to acquire an image to be color-adjusted and a color-adjusting template corresponding to the image to be color-adjusted; A color adjustment module, including a classification marking unit, configured to perform image segmentation and acceleration guided filtering on the image to be color adjusted, and determine classification marking information of the image to be color adjusted; a color adjustment unit configured to adjust the color tone in the color tone histogram of the image to be adjusted according to the classification mark information of the image to be adjusted through a graphics processor (GPU), and compress the color tone to be adjusted into the sector-shaped area to obtain an intermediate image, wherein the color tone to be adjusted is the color tone in the color tone histogram except the sector-shaped area; A key area determination module is configured to determine a key area that needs color protection in the image to be toned, and obtain a key area image and a mask image of the key area; The blending operation module is configured to perform a blending operation on the key area image and the intermediate image through the mask image of the key area to obtain a target image.

8. The color mixing device according to claim 7, characterized in that: The color adjustment device further includes a second acquisition module, wherein the second acquisition module is configured to acquire the distance between the to-be-adjusted hue and the boundary of each of the to-be-adjusted hue and the saturation corresponding to the to-be-adjusted hue when the number of the sector-shaped regions is greater than one; The color adjustment unit is further configured to perform image segmentation and acceleration guided filtering on the image to be color adjusted when the distance between the hue to be adjusted and the boundary of each of the sector-shaped areas is equal and the saturation is less than a saturation threshold, so as to determine the classification mark information of the image to be color adjusted.

9. The color mixing device according to claim 7, characterized in that: The color adjustment unit is further configured to perform downsampling processing and image segmentation on the image to be color adjusted to obtain a thumbnail segmentation result; and perform accelerated guided filtering and upsampling processing on the thumbnail segmentation result to obtain classification labeling information of the image to be color adjusted.

10. The color mixing device according to claim 9, characterized in that: The color adjustment unit is also configured to perform YUV sampling on the image to be color adjusted to obtain component Y, use component Y as a guide map, and perform guided filtering on the thumbnail segmentation result; upsample the result of the guided filtering through a sampler of a graphics processor GPU to obtain classification labeling information of the image to be color adjusted.

11. The color mixing device according to any one of claims 7 to 10, characterized in that: The key area determination module is further configured to perform target image segmentation on the image to be toned, and convert the obtained target image from the first color space to the second color space, wherein the target image is a partial image of the image to be toned including the key area; According to a preset parameter range in the second color space, the key area is determined in the target image, and the key area image is obtained; and the key area image is binarized to obtain a mask image of the key area.

12. The color mixing device according to claim 11, characterized in that: The blending operation module is further configured to restore the intermediate image to the first color space; and perform a blending operation on the key area image and the intermediate image restored to the first color space through the mask image of the key area to obtain the target image.

13. An electronic device, characterized in that: include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the color adjustment method according to any one of claims 1 to 6. 14 . A storage medium, when instructions in the storage medium are executed by a processor of an electronic device, the electronic device is enabled to execute the color adjustment method according to claim 1 .

15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the color adjustment method according to any one of claims 1 to 6 is implemented.

Citation Information

Patent Citations

  • Method for producing an image and system for producing an image

    US20080279476A1

  • Method and device for processing a picture

    US20140348421A1