WO2022218293A1 - 图像处理方法及装置 - Google Patents

图像处理方法及装置 Download PDF

Info

Publication number
WO2022218293A1
WO2022218293A1 PCT/CN2022/086283 CN2022086283W WO2022218293A1 WO 2022218293 A1 WO2022218293 A1 WO 2022218293A1 CN 2022086283 W CN2022086283 W CN 2022086283W WO 2022218293 A1 WO2022218293 A1 WO 2022218293A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
color
image
region
original
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Ceased
Application number
PCT/CN2022/086283
Other languages
English (en)
French (fr)
Inventor
陈铭津
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Zitiao Network Technology Co Ltd
Original Assignee
Beijing Zitiao Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Zitiao Network Technology Co Ltd filed Critical Beijing Zitiao Network Technology Co Ltd
Priority to US18/551,725 priority Critical patent/US20240169487A1/en
Publication of WO2022218293A1 publication Critical patent/WO2022218293A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/40Image enhancement or restoration using histogram techniques
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/40Scaling of whole images or parts thereof, e.g. expanding or contracting
    • G06T3/4038Image mosaicing, e.g. composing plane images from plane sub-images
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration using two or more images, e.g. averaging or subtraction
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/90Dynamic range modification of images or parts thereof
    • G06T5/94Dynamic range modification of images or parts thereof based on local image properties, e.g. for local contrast enhancement
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/10Segmentation; Edge detection
    • G06T7/11Region-based segmentation
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20021Dividing image into blocks, subimages or windows
    • GPHYSICS
    • G06COMPUTING OR CALCULATING; COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/20Special algorithmic details
    • G06T2207/20212Image combination
    • G06T2207/20221Image fusion; Image merging

Definitions

  • the present disclosure relates to the technical field of computer vision, and in particular, to an image processing method and apparatus.
  • the histogram of each channel of the original image is matched with the histogram of each channel of the reference image, so that the histogram of each channel of the original image is close to the reference image.
  • the present disclosure provides an image processing method and apparatus.
  • the present disclosure provides an image processing method, including:
  • the multiple original areas at least include a first area and a second area, and the brightness value of the pixels in the first area is greater than the brightness value of the pixels in the second area;
  • the reference image is divided into a plurality of reference areas; the reference area includes at least a third area and a fourth area, wherein the brightness value of the pixels in the third area is greater than the brightness value of the pixels in the fourth area;
  • the transformation matrix of the first area is obtained, and according to the color value of the pixel in the second area and the color value of the pixel in the fourth area , get the transformation matrix of the second region;
  • color mapping is performed on the original image to obtain the target image.
  • the transformation matrix of the first area is obtained according to the color values of the pixels in the first area and the color values of the pixels in the third area
  • the transformation matrix of the first area is obtained according to the color values of the pixels in the second area and the color values of the pixels in the fourth area.
  • the color value of the pixel in the middle, and the transformation matrix of the second area is obtained, including:
  • the transformation matrix of the second region is determined based on the covariance matrix of the color channel dimension corresponding to the second region and the covariance matrix of the color channel dimension corresponding to the fourth region.
  • color mapping is performed on the original image according to the transformation matrix of the first region and the transformation matrix of the second region to obtain the target image, including:
  • the color values of the pixels in the original image are processed to obtain a first corrected image corresponding to the transformation matrix of the first region;
  • the color values of the pixels in the original image are processed to obtain a second corrected image corresponding to the transformation matrix of the second region;
  • the target image is obtained by fusing the first corrected image and the second corrected image.
  • color mapping is performed on the original image according to the transformation matrix of the first region and the transformation matrix of the second region to obtain the target image, including:
  • the color values of the pixels in the first area are processed to obtain the first correction area corresponding to the first area;
  • the color values of the pixels in the second area are processed to obtain the second correction area corresponding to the second area;
  • the target image is obtained by splicing the first correction area and the second correction area.
  • the original image is divided into multiple original regions, including:
  • the pixels in the reference image are divided into a plurality of reference regions based on at least one second boundary value.
  • the plurality of original regions further include a fifth region, and the brightness value of the pixels in the fifth region is greater than the brightness value of the pixels in the first region, or the brightness value of the pixels in the fifth region is smaller than that of the second region.
  • the reference area further includes a sixth area, wherein the brightness value of the pixels in the sixth area is greater than the brightness value of the pixels in the third area, or the brightness value of the pixels in the sixth area is smaller than the brightness value of the pixels in the fourth area value;
  • Methods also include:
  • the transformation matrix of the fifth area is obtained;
  • the transformation matrix of the first region and the transformation matrix of the second region perform color mapping on the original image to obtain the target image, including:
  • color mapping is performed on the original image to obtain the target image.
  • an image processing apparatus including:
  • an area division module used to divide the original image into multiple original areas;
  • the multiple original areas at least include a first area and a second area, and the brightness value of the pixels in the first area is greater than the brightness value of the pixels in the second area;
  • the reference image is divided into a plurality of reference areas; the reference area includes at least a third area and a fourth area, wherein the brightness value of the pixels in the third area is greater than the brightness value of the pixels in the fourth area;
  • the transformation matrix generation module is used to obtain the transformation matrix of the first region according to the color value of the pixel point in the first region and the color value of the pixel point in the third region, and according to the color value of the pixel point in the second region and the fourth region The color value of the pixel point in the area is obtained, and the transformation matrix of the second area is obtained;
  • the processing module is configured to perform color mapping on the original image according to the transformation matrix of the first area and the change matrix of the second area to obtain the target image.
  • the transformation matrix generation module is specifically used to:
  • the covariance matrix of and the covariance matrix of the color channel dimension corresponding to the fourth region determine the transformation matrix of the second region.
  • the processing module is specifically used to:
  • the color values of the pixels in the original image are processed to obtain the first corrected image corresponding to the transformation matrix of the first area; according to the transformation matrix of the second area, the color values of the pixels in the original image are processed The value is processed to obtain the second corrected image corresponding to the transformation matrix of the second region; the first corrected image and the second corrected image are fused to obtain the target image.
  • the processing module is specifically used to:
  • the color values of the pixels in the first area are processed to obtain the first correction area corresponding to the first area; according to the transformation matrix of the second area, the color values of the pixels in the second area are processed Perform processing to obtain a second correction area corresponding to the second area; and splicing the first correction area and the second correction area to obtain a target image.
  • the area division module is specifically used to:
  • the plurality of original regions further include a fifth region, and the brightness value of the pixels in the fifth region is greater than the brightness value of the pixels in the first region, or the brightness value of the pixels in the fifth region is smaller than that of the second region.
  • the reference area further includes a sixth area, wherein the brightness value of the pixels in the sixth area is greater than the brightness value of the pixels in the third area, or the brightness value of the pixels in the sixth area is smaller than the brightness value of the pixels in the fourth area value;
  • the transformation matrix generation module is also used to:
  • the transformation matrix of the fifth area is obtained;
  • the processing module is specifically used for:
  • color mapping is performed on the original image to obtain the target image.
  • the present disclosure provides an electronic device comprising: one or more processors; a memory; and one or more computer programs; wherein the one or more computer programs are stored in the memory; one or more processing When the computer executes one or more computer programs, the electronic device enables the image processing method of the first aspect above.
  • the present disclosure provides a computer storage medium, including computer instructions, which, when the computer instructions are executed on an electronic device, cause the electronic device to execute the image processing method according to the above-mentioned first aspect.
  • the present disclosure provides a computer program product that, when the computer program product runs on a computer, causes the computer to execute the image processing method of the first aspect above.
  • 1A is a schematic diagram of an original image
  • 1B is a schematic diagram of a reference image
  • 1C is a schematic diagram of a filter migration result
  • FIG. 2 is a schematic flowchart of an image processing method according to an embodiment of the present disclosure
  • FIG. 3 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure.
  • FIG. 4 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure.
  • FIG. 5 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure.
  • FIG. 6 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure.
  • FIG. 7 is a schematic structural diagram of an image processing apparatus according to an embodiment of the present disclosure.
  • Filter migration refers to adjusting the tone style of the original image/video according to the tone style of the reference image/video, so that the tone of the original image/video is the same as that of the reference image/video.
  • FIG. 1A is a schematic diagram of an original image
  • FIG. 1B is a schematic diagram of a reference image
  • FIG. 1C is a schematic diagram of a filter transfer result.
  • the video image is composed of multiple frames of images.
  • the tone style of each frame of the original image in the video is adjusted according to the tone style of the reference image, so that each frame of the original image and The color tone of the reference image is consistent.
  • the tone style of the reference image is adjusted according to the tone style of the reference image, so that each frame of the original image and The color tone of the reference image is consistent.
  • the histogram of each channel of the original image is matched with the histogram of each channel of the reference image, so that the histogram of each channel of the original image is close to the reference image.
  • the present disclosure provides an image processing method. By dividing the original image and the reference image into regions according to the brightness values of the pixel points, for each corresponding region, based on the color values of the pixel points in the original image and the reference image, obtain the The transformation matrix from the original image of the region to the target image, so that at least two transformation matrices are obtained according to different brightness value regions, and the target image is obtained according to the at least two transformation matrices, so that the obtained target image is more natural and the filter migration effect is good.
  • the multiple original areas include at least a first area and a second area, and the brightness value of the pixels in the first area is greater than the brightness value of the pixels in the second area, and the reference image is divided into At least two reference regions, whereby the original image and the reference image are divided into regions corresponding to one-to-one, respectively, according to the luminance values of the original image and the reference image.
  • the transformation matrix of the first area is obtained, and according to the color value of the pixel in the second area and the color value of the pixel in the fourth area , obtain the transformation matrix of the second area, that is, according to different areas, separate processing, according to the color value, obtain the corresponding transformation matrix of each area, and then according to the transformation matrix of the first area and the change matrix of the second area, to The original image is color-mapped to get the target image.
  • the pixels in the image are divided into regions according to the brightness value, the color values in each region are processed separately to obtain a transformation matrix, and the filter migration process is performed according to the obtained at least two transformation matrices, so that the obtained target image is more natural, The target image is tonal closer to the reference image, resulting in better filter transfer.
  • FIG. 2 is a schematic flowchart of an image processing method provided by an embodiment of the present disclosure. As shown in FIG. 2 , the method of this embodiment is executed by an electronic device, and the electronic device may be a computer, a mobile phone, a Tablet devices, etc., are not limited in this disclosure, and the method in this embodiment is as follows:
  • the plurality of original areas include at least a first area and a second area, and the brightness value of the pixel points in the first area is greater than the brightness value of the pixel points in the second area.
  • the reference area includes at least a third area and a fourth area, wherein the luminance value of the pixels in the third area is greater than the luminance value of the pixels in the fourth area.
  • the color spaces of the original image and the reference image both contain a luminance value channel and a color value channel.
  • the color space can be Lab, luminance-chromatic difference (YUV) or luminance-hue (L ⁇ ) color space, etc., where in the Lab color space Among them, L represents brightness; a represents the first parameter, and the value range of a is +127 to -128, where positive numbers represent red and negative numbers represent green; b represents the second parameter, and the value range of b is +127 to -128, where positive numbers represent yellow and negative numbers represent blue.
  • L represents brightness
  • a represents the first parameter, and the value range of a is +127 to -128, where positive numbers represent red and negative numbers represent green
  • b represents the second parameter, and the value range of b is +127 to -128, where positive numbers represent yellow and negative numbers represent blue.
  • the YUV color space is used as an example for description.
  • the YUV color space includes three channels, namely the Y channel, the U channel and the V channel
  • the color space of the reference image is the same as the color space of the original image. If the color space of the reference image is different from the original image, a conversion is required so that the reference image and the original image are in the same color space.
  • the color space of the original image may be red green blue (Red Green Blue, RGB for short) or cyan, yellow and black ( Cyan Magenta Yellow Black (CMYK for short) and other color spaces, which are not limited in this disclosure.
  • RGB Red Green Blue
  • CMYK Cyan Magenta Yellow Black
  • the color space of the reference image may be a color space such as RGB or CMYK, which is not limited in the present disclosure.
  • the pixel points in the original image can be divided into regions according to the brightness values of the pixel points in the original image to obtain a plurality of original regions. For example, in the YUV color space, according to the brightness value of the Y channel of the original image, the pixels in the original image are divided into regions, and all the pixels are divided into multiple original regions.
  • the pixel points in the reference image can be divided into regions according to the brightness values of the pixel points in the reference image to obtain a plurality of reference regions. For example, according to the luminance value of the Y channel of the reference image, the pixels in the original image are divided into regions, and all the pixels are divided into multiple reference regions.
  • the number of obtained original regions is the same as the number of reference regions, and the original regions and the reference regions are in one-to-one correspondence, and subsequently the divided original regions and the corresponding reference regions are separately processed. That is, for the original image, multiple original areas are obtained according to the brightness values of the pixels and the preset rules. For the reference image, multiple reference areas are obtained according to the brightness values of the pixels and the preset rules. The above preset rules are the same, Then the obtained original area corresponds to the reference area one-to-one.
  • the preset rule can be to arrange the pixels in the image from high to bottom according to the brightness value, or from low to high, and then divide the areas according to the order of arrangement. Therefore, the obtained original area corresponds to the reference area one-to-one, that is, the first One area corresponds to the third area, and the second area corresponds to the fourth area.
  • the preset rule is to divide an image into two regions according to the brightness value arrangement from high to low, the pixels corresponding to the first half of the brightness value are divided into the first region, and the last half of the brightness value is divided into two regions.
  • the corresponding pixels are divided into the second area. The higher the divided area is, the larger the brightness value of the pixels in the area is.
  • the original image and the reference image are processed according to preset rules below.
  • the pixels in the original image are arranged from high to bottom according to the brightness value, the pixels corresponding to the first half of the brightness values are divided into the first area, and the pixels corresponding to the last half of the brightness values are divided into the second area.
  • the pixels in the reference image are arranged from high to bottom according to the brightness value, the pixels corresponding to the first half of the brightness values are divided into the third area, and the pixels corresponding to the last half of the brightness values are divided into the third area. Four areas. Then the first area 1 corresponds to the third area, and the second area 2 corresponds to the fourth area.
  • Filter migration is a process of color mapping, that is, after the color of the original image is mapped, the color of the mapped target image is obtained.
  • the color of the reference image and the target image to be obtained are similar. Therefore, the mapping function can be determined according to the color of the original image and the color of the reference image, and the target image can be obtained to realize the filter migration. In order to obtain the target image, the mapping function needs to be determined first.
  • the transformation matrix of the original area is obtained according to the color value of the pixel point in the original area and the color value of the pixel point in the reference area.
  • the color value of the pixel in the original area is the value of the pixel in the original area in the color channel
  • the color value of the pixel in the reference area is the value of the pixel in the reference area in the color channel.
  • the transformation matrix of the first area is obtained according to the color value of the pixel in the first area and the color value of the pixel in the third area
  • the transformation matrix of the second area is obtained according to the color value of the pixel point in the second area and the color value of the pixel point in the fourth area.
  • the color value of the pixel point in the first area is the value of the pixel point in the first area in the color channel.
  • the color value of the pixel in the second area is the value in the color channel of the pixel in the second area.
  • the color value of the pixel in the third area is the value in the color channel of the pixel in the third area.
  • the color value of the pixel point in the fourth area is the value of the pixel point in the fourth area in the color channel.
  • the color value of a pixel in a certain area is the value of the U channel and the value of the V channel of all pixels in the area.
  • the color value of the pixel in the first area is the value of the U channel and the value of the V channel of all the pixels in the first area.
  • the obtained transformation matrix for each original region may be one.
  • the covariance transformation matrix of at least two color channels corresponding to the original region pixels can be obtained.
  • a transformation matrix corresponding to each color channel can also be obtained for each color channel in each original region, and the number of transformation matrices in the original region is the same as the number of color channels. For example, each color channel gets one standard deviation.
  • S204 Perform color mapping on the original image according to the transformation matrix of the first region and the transformation matrix of the second region to obtain a target image.
  • each color mapping result is fused with the brightness value of the original image to obtain the target image. That is, according to the transformation matrix of the first area and the change matrix of the second area, the original image is color-mapped to obtain two color-mapping results, and the two color-mapping results and the brightness value of the original image are fused to obtain the target image.
  • each color transformation result can be obtained according to the transformation matrix of each original region, the color mean value of each original region and the color mean value of each reference region.
  • the color mean of the original area is the average value of the color values of all pixels in the original area.
  • the color mean of the reference area is the average value of the color values of all pixels in the reference area.
  • the color mean is an average calculated individually for each color channel. Taking the YUV color space as an example, the color mean is the average of the values of the U channel and the average of the values of the V channel.
  • the color value of the target image can be obtained according to all the obtained color transformation results, and each pixel The color value of the point is fused with the corresponding brightness value of the original image to obtain the target image.
  • the original image if the original image is in a color space without a luminance value channel before performing the above image processing step, before processing the original image, the original image needs to be converted into a color space including a luminance value channel and a color channel After processing the original image, the color space to which the obtained target image belongs is different from the color space to which the original image belongs. It is necessary to convert the color space to which the target image belongs to the color of the original image before the above image processing steps are performed. space.
  • the original image is in RGB color space
  • the original image is converted from RGB color space to YUV color space, so that through the above image processing steps, the obtained target image is in YUV color space, and the target image is converted into YUV color space. Convert from YUV color space to RGB color space to get the final desired target image.
  • the multiple original areas include at least a first area and a second area, and the brightness value of the pixels in the first area is greater than the brightness value of the pixels in the second area.
  • the reference image is divided into at least two reference regions, whereby the original image and the reference image are respectively divided into regions corresponding to one-to-one according to the luminance values of the original image and the reference image.
  • the transformation matrix of the first area is obtained, and according to the color value of the pixel in the second area and the color value of the pixel in the fourth area , obtain the transformation matrix of the second area, that is, according to different areas, separate processing, according to the color value, obtain the corresponding transformation matrix of each area, and then according to the transformation matrix of the first area and the change matrix of the second area, to The original image is color-mapped to get the target image.
  • the pixels in the image are divided into regions according to the brightness value, the color values in each region are processed separately to obtain a transformation matrix, and the filter migration process is performed according to the obtained at least two transformation matrices, so that the obtained target image is more natural, The target image is tonal closer to the reference image, resulting in better filter transfer.
  • a possible implementation manner of S201 and S202 may be to arrange the pixel points according to the brightness value from low to high, determine the boundary value of the area division, and then divide according to the boundary value.
  • FIG. 3 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure, and FIG. 3 is based on the embodiment shown in FIG. 2 , S2011 and S2012 are a specific kind of S201 Implementation mode, correspondingly, S2021 and S2022 are a specific implementation mode of S202:
  • Each pixel in the original image corresponds to a brightness value, and these brightness values can be obtained, arranged in order from low to high to form a brightness value sequence, and at least one first boundary value is determined according to a preset value rule.
  • the preset value rule is to obtain a first boundary value for every preset number of brightness values.
  • the preset value rule may be to obtain a first dividing value for every same number of luminance values, and the first dividing value divides the sequence of luminance values equally.
  • the pixel point corresponding to the first boundary value is divided into two adjacent original areas, or divided into one original area among the two adjacent original areas, which is not limited in the present disclosure.
  • the brightness values of the pixels in the obtained original image are 20, 30, 50, 200, 50, 150, 150, 210 and 160 respectively, then firstly arrange them from low to high to obtain the sequence of brightness values: 20 , 30, 50, 50, 150, 150, 160, 200, 210, assuming that in order to divide the pixels into two original areas equally according to the brightness value, the first dividing value can be taken as 150. Since the total number of pixels is 9, it is divided into The two original areas cannot be completely divided. Therefore, the original area divided according to the first boundary value can be 20, 30, 50, 50 pixels included in the second area, and pixels included in the first area are 150, 150, 160, 200, 210.
  • the pixels included in the second area are 20, 30, 50, 50, and 150
  • the pixels included in the first area are 150, 160, 200, and 210, and two pixels with a brightness value of 150 They are respectively divided into the first area and the second area, and which one is divided into the first area is not disclosed or limited.
  • S2021. Arrange the pixels in the reference image from low to high brightness values, and determine at least one second boundary value.
  • Steps S2021-S2022 are similar to the above-mentioned steps S2011-S2012, and are not repeated here.
  • the number of the first cutoff value and the number of the second cutoff value are equal.
  • the preset value rules for obtaining the first cutoff value and the second cutoff value are the same.
  • the same number of boundary values are determined according to the luminance values of the respective pixel points arranged from low to high, and then the regions are divided according to the boundary values. Since the number of the first boundary value and the second boundary value is equal, the number of the original area and the reference area are equal, and the area is divided according to the boundary value obtained by arranging the luminance values from low to high, so that the original area of the original image is One-to-one correspondence with the reference area of the reference image. It is convenient for subsequent processing, so that the obtained target image is more natural and closer to the reference image in color tone, so that the filter transfer effect is better.
  • the number of the first cutoff value and the number of the second cutoff value are both two, that is, the original image and the reference image are divided into three regions as an example for further illustrate.
  • step S2011 is: arranging the pixel points in the original image according to the luminance value from low to high, and determining two first boundary values.
  • a specific implementation manner of S2012 is: dividing the pixel point into three original regions based on the two first boundary values.
  • the original area also includes a fifth area, wherein the brightness value of the pixels in the fifth area is greater than the brightness value of the pixels in the first area, or, the pixels in the fifth area The brightness value of the point is smaller than the brightness value of the pixel point in the second area.
  • the Y channel is the brightness value channel
  • the cumulative distribution of the brightness values of the pixels on the Y channel of the original image can be counted to determine two first boundary values, and three original regions can be obtained.
  • the brightness value corresponding to the first 1/3 of the cumulative distribution of the brightness values of the pixel points is used as the first dividing point between the dark part and the midtone, and the brightness value corresponding to the first 2/3 is the first dividing point between the midtone and the highlight.
  • the pixels in the original image are divided into three original regions.
  • the brightness of the pixels contained in the first original area of the three original areas is relatively the lowest, which can be called the original dark area; the brightness of the pixels contained in the second original area is higher than that of the first original area, which can be called the original dark area.
  • the original midtone area; the pixels contained in the third original area have the highest brightness and can be called the original highlight area.
  • a specific implementation manner of S2021 may be: arranging the pixels in the reference image from low to high brightness values, and determining two second boundary values.
  • a specific implementation manner of S2022 may be: dividing the pixel points into three reference regions equally based on the two second boundary values.
  • the reference area also includes a sixth area, where the luminance value of the pixels in the sixth area is greater than the luminance value of the pixels in the third area, or, the pixels in the sixth area The brightness value of the point is smaller than the brightness value of the pixel point in the fourth area.
  • the sixth area corresponds to the fifth area. If the luminance value of the pixels in the fifth area is greater than the luminance value of the pixels in the first area, the luminance value of the pixels in the sixth area is greater than that of the pixels in the third area. If the luminance value of the pixels in the fifth area is smaller than that of the pixels in the second area, the luminance value of the pixels in the sixth area is smaller than that of the pixels in the fourth area.
  • the cumulative distribution of the luminance values of the pixels on the Y channel of the reference image can be counted, thereby determining two second boundary values. Based on the two second boundary values, three reference regions can be obtained.
  • the luminance value corresponding to the first 1/3 of the cumulative distribution of the luminance values of the pixel points is used as the second dividing point between the dark part and the midtone, and the luminance value corresponding to the first 2/3 is the second dividing point between the midtone and the highlight.
  • the pixel points are divided into three reference areas.
  • the brightness of the pixels contained in the first reference area of the three reference areas is relatively low, which can be called the reference dark area; the brightness of the pixels contained in the second reference area is higher than that of the first reference area, which can be called the reference dark area.
  • the reference midtone area; the pixels contained in the third reference area have the highest brightness, which can be called the reference highlight area.
  • the original dark area corresponds to the reference dark area
  • the original midtone area corresponds to the reference midtone area
  • the original highlight area corresponds to the reference highlight area
  • the method of the present embodiment further includes the following steps on the basis of the method of the above-mentioned embodiment:
  • the transformation matrix of the fifth area is obtained.
  • the transformation matrix of the fifth region is obtained using a method similar to that used to obtain the transformation matrix of the first region.
  • color mapping is performed on the original image to obtain the target image.
  • the original image is color-mapped to obtain the target image.
  • the original image is divided into three areas and the reference image is divided into three areas, so that in the case of dividing into three areas, the transformation matrix corresponding to each area is obtained respectively, thereby obtaining the target image.
  • the more regions are divided the better the filter migration effect of the target image will be, but the corresponding amount of calculation will also increase. Therefore, dividing into three regions can make the amount of calculation moderate and achieve better filters. Migration effect.
  • the transformation matrix may be determined by calculating the covariance matrix.
  • FIG. 4 is a flowchart of another image processing method provided by the embodiment of the present disclosure. A schematic diagram, FIG. 4 is based on the embodiment shown in FIG. 2 or FIG. 3 , S2031-S2034 are a specific implementation of S203:
  • the covariance matrix of the color channel dimension corresponding to the multiple original regions is calculated, wherein the covariance matrix of the color channel dimension is the color
  • the color channel contained in the space is the dimension, and the calculated covariance transformation matrix.
  • the value of the U channel and the value of the V channel of each pixel in the first area are used as a two-dimensional variable, and the color values of all pixels in the first area can be regarded as a
  • the covariance matrix corresponding to the first region can be calculated. It can be understood that the two dimensions of the two-dimensional variables are the U channel and the V channel respectively, and the covariance matrix is a 2 ⁇ 2 matrix. Then a 2 ⁇ 2 covariance matrix can be obtained for each original region.
  • the value of the U channel and the value of the V channel of the pixels in the third area are used as a series of two-dimensional variables, and the covariance matrix corresponding to the third area is calculated.
  • the two dimensions of the two-dimensional variables are U channel and V channel
  • the covariance matrix is a 2 ⁇ 2 matrix. Then a 2 ⁇ 2 covariance matrix can be obtained for each reference region.
  • S2031 may be executed first, then S2032 may be executed, or S2032 may be executed first, and then S2031 may be executed, or S2031 and S2032 may be executed simultaneously, which is not limited in this disclosure. .
  • the linear transformation has a covariance matrix suitable for the two variables. Since the color style of the target image is similar to that of the reference image, the The covariance matrix is equal to the covariance matrix of the reference image after linear transformation T, and the mapping function can be obtained by the covariance matrix of the original image and the covariance matrix of the reference image.
  • a transformation matrix can be obtained for each original region and its corresponding reference region obtained above. That is, for the covariance matrix of the color channel dimension of each original region and the covariance matrix of the color channel dimension of the reference region corresponding to the original region, the transformation matrix of the original region can be obtained. It can be understood that since the first area corresponds to the third area and the second area corresponds to the fourth area, then based on the covariance matrix of the color channel dimension corresponding to the first area and the covariance matrix of the color channel dimension corresponding to the third area, A transformation matrix for the first region is determined. The transformation matrix of the second region is determined based on the covariance matrix of the color channel dimension corresponding to the second region and the covariance matrix of the color channel dimension corresponding to the fourth region.
  • the transformation matrix of the corresponding area of the original image and the reference image it is the transformation matrix of the color channel dimension (that is, the U channel and the V channel dimension).
  • the transformation matrix of the color channel dimension that is, the U channel and the V channel dimension.
  • Monge-Kantorovitch can be used as the solution method
  • the covariance matrix of the original region is ⁇ _u
  • the covariance matrix of the reference region corresponding to the original region is ⁇ _v
  • the transformation matrix T It can be obtained by the following formula (1):
  • u is the covariance matrix of the original region
  • v is the covariance matrix of the reference region.
  • the covariance matrices of the color channel dimensions corresponding to the multiple original regions are calculated according to the color values of the pixels in the multiple original regions
  • the multiple reference regions are calculated according to the color values of the pixels in the multiple reference regions
  • the covariance matrix of the corresponding color channel dimension based on the covariance matrix of the color channel dimension corresponding to the first area and the covariance matrix of the color channel dimension corresponding to the third area, determine the transformation matrix of the first area, based on the second area.
  • the covariance matrix of the corresponding color channel dimension and the covariance matrix of the color channel dimension corresponding to the fourth region determine the transformation matrix of the second region, that is, the covariance matrix corresponding to each original region and its corresponding reference region, respectively, to obtain
  • the transformation matrix because the covariance matrix can reflect the correlation between color channels, makes the transition between the color channels of the target image finally obtained according to the covariance matrix more natural, and the color tone of the target image is close to the reference image, so as to achieve filtering. mirror migration.
  • each original area may be processed separately, and the pixels in the original area may be processed according to the transformation matrix of the original area to obtain the original
  • the corrected regions corresponding to the regions are then stitched together with the corrected regions corresponding to the original regions to obtain a target image.
  • FIG. 5 is a schematic flowchart of another image processing method provided by an embodiment of the present disclosure, S2041-S2043 It is a specific implementation manner of S204, which is specifically described below.
  • S2042 Process the color values of the pixel points in the second area according to the transformation matrix of the second area to obtain a second correction area corresponding to the second area.
  • Each original area is processed separately, and the color values of the pixels in the original area are processed according to the transformation matrix corresponding to the original area to obtain the corrected area corresponding to the original area, thereby obtaining the corrected area corresponding to each original area.
  • the color values of the pixels in the original area are processed to obtain the corrected area corresponding to the original area.
  • the corrected area corresponding to the original area is the target color value corresponding to each pixel in the original area.
  • the correction area of the original area is the target value of the U channel and the target value of the V channel corresponding to each pixel in the original area.
  • the correction region corresponding to the original region can be obtained through the following steps 1-3:
  • Step 1 Subtract the color mean value of the original area from the color value of each pixel in the original area to obtain a zero-removal result.
  • Step 2 Process the zero-removal result based on the transformation matrix of the original region to obtain a transformation result.
  • Step 3 Add the color mean value of the reference area to the transformation result to obtain the corrected area corresponding to the original area.
  • the above steps 1-3 can be regarded as the operations of translating, rotating, scaling and translating the vector of the color dimension in sequence. Therefore, according to the transformation matrix of the original area, the average color value of the original area can be and the color mean of the reference area to get the total transformation matrix. Based on the total transformation matrix, the color values of the pixels in the original area are processed to obtain the corrected area corresponding to the original area.
  • the corrected regions corresponding to all the original regions are spliced to obtain the color result of the target image.
  • the target image is obtained by fusing the color result of the target image with the brightness value of the original image.
  • the color result of the target image is the target color value corresponding to each pixel of the target image.
  • the color result of the target image is the target value of the U channel corresponding to each pixel in the target image and V The target value of the channel.
  • the filter migrates to convert the color, the brightness value of the pixel of the original image is not changed in the previous steps. Therefore, after the color result of the target image is obtained, the color result of the target image is compared with the original image. The brightness values of the pixels are fused to obtain a complete target image.
  • the color values of the pixels in each original area are separately processed to obtain the corrected area of the original area, and then the corrected areas of each original area are spliced to obtain the target image, the transformation matrix of each original area The original area is processed, so that the corrected area obtained by each original area is more accurate, so that the target image is closer to the reference image, and the filter transfer effect is better.
  • step S204 according to the transformation matrix of the original area, the color mean value, and the color mean value of the reference area corresponding to the original area, for the original image All pixel points are processed to obtain the color transformation result corresponding to the transformation matrix, and the mean value of all the color transformation results is calculated to obtain the target image.
  • FIG. 6 FIG. Flow chart, S204a-S204c is a specific implementation of S204:
  • S204a Process the color values of the pixels in the original image according to the transformation matrix of the first region to obtain a first corrected image corresponding to the transformation matrix of the first region.
  • S204b Process the color values of the pixels in the original image according to the transformation matrix of the second region to obtain a second modified image corresponding to the transformation matrix of the second region.
  • the color value of each pixel in the original image can be processed according to the transformation matrix of the original region to obtain a corrected image corresponding to the transformation matrix.
  • a corrected image corresponding to each transformation matrix is obtained.
  • the color value of each pixel in the original image is processed according to the color mean value of the original area and the color mean value of the reference area corresponding to the original area.
  • a corrected image equal to the number of original areas can be obtained.
  • the corrected image corresponding to the transformation matrix is the matching color value corresponding to each pixel in the original image.
  • Each pixel in the original image can get at least two matching color values, and the number of matching color values is equal to the number of the original area.
  • the corrected image corresponding to the transformation matrix of the original area is the matching color value of the U channel and the matching color value of the V channel corresponding to each pixel in the original image.
  • the corrected image corresponding to the transformation matrix can be obtained through the following steps a-c:
  • Step a Subtract the color mean value of the original area from the color value of the pixel point of the original image to obtain a zero-removal result.
  • Step b Process the zero-removal result based on the transformation matrix of the original region to obtain a transformation result.
  • step c the transformation result is added to the color mean value of the reference area to obtain a corrected image corresponding to the transformation matrix.
  • the above steps a-c can be regarded as the operations of translating, rotating, scaling and translating the vector of the color dimension in sequence. Therefore, according to the transformation matrix of each original area, the average color value of each original area can be and the color mean of each reference area corresponding to the original area, respectively, to obtain the total transformation matrix corresponding to each transformation matrix. Based on the total transformation matrix corresponding to each transformation matrix, the original image is processed to obtain a modified image corresponding to the transformation matrix.
  • the color value of each pixel in the original image in each corrected image is fused to obtain the target value of each pixel, which is the value of the target image.
  • the mean value of the corrected images corresponding to the transformation matrices of all the original regions can be calculated to obtain the target image.
  • the average value of the color values of each pixel in all the corrected images may be calculated separately to obtain the color result of the target image.
  • the mean value is the target color value of the pixel in the target image.
  • the filter migrates to convert the color, the brightness value of the pixel of the original image is not changed in the previous steps, so that the color result of the target image and the brightness value of the pixel of the original image are fused, Get the target image.
  • the color values of the pixels in the original image are processed according to the transformation matrix of the first region to obtain a first corrected image corresponding to the transformation matrix of the first region, and the original image is processed according to the transformation matrix of the second region.
  • the color values of the middle pixels are processed to obtain the second corrected image corresponding to the transformation matrix of the second area, that is, according to the transformation matrix of each original area, all the pixels of the original image are processed respectively to obtain multiple original images. Correct the image, and then fuse all the corrected images to obtain the target image, so that the transition between the pixels of different brightness in the obtained target image is more natural, thereby making the target image more natural.
  • each frame of image contained in the original video is used as an original image, which is different from the reference image.
  • the above image processing method is performed to obtain a target image, and the target image is formed into a picture of the target video according to the position of the original image in the video.
  • the target image of the first frame of the original image of the original image can be obtained by the method of the above-mentioned embodiment, from Starting from the second frame of the original image of the original image, there is no need to perform steps S201-S203, that is, there is no need to calculate the transformation matrix corresponding to each original area of the original image of the frame. The resulting transformation matrix for each original region of the image.
  • the GPU When performing filter migration on video, the GPU is used in electronic equipment for processing. For 720P video, it can take less than 2ms per frame, thus greatly improving the efficiency of video filter migration.
  • FIG. 7 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present disclosure. As shown in FIG. 7 , the apparatus provided by this embodiment includes:
  • the area division module 701 is used to divide the original image into multiple original areas; the multiple original areas include at least a first area and a second area, and the brightness value of the pixels in the first area is greater than the brightness value of the pixels in the second area. ; Divide the reference image into a plurality of reference areas; the reference area includes at least a third area and a fourth area, wherein the brightness value of the pixel in the third area is greater than the brightness value of the pixel in the fourth area;
  • the transformation matrix generation module 702 is configured to obtain the transformation matrix of the first region according to the color value of the pixel point in the first region and the color value of the pixel point in the third region, and according to the color value of the pixel point in the second region and the color value of the pixel point in the third region.
  • the color values of the pixels in the four regions are obtained to obtain the transformation matrix of the second region;
  • the processing module 703 is configured to perform color mapping on the original image according to the transformation matrix of the first region and the change matrix of the second region to obtain the target image.
  • the transformation matrix generation module 702 is specifically configured to:
  • the covariance matrix of and the covariance matrix of the color channel dimension corresponding to the fourth region determine the transformation matrix of the second region.
  • processing module 703 is specifically configured to:
  • the color values of the pixels in the original image are processed to obtain the first corrected image corresponding to the transformation matrix of the first area; according to the transformation matrix of the second area, the color values of the pixels in the original image are processed The value is processed to obtain the second corrected image corresponding to the transformation matrix of the second region; the first corrected image and the second corrected image are fused to obtain the target image.
  • processing module 703 is specifically configured to:
  • the color values of the pixels in the first area are processed to obtain the first correction area corresponding to the first area; according to the transformation matrix of the second area, the color values of the pixels in the second area are processed Perform processing to obtain a second correction area corresponding to the second area; and splicing the first correction area and the second correction area to obtain a target image.
  • the area division module 701 is specifically used for:
  • the plurality of original regions further include a fifth region, and the brightness value of the pixels in the fifth region is greater than the brightness value of the pixels in the first region, or the brightness value of the pixels in the fifth region is smaller than that of the second region.
  • the reference area further includes a sixth area, wherein the brightness value of the pixels in the sixth area is greater than the brightness value of the pixels in the third area, or the brightness value of the pixels in the sixth area is smaller than the brightness value of the pixels in the fourth area value;
  • the transformation matrix generation module 702 is also used to:
  • the transformation matrix of the fifth area is obtained;
  • the processing module 703 is specifically used for:
  • color mapping is performed on the original image to obtain the target image.
  • An embodiment of the present disclosure provides an electronic device, comprising: one or more processors; a memory; and one or more computer programs; wherein the one or more computer programs are stored in the memory; When one or more computer programs are executed, the electronic device is made to implement the image processing method according to any one of the embodiments shown in FIG. 2 to FIG. 6 above.
  • An embodiment of the present disclosure provides a computer storage medium, including computer instructions, which, when the computer instructions are executed on an electronic device, cause the electronic device to execute the image processing method according to any of the embodiments shown in FIG. 2 to FIG. 6 .
  • An embodiment of the present disclosure provides a computer program product, which, when the computer program product runs on a computer, causes the computer to execute the image processing method according to any of the embodiments shown in FIG. 2 to FIG. 6 above.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Image Processing (AREA)

Abstract

本公开提供一种图像处理方法及装置,通过将原始图像划分为多个原始区域,多个原始区域至少包括第一区域和第二区域,第一区域中像素点的亮度值大于第二区域中像素点的亮度值,将参考图像划分为多个参考区域;参考区域至少包括第三区域和第四区域,其中,第三区域中像素点的亮度值大于第四区域中像素点的亮度值,根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵,根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像。使得目标图像更自然,且在色调上与参考图像更接近,滤镜迁移效果好。

Description

图像处理方法及装置
本申请是以中国申请号为202110389102.7,申请日为2021年4月12日的申请为基础,并主张其优先权,该中国申请的公开内容在此作为整体引入本申请中。
技术领域
本公开涉及计算机视觉技术领域,尤其涉及一种图像处理方法及装置。
背景技术
在许多场景下,需要对图像或者视频进行滤镜迁移操作,即根据参考图像/视频的色调风格调整原始图像/视频的色调风格,使得原始图像/视频与参考图像/视频的色调一致。
现有的滤镜迁移方法,将原始图像的各通道的直方图与参考图像的各个通道的直方图进行匹配,使得原始图像的各通道的直方图与参考图像接近。
然而,这样得到的滤镜迁移的效果不好。
发明内容
为了解决上述技术问题,本公开提供了一种图像处理方法及装置。
第一方面,本公开提供了一种图像处理方法,包括:
将原始图像划分为多个原始区域;多个原始区域至少包括第一区域和第二区域,第一区域中像素点的亮度值大于第二区域中像素点的亮度值;
将参考图像划分为多个参考区域;参考区域至少包括第三区域和第四区域,其中,第三区域中像素点的亮度值大于第四区域中像素点的亮度值;
根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵;
根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像。
在一些实施例中,根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵,包括:
根据多个原始区域中像素点的颜色值,计算多个原始区域分别对应的颜色通道维度的 协方差矩阵;
根据多个参考区域中像素点的颜色值,计算多个参考区域分别对应的颜色通道维度的协方差矩阵;
基于第一区域对应的颜色通道维度的协方差矩阵和第三区域对应的颜色通道维度的协方差矩阵,确定第一区域的变换矩阵;
基于第二区域对应的颜色通道维度的协方差矩阵和第四区域对应的颜色通道维度的协方差矩阵,确定第二区域的变换矩阵。
在一些实施例中,根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像,包括:
根据第一区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第一区域的变换矩阵对应的第一修正图像;
根据第二区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第二区域的变换矩阵对应的第二修正图像;
融合第一修正图像和第二修正图像,得到目标图像。
在一些实施例中,根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像,包括:
根据第一区域的变换矩阵,对第一区域中像素点的颜色值进行处理,得到第一区域对应的第一修正区域;
根据第二区域的变换矩阵,对第二区域中像素点的颜色值进行处理,得到第二区域对应的第二修正区域;
对第一修正区域和第二修正区域进行拼接,得到目标图像。
在一些实施例中,将原始图像划分为多个原始区域,包括:
将原始图像中像素点按照亮度值从低到高排列,确定至少一个第一分界值;
基于至少一个第一分界值将原始图像中像素点分为多个原始区域;
将参考图像划分为多个参考区域,包括:
将参考图像中像素点按照亮度值从低到高排列,确定至少一个第二分界值;
基于至少一个第二分界值将参考图像中像素点分为多个参考区域。
在一些实施例中,多个原始区域还包括第五区域,第五区域中像素点的亮度值大于第一区域中像素点的亮度值,或者,第五区域中像素点的亮度值小于第二区域中像素点的亮度值;
参考区域还包括第六区域,其中,第六区域中像素点的亮度值大于第三区域中像素点 的亮度值,或者,第六区域中像素点的亮度值小于第四区域中像素点的亮度值;
方法还包括:
根据第五区域中像素点的颜色值和第六区域中像素点的颜色值,得到第五区域的变换矩阵;
根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像,包括:
根据第一区域的变换矩阵、第二区域的变化矩阵和第五区域的变换矩阵,对原始图像进行颜色映射,得到目标图像。
第二方面,本公开提供了一种图像处理装置,包括:
区域划分模块,用于将原始图像划分为多个原始区域;多个原始区域至少包括第一区域和第二区域,第一区域中像素点的亮度值大于第二区域中像素点的亮度值;将参考图像划分为多个参考区域;参考区域至少包括第三区域和第四区域,其中,第三区域中像素点的亮度值大于第四区域中像素点的亮度值;
变换矩阵生成模块,用于根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵;
处理模块,用于根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像。
在一些实施例中,变换矩阵生成模块具体用于:
根据多个原始区域中像素点的颜色值,计算多个原始区域分别对应的颜色通道维度的协方差矩阵;根据多个参考区域中像素点的颜色值,计算多个参考区域分别对应的颜色通道维度的协方差矩阵;基于第一区域对应的颜色通道维度的协方差矩阵和第三区域对应的颜色通道维度的协方差矩阵,确定第一区域的变换矩阵;基于第二区域对应的颜色通道维度的协方差矩阵和第四区域对应的颜色通道维度的协方差矩阵,确定第二区域的变换矩阵。
在一些实施例中,处理模块具体用于:
根据第一区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第一区域的变换矩阵对应的第一修正图像;根据第二区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第二区域的变换矩阵对应的第二修正图像;融合第一修正图像和第二修正图像,得到目标图像。
在一些实施例中,处理模块具体用于:
根据第一区域的变换矩阵,对第一区域中像素点的颜色值进行处理,得到第一区域对 应的第一修正区域;根据第二区域的变换矩阵,对第二区域中像素点的颜色值进行处理,得到第二区域对应的第二修正区域;对第一修正区域和第二修正区域进行拼接,得到目标图像。
在一些实施例中,区域划分模块具体用于:
将原始图像中像素点按照亮度值从低到高排列,确定至少一个第一分界值;基于至少一个第一分界值将原始图像中像素点分为多个原始区域;将参考图像中像素点按照亮度值从低到高排列,确定至少一个第二分界值;基于至少一个第二分界值将参考图像中像素点分为多个参考区域。
在一些实施例中,多个原始区域还包括第五区域,第五区域中像素点的亮度值大于第一区域中像素点的亮度值,或者,第五区域中像素点的亮度值小于第二区域中像素点的亮度值;
参考区域还包括第六区域,其中,第六区域中像素点的亮度值大于第三区域中像素点的亮度值,或者,第六区域中像素点的亮度值小于第四区域中像素点的亮度值;
变换矩阵生成模块还用于:
根据第五区域中像素点的颜色值和第六区域中像素点的颜色值,得到第五区域的变换矩阵;
处理模块具体用于:
根据第一区域的变换矩阵、第二区域的变化矩阵和第五区域的变换矩阵,对原始图像进行颜色映射,得到目标图像。
第三方面,本公开提供一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序;其中,一个或多个计算机程序被存储在存储器中;一个或多个处理器在执行一个或多个计算机程序时,使得电子设备实现如上述第一方面的图像处理方法。
第四方面,本公开提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如上述第一方面的图像处理方法。
第五方面,本公开提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述第一方面的图像处理方法。
附图说明
此处的附图被并入说明书中并构成本说明书的一部分,示出了符合本公开的实施例,并与说明书一起用于解释本公开的原理。
为了更清楚地说明本公开实施例或相关技术中的技术方案,下面将对实施例或相关技 术描述中所需要使用的附图作简单地介绍,显而易见地,对于本领域普通技术人员而言,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1A为一种原始图像示意图;
图1B为一种参考图像示意图;
图1C为一种滤镜迁移结果示意图;
图2为本公开实施例提供的一种图像处理方法的流程示意图;
图3为本公开实施例提供的另一种图像处理方法的流程示意图;
图4为本公开实施例提供的另一种图像处理方法的流程示意图;
图5为本公开实施例提供的另一种图像处理方法的流程示意图;
图6为本公开实施例提供的另一种图像处理方法的流程示意图;
图7为本公开实施例提供的一种图像处理装置的结构示意图。
具体实施方式
为了能够更清楚地理解本公开的上述目的、特征和优点,下面将对本公开的方案进行进一步描述。需要说明的是,在不冲突的情况下,本公开的实施例及实施例中的特征可以相互组合。
在下面的描述中阐述了很多具体细节以便于充分理解本公开,但本公开还可以采用其他不同于在此描述的方式来实施;显然,说明书中的实施例只是本公开的一部分实施例,而不是全部的实施例。
在许多场景下,需要通过电子设备对图像或者视频进行滤镜迁移操作。滤镜迁移是指根据参考图像/视频的色调风格调整原始图像/视频的色调风格,使得原始图像/视频与参考图像/视频的色调一致。
对于图像的滤镜迁移,需要根据参考图像的色调风格调整原始图像的色调风格,使得原始图像和参考图像的色调一致。例如,为营造某种氛围会根据实际需求对原始图像进行色调上的调整,或者,在多个图像的色调不一致情况下,为了统一多个图像的色调,对图像进行滤镜迁移。请参考图1A、图1B和图1C,图1A为一种原始图像示意图,图1B为一种参考图像示意图,图1C为一种滤镜迁移结果示意图。
视频画面是由多帧图像组成的,对于视频的滤镜迁移,与图像的滤镜迁移类似,根据参考图像的色调风格调整视频中每一帧原始图像的色调风格,使得每一帧原始图像和参考图像的色调一致。例如,在电影制作或视频剪辑过程中,由于每个视频片段的拍摄环境、拍摄时间和/或拍摄环境光等不同,导致每个视频片段之间存在色调的差异,需要统一这些 片段的色调,使得这些视频片段拼接起来后显得更加自然。这些情况都需要快速地将多个视频片段的色调统一起来。
现有的滤镜迁移方法,将原始图像的各通道的直方图分别与参考图像的各个通道的直方图进行匹配,使得原始图像的各通道的直方图与参考图像接近。
然而,这样得到的滤镜迁移的效果不好。
本公开提供了一种图像处理方法,通过将原始图像和参考图像分别根据像素点的亮度值进行区域划分,对于每个对应区域,基于原始图像和参考图像中像素点的颜色值,得到在该区域的原始图像到目标图像的变换矩阵,从而根据不同亮度值区域得到至少两个变换矩阵,根据至少两个变换矩阵,得到目标图像,使得得到的目标图像更加自然,滤镜迁移效果好。
具体来讲,本公开实施例提供的技术方案与相关技术相比具有如下优点:
通过将原始图像划分为多个原始区域,多个原始区域至少包括第一区域和第二区域,第一区域中像素点的亮度值大于第二区域中像素点的亮度值,将参考图像划分为至少两个参考区域,由此,根据原始图像和参考图像的亮度值,分别将原始图像和参考图像划分为一一对应的区域。根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵,也就是,按照不同的区域进行单独处理,根据颜色值,得到每个区域对应的变换矩阵,然后根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像。根据亮度值将图像中像素点进行划分区域,对每个区域内的颜色值进行单独处理,得到变换矩阵,根据得到的至少两个变换矩阵进行滤镜迁移处理,从而得到的目标图像更自然,目标图像在色调上与参考图像更加接近,从而使得滤镜迁移效果更好。
根据本公开的一些实施例,图2为本公开实施例提供的一种图像处理方法的流程示意图,如图2所示,本实施例的方法由电子设备执行,电子设备可以是计算机、手机、平板设备等,本公开对此不做限定,本实施例的方法如下:
S201、将原始图像划分为多个原始区域。
其中,多个原始区域至少包括第一区域和第二区域,第一区域中像素点的亮度值大于第二区域中像素点的亮度值。
S202、将参考图像划分为多个参考区域。
其中,参考区域至少包括第三区域和第四区域,其中,第三区域中像素点的亮度值大 于第四区域中像素点的亮度值。
获取原始图像和参考图像。其中,需要将参考图像的滤镜迁移至原始图像。
原始图像和参考图像的颜色空间均分别包含亮度值通道和颜色值通道,例如,颜色空间可以为Lab、亮度-色差(YUV)或者亮度-色相(Lαβ)颜色空间等,其中,在Lab颜色空间中,L表示亮度;a表示第一参数,a的取值范围为+127至-128,其中,正数代表红色,负数代表绿色;b表示第二参数,b的取值范围为+127至-128,其中,正数代表黄色,负数代表蓝色。本公开对此不作限定。本实施例中以YUV颜色空间为例进行说明,YUV颜色空间共包含三个通道,分别为Y通道、U通道和V通道,其中,Y通道为亮度值通道,U通道和V通道为颜色值通道。
参考图像的颜色空间与原始图像的颜色空间相同。如果参考图像与原始图像的颜色空间不同,需要进行转换,使得参考图像和原始图像为相同的颜色空间。
在一些实施例中,在获取到的原始图像为没有亮度值通道的颜色空间的情况下,例如,原始图像的颜色空间可以为红绿蓝(Red Green Blue,简称RGB)或者青品黄黑(Cyan Magenta Yellow Black,简称CMYK)等颜色空间,本公开对此不作限定。可以先将原始图像转换为包含亮度值通道和颜色值通道的颜色空间。例如,需要在YUV颜色空间进行处理,可以将原始图像由RGB颜色空间转换为YUV颜色空间,然后进行后续处理。
在获取到的参考图像为没有亮度值通道的颜色空间的情况下,例如,参考图像的颜色空间可以为RGB或CMYK等颜色空间,本公开对此不作限定。可以先将参考图像转换为包含亮度值通道和颜色值通道的颜色空间。例如,需要在YUV颜色空间进行处理,将参考图像由RGB颜色空间转换为YUV颜色空间,然后进行后续处理。
可以根据原始图像中像素点的亮度值,对原始图像中像素点进行区域划分,得到多个原始区域。例如,YUV颜色空间中,根据原始图像的Y通道的亮度值,对原始图像中像素点进行区域划分,将所有像素点划分至多个原始区域。
相应的,可以根据参考图像中像素点的亮度值,对参考图像中像素点进行区域划分,得到多个参考区域。例如,根据参考图像的Y通道的亮度值,对原始图像中像素点进行区域划分,将所有像素点划分至多个参考区域。
得到的原始区域的数量与参考区域的数量相同,且原始区域与参考区域一一对应,后续针对划分的原始区域与对应的参考区域分别进行处理。也就是对于原始图像,根据像素点的亮度值和预设规则,得到多个原始区域,对于参考图像,根据像素点的亮度值和预设规则,得到多个参考区域,上述预设规则相同,则得到的原始区域与参考区域一一对应。例如,预设规则可以为将图像中像素点按照亮度值由高到底排列,或者由低到高排列,然 后按照排列的顺序划分区域,因此,得到的原始区域与参考区域一一对应,即第一区域与第三区域对应,第二区域与第四区域对应。
假设,预设规则为将一个图像按照亮度值由高到低排列划分为两个区域,前二分之一的亮度值对应的像素点划分至第一个区域,后二分之一的亮度值对应的像素点划分至第二个区域。则划分的区域越靠前,区域内的像素点的亮度值相对越大。下面按照预设规则对原始图像和参考图像进行处理。将原始图像中像素点按照亮度值由高到底排列,前二分之一的亮度值对应的像素点划分至第一区域,后二分之一的亮度值对应的像素点划分至第二区域。相应的,将参考图像中像素点按照亮度值由高到底排列,前二分之一的亮度值对应的像素点划分至第三区域,后二分之一的亮度值对应的像素点划分至第四区域。则第一区域1和第三区域对应,第二区域2和第四区域对应。
可以理解,对于步骤S201和S202的执行没有先后顺序,可以先执行S201,再执行S202,也可以先执行S202,再执行S201,还可以同时执行S201和S202,本公开对此不做限定。
S203、根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵。
滤镜迁移是一个颜色映射的过程,即将原始图像的颜色经过映射以后,得到映射后的目标图像的颜色。可以通过颜色的映射函数和原始图像的颜色得到目标图像的颜色,即v=T(u),其中,v为目标图像的颜色,u为原始图像的颜色,T为颜色的映射函数。参考图像和所要得到的目标图像的颜色相似,因此,根据原始图像的颜色和参考图像的颜色可以确定映射函数,便可得到目标图像,实现滤镜迁移。则为了得到目标图像需要先确定映射函数。
对于每个原始区域和原始区域对应的参考区域,根据原始区域中像素点的颜色值和参考区域中像素点的颜色值,得到原始区域的变换矩阵。其中,原始区域中像素点的颜色值为原始区域中像素点在颜色通道的值,参考区域中像素点的颜色值为参考区域中像素点在颜色通道的值。
由于第一区域与第三区域对应,第二区域与第四区域对应,因此,根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵。其中,第一区域中像素点的颜色值为第一区域中像素点在颜色通道的值。第二区域中像素点的颜色值为第二区域中像素点在颜色通道的值。第三区域中像素点的颜色值为第三区域中像素点在 颜色通道的值。第四区域中像素点的颜色值为第四区域中像素点在颜色通道的值。
以原始图像和参考图像为YUV颜色空间为例,则某一区域中像素点的颜色值为该区域中所有像素点的U通道的值和V通道的值。例如,第一区域中像素点的颜色值为第一区域中所有像素点的U通道的值和V通道的值。
在原始图像和参考图像所属的颜色空间中,颜色通道为两个或两个以上的情况下,一种可能的实现方式中,得到的每个原始区域的变换矩阵可以为一个。例如,可以得到原始区域像素点对应的至少两个颜色通道的协方差变换矩阵。
另一种可能的实现方式中,也可以针对每个原始区域中的每个颜色通道,得到每个颜色通道分别对应的变换矩阵,则原始区域的变换矩阵的数量与颜色通道的数量相同。例如,每个颜色通道得到一个标准差。
S204、根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像。
根据各原始区域的变换矩阵分别对原始图像的颜色通道进行颜色映射,得到各颜色映射结果,将各颜色映射结果和原始图像的亮度值进行融合,得到目标图像。即根据第一区域的变换矩阵和第二区域的变化矩阵,分别对原始图像进行颜色映射,得到两个颜色映射结果,将两个颜色映射结果和原始图像的亮度值进行融合,得到目标图像
进一步地,得到各颜色变换结果的一种可能的实现方式中,可以根据各原始区域的变换矩阵,各原始区域的颜色均值和各参考区域的颜色均值,得到各颜色变换结果。其中,原始区域的颜色均值为原始区域的所有像素点的颜色值的平均值。参考区域的颜色均值为参考区域的所有像素点的颜色值的平均值。颜色均值为对于每个颜色通道单独计算的平均值。以YUV色彩空间为例,颜色均值为U通道的值的平均值和V通道的值的平均值。
进一步地,将各颜色变换结果和原始图像的亮度值进行融合,得到目标图像的一种可能的实现方式中,可以根据得到的所有的颜色变换结果,得到目标图像的颜色值,将每个像素点的颜色值和对应的原始图像的亮度值相融合,得到目标图像。
在一些实施例中,若在进行上述图像处理的步骤前,若原始图像为没有亮度值通道的颜色空间,则在对原始图像进行处理之前,需要将原始图像转换到包含亮度值通道和颜色通道的颜色空间,再对原始图像进行处理,则得到的目标图像所属的颜色空间与原始图像所属的颜色空间不同,需要将目标图像所属的颜色空间转换为进行上述图像处理步骤前的原始图像的颜色空间。
例如,原始图像为RGB颜色空间,在进行上述图像处理的步骤前,将原始图像从RGB颜色空间转换为YUV颜色空间,从而通过上述图像处理步骤,得到的目标图像为YUV颜 色空间,将目标图像由YUV颜色空间转换为RGB颜色空间,从而得到最终需要的目标图像。
本实施例,通过将原始图像划分为多个原始区域,多个原始区域至少包括第一区域和第二区域,第一区域中像素点的亮度值大于第二区域中像素点的亮度值,将参考图像划分为至少两个参考区域,由此,根据原始图像和参考图像的亮度值,分别将原始图像和参考图像划分为一一对应的区域。根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵,也就是,按照不同的区域进行单独处理,根据颜色值,得到每个区域对应的变换矩阵,然后根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像。根据亮度值将图像中像素点进行划分区域,对每个区域内的颜色值进行单独处理,得到变换矩阵,根据得到的至少两个变换矩阵进行滤镜迁移处理,从而得到的目标图像更自然,目标图像在色调上与参考图像更加接近,从而使得滤镜迁移效果更好。
进一步地,在图2所示实施例的基础上,S201和S202的一种可能的实现方式可以为将像素点按照亮度值从低到高排列,确定区域划分的分界值,再根据分界值划分区域,请参见图3,图3为本公开实施例提供的另一种图像处理方法的流程示意图,图3是在图2所示实施例的基础上,S2011和S2012为S201的一种具体的实现方式,相应的,S2021和S2022为S202的一种具体的实现方式:
S2011、将原始图像中像素点按照亮度值从低到高排列,确定至少一个第一分界值。
S2012、基于至少一个第一分界值将原始图像中像素点分为多个原始区域。
每个原始图像中像素点对应一个亮度值,可以获取这些亮度值,按照从低到高的顺序排列成为亮度值序列,按照预设取值规则,确定至少一个第一分界值。
其中,预设取值规则为每隔预设数量的亮度值获取一个第一分界值。示例性的,预设取值规则可以为每隔相同数量的亮度值获取一个第一分界值,第一分界值将亮度值序列均分,若像素点总数无法实现完全的均分,则可以将第一分界值对应的像素点划分到其相邻的两个原始区域中,或者划分到相邻的两个原始区域中的一个原始区域中,对此本公开对此不做限定。
例如,获取到的原始图像中像素点的亮度值分别为20、30、50、200、50、150、150、210和160,则首先按照从低到高进行排列,得到亮度值序列为:20、30、50、50、150、150、160、200、210,假设为了将像素点按照亮度值均分为两个原始区域,则第一分界值可以取150,由于像素点总数为9,分成2个原始区域无法实现完全的均分,因此,按照第 一分界值划分的原始区域可以为第二区域中包含的像素点为20,30,50,50,第一区域中包含的像素点为150,150,160,200,210。还可以为第二区域中包含的像素点为20,30,50,50,150,第一区域中包含的像素点为150,160,200,210,其中,亮度值为150的两个像素点分别划分到了第一区域和第二区域,至于哪一个划分到第一区域不公开不做限定。
S2021、将参考图像中像素点按照亮度值从低到高排列,确定至少一个第二分界值。
S2022、基于至少一个第二分界值将参考图像中像素点均分为多个参考区域。
步骤S2021-S2022与上述步骤S2011-S2012类似,此处不再赘述。
需要说明的是,第一分界值与第二分界值的数量相等。得到第一分界值和第二分界值的预设取值规则相同。
本实施例,在对原始图像和参考图像进行区域划分时,分别根据通过各自像素点的亮度值从低到高排列,确定数量相同的分界值,再根据分界值进行划分区域。由于第一分界值与第二分界值的数量相等,因此,原始区域和参考区域的数量相等,并且按照亮度值从低到高排列得到的分界值,进行区域划分,从而使得原始图像的原始区域与参考图像的参考区域一一对应。便于进行后续处理,使得得到目标图像更加自然,且在色调上与参考图像更加接近,从而使得滤镜迁移效果更好。
在图3实施例的基础上,进一步地,本实施例以第一分界值和第二分界值的数量均为两个,也即原始图像和参考图像均分为三个区域为例进行进一步的说明。
步骤S2011的一种具体的实现方式为:将原始图像中像素点按照亮度值从低到高排列,确定两个第一分界值。
相应的,S2012的一种具体的实现方式为:基于两个第一分界值将像素点分为三个原始区域。
也就是原始区域除了包括第一区域和第二区域以外,还包括第五区域,其中,第五区域中像素点的亮度值大于第一区域中像素点的亮度值,或者,第五区域中像素点的亮度值小于第二区域中像素点的亮度值。
以YUV颜色空间为例,Y通道为亮度值通道,可以统计原始图像在Y通道上的像素点的亮度值的累计分布,从而确定出两个第一分界值,可以得到三个原始区域。
例如,像素点的亮度值的累计分布中前1/3所对应的亮度值作为暗部和中间调的第一分界点,前2/3所对应的亮度值作为中间调和高亮的第一分界点。根据上述两个第一分界点,将原始图像中的像素点分为了三个原始区域。三个原始区域中的第一个原始区域中包含的像素点的亮度相对最低,可以叫做原始暗部区域;第二个原始区域中包含的像素点的亮度比第一个原始区域的高,可以叫做原始中间调区域;第三个原始区域中包含的像素点 的亮度相对最高,可以叫做原始高亮区域。
S2021的一种具体的实现方式可以为:将参考图像中像素点按照亮度值从低到高排列,确定两个第二分界值。
相应的,S2022的一种具体的实现方式可以为:基于两个第二分界值将像素点均分为三个参考区域。
也就是参考区域除了包括第三区域和第四区域以外,还包括第六区域,其中,第六区域中像素点的亮度值大于第三区域中像素点的亮度值,或者,第六区域中像素点的亮度值小于第四区域中像素点的亮度值。
需要说明的是,第六区域与第五区域对应。若第五区域中像素点的亮度值大于第一区域中像素点的亮度值,则第六区域中像素点的亮度值大于第三区域中像素点的亮度值。若第五区域中像素点的亮度值小于第二区域中像素点的亮度值,则第六区域中像素点的亮度值小于第四区域中像素点的亮度值。
以YUV颜色空间为例,可以统计参考图像在Y通道上的像素点的亮度值的累计分布,从而确定出两个第二分界值,基于两个第二分界值,可以得到三个参考区域。
例如,像素点的亮度值的累计分布中前1/3所对应的亮度值作为暗部和中间调的第二分界点,前2/3所对应的亮度值作为中间调和高亮的第二分界点。根据上述两个第二分界点,将像素点分为了三个参考区域。三个参考区域中的第一个参考区域中包含的像素点的亮度相对最低,可以叫做参考暗部区域;第二个参考区域中包含的像素点的亮度比第一个参考区域的高,可以叫做参考中间调区域;第三个参考区域中包含的像素点的亮度相对最高,可以叫做参考高亮区域。
则原始暗部区域与参考暗部区域对应,原始中间调区域与参考中间调区域对应,原始高亮区域与参考高亮区域对应。
从而本实施例的方法在上述实施例方法的基础上,还包括如下步骤:
根据第五区域中像素点的颜色值和第六区域中像素点的颜色值,得到第五区域的变换矩阵。
由于第五区域和第六区域对应,因此,使用与得到第一区域的变换矩阵类似的方法,得到第五区域的变换矩阵。
相应的,S204的一种具体的事项方式为:
根据第一区域的变换矩阵、第二区域的变化矩阵和第五区域的变换矩阵,对原始图像进行颜色映射,得到目标图像。
从而根据第一区域、第二区域和第五区域分别对应的变换矩阵,对原始图像进行颜色 映射,得到目标图像。
本实施例,通过将原始图像分为三个区域,参考图像分为三个区域,从而在分为三个区域的情况下,分别得到每个区域对应的变换矩阵,从而得到目标图像。若区域划分越多,则得到目标图像的滤镜迁移效果越好,但相应的计算量也会增多,因此,划分为三个区域,即可以使得计算量适中,又可以实现较好的滤镜迁移效果。
在上述实施例的基础上,S203的一种实现方式中,可以通过计算协方差矩阵,进而确定变换矩阵,请参见图4,图4为本公开实施例提供的另一种图像处理方法的流程示意图,图4是在图2或图3所示实施例的基础上,S2031-S2034为S203的一种具体的实现方式:
S2031、根据多个原始区域中像素点的颜色值,计算多个原始区域分别对应的颜色通道维度的协方差矩阵。
S2032、根据多个参考区域中像素点的颜色值,计算多个参考区域分别对应的颜色通道维度的协方差矩阵。
在原始图像和参考图像所属的颜色空间中,颜色通道为两个或两个以上,计算多个原始区域分别对应的颜色通道维度的协方差矩阵,其中,颜色通道维度的协方差矩阵为以颜色空间中包含的颜色通道为维度,计算得到的协方差变换矩阵。
示例性的,以YUV颜色空间为例,第一区域中的每个像素点的U通道的值和V通道的值作为一个二维变量,第一区域中所有像素点的颜色值可以看做一系列的二维变量,可以计算第一区域对应的协方差矩阵,可以理解,其二维变量的两个维度分别为U通道和V通道,该协方差矩阵为一个2×2的矩阵。则对于每个原始区域可以得到一个2×2的协方差矩阵。相应的,第三区域中像素点的U通道的值和V通道的值作为一系列的二维变量,计算第三区域对应的协方差矩阵,可以理解,其二维变量的两个维度分别为U通道和V通道,该协方差矩阵为一个2×2的矩阵。则对于每个参考区域可以得到一个2×2的协方差矩阵。
需要说明的是,对于步骤S2031和S2032的执行没有先后顺序,可以先执行S2031,再执行S2032,也可以先执行S2032,再执行S2031,还可以同时执行S2031和S2032,本公开对此不做限定。
S2033、基于第一区域对应的颜色通道维度的协方差矩阵和第三区域对应的颜色通道维度的协方差矩阵,确定第一区域的变换矩阵。
S2034、基于第二区域对应的颜色通道维度的协方差矩阵和第四区域对应的颜色通道维度的协方差矩阵,确定第二区域的变换矩阵。
由图2所示实施例可知,通过颜色的映射函数T和原始图像的颜色u,可以得到目标 图像的颜色v,即v=T(u),在此需要确定映射函数T,则便可以得到目标图像的颜色v。由于一个线性函数足以拟合颜色映射情况,而且对于线性函数的求解也会相对简单,计算复杂度较低,映射函数T可以为一个线性函数,即目标图像的颜色v可以表示为v=a*u+b,其中,a和b为参数,原始图像的颜色u可以通过线性变换T转换为目标图像的颜色v。根据线性变换的数学理论,如果两个变量之间存在一个线性变换,则线性变换有适用于两个变量的协方差矩阵,由于目标图像的颜色风格与参考图像的颜色风格类似,则原始图像的协方差矩阵经过线性变换T后等于参考图像的协方差矩阵,通过原始图像的协方差矩阵和参考图像的协方差矩阵可以得到映射函数。
因此,对于上述获得的每个原始区域和其对应的参考区域,可以得到一个变换矩阵。也就是针对每个原始区域的颜色通道维度的协方差矩阵以及原始区域对应的参考区域的颜色通道维度的协方差矩阵,可以得到原始区域的变换矩阵。可以理解,由于第一区域与第三区域对应,第二区域与第四区域对应,则基于第一区域对应的颜色通道维度的协方差矩阵和第三区域对应的颜色通道维度的协方差矩阵,确定第一区域的变换矩阵。基于第二区域对应的颜色通道维度的协方差矩阵和第四区域对应的颜色通道维度的协方差矩阵,确定第二区域的变换矩阵。
以YUV颜色空间为例,对于原始图像和参考图像的对应区域的变换矩阵,为颜色通道维度(也就是U通道和V通道维度)的变换矩阵,针对每个原始区域及其对应的参考区域,分别计算他们之间U通道和V通道的变换矩阵,即得到颜色的映射函数。
示例性的,可以使用蒙格·康托罗维奇(Monge-Kantorovitch)作为求解的方法,原始区域的协方差矩阵为∑_u,与原始区域对应的参考区域的协方差矩阵为∑_v,变换矩阵T可以通过如下公式(1)得到:
Figure PCTCN2022086283-appb-000001
其中,u为原始区域的协方差矩阵,v为参考区域的协方差矩阵。
本实施例,通过根据多个原始区域中像素点的颜色值,计算多个原始区域分别对应的颜色通道维度的协方差矩阵,根据多个参考区域中像素点的颜色值,计算多个参考区域分别对应的颜色通道维度的协方差矩阵,基于第一区域对应的颜色通道维度的协方差矩阵和第三区域对应的颜色通道维度的协方差矩阵,确定第一区域的变换矩阵,基于第二区域对应的颜色通道维度的协方差矩阵和第四区域对应的颜色通道维度的协方差矩阵,确定第二区域的变换矩阵,即针对每个原始区域与其对应的参考区域分别对应的协方差矩阵,得到变换矩阵,由于协方差矩阵能够体现颜色通道间的关联性,因此,使得根据协方差矩阵最终得到的目标图像的各个颜色通道间的过渡更加自然,目标图像的色调与参考图像接近, 从而实现滤镜迁移。
在上述实施例的基础上,进一步地,步骤S204的一种可能的实现方式中可以针对每个原始区域单独进行处理,根据该原始区域的变换矩阵,对原始区域中像素点进行处理,得到原始区域对应的修正区域,再将各原始区域对应的修正区域进行拼接,从而得到目标图像,请参见图5,图5为本公开实施例提供的另一种图像处理方法的流程示意图,S2041-S2043为S204的一种具体的实现方式,下面进行具体的说明。
S2041、根据第一区域的变换矩阵,对原始区域中像素点的颜色值进行处理,得到第一区域对应的第一修正区域。
S2042、根据第二区域的变换矩阵,对第二区域中像素点的颜色值进行处理,得到第二区域对应的第二修正区域。
对于每个原始区域进行单独处理,根据原始区域对应的变换矩阵,对该原始区域中像素点的颜色值进行处理,得到该原始区域对应的修正区域,从而得到了各原始区域对应的修正区域。
进一步地,对于每个原始区域,根据原始区域的颜色均值,与该原始区域对应的参考区域的颜色均值,对原始区域中像素点的颜色值进行处理,得到该原始区域对应的修正区域。其中,原始区域对应的修正区域为原始区域中每个像素点对应的目标颜色值。以YUV颜色空间为例,原始区域的修正区域为原始区域中每个像素点对应的U通道的目标值和V通道的目标值。
一种可能的实现方式中,针对每个原始区域,可以通过如下步骤1-3得到原始区域对应的修正区域:
步骤1、将原始区域中的各像素点的颜色值减去原始区域的颜色均值,得到去零结果。
步骤2、基于原始区域的变换矩阵对去零结果进行处理,得到变换结果。
步骤3、针对变换结果加上参考区域的颜色均值,得到原始区域对应的修正区域。
另一种可能的实现方式中,上述步骤1-3可以看做是对颜色维度的向量按顺序进行平移、旋转缩放和平移的操作,因此,可以根据原始区域的变换矩阵,原始区域的颜色均值和参考区域的颜色均值,得到总变换矩阵。基于总变换矩阵,对原始区域中像素点的颜色值进行处理,得到原始区域对应的修正区域。
S2043、对第一修正区域和第二修正区域进行拼接,得到目标图像。
对所有的原始区域对应的修正区域进行拼接,得到目标图像的颜色结果。将目标图像的颜色结果和原始图像的亮度值融合,得到目标图像。
将所有的原始区域对应的修正区域,按照其包含的像素点在原始图像的位置进行拼接, 得到目标图像的颜色结果。其中,目标图像的颜色结果为目标图像的每个像素点对应的目标颜色值,以YUV颜色空间为例,目标图像的颜色结果为目标图像中每个像素点对应的U通道的目标值和V通道的目标值。
由于滤镜迁移为对颜色进行转换,因此,在之前的步骤中并未对原始图像的像素点的亮度值进行改变,从而,得到目标图像的颜色结果之后,将目标图像的颜色结果和原始图像的像素点的亮度值融合,得到完整的目标图像。
本实施例,通过对每个原始区域中像素点的颜色值进行单独处理,得到原始区域的修正区域,再将各原始区域的修正区域进行拼接,从而得到目标图像,每个原始区域的变换矩阵对该原始区域进行处理,从而使得每个原始区域得到的修正区域更加准确,进而使得目标图像更接近参考图像,滤镜迁移效果更好。
在上述实施例的基础上,进一步地,步骤S204的另一种可能的实现方式中,可以根据原始区域的变换矩阵、颜色均值,与该原始区域对应的参考区域的颜色均值,对原始图像的所有像素点进行处理,得到变换矩阵对应的颜色变换结果,计算所有的颜色变换结果的均值,从而得到目标图像,请参见图6,图6为本公开实施例提供的另一种图像处理方法的流程示意图,S204a-S204c为S204的一种具体的实现方式:
S204a、根据第一区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第一区域的变换矩阵对应的第一修正图像。
S204b、根据第二区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第二区域的变换矩阵对应的第二修正图像。
对于每个原始区域的变换矩阵,可以根据原始区域的变换矩阵,对原始图像中的各像素点的颜色值进行处理,得到变换矩阵对应的修正图像。由此,得到了各变换矩阵对应的修正图像。
进一步地,对于每个原始区域,根据原始区域的的颜色均值,与该原始区域对应的参考区域的颜色均值,对原始图像中的各像素点的颜色值进行处理。由此可以得到与原始区域数量相等的修正图像。其中,变换矩阵对应的修正图像为原始图像中每个像素点对应的匹配颜色值。原始图像中的每个像素点可以得到至少两个匹配颜色值,匹配颜色值的数量与原始区域的数量相等。以YUV颜色空间为例,原始区域的变换矩阵对应的修正图像为原始图像中每个像素点对应的U通道的匹配颜色值和V通道的匹配颜色值。
一种可能的实现方式中,针对每个原始区域的变换矩阵,可以通过如下步骤a-c得到变换矩阵对应的修正图像:
步骤a、将原始图像的像素点的颜色值减去原始区域的颜色均值,得到去零结果。
步骤b、基于原始区域的变换矩阵对去零结果进行处理,得到变换结果。
步骤c、变换结果加上参考区域的颜色均值,得到变换矩阵对应的修正图像。
另一种可能的实现方式中,上述步骤a-c可以看做是对颜色维度的向量按顺序进行平移、旋转缩放和平移的操作,因此,可以根据各原始区域的变换矩阵,各原始区域的颜色均值和各与原始区域对应的参考区域的颜色均值,分别得到各变换矩阵对应的总变换矩阵。基于各变换矩阵对应的总变换矩阵,对原始图像进行处理,得到变换矩阵对应的修正图像。
S204c、融合第一修正图像和第二修正图像,得到目标图像。
将原始图像中的每个像素点在各修正图像中的颜色值进行融合处理,得到每个像素点的目标值,即为目标图像的值。
进一步地,可以计算所有的原始区域的变换矩阵对应的修正图像的均值,得到目标图像。示例性的,可以分别计算每个像素点在所有的修正图像中的颜色值的均值,得到目标图像的颜色结果。该均值即为目标图像中该像素点的目标颜色值。由此可以得到目标图像的所有像素点分别对应的目标颜色值,即得到了目标图像的颜色结果。
由于滤镜迁移为对颜色进行转换,因此,在之前的步骤中并未对原始图像的像素点的亮度值进行改变,从而,将目标图像的颜色结果和原始图像的像素点的亮度值融合,得到目标图像。
本实施例,通过根据第一区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第一区域的变换矩阵对应的第一修正图像,根据第二区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第二区域的变换矩阵对应的第二修正图像,也即根据各原始区域的变换矩阵,分别对原始图像的所有像素点进行处理,得到多个原始图像的修正图像,再融合所有的修正图像,得到目标图像,使得得到的目标图像不同亮度的像素点之间的过度更加自然,从而使得目标图像更加自然。
在上述实施例的基础上,进一步地,若需要根据参考视频或者参考图像的色调风格对原始视频进行滤镜迁移操作,则将原始视频中包含的每一帧图像作为一个原始图像,与参考图像进行上述图像处理方法,得到目标图像,按照原始图像在视频中的位置,将目标图像组成目标视频的画面。
在一些实施例中,如果原始视频为同一个场景,即原始视频的每一帧原始图像之间的场景不变,原始图像的第一帧原始图像通过上述实施例的方法可以得到目标图像,从原始图像的第二帧原始图像开始,无需进行S201-S203步骤,即无需计算该帧原始图像的每个原始区域分别对应的变换矩阵,在S204步骤中直接根据原始视频的第一帧图像和参考图像得到的每个原始区域的变换矩阵。
对视频进行滤镜迁移时,在电子设备中使用GPU进行处理,对于720P的视频能实现每帧耗时2ms以内,从而大大提高了视频的滤镜迁移效率。
图7为本公开实施例提供的一种图像处理装置的结构示意图,如图7所示,本实施例提供的装置包括:
区域划分模块701,用于将原始图像划分为多个原始区域;多个原始区域至少包括第一区域和第二区域,第一区域中像素点的亮度值大于第二区域中像素点的亮度值;将参考图像划分为多个参考区域;参考区域至少包括第三区域和第四区域,其中,第三区域中像素点的亮度值大于第四区域中像素点的亮度值;
变换矩阵生成模块702,用于根据第一区域中像素点的颜色值和第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据第二区域中像素点的颜色值和第四区域中像素点的颜色值,得到第二区域的变换矩阵;
处理模块703,用于根据第一区域的变换矩阵和第二区域的变化矩阵,对原始图像进行颜色映射,得到目标图像。
在一些实施例中,变换矩阵生成模块702具体用于:
根据多个原始区域中像素点的颜色值,计算多个原始区域分别对应的颜色通道维度的协方差矩阵;根据多个参考区域中像素点的颜色值,计算多个参考区域分别对应的颜色通道维度的协方差矩阵;基于第一区域对应的颜色通道维度的协方差矩阵和第三区域对应的颜色通道维度的协方差矩阵,确定第一区域的变换矩阵;基于第二区域对应的颜色通道维度的协方差矩阵和第四区域对应的颜色通道维度的协方差矩阵,确定第二区域的变换矩阵。
在一些实施例中,处理模块703具体用于:
根据第一区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第一区域的变换矩阵对应的第一修正图像;根据第二区域的变换矩阵,对原始图像中像素点的颜色值进行处理,得到第二区域的变换矩阵对应的第二修正图像;融合第一修正图像和第二修正图像,得到目标图像。
在一些实施例中,处理模块703具体用于:
根据第一区域的变换矩阵,对第一区域中像素点的颜色值进行处理,得到第一区域对应的第一修正区域;根据第二区域的变换矩阵,对第二区域中像素点的颜色值进行处理,得到第二区域对应的第二修正区域;对第一修正区域和第二修正区域进行拼接,得到目标图像。
在一些实施例中,区域划分模块701具体用于:
将原始图像中像素点按照亮度值从低到高排列,确定至少一个第一分界值;基于至少 一个第一分界值将原始图像中像素点分为多个原始区域;将参考图像中像素点按照亮度值从低到高排列,确定至少一个第二分界值;基于至少一个第二分界值将参考图像中像素点分为多个参考区域。
在一些实施例中,多个原始区域还包括第五区域,第五区域中像素点的亮度值大于第一区域中像素点的亮度值,或者,第五区域中像素点的亮度值小于第二区域中像素点的亮度值;
参考区域还包括第六区域,其中,第六区域中像素点的亮度值大于第三区域中像素点的亮度值,或者,第六区域中像素点的亮度值小于第四区域中像素点的亮度值;
变换矩阵生成模块702还用于:
根据第五区域中像素点的颜色值和第六区域中像素点的颜色值,得到第五区域的变换矩阵;
处理模块703具体用于:
根据第一区域的变换矩阵、第二区域的变化矩阵和第五区域的变换矩阵,对原始图像进行颜色映射,得到目标图像。
上述实施例的装置,可以用于执行上述方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。
本公开实施例提供一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序;其中,一个或多个计算机程序被存储在存储器中;一个或多个处理器在执行一个或多个计算机程序时,使得电子设备实现如上述图2-图6任一所示实施例的图像处理方法。
本公开实施例提供一种计算机存储介质,包括计算机指令,当计算机指令在电子设备上运行时,使得电子设备执行如上述图2-图6任一所示实施例的图像处理方法。
本公开实施例提供一种计算机程序产品,当计算机程序产品在计算机上运行时,使得计算机执行如上述图2-图6任一所示实施例的图像处理方法。
需要说明的是,在本文中,诸如“第一”和“第二”等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上仅是本公开的具体实施方式,使本领域技术人员能够理解或实现本公开。对这些实施例的多种修改对本领域的技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本公开的精神或范围的情况下,在其它实施例中实现。因此,本公开将不会被限制于本文的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims (10)

  1. 一种图像处理方法,包括:
    将原始图像划分为多个原始区域;所述多个原始区域至少包括第一区域和第二区域,所述第一区域中像素点的亮度值大于所述第二区域中像素点的亮度值;
    将参考图像划分为多个参考区域;所述参考区域至少包括第三区域和第四区域,其中,所述第三区域中像素点的亮度值大于所述第四区域中像素点的亮度值;
    根据所述第一区域中像素点的颜色值和所述第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据所述第二区域中像素点的颜色值和所述第四区域中像素点的颜色值,得到第二区域的变换矩阵;以及
    根据所述第一区域的变换矩阵和所述第二区域的变化矩阵,对所述原始图像进行颜色映射,得到目标图像。
  2. 根据权利要求1所述的方法,根据所述第一区域中像素点的颜色值和所述第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据所述第二区域中像素点的颜色值和所述第四区域中像素点的颜色值,得到第二区域的变换矩阵,包括:
    根据所述多个原始区域中像素点的颜色值,计算所述多个原始区域分别对应的颜色通道维度的协方差矩阵;
    根据所述多个参考区域中像素点的颜色值,计算所述多个参考区域分别对应的颜色通道维度的协方差矩阵;
    基于所述第一区域对应的颜色通道维度的协方差矩阵和所述第三区域对应的颜色通道维度的协方差矩阵,确定所述第一区域的变换矩阵;以及
    基于所述第二区域对应的颜色通道维度的协方差矩阵和所述第四区域对应的颜色通道维度的协方差矩阵,确定所述第二区域的变换矩阵。
  3. 根据权利要求1所述的方法,根据所述第一区域的变换矩阵和所述第二区域的变化矩阵,对所述原始图像进行颜色映射,得到目标图像,包括:
    根据所述第一区域的变换矩阵,对所述原始图像中像素点的颜色值进行处理,得到第一区域的变换矩阵对应的第一修正图像;
    根据所述第二区域的变换矩阵,对所述原始图像中像素点的颜色值进行处理,得到第 二区域的变换矩阵对应的第二修正图像;以及
    融合所述第一修正图像和所述第二修正图像,得到所述目标图像。
  4. 根据权利要求1所述的方法,根据所述第一区域的变换矩阵和所述第二区域的变化矩阵,对所述原始图像进行颜色映射,得到目标图像,包括:
    根据所述第一区域的变换矩阵,对所述第一区域中像素点的颜色值进行处理,得到所述第一区域对应的第一修正区域;
    根据所述第二区域的变换矩阵,对所述第二区域中像素点的颜色值进行处理,得到所述第二区域对应的第二修正区域;以及
    对所述第一修正区域和第二修正区域进行拼接,得到所述目标图像。
  5. 根据权利要求1-4任一项所述的方法,将原始图像划分为多个原始区域,包括:
    将原始图像中像素点按照亮度值从低到高排列,确定至少一个第一分界值;
    基于所述至少一个第一分界值将所述原始图像中像素点分为多个原始区域;
    将参考图像划分为多个参考区域,包括:
    将参考图像中像素点按照亮度值从低到高排列,确定至少一个第二分界值;
    基于所述至少一个第二分界值将所述参考图像中像素点分为多个参考区域。
  6. 根据权利要求1-4任一项所述的方法,所述多个原始区域还包括第五区域,所述第五区域中像素点的亮度值大于所述第一区域中像素点的亮度值,或者,所述第五区域中像素点的亮度值小于所述第二区域中像素点的亮度值;
    所述参考区域还包括第六区域,其中,所述第六区域中像素点的亮度值大于所述第三区域中像素点的亮度值,或者,所述第六区域中像素点的亮度值小于所述第四区域中像素点的亮度值;
    所述方法还包括:
    根据所述第五区域中像素点的颜色值和所述第六区域中像素点的颜色值,得到第五区域的变换矩阵;
    所述根据所述第一区域的变换矩阵和所述第二区域的变化矩阵,对所述原始图像进行颜色映射,得到目标图像,包括:
    根据所述第一区域的变换矩阵、所述第二区域的变化矩阵和第五区域的变换矩阵,对所述原始图像进行颜色映射,得到目标图像。
  7. 一种图像处理装置,包括:
    区域划分模块,用于将原始图像划分为多个原始区域;所述多个原始区域至少包括第一区域和第二区域,所述第一区域中像素点的亮度值大于所述第二区域中像素点的亮度值;将参考图像划分为多个参考区域;所述参考区域至少包括第三区域和第四区域,其中,所述第三区域中像素点的亮度值大于所述第四区域中像素点的亮度值;
    变换矩阵生成模块,用于根据所述第一区域中像素点的颜色值和所述第三区域中像素点的颜色值,得到第一区域的变换矩阵,并根据所述第二区域中像素点的颜色值和所述第四区域中像素点的颜色值,得到第二区域的变换矩阵;以及
    处理模块,用于根据所述第一区域的变换矩阵和所述第二区域的变化矩阵,对所述原始图像进行颜色映射,得到目标图像。
  8. 一种电子设备,包括:一个或多个处理器;存储器;以及一个或多个计算机程序;其中,所述一个或多个计算机程序被存储在所述存储器中;其特征在于,所述一个或多个处理器在执行所述一个或多个计算机程序时,使得所述电子设备实现如权利要求1-6任一项所述的图像处理方法。
  9. 一种计算机存储介质,包括计算机指令,当所述计算机指令在电子设备上运行时,使得所述电子设备执行如权利要求1-6任一项所述的图像处理方法。
  10. 一种计算机程序产品,当所述计算机程序产品在计算机上运行时,使得所述计算机执行如权利要求1-6任一项所述的图像处理方法。
PCT/CN2022/086283 2021-04-12 2022-04-12 图像处理方法及装置 Ceased WO2022218293A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US18/551,725 US20240169487A1 (en) 2021-04-12 2022-04-12 Image processing method and device

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202110389102.7A CN115205167B (zh) 2021-04-12 2021-04-12 图像处理方法及装置
CN202110389102.7 2021-04-12

Publications (1)

Publication Number Publication Date
WO2022218293A1 true WO2022218293A1 (zh) 2022-10-20

Family

ID=83570609

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2022/086283 Ceased WO2022218293A1 (zh) 2021-04-12 2022-04-12 图像处理方法及装置

Country Status (3)

Country Link
US (1) US20240169487A1 (zh)
CN (1) CN115205167B (zh)
WO (1) WO2022218293A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117036375A (zh) * 2023-08-23 2023-11-10 中国电信股份有限公司技术创新中心 图像处理方法、装置和非易失性计算机可读存储介质
US12573195B2 (en) * 2023-09-12 2026-03-10 Samsung Electronics Co., Ltd. Method for evaluating performance of image signal processor
CN117292158A (zh) * 2023-10-27 2023-12-26 北京字跳网络技术有限公司 一种图像处理方法、装置、电子设备及存储介质

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070211272A1 (en) * 2006-03-07 2007-09-13 Samsung Electronics Co., Ltd. Apparatus and method for image-adaptive color reproduction
CN105761202A (zh) * 2016-02-03 2016-07-13 武汉大学 一种彩色图像颜色迁移方法

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5235759B2 (ja) * 2009-04-07 2013-07-10 キヤノン株式会社 画像処理装置、画像処理方法、及びプログラム
US8611655B2 (en) * 2011-02-04 2013-12-17 Apple Inc. Hue-based color matching
US8854370B2 (en) * 2011-02-16 2014-10-07 Apple Inc. Color waveform
US8958640B1 (en) * 2013-07-01 2015-02-17 Google Inc. Image color cast correction using groups of pixels
US9454807B2 (en) * 2014-03-25 2016-09-27 Spreadtrum Communications (Shanghai) Co., Ltd. Methods and systems for denoising images
CN106991645B (zh) * 2017-03-22 2018-09-28 腾讯科技(深圳)有限公司 图像拼接方法及装置
US10571336B2 (en) * 2017-08-12 2020-02-25 My Nudest, Inc. System and method for color matching
CN110609722B (zh) * 2019-08-09 2021-07-20 华为技术有限公司 一种暗模式显示界面处理方法、电子设备与存储介质
CN111737712B (zh) * 2020-06-17 2023-06-13 北京石油化工学院 一种基于三维动态整数帐篷映射的彩色图像加密方法
CN111768335B (zh) * 2020-07-02 2023-08-04 北京工商大学 一种基于cnn的用户交互式图像局部服饰风格迁移方法
CN112580501A (zh) * 2020-12-17 2021-03-30 上海眼控科技股份有限公司 车架号图像生成方法、装置、计算机设备和存储介质

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20070211272A1 (en) * 2006-03-07 2007-09-13 Samsung Electronics Co., Ltd. Apparatus and method for image-adaptive color reproduction
CN105761202A (zh) * 2016-02-03 2016-07-13 武汉大学 一种彩色图像颜色迁移方法

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
GUO-FEI HU, FU JIAN, PENG QUN-SHENG: "Adaptive Color Transfer", CHINESE JOURNAL OF COMPUTERS, vol. 27, no. 9, 1 September 2004 (2004-09-01), pages 1245 - 1249, XP055795350 *
郑宁斐 等 (ZHENG, NINGFEI ET AL.): "颜色迁移算法的研究 (Research on Color Transfer)", 电视技术 (VIDEO ENGINEERING), no. 11, 30 November 2006 (2006-11-30), ISSN: 1002-8692 *

Also Published As

Publication number Publication date
CN115205167A (zh) 2022-10-18
CN115205167B (zh) 2024-11-08
US20240169487A1 (en) 2024-05-23

Similar Documents

Publication Publication Date Title
US8311355B2 (en) Skin tone aware color boost for cameras
WO2022218293A1 (zh) 图像处理方法及装置
WO2023010754A1 (zh) 一种图像处理方法、装置、终端设备及存储介质
WO2022227308A1 (zh) 图像处理方法、装置、设备以及介质
CN109274985B (zh) 视频转码方法、装置、计算机设备和存储介质
EP2426928A2 (en) Image processing apparatus, image processing method and program
WO2019170007A1 (zh) 图像色彩调整方法及装置
CN111311513B (zh) 图像的颜色风格统一方法、设备及计算机存储介质
EP3779861B1 (en) Color correction method for panoramic image and electronic device
Wang et al. Measuring perceptual color differences of smartphone photographs
CN110930341A (zh) 一种基于图像融合的低光照图像增强方法
CN113781321B (zh) 图像高亮区域的信息补偿方法、装置、设备及存储介质
CN110706162A (zh) 一种图像处理方法、装置及计算机存储介质
WO2020093653A1 (zh) 色彩调整方法、色彩调整装置、电子设备及计算机可读存储介质
Le et al. GamutNet: Restoring wide-gamut colors for camera-captured images
WO2021179142A1 (zh) 一种图像处理方法及相关装置
CN111047653A (zh) 一种主色调确定方法、装置、设备及可读介质
CN113556525B (zh) 色温调整方法、装置、计算机设备和存储介质
WO2020037635A1 (zh) 色彩校正方法及装置
CN114999363B (zh) 色偏校正方法、装置、设备、存储介质及程序产品
CN113658280B (zh) 基于人工智能的数据增广方法、装置、设备和存储介质
TWI523500B (zh) 影像的動態範圍壓縮方法與影像處理裝置
CN118101854A (zh) 图像处理方法、装置、电子设备和计算机可读存储介质
CN114463221B (zh) 一种用于多设备域awb增强的自监督颜色校正方法
CN112465721B (zh) 图像校正方法及装置、移动终端及存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 22787517

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 18551725

Country of ref document: US

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 22787517

Country of ref document: EP

Kind code of ref document: A1