Image color migration method and device, storage medium and electronic equipment

By selecting reference images with high similarity from the image library, extracting the main color of the character's skin and masking the image to be transferred, combining the interval division and adjustment of saturation and brightness, the problem of insufficient saturation in traditional poster production is solved. , achieving the detailed and beautiful image improvement.

CN119444557APending Publication Date: 2025-02-14BEIJING QIYI CENTURY SCI & TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411540891.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-31
Publication Date
2025-02-14

AI Technical Summary

Technical Problem

The traditional poster production method is not flexible enough, which leads to the color of the screen frame picture not saturated enough and cannot attract the audience's attention, resulting in the picture not being beautiful enough.

Method used

By determining the reference image with the highest similarity to the image to be migrated from the image library, the main color of the character skin of the reference image is extracted, and mask-weighted the image to be migrated according to the color. Dividing multiple migration intervals and reference intervals according to the saturation and brightness ranges, determining the migration scheme for each migration interval, adjusting its saturation and brightness to generate a migration image.

Benefits of technology

The detailed control of image color is achieved, the aesthetics and ornamentality of the image is improved, and the problem of insufficient saturation of colors in traditional methods is solved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119444557A_ABST
    Figure CN119444557A_ABST
Patent Text Reader

Abstract

The invention relates to an image color migration method and device, a storage medium and electronic equipment. The method comprises the following steps: determining a reference image with the highest feature similarity with an image to be migrated from an image library; extracting a figure skin main color of the reference image, and performing mask weighting on the to-be-migrated image according to the figure skin main color to obtain a mask image; dividing the mask image into a plurality of intervals to be migrated according to the saturation range and the brightness range, dividing the reference image into a plurality of reference intervals, and determining a migration scheme for each interval to be migrated according to the first data group of each interval to be migrated and the second data group of each reference interval; according to the migration scheme of each to-be-migrated interval, the saturation and brightness of each to-be-migrated interval are adjusted, and a migrated image is obtained. The technical problem that a traditional poster manufacturing method is not flexible enough, and consequently pictures are not attractive enough is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of multimedia intelligent processing technology, and in particular to an image color migration method, device, storage medium and electronic device. Background Art

[0002] Posters play a vital role in film and television marketing. They not only show the theme and connotation of the film and television drama, but also have a profound impact on the audience's first impression. Therefore, the design quality of the poster is closely related to the reputation of the drama. Excellent posters require not only the coordination and integration of characters and backgrounds, but also proper color matching, including the matching of the color of the characters' clothes and the background, and the color matching of the drama title. These elements work together to promote the promotion and sales of film and television dramas. Traditional poster production methods have proposed multiple methods for automatically selecting materials to make posters, which are designed to ensure the beauty of posters while meeting the needs of mass production. However, in the production process, a key problem often faced is that the colors of the screenshots are often not saturated enough, which may be in line with reality in the drama, but for static posters, this color tonality may not attract the audience's attention, resulting in an unsightly picture. Artificially produced static posters usually adjust the saturation, brightness, contrast and color of the image to enhance the visual effect of the picture. At present, the technical solutions are roughly divided into two categories: traditional solutions: based on color temperature theory, the image is adjusted so that the entire picture presents a uniform color temperature, such as warm colors, which helps to enhance the coordination and beauty of the picture. Traditional image enhancement schemes will fine-tune saturation and brightness. However, the disadvantage of this method is that the unified enhancement parameters may not be suitable for all images and may easily produce abnormal color blocks. Model solution: Learn image enhancement methods by training deep learning models. It may be to use artificially made LUTs (Look-Up Tables) for nonlinear mapping, or it may be to build a hidden space based on reference images and learn the color mapping relationship from the original image to the reference image. The advantage is that it has good applicability to image changes, but a large number of reference images or LUTs are required during the training process, and these data are difficult to obtain. These methods have their own advantages and disadvantages. The traditional solution is relatively simple but may not be flexible enough, while the model solution can provide higher adaptability but requires a lot of data support. Summary of the invention

[0003] The present application provides an image color migration method, device, storage medium and electronic device to solve the technical problem that the traditional poster production method is not flexible enough, resulting in an unattractive picture.

[0004] In a first aspect, the present application provides a method for migrating image color, comprising: determining from an image library a reference image having the highest feature similarity to an image to be migrated; extracting the main skin color of the person in the reference image, and performing mask weighting on the image to be migrated according to the main skin color of the person to obtain a mask image; dividing the mask image into a plurality of intervals to be migrated and the reference image into a plurality of reference intervals according to a saturation range and a brightness range, and determining a migration scheme for each interval to be migrated according to a first data group of each interval to be migrated and a second data group of each reference interval, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean and a second brightness variance of the reference interval; adjusting the saturation and brightness of each interval to be migrated according to the migration scheme of the interval to be migrated to obtain a migration image.

[0005] In a second aspect, the present application provides an image color migration device, comprising: a first determination module, used to determine a reference image with the highest feature similarity to the image to be migrated from an image library; an extraction module, used to extract the main skin color of the character in the reference image, and perform mask weighting on the image to be migrated according to the main skin color of the character to obtain a mask image; a second determination module, used to divide the mask image into multiple intervals to be migrated and the reference image into multiple reference intervals according to a saturation range and a brightness range, and determine a migration scheme for each of the intervals to be migrated according to a first data group of each of the intervals to be migrated and a second data group of each of the reference intervals, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean and a second brightness variance of the reference interval; an adjustment module, used to adjust the saturation and brightness of each of the intervals to be migrated according to the migration scheme of each of the intervals to be migrated to obtain a migration image.

[0006] As an optional example, the above-mentioned extraction module includes: an extraction unit, used to extract the facial skin area of ​​each person from the above-mentioned reference image; a first determination unit, used to determine the person with the largest facial skin area in the above-mentioned reference image as the target person; a first division unit, used to divide the target facial skin area of ​​the above-mentioned target person into multiple color intervals; a statistical unit, used to count the pixel proportion and average color of each of the above-mentioned color intervals; a second determination unit, used to use the average color of the color interval with the highest pixel proportion among the above-mentioned multiple color intervals as the main skin color of the person in the above-mentioned reference image.

[0007] As an optional example, the extraction unit includes: an analysis subunit, used to perform character analysis on the reference image to obtain the overall area of ​​each character; a processing subunit, used to take each character in the reference image as the current character, and perform the following operations on the current character: perform key point detection on the overall area of ​​the current character to obtain all key point positions of the current character; connect all key point positions of the current character into a closed-loop area to obtain the facial skin area of ​​the current character.

[0008] As an optional example, the above-mentioned second determination module includes: a second division unit, used to divide the above-mentioned saturation range into multiple levels of first sub-intervals; a third division unit, used to divide the above-mentioned brightness range into multiple levels of second sub-intervals; a combination unit, used to combine multiple associated intervals according to the multiple levels of the above-mentioned first sub-intervals and the multiple levels of the above-mentioned second sub-intervals; a fourth division unit, used to divide the above-mentioned mask image into multiple of the above-mentioned intervals to be migrated, and divide the above-mentioned reference image into multiple of the above-mentioned reference intervals according to the multiple above-mentioned associated intervals.

[0009] As an optional example, the second determination module includes: a third determination unit, which is used to determine that the migration scheme of the target interval to be migrated is a first migration scheme when the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold, and the maximum brightness of the brightness range of the target interval to be migrated is less than or equal to the first threshold, wherein the target interval to be migrated is any one of the multiple intervals to be migrated, and the first migration scheme is to increase the brightness of the target interval to be migrated by a first preset value; a fourth determination unit, which is used to determine that the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold, and the maximum brightness of the brightness range of the target interval to be migrated is less than or equal to the first threshold, and the target interval to be migrated is When the minimum brightness of the brightness range of the migration interval is greater than the second threshold, the migration scheme of the target interval to be migrated is determined to be the first migration scheme; the fifth determination unit is used to determine that the migration scheme of the target interval to be migrated is the second migration scheme when the first distance between the target interval to be migrated and the first reference interval is less than or equal to the third threshold, and the color proportion of the first reference interval is greater than the fourth threshold, wherein the first reference interval is one interval to be migrated among the reference intervals, the first sub-interval and / or the second sub-interval of the first reference interval are respectively one level larger than the first sub-interval and / or the second sub-interval of the target interval to be migrated, and the second migration scheme The sixth determining unit is used to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the first reference interval; the sixth determining unit is used to determine that the migration scheme of the target interval to be migrated is the third migration scheme when the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold, and the second distance between the target interval to be migrated and the second reference interval is less than or equal to the third threshold, and the color proportion of the second reference interval is greater than the fourth threshold, wherein the second reference interval is one of the intervals to be migrated among the reference intervals, and the first sub-interval and the second sub-interval of the second reference interval are The first sub-interval and the second sub-interval of the target interval to be migrated are respectively at the same level, and the third migration scheme is to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the second reference interval; the seventh determination unit is used to determine that the migration scheme of the target interval to be migrated is the fourth migration scheme when the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold value, and the second distance between the target interval to be migrated and the second reference interval is greater than the second threshold value, wherein the fourth migration scheme is to increase the brightness and saturation of the target interval to be migrated by a second preset value respectively;An eighth determination unit is used to determine that the migration scheme of the target interval to be migrated is the fourth migration scheme when the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold and the color proportion of the second reference interval is greater than the fourth threshold. ;

[0010] As an optional example, the second determination module further includes: a settlement unit, configured to calculate the first distance by using the following formula before determining that the migration solution of the target to-be-migrated interval is the second migration solution:

[0011] The above d1 is the above first distance, the above is the first saturation mean of the target migration interval. s_next is the second saturation mean value of the first reference interval, is the first brightness mean of the target to be migrated interval, the above mean v_next is the second brightness mean value of the first reference interval.

[0012] As an optional example, the adjustment module includes: a first adjustment unit, configured to adjust the brightness of the target interval to be migrated by using the following formula when the migration scheme of the target interval to be migrated is the first migration scheme: V out =V Imask +a; where the above V out is the brightness of the target migration interval after adjustment, and the above V imask is the brightness of the target interval to be migrated before adjustment, and a is the first preset value; a second adjustment unit is used to adjust the target interval to be migrated, the saturation and the brightness by the following formula when the migration scheme of the target interval to be migrated is the second migration scheme: Among them, the above S out is the saturation of the target migration interval after adjustment. Imask is the saturation of the target migration interval before adjustment. s_Imask is the first saturation mean of the target migration interval, is the first saturation variance of the target migration interval, is the second saturation variance of the first reference interval, is the second saturation mean value of the first reference interval, and the V out is the brightness of the target migration interval after adjustment, and the above V Imask is the brightness of the target migration interval before adjustment, and the mean v_Imask is the first brightness mean of the target to be migrated interval, is the first brightness variance of the target interval to be migrated, is the second brightness variance of the first reference interval, is the second brightness mean of the first reference interval; and a third adjustment unit, configured to adjust the target interval to be migrated, the saturation and the brightness by the following formula when the migration scheme of the target interval to be migrated is the third migration scheme: Among them, the above S out is the saturation of the target migration interval after adjustment. Imask is the saturation of the target migration interval before adjustment. s_Imask is the first saturation mean of the target migration interval, is the first saturation variance of the target migration interval, is the second saturation variance of the second reference interval, is the second saturation mean value of the second reference interval, and the V out is the brightness of the target migration interval after adjustment, and the above V Imask is the brightness of the target migration interval before adjustment, and the mean v_Imask is the first brightness mean of the target to be migrated interval, is the first brightness variance of the target interval to be migrated, is the second brightness variance of the second reference interval, is the second brightness mean of the second reference interval; and a fourth adjustment unit, configured to adjust the target interval to be migrated, the saturation and the brightness by the following formula when the migration scheme of the target interval to be migrated is the fourth migration scheme: Among them, the above S out is the saturation of the target migration interval after adjustment. Imask is the saturation of the target migration interval before adjustment, b is the second preset value, and V out is the brightness of the target migration interval after adjustment, and the above V Imask It is the brightness of the above target migration interval before adjustment.

[0013] In a third aspect, the present application provides a storage medium storing a computer program, wherein the computer program executes the above-mentioned image color migration method when executed by a processor.

[0014] In a fourth aspect, the present application further provides an electronic device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor is configured to execute the above-mentioned image color migration method through the computer program.

[0015] In an embodiment of the present application, a reference image having the highest feature similarity to the image to be migrated is determined from an image library; the main skin color of the person in the reference image is extracted, and the image to be migrated is mask-weighted according to the main skin color of the person to obtain a mask image; the mask image is divided into a plurality of intervals to be migrated according to the saturation range and the brightness range, and the reference image is divided into a plurality of reference intervals, and a migration scheme is determined for each of the intervals to be migrated according to a first data group of each of the intervals to be migrated and a second data group of each of the reference intervals, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean and a second brightness variance of the reference interval; according to the migration scheme of each of the intervals to be migrated, an adjustment is made. The saturation and brightness of each of the above-mentioned intervals to be migrated are obtained to obtain a method for obtaining a migration image. In the above method, a similarity search is performed on the image to be migrated to find a reference image with the highest feature similarity in the image library, the main color of the character's skin is extracted from the reference image as the representative color of the entire image, the extracted representative color is used as a color mask, and is weightedly fused with the input image to generate a preliminary migration image mask image, the reference image and the mask image are threshold-divided based on the saturation range and the brightness range to obtain multiple intervals, the saturation mean and variance as well as the brightness mean and variance of each interval are calculated, a migration file is determined for each interval of the mask image, and finally the saturation and brightness of each interval of the mask image are adjusted to generate the final migration image, thereby achieving the purpose of effectively simplifying the image color migration process and improving the aesthetics and practicality of the image, thereby solving the technical problem that the traditional poster production method is not flexible enough, resulting in an unsightly picture. BRIEF DESCRIPTION OF THE DRAWINGS

[0016] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.

[0017] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.

[0018] One or more embodiments are exemplarily described by pictures in the corresponding drawings, and these exemplified descriptions do not constitute limitations on the embodiments. Elements with the same reference numerals in the drawings represent similar elements, and unless otherwise stated, the figures in the drawings do not constitute proportional limitations.

[0019] Figure 1 is a flow chart of an optional image color migration method according to an embodiment of the present application;

[0020] Figure 2 is a flowchart of an overall solution of an optional image color migration method according to an embodiment of the present application;

[0021] Figure 3 is a schematic structural diagram of an optional image color migration device according to an embodiment of the present application;

[0022] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.

[0024] The disclosure below provides many different embodiments or examples to realize the different structures of the present application. In order to simplify the disclosure of the present application, the parts and settings of specific examples are described below. Of course, they are only examples, and the purpose is not to limit the present application. In addition, the present application can repeat reference numbers and / or letters in different examples. This repetition is for the purpose of simplification and clarity, and does not itself indicate the relationship between the various embodiments and / or settings discussed.

[0025] According to a first aspect of an embodiment of the present application, a method for migrating image color is provided. Optionally, as follows: Figure 1 As shown, the above method includes:

[0026] S102, determining from the image library a reference image having the highest feature similarity to the image to be migrated;

[0027] S104, extracting the main skin color of the person in the reference image, and performing mask weighting on the image to be transferred according to the main skin color of the person to obtain a mask image;

[0028] S106, dividing the mask image into a plurality of intervals to be migrated and the reference image into a plurality of reference intervals according to the saturation range and the brightness range, and determining a migration scheme for each interval to be migrated according to a first data group of each interval to be migrated and a second data group of each reference interval, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean, and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean, and a second brightness variance of the reference interval;

[0029] S108, adjusting the saturation and brightness of each interval to be migrated according to the migration scheme of each interval to be migrated, to obtain a migration image.

[0030] Optionally, in this embodiment, an image library is first constructed: official or manually modified images that meet expectations are manually selected as image library images, which may be dozens, hundreds, thousands, or even more. A reference image with the highest similarity to the image to be migrated is determined from the image library. This process is completed by similarity search or manual designation, ensuring that the selected reference image has the closest color and style, and improving the accuracy and visual consistency of the migration effect. The main color tone of the character's skin is extracted from the reference image and used as the reference color for migration, providing an accurate color basis so that the migration result can better match the color style in the target image. Mask weighting is performed on the image to be migrated according to the extracted main color tone to generate a mask image, and the main color tone is applied to the image to be migrated to ensure that the color migration area is consistent with the reference image, thereby enhancing the uniformity of the visual effect. The mask image is divided into multiple intervals to be migrated according to the saturation and brightness ranges, and the reference image is also divided into multiple reference intervals. Based on the mean and variance of the saturation and brightness of the interval to be migrated and the reference interval, a migration scheme is determined for each interval to be migrated. Finally, according to the migration scheme of each interval to be migrated, the saturation and brightness are adjusted to obtain the final migration image. Precisely control the details of color migration to ensure that the color adjustment of each interval is in line with the target style and avoid unnatural colors. This enables detailed control of image colors, so that the migrated image can maintain the consistency of the main color tone while adapting to the visual effects requirements of different areas, thereby improving the overall aesthetics and viewing experience.

[0031] Optionally, in this embodiment, an image library is constructed, and the overall similarity of the image is used to search for suitable reference images, so as to avoid the color migration of completely dissimilar images from the source, and greatly reduce the error rate of color migration; the image library can be used flexibly, and only a small number of pictures are needed, and as the number of pictures increases, the migration accuracy will also increase. The color migration is divided into two parts: hue mask and saturation brightness distribution migration, which not only ensures the effect of the migration, but also ensures the color consistency of the whole picture, which is more beautiful and coordinated. The hue migration uses the skin theme color to improve the effect, and the saturation brightness migration uses the rule matching method to transform, dynamically adjust the range of change of each interval, so that the result is more accurate, and abnormal color blocks are not allowed to appear.

[0032] As an optional example, extracting the main skin color of a person in a reference image includes:

[0033] Extract the facial skin area of ​​each person from the reference image;

[0034] The person with the largest facial skin area in the reference image is determined as the target person;

[0035] Divide the target facial skin area of ​​the target person into multiple color intervals;

[0036] Count the pixel ratio and average color of each color interval;

[0037] The average color of the color interval with the highest pixel ratio among the multiple color intervals is used as the main skin color of the person in the reference image.

[0038] Optionally, in this embodiment, no matter what filter style the poster image is, the skin color of the character is often less likely to have some unnatural skin colors such as blue and yellow with high saturation. Therefore, in the process of whole-image hue migration, the skin color of the character in the reference image is a more accurate representative color. The facial skin area of ​​each character is identified and extracted from the reference image, and image segmentation technology or machine learning algorithm can be used for face detection and skin area segmentation. Among all the extracted characters, the largest character is selected as the target character, which can be determined based on the size or significance of the facial area. The facial skin area of ​​the target character is divided into colors, and the skin color is usually divided into multiple intervals using a color model (such as HSV or LAB), and the pixel proportion and average color in each color interval are calculated. The pixel proportion reflects the distribution of the color in the skin area, and the average color represents the main hue of the area. The average color of the color interval with the highest pixel proportion is selected as the main skin color of the character in the reference image. By dividing the color interval and counting the pixel proportion, it is ensured that the main color finally selected accurately reflects the actual skin color of the target character, so that the migration effect is natural and consistent.

[0039] As an optional example, extracting the facial skin area of ​​each person from the reference image includes:

[0040] Perform character analysis on the reference image to obtain the overall area of ​​each character;

[0041] Take each person in the reference image as the current person and perform the following operations on the current person:

[0042] Perform key point detection on the entire area of ​​the current character to obtain the positions of all key points of the current character;

[0043] All key point positions of the current person are connected into a closed-loop area to obtain the facial skin area of ​​the current person.

[0044] Optionally, in this embodiment, image segmentation or detection technology is used to perform character analysis on the reference image to identify each person in the image and determine the overall area of ​​each person. For each identified person, further processing is performed to extract its facial skin area, and key point detection technology is applied to the overall area of ​​each identified person to obtain the key point positions of the person's face, and the key points include facial feature points such as eyes, nose, and mouth. The detected key points are connected in a certain order to form a closed loop area, which is the facial skin area of ​​the hanging person.

[0045] As an optional example, according to the saturation range and the brightness range, the mask image is divided into a plurality of intervals to be migrated, and the reference image is divided into a plurality of reference intervals, including:

[0046] Dividing multiple levels of first sub-intervals according to the saturation range;

[0047] Dividing a plurality of second sub-intervals according to the brightness range;

[0048] Combining multiple associated intervals according to the multiple levels of first sub-intervals and the multiple levels of second sub-intervals;

[0049] According to the multiple associated intervals, the mask image is divided into multiple intervals to be migrated, and the reference image is divided into multiple reference intervals.

[0050] Optionally, in this embodiment, during the process of image color migration, fine color adjustment can be achieved by dividing the mask image and the reference image into intervals of saturation and brightness. Specifically, according to the saturation (S) range, it is divided into multiple sub-intervals. For example, the saturation is divided into four levels 0-25, 26-50, 51-75, 76-100, and according to the brightness (V) range, it is divided into multiple sub-intervals. The same grading method can be used, for example, the brightness is divided into four levels 0-25, 26-50, 51-75, 76-100. Multiple sub-intervals of saturation are combined with multiple sub-intervals of brightness to form multiple associated intervals. For example, each saturation sub-interval is paired with each brightness sub-interval to obtain a total of 16 associated intervals. According to the above 16 associated intervals, the mask image is divided into multiple intervals to be migrated, and the reference image is divided into corresponding reference intervals. Each interval to be migrated is paired with a corresponding reference interval.

[0051] As an optional example, according to the first data group of each interval to be migrated and the second data group of each reference interval, determining a migration scheme for each interval to be migrated includes:

[0052] When the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold, and the maximum brightness of the brightness range of the target interval to be migrated is less than or equal to the first threshold, determining that the migration scheme of the target interval to be migrated is a first migration scheme, wherein the target interval to be migrated is any one of the multiple intervals to be migrated, and the first migration scheme is to increase the brightness of the target interval to be migrated by a first preset value;

[0053] When the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold, and the minimum brightness of the brightness range of the target interval to be migrated is greater than the second threshold, determining the migration scheme of the target interval to be migrated to be the first migration scheme;

[0054] In the case where the first distance between the target interval to be migrated and the first reference interval is less than or equal to the third threshold value, and the color proportion of the first reference interval is greater than the fourth threshold value, determining that the migration scheme of the target interval to be migrated is the second migration scheme, wherein the first reference interval is an interval to be migrated among multiple reference intervals, the first sub-interval and / or the second sub-interval of the first reference interval are respectively one level larger than the first sub-interval and / or the second sub-interval of the target interval to be migrated, and the second migration scheme is to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the first reference interval;

[0055] In the case where a first distance between the target interval to be migrated and the first reference interval is greater than a third threshold, and a second distance between the target interval to be migrated and the second reference interval is less than or equal to the third threshold, and a color proportion of the second reference interval is greater than a fourth threshold, determining that the migration scheme of the target interval to be migrated is a third migration scheme, wherein the second reference interval is an interval to be migrated among multiple reference intervals, a first sub-interval and a second sub-interval of the second reference interval are respectively at the same level as the first sub-interval and the second sub-interval of the target interval to be migrated, and the third migration scheme is to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the second reference interval;

[0056] When the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold, and the second distance between the target interval to be migrated and the second reference interval is greater than the second threshold, determining that the migration scheme of the target interval to be migrated is a fourth migration scheme, wherein the fourth migration scheme is to increase the brightness and saturation of the target interval to be migrated by a second preset value respectively;

[0057] When the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold, and the color proportion of the second reference interval is greater than the fourth threshold, the migration scheme of the target interval to be migrated is determined to be the fourth migration scheme.

[0058] Optionally, in this embodiment, all the intervals to be migrated of the image to be migrated are divided into four types of migration schemes. The first migration scheme is to determine the interval of S∈[0-25]&V∈[0-25] as black, and the interval of S∈[0-25]&V∈[76-100] as white among the 16 associated intervals. In the process of color migration, black and white only need to increase the brightness appropriately, and the saturation remains unchanged. Therefore, the first migration scheme is to increase the brightness of the black interval to be migrated and the white interval to be migrated of the image to be migrated by a first preset value, such as 5. If the brightness of a certain interval to be migrated is already the maximum value before adjustment, no adjustment is required.

[0059] The condition for the second migration scheme is that, excluding the black interval to be migrated and the white interval to be migrated, the distance between the interval to be migrated and the first reference interval is less than or equal to the third threshold, and the color proportion of the first reference interval is greater than the fourth threshold, and the first sub-interval and / or the second sub-interval of the first reference interval are respectively one level larger than the first sub-interval and / or the second sub-interval of the target interval to be migrated. For example, if the interval to be migrated is S∈[25-50]&V∈[25-50], then the first reference interval is S∈[50-75]&V∈[50-75], and if the interval to be migrated is S∈[75-100]&V∈[25-50], then the first reference interval is S∈[75-100]&V∈[50-75]. Calculate the color ratio of the first reference interval in the reference image. For example, if the number of pixels in the interval is m and the total number of pixels in the image is n, then the ratio = m / n. If the ratio is less than the fourth threshold, it is considered that the ratio of the interval in the reference image is too small and has no reference significance. The migration scheme is postponed to the third migration scheme according to the rule sequence after skipping this level. The second migration scheme is to adjust the brightness and saturation of the interval to be migrated based on the first data group of the interval to be migrated and the second data group of the first reference interval.

[0060] The condition for the third migration scheme is that, excluding the black interval to be migrated and the white interval to be migrated, the distance between the interval to be migrated and the first reference interval is greater than the third threshold, and the distance between the interval to be migrated and the second reference interval is less than or equal to the third threshold, and the color proportion of the second reference interval is greater than the fourth threshold, and the first sub-interval and the second sub-interval of the second reference interval are respectively at the same level as the first sub-interval and the second sub-interval of the target interval to be migrated. For example, if the interval to be migrated is S∈[25-50]&V∈[25-50], then the second reference interval is S∈[25-50]&V∈[25-50]. Calculate the color proportion of the second reference interval in the reference image. If the proportion is less than the fourth threshold, it is considered that the proportion of this interval in the reference image is too small and has no reference significance. Skipping this level, the migration scheme is postponed to the fourth migration scheme according to the regular order. The third migration scheme is to adjust the brightness and saturation of the interval to be migrated based on the first data group of the interval to be migrated and the second data group of the second reference interval.

[0061] The condition for the fourth migration scheme is that, excluding the black interval to be migrated and the white interval to be migrated, the distance between the interval to be migrated and the first reference interval is greater than the third threshold, and the distance between the interval to be migrated and the second reference interval is greater than the second threshold, or the distance between the interval to be migrated and the first reference interval is greater than the third threshold and the color proportion of the second reference interval is greater than the fourth threshold, and neither the first reference interval nor the second reference interval has a reference significance. Therefore, the fourth migration scheme is to increase the brightness and saturation of the interval to be migrated by the second preset value, for example 5. If the saturation or brightness of a certain interval to be migrated is already the maximum value before adjustment, no adjustment is required.

[0062] As an optional example, before determining that the migration scheme of the target to-be-migrated interval is the second migration scheme, the method further includes:

[0063] The first distance is calculated by the following formula:

[0064]

[0065] Among them, d1 is the first distance, is the first saturation mean of the target migration interval, mean s_next is the second saturation mean of the first reference interval, is the first brightness mean of the target to be migrated interval, mean v_next is the second brightness mean value of the first reference interval.

[0066] Optionally, in this embodiment, the distance between the interval to be migrated and the reference interval is calculated by calculating the first saturation mean and the first brightness mean of the interval to be migrated, and the second saturation mean and the second brightness mean of the reference interval. If the distance is too large, it means that the reference interval has no reference significance.

[0067] As an optional example, according to the migration scheme of each interval to be migrated, the saturation and brightness of each interval to be migrated are adjusted to obtain a migration image including:

[0068] When the migration scheme of the target interval to be migrated is the first migration scheme, the brightness of the target interval to be migrated is adjusted by the following formula:

[0069] V out =V Imask +a;

[0070] Among them, V out is the brightness of the target migration interval after adjustment, V Imask is the brightness of the target migration interval before adjustment, and a is the first preset value;

[0071] When the migration scheme of the target interval to be migrated is the second migration scheme, the target interval to be migrated, the saturation and the brightness are adjusted by the following formula:

[0072]

[0073] Among them, S out is the adjusted saturation of the target migration interval, S Imask is the saturation of the target migration interval before adjustment, mean s_Imask is the first saturation mean of the target migration interval, is the first saturation variance of the target migration interval, is the second saturation variance of the first reference interval, is the second saturation mean value of the first reference interval, V out is the brightness of the target migration interval after adjustment, V Imask is the brightness of the target migration interval before adjustment, mean v_Imask is the first brightness mean of the target migration interval, is the first brightness variance of the target interval to be migrated, is the second brightness variance of the first reference interval, is the second brightness mean value of the first reference interval;

[0074] When the migration scheme of the target interval to be migrated is the third migration scheme, the target interval to be migrated, the saturation and the brightness are adjusted by the following formula:

[0075]

[0076] Among them, S out is the adjusted saturation of the target migration interval, S Imask is the saturation of the target migration interval before adjustment, mean s_Imask is the first saturation mean of the target migration interval, is the first saturation variance of the target migration interval, is the second saturation variance of the second reference interval, is the second saturation mean value of the second reference interval, V out is the brightness of the target migration interval after adjustment, V Imask is the brightness of the target migration interval before adjustment, mean v_Imask is the first brightness mean of the target migration interval, is the first brightness variance of the target interval to be migrated, is the second brightness variance of the second reference interval, is the second brightness mean value of the second reference interval;

[0077] When the migration scheme of the target interval to be migrated is the fourth migration scheme, the target interval to be migrated, the saturation and the brightness are adjusted by the following formula:

[0078]

[0079] Among them, S out is the adjusted saturation of the target migration interval, S Imask is the saturation of the target migration interval before adjustment, b is the second preset value, V out is the brightness of the target migration interval after adjustment, V Imask The brightness of the target migration interval before adjustment.

[0080] Optionally, in this embodiment, according to the migration scheme of each interval to be migrated, the saturation and brightness of each interval to be migrated are adjusted, and finally the image of the HSV channel is converted back to the RGB channel to obtain the final migration image.

[0081] Combined with an example, this application proposes an improved image color migration method, which takes the skin of the person in the reference image as the main color tone, and dynamically migrates the saturation and brightness. The reference image comes from the search and matching of the template library, which solves the problem of the difficulty of collecting a large number of artificial images in advance. Not only can it be achieved with a small number of images, but the database can also be supplemented in real time to improve the effect. Figure 2 As shown in the specific implementation flow chart of the overall solution, the process of the solution proposed in this application is as follows:

[0082] (1) Image library construction: Manually select official or manually modified images that meet expectations as template library images. This can be dozens, hundreds, thousands, or even more.

[0083] (2) Input the image to be migrated, perform a similarity search in the image library, and find the closest image as the reference image for subsequent image color enhancement / migration. You can also manually specify the reference image;

[0084] (3) Extract the main color tone of the person’s skin in the reference image as the representative color of the entire image;

[0085] (4) The representative color obtained in the previous step is used as a color mask and weighted fused with the input image to be migrated to obtain a preliminary migration image mask image;

[0086] (5) Convert the reference image and the preliminary migration image to the HSV color space, divide the thresholds of S and V to obtain 9 sub-intervals, calculate the mean variance of each sub-interval respectively, adjust the distribution according to certain rules, and obtain the final migration image.

[0087] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the present application is not limited by the described order of actions, because according to the present application, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the present application.

[0088] According to another aspect of the embodiment of the present application, a device for migrating image color is also provided. Figure 3 As shown, including:

[0089] A first determination module 302 is used to determine, from the image library, a reference image having the highest feature similarity to the image to be migrated;

[0090] An extraction module 304 is used to extract the main skin color of the person in the reference image, and perform mask weighting on the image to be transferred according to the main skin color of the person to obtain a mask image;

[0091] A second determination module 306 is used to divide the mask image into a plurality of intervals to be migrated and the reference image into a plurality of reference intervals according to the saturation range and the brightness range, and determine a migration scheme for each interval to be migrated according to the first data group of each interval to be migrated and the second data group of each reference interval, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean, and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean, and a second brightness variance of the reference interval;

[0092] The adjustment module 308 is used to adjust the saturation and brightness of each interval to be migrated according to the migration scheme of each interval to be migrated to obtain a migrated image.

[0093] It should be noted that the first determination module 302 in this embodiment can be used to execute step S102 in the embodiment of the present application, the extraction module 304 in this embodiment can be used to execute step S104 in the embodiment of the present application, the second determination module 306 in this embodiment can be used to execute step S106 in the embodiment of the present application, and the adjustment module 308 in this embodiment can be used to execute step S108 in the embodiment of the present application.

[0094] As an optional example, the extraction module includes:

[0095] An extraction unit, used for extracting a facial skin region of each person from a reference image;

[0096] A first determining unit, used to determine the person with the largest facial skin area in the reference image as the target person;

[0097] A first division unit is used to divide the target face skin area of ​​the target person into a plurality of color intervals;

[0098] The statistical unit is used to count the pixel ratio and average color of each color interval;

[0099] The second determining unit is used to use the average color of the color interval with the highest pixel ratio among the multiple color intervals as the main skin color of the person in the reference image.

[0100] As an optional example, the extraction unit includes:

[0101] The analysis subunit is used to perform character analysis on the reference image to obtain the overall area of ​​each character;

[0102] The processing subunit is used to take each person in the reference image as the current person and perform the following operations on the current person:

[0103] Perform key point detection on the entire area of ​​the current character to obtain the positions of all key points of the current character;

[0104] All key point positions of the current person are connected into a closed-loop area to obtain the facial skin area of ​​the current person.

[0105] As an optional example, the second determining module includes:

[0106] A second division unit, used for dividing into multiple levels of first sub-intervals according to the saturation range;

[0107] A third division unit, used for dividing a plurality of second sub-intervals according to the brightness range;

[0108] A combining unit, used for combining a plurality of associated intervals according to the multi-level first sub-intervals and the multi-level second sub-intervals;

[0109] The fourth division unit is used to divide the mask image into a plurality of intervals to be migrated and divide the reference image into a plurality of reference intervals according to the plurality of associated intervals.

[0110] As an optional example, the second determining module includes:

[0111] a third determining unit, configured to determine that the migration scheme of the target interval to be migrated is a first migration scheme when the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold value and the maximum brightness of the brightness range of the target interval to be migrated is less than or equal to the first threshold value, wherein the target interval to be migrated is any one of the multiple intervals to be migrated, and the first migration scheme is to increase the brightness of the target interval to be migrated by a first preset value;

[0112] a fourth determining unit, configured to determine that the migration scheme of the target interval to be migrated is the first migration scheme when the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold and the minimum brightness of the brightness range of the target interval to be migrated is greater than the second threshold;

[0113] a fifth determination unit, configured to determine that the migration scheme of the target interval to be migrated is a second migration scheme when a first distance between the target interval to be migrated and the first reference interval is less than or equal to a third threshold value and the color proportion of the first reference interval is greater than a fourth threshold value, wherein the first reference interval is an interval to be migrated among multiple reference intervals, the first sub-interval and / or the second sub-interval of the first reference interval are respectively one level larger than the first sub-interval and / or the second sub-interval of the target interval to be migrated, and the second migration scheme is to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the first reference interval;

[0114] a sixth determination unit, configured to determine that the migration scheme of the target interval to be migrated is a third migration scheme when a first distance between the target interval to be migrated and the first reference interval is greater than a third threshold, a second distance between the target interval to be migrated and the second reference interval is less than or equal to the third threshold, and a color proportion of the second reference interval is greater than a fourth threshold, wherein the second reference interval is an interval to be migrated among multiple reference intervals, a first sub-interval and a second sub-interval of the second reference interval are respectively at the same level as the first sub-interval and the second sub-interval of the target interval to be migrated, and the third migration scheme is to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the second reference interval;

[0115] a seventh determining unit, configured to determine that the migration scheme of the target interval to be migrated is a fourth migration scheme when a first distance between the target interval to be migrated and the first reference interval is greater than a third threshold value and a second distance between the target interval to be migrated and the second reference interval is greater than a second threshold value, wherein the fourth migration scheme is to increase the brightness and saturation of the target interval to be migrated by a second preset value respectively;

[0116] The eighth determining unit is configured to determine that the migration scheme of the target interval to be migrated is the fourth migration scheme when the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold and the color proportion of the second reference interval is greater than the fourth threshold.

[0117] As an optional example, the second determining module further includes:

[0118] The settlement unit is configured to calculate the first distance by using the following formula before determining that the migration solution of the target to-be-migrated interval is the second migration solution:

[0119]

[0120] Among them, d1 is the first distance, is the first saturation mean of the target migration interval, mean s_next is the second saturation mean of the first reference interval, is the first brightness mean of the target to be migrated interval, mean v_next is the second brightness mean value of the first reference interval.

[0121] As an optional example, the adjustment module includes:

[0122] The first adjustment unit is configured to adjust the brightness of the target interval to be migrated by using the following formula when the migration scheme of the target interval to be migrated is the first migration scheme:

[0123] V out =V Imask +a;

[0124] Among them, V out is the brightness of the target migration interval after adjustment, V Imask is the brightness of the target migration interval before adjustment, and a is the first preset value;

[0125] The second adjustment unit is used to adjust the target interval to be migrated, the saturation and the brightness by the following formula when the migration scheme of the target interval to be migrated is the second migration scheme:

[0126]

[0127] Among them, S out is the adjusted saturation of the target migration interval, S Imask is the saturation of the target migration interval before adjustment, mean s_Imask is the first saturation mean of the target migration interval, is the first saturation variance of the target migration interval, is the second saturation variance of the first reference interval, is the second saturation mean value of the first reference interval, V out is the brightness of the target migration interval after adjustment, V Imask is the brightness of the target migration interval before adjustment, mean v_Imask is the first brightness mean of the target migration interval, is the first brightness variance of the target interval to be migrated, is the second brightness variance of the first reference interval, is the second brightness mean value of the first reference interval;

[0128] The third adjustment unit is used to adjust the target interval to be migrated, the saturation and the brightness by the following formula when the migration scheme of the target interval to be migrated is the third migration scheme:

[0129]

[0130] Among them, S outis the adjusted saturation of the target migration interval, S imask is the saturation of the target migration interval before adjustment, mean s_Imask is the first saturation mean of the target migration interval, is the first saturation variance of the target migration interval, is the second saturation variance of the second reference interval, is the second saturation mean value of the second reference interval, V out is the brightness of the target migration interval after adjustment, V Imask is the brightness of the target migration interval before adjustment, mean v_Imask is the first brightness mean of the target migration interval, is the first brightness variance of the target interval to be migrated, is the second brightness variance of the second reference interval, is the second brightness mean value of the second reference interval;

[0131] The fourth adjustment unit is used to adjust the target interval to be migrated, the saturation and the brightness by the following formula when the migration scheme of the target interval to be migrated is the fourth migration scheme:

[0132]

[0133] Among them, S out is the adjusted saturation of the target migration interval, S Imask is the saturation of the target migration interval before adjustment, b is the second preset value, V out is the brightness of the target migration interval after adjustment, V Imask The brightness of the target migration interval before adjustment.

[0134] For other examples of this embodiment, please refer to the above examples and will not be repeated here.

[0135] Figure 4 is a schematic diagram of an optional electronic device according to an embodiment of the present application, such as Figure 4 As shown, it includes a processor 402, a communication interface 404, a memory 406 and a communication bus 408, wherein the processor 402, the communication interface 404 and the memory 406 communicate with each other through the communication bus 408, wherein,

[0136] Memory 406, used to store computer programs;

[0137] The processor 402 is used to implement the following steps when executing the computer program stored in the memory 406:

[0138] Determine from the image library a reference image having the highest feature similarity to the image to be migrated;

[0139] Extracting the main skin color of the person in the reference image, and performing mask weighting on the image to be transferred according to the main skin color of the person to obtain a mask image;

[0140] According to the saturation range and the brightness range, the mask image is divided into a plurality of intervals to be migrated, and the reference image is divided into a plurality of reference intervals, and a migration scheme is determined for each interval to be migrated according to a first data group of each interval to be migrated and a second data group of each reference interval, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean, and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean, and a second brightness variance of the reference interval;

[0141] According to the migration scheme of each interval to be migrated, the saturation and brightness of each interval to be migrated are adjusted to obtain a migration image.

[0142] Optionally, in this embodiment, the communication bus may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 4 The communication interface is used for communication between the above electronic device and other devices.

[0143] The memory may include RAM, or may include non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.

[0144] As an example, the memory 406 may include, but is not limited to, the first determination module 302, the extraction module 304, the second determination module 306, and the adjustment module 308 in the image color migration device. In addition, other module units in the image color migration device may also be included but are not limited to, which will not be described in detail in this example.

[0145] The above-mentioned processor can be a general-purpose processor, which can include but not be limited to: CPU (Central Processing Unit), NP (Network Processor), etc.; it can also be DSP (Digital Signal Processing), ASIC (Application Specific Integrated Circuit), FPGA (Field-Programmable Gate Array) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components.

[0146] Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment will not be described in detail here.

[0147] It can be understood by those skilled in the art that Figure 4 The structure shown is for illustration only. The device for implementing the above-mentioned image color migration method may be a terminal device, which may be a smart phone (such as an Android phone, an iOS phone, etc.), a tablet computer, a PDA, a mobile Internet device (Mobile Internet Devices, MID), a PAD, and other terminal devices. Figure 4 The structure of the electronic device is not limited. For example, the electronic device may also include Figure 4 More or fewer components (such as network interfaces, display devices, etc.) shown in, or having Figure 4 Different configurations shown.

[0148] A person of ordinary skill in the art can understand that all or part of the steps in the various methods of the above embodiments can be completed by instructing the hardware related to the terminal device through a program, and the program can be stored in a computer-readable storage medium, which can include: a flash drive, ROM, RAM, a magnetic disk or an optical disk, etc.

[0149] According to another aspect of the embodiments of the present application, a computer-readable storage medium is provided, in which a computer program is stored, wherein the computer program executes the steps in the above-mentioned image color migration method when executed by a processor.

[0150] Optionally, in this embodiment, a person of ordinary skill in the art may understand that all or part of the steps in the various methods of the above embodiments may be completed by instructing hardware related to the terminal device through a program, and the program may be stored in a computer-readable storage medium, and the storage medium may include: a flash drive, a read-only memory (ROM), a random access memory (RAM), a disk or an optical disk, etc.

[0151] The serial numbers of the above-mentioned embodiments of the present application are for description only and do not represent the advantages or disadvantages of the embodiments.

[0152] If the integrated units in the above embodiments are implemented in the form of software functional units and sold or used as independent products, they can be stored in the above computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or all or part of the technical solution can be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for enabling one or more computer devices (which may be personal computers, servers, or network devices, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present application.

[0153] In the above embodiments of the present application, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, please refer to the relevant description of other embodiments.

[0154] In the several embodiments provided in the present application, it should be understood that the disclosed client can be implemented in other ways. Among them, the device embodiments described above are only schematic. For example, the division of the units is only a logical function division. There may be other division methods in actual implementation. For example, multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of units or modules, which can be electrical or other forms.

[0155] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.

[0156] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit. The above-mentioned integrated unit may be implemented in the form of hardware or in the form of software functional units.

[0157] The above is only a preferred implementation of the present application. It should be pointed out that for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present application. These improvements and modifications should also be regarded as the scope of protection of the present application.

Claims

1. A method for migrating image color, characterized in that: include: Determine from the image library a reference image having the highest feature similarity to the image to be migrated; Extracting the main skin color of the person in the reference image, and performing mask weighting on the image to be migrated according to the main skin color of the person to obtain a mask image; According to the saturation range and the brightness range, the mask image is divided into a plurality of intervals to be migrated, and the reference image is divided into a plurality of reference intervals, and a migration scheme is determined for each interval to be migrated according to a first data group of each interval to be migrated and a second data group of each reference interval, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean, and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean, and a second brightness variance of the reference interval; According to the migration scheme of each of the intervals to be migrated, the saturation and brightness of each of the intervals to be migrated are adjusted to obtain a migration image.

2. The method according to claim 1, characterized in that The extracting the main skin color of the person in the reference image comprises: Extracting a facial skin region of each person from the reference image; Determine the person with the largest facial skin area in the reference image as the target person; Dividing a target facial skin area of ​​the target person into a plurality of color intervals; Counting the pixel ratio and average color of each color interval; The average color of the color interval with the highest pixel ratio among the multiple color intervals is used as the main skin color of the person in the reference image.

3. The method according to claim 2, characterized in that The step of extracting the facial skin area of ​​each person from the reference image comprises: Performing character analysis on the reference image to obtain an overall region of each character; Take each person in the reference image as the current person, and perform the following operations on the current person: Performing key point detection on the entire area of ​​the current character to obtain positions of all key points of the current character; All key point positions of the current person are connected into a closed-loop area to obtain the facial skin area of ​​the current person.

4. The method according to claim 1, characterized in that: The step of dividing the mask image into a plurality of intervals to be migrated according to the saturation range and the brightness range, and dividing the reference image into a plurality of reference intervals comprises: Dividing a plurality of first sub-intervals according to the saturation range; Dividing a plurality of second sub-intervals according to the brightness range; Combining a plurality of associated intervals according to the multiple levels of the first sub-intervals and the multiple levels of the second sub-intervals; According to the multiple associated intervals, the mask image is divided into multiple intervals to be migrated, and the reference image is divided into multiple reference intervals.

5. The method according to claim 4, characterized in that Determining a migration scheme for each of the intervals to be migrated according to the first data group of each of the intervals to be migrated and the second data group of each of the reference intervals comprises: When the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold, and the maximum brightness of the brightness range of the target interval to be migrated is less than or equal to the first threshold, determining that the migration scheme of the target interval to be migrated is a first migration scheme, wherein the target interval to be migrated is any one of the multiple intervals to be migrated, and the first migration scheme is to increase the brightness of the target interval to be migrated by a first preset value; When the maximum saturation of the saturation range of the target interval to be migrated is less than or equal to the first threshold, and the minimum brightness of the brightness range of the target interval to be migrated is greater than the second threshold, determining that the migration scheme of the target interval to be migrated is the first migration scheme; In the case where the first distance between the target interval to be migrated and the first reference interval is less than or equal to the third threshold value, and the color proportion of the first reference interval is greater than the fourth threshold value, determining that the migration scheme of the target interval to be migrated is the second migration scheme, wherein the first reference interval is an interval to be migrated among the multiple reference intervals, the first sub-interval and / or the second sub-interval of the first reference interval are respectively one level larger than the first sub-interval and / or the second sub-interval of the target interval to be migrated, and the second migration scheme is to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the first reference interval; In the case where the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold, and the second distance between the target interval to be migrated and the second reference interval is less than or equal to the third threshold, and the color proportion of the second reference interval is greater than the fourth threshold, the migration scheme of the target interval to be migrated is determined to be the third migration scheme, wherein the second reference interval is an interval to be migrated among the multiple reference intervals, the first sub-interval and the second sub-interval of the second reference interval are respectively at the same level as the first sub-interval and the second sub-interval of the target interval to be migrated, and the third migration scheme is to adjust the brightness and saturation of the target interval to be migrated according to the first data group of the target interval to be migrated and the second data group of the second reference interval; in the case where the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold, and the second distance between the target interval to be migrated and the second reference interval is greater than the second threshold, the migration scheme of the target interval to be migrated is determined to be the fourth migration scheme, wherein the fourth migration scheme is to increase the brightness and saturation of the target interval to be migrated by second preset values ​​respectively; When the first distance between the target interval to be migrated and the first reference interval is greater than the third threshold, and the color proportion of the second reference interval is greater than the fourth threshold, the migration scheme of the target interval to be migrated is determined to be the fourth migration scheme.

6. The method according to claim 5, characterized in that Before determining that the migration scheme of the target to-be-migrated interval is the second migration scheme, the method further includes: The first distance is calculated by the following formula: Wherein, d1 is the first distance, is the first saturation mean of the target migration interval, the mean s_next is the second saturation mean value of the first reference interval, is the first brightness mean of the target to be migrated interval, the mean v_next is the second brightness mean value of the first reference interval.

7. The method according to claim 5, characterized in that The step of adjusting the saturation and brightness of each of the intervals to be migrated according to the migration scheme of each of the intervals to be migrated to obtain a migration image comprises: When the migration scheme of the target interval to be migrated is the first migration scheme, the brightness of the target interval to be migrated is adjusted by the following formula: In out =V Imask +a; Among them, the V out is the brightness of the target to-be-migrated interval after adjustment, and V Imask is the brightness of the target to-be-migrated interval before adjustment, and a is the first preset value; When the migration scheme of the target interval to be migrated is the second migration scheme, the target interval to be migrated, the saturation and the brightness are adjusted by the following formula: Among them, the S out is the saturation of the target migration interval after adjustment, the S Imask is the saturation of the target migration interval before adjustment, the mean s_Imask is the first saturation mean value of the target migration interval, is the first saturation variance of the target interval to be migrated, is the second saturation variance of the first reference interval, is the second saturation mean value of the first reference interval, the V out is the brightness of the target to-be-migrated interval after adjustment, and V Imask is the brightness of the target migration interval before adjustment, the mean v_Imask is the first brightness mean value of the target to be migrated interval, is the first brightness variance of the target to-be-migrated interval, is the second brightness variance of the first reference interval, is the second brightness mean value of the first reference interval; When the migration scheme of the target interval to be migrated is the third migration scheme, the target interval to be migrated, the saturation and the brightness are adjusted by the following formula: Among them, the S out is the saturation of the target migration interval after adjustment, the S Imask is the saturation of the target migration interval before adjustment, the mean s_Imask is the first saturation mean value of the target migration interval, is the first saturation variance of the target interval to be migrated, is the second saturation variance of the second reference interval, is the second saturation mean value of the second reference interval, and the V out is the brightness of the target to-be-migrated interval after adjustment, and V Imask is the brightness of the target migration interval before adjustment, the mean v_Imask is the first brightness mean value of the target to be migrated interval, is the first brightness variance of the target to-be-migrated interval, is the second brightness variance of the second reference interval, is a second brightness mean value of the second reference interval; When the migration scheme of the target interval to be migrated is the fourth migration scheme, the target interval to be migrated, the saturation and the brightness are adjusted by the following formula: Among them, the S out is the saturation of the target migration interval after adjustment, the S Imask is the saturation of the target migration interval before adjustment, b is the second preset value, and V out is the brightness of the target to-be-migrated interval after adjustment, and V Imask is the brightness of the target migration interval before adjustment.

8. An image color migration device, characterized in that: include: A first determination module is used to determine, from the image library, a reference image having the highest feature similarity to the image to be migrated; An extraction module, used for extracting the main skin color of the person in the reference image, and performing mask weighting on the image to be migrated according to the main skin color of the person to obtain a mask image; A second determination module is used to divide the mask image into a plurality of intervals to be migrated and the reference image into a plurality of reference intervals according to a saturation range and a brightness range, and to determine a migration scheme for each interval to be migrated according to a first data group of each interval to be migrated and a second data group of each reference interval, wherein the first data group includes a first saturation mean, a first saturation variance, a first brightness mean, and a first brightness variance of the interval to be migrated, and the second data group includes a second saturation mean, a second saturation variance, a second brightness mean, and a second brightness variance of the reference interval; The adjustment module is used to adjust the saturation and brightness of each of the intervals to be migrated according to the migration scheme of each of the intervals to be migrated to obtain a migration image.

9. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is executed.

10. An electronic device comprising a memory and a processor, characterized in that: A computer program is stored in the memory, and the processor is configured to execute the method according to any one of claims 1 to 7 through the computer program.