WO2022042754A1 - 图像处理方法、装置及设备 - Google Patents

图像处理方法、装置及设备 Download PDF

Info

Publication number
WO2022042754A1
WO2022042754A1 PCT/CN2021/115837 CN2021115837W WO2022042754A1 WO 2022042754 A1 WO2022042754 A1 WO 2022042754A1 CN 2021115837 W CN2021115837 W CN 2021115837W WO 2022042754 A1 WO2022042754 A1 WO 2022042754A1
Authority
WO
WIPO (PCT)
Prior art keywords
area
hue
preset
color
image
Prior art date
Application number
PCT/CN2021/115837
Other languages
English (en)
French (fr)
Inventor
王紫嫣
Original Assignee
维沃移动通信有限公司
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 维沃移动通信有限公司 filed Critical 维沃移动通信有限公司
Publication of WO2022042754A1 publication Critical patent/WO2022042754A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T5/00Image enhancement or restoration
    • G06T5/50Image enhancement or restoration by the use of more than one image, e.g. averaging, subtraction
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T7/00Image analysis
    • G06T7/90Determination of colour characteristics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T2207/00Indexing scheme for image analysis or image enhancement
    • G06T2207/10Image acquisition modality
    • G06T2207/10024Color image

Definitions

  • the present application belongs to the technical field of image processing, and in particular relates to an image processing method, device and device.
  • Image processing is the technique of processing images with electronic equipment to achieve desired results.
  • Image processing includes but is not limited to: image compression, brightness adjustment, contrast adjustment, background blur, color gradient processing, filter processing and color migration processing, etc.
  • Color migration refers to synthesizing a new image C based on image A and image B.
  • Image C has shape information of image A and color information of image B.
  • the color migration process in the related art is to first convert the image A and image B in the RGB space to the Lab space, use the mean and standard deviation of the images to perform color migration, and obtain the image C in the Lab space, and then convert the image C to the Lab space.
  • image D is obtained.
  • the image D at this time has shape information of the image A and color information of the image B.
  • the purpose of the embodiments of the present application is to provide an image processing method, device and device, which can solve the problems of slow color migration and low efficiency.
  • an embodiment of the present application provides an image processing method, including:
  • hue information determine the first area in the reference image corresponding to the target area in the original image
  • the target area is processed by using the color of the first area to obtain a target image corresponding to the original image.
  • an image processing apparatus including:
  • the acquisition module is used to acquire the original image and the reference image
  • a determining module configured to determine, according to the hue information, a first area in the reference image corresponding to the target area in the original image
  • the processing module is used to process the target area by using the color of the first area to obtain the target image corresponding to the original image.
  • embodiments of the present application provide an electronic device, the electronic device includes a processor, a memory, and a program or instruction stored on the memory and executable on the processor, the program or instruction being The processor implements the steps of the method according to the first aspect when executed.
  • an embodiment of the present application provides a readable storage medium, where a program or an instruction is stored on the readable storage medium, and when the program or instruction is executed by a processor, the steps of the method according to the first aspect are implemented .
  • an embodiment of the present application provides a chip, the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction, and implement the first aspect the steps of the method.
  • the first area in the reference image corresponding to the target area in the original image can be determined according to the hue information, and then the color of the first area can be used to compare the target area.
  • the target image corresponding to the original image is obtained.
  • the color of the first area in the reference image corresponding to the target area of the original image can be used to directly perform color processing on the target area, so that color migration in different images can be realized in the RGB space of the image. , without performing spatial transformation and calculating the mean and standard deviation of images, etc. Therefore, compared with the related art, the embodiments of the present application improve the color transfer speed and efficiency between different images.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • FIG. 2 is a first schematic diagram of dividing an original image and a reference image provided by an embodiment of the present application
  • Fig. 3 is the first schematic diagram of the sorting order provided by the embodiment of the present application.
  • FIG. 4 is a first schematic diagram of a target image provided by an embodiment of the present application.
  • FIG. 5 is a second schematic diagram of dividing an original image and a reference image provided by an embodiment of the present application.
  • FIG. 6 is a second schematic diagram of a sorting order provided by an embodiment of the present application.
  • FIG. 7 is a second schematic diagram of a target image provided by an embodiment of the present application.
  • FIG. 8 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application.
  • FIG. 9 is a schematic structural diagram of an electronic device provided by an embodiment of the present application.
  • FIG. 10 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • first, second and the like in the description and claims of the present application are used to distinguish similar objects, and are not used to describe a specific order or sequence. It is to be understood that the data so used are interchangeable under appropriate circumstances so that the embodiments of the present application can be practiced in sequences other than those illustrated or described herein, and distinguish between “first”, “second”, etc.
  • the objects are usually of one type, and the number of objects is not limited.
  • the first object may be one or more than one.
  • “and/or” in the description and claims indicates at least one of the connected objects, and the character “/" generally indicates that the associated objects are in an "or” relationship.
  • FIG. 1 is a schematic flowchart of an image processing method provided by an embodiment of the present application.
  • Image processing methods can include:
  • S101 Acquire an original image and a reference image.
  • S102 Determine, according to the hue information, a first area in the reference image that corresponds to the target area in the original image.
  • S103 Process the target area by using the color of the first area to obtain a target image corresponding to the original image.
  • the first area in the reference image corresponding to the target area in the original image can be determined according to the hue information, and then the color of the first area can be used to compare the target area.
  • the target image corresponding to the original image is obtained.
  • the color of the first area in the reference image corresponding to the target area of the original image can be used to directly perform color processing on the target area, so that color migration in different images can be realized in the RGB space of the image. , without performing spatial transformation and calculating the mean and standard deviation of images, etc. Therefore, compared with the related art, the embodiments of the present application improve the color transfer speed and efficiency between different images.
  • S102 may include: according to the first preset area division manner, respectively dividing the original image and the reference image to obtain a plurality of second areas corresponding to the original image and the reference image. a plurality of third regions; generate a first hue sequence corresponding to the original image according to the hue information of the plurality of second regions, and generate a second hue sequence corresponding to the reference image according to the hue information of the plurality of third regions; The sequence of hues and the sequence of second hues determine the first area in the reference image that corresponds to the target area in the original image.
  • the first preset area division manner may be set according to actual needs.
  • the first preset area division mode is an average 4*5 area division mode as an example for description.
  • the average 4*5 area division method is 4 equal divisions in the horizontal direction and 5 equal divisions in the vertical direction.
  • both the original image 100 and the reference image 200 include a total of 400 pixels in 25 rows and 16 columns.
  • FIG. 2 is a schematic diagram of dividing an original image and a reference image according to an embodiment of the present application.
  • the 20 second areas are from left to right, and from top to bottom are the first second area 201, the second second area 202, ..., the 20th second area 220.
  • the 20 third areas are from the left To the right, from top to bottom are the first third area 301 , the second third area 302 , . . . , and the twentieth third area 320 .
  • each second area and each third area include a total of 20 pixels in 5 rows and 4 columns.
  • the average RGB colors of the 20 pixels included in the first second area 201 to the 20th second area 220 are (34, 253, 5), (46, 65, 76), (155, 46, 76) respectively. ), (56,46,54), (46,54,32), (78,65,234), (36,65,49), (136,165,149), (136,87,58), (136,23,65 ), (136,23,65), (136,34,87), (165,57,89), (189,200,43), (200,123,83), (246,234,231), (243,157,138), (254,158,156), (140, 140, 240) and (243, 157, 138).
  • the average RGB colors of the 20 pixels included in the first third area 301 to the 20th third area 320 are (65, 34, 57), (146, 165, 176), (155, 146, 176), (156, 146, 154), (146, 154, 132) respectively. ), (178,165,34), (136,165,149), (36,165,149), (136,8,58), (16,23,65), (13,123,65), (136,134,87), (65,157,89), (189,200,143), (200,123,183), (246,34,21), (143,57,38), (54,58,56), (140,240,140) and (143,57,38).
  • the hue values corresponding to the first second area 201 to the twentieth second area 220 are: 113°, 202°, 343°, 312°, 82°, 245°, 147°, 147°, 22°, 338°, 338°, 329°, 342°, 64°, 21°, 12°, 11°, 1°, 240° and 11°.
  • the hue values corresponding to the first third area 301 to the 20th third area 320 are: 315°, 202°, 258°, 312°, 82°, 55°, 147°, 173°, 337°, 231 °, 148°, 58°, 136°, 72°, 313°, 3°, 11°, 150°, 120° and 11°.
  • the first hue sequence in the reference image 200 corresponding to the target area in the original image 100 is determined according to the first hue sequence and the second hue sequence an area.
  • determining the first area in the reference image that corresponds to the target area in the original image according to the first hue sequence and the second hue sequence may include: according to a preset segmentation method, respectively The first hue sequence and the second hue sequence are divided to obtain a plurality of first hue subsequences corresponding to the first hue sequence and a plurality of second hue subsequences corresponding to the second hue sequence; The corresponding second regions and the third regions corresponding to the plurality of second hue sub-sequences are sorted according to the order of the first preset area size, to obtain the sorting rank and the plurality of the second regions corresponding to the plurality of first hue sub-sequences. The sorting order of the third region corresponding to the two-hue sub-sequence; the region in the reference image with the same sorting order corresponding to the target region is determined as the first region.
  • the embodiment of the present application does not limit the preset division manner, and any available division manner may be applied to the embodiment of the present application.
  • the preset segmentation method is to divide the hue sequence into 3 hue sub-sequences equally.
  • each hue subsequence includes the same number of hue values.
  • the number of hue values included in the last hue subsequence is the sum of the quotient and remainder of the number of hue values included in the hue sequence and 3;
  • the number of hue values included in other hue subsequences is the quotient of the number of hue values included in the hue sequence and 3.
  • the above-mentioned first hue sequence is divided into 3 first hue subsequences, wherein the first first hue subsequence includes 5 hue values: 1°, 11°, 12°, 21° and 22°.
  • the second first hue subsequence includes 5 hue values: 64°, 82°, 113°, 147°, and 202°.
  • the third first hue subsequence includes 7 hue values: 240°, 245°, 312°, 329°, 338°, 342°, and 343°.
  • the above-mentioned second hue sequence is divided into three first hue subsequences, wherein the first second hue subsequence includes six hue values: 3°, 11°, 55°, 58°, 72°, and 82° .
  • the second second hue subsequence includes 6 hue values: 120°, 136°, 147°, 148°, 150°, and 173°.
  • the third second hue subsequence includes 7 hue values: 202°, 231°, 258°, 312°, 313°, 315°, and 337°.
  • the second regions corresponding to the first first hue subsequence include: the ninth second region 209, the fifteenth second region 215, the sixteenth second region 216, the seventeenth second region 217, the 18th second region The second area 218 and the twentieth second area 220 .
  • the area of the second regions corresponding to the first first hue subsequence is 6 second regions.
  • the second area corresponding to the second first hue sub-sequence includes: the first second area 201, the second second area 202, the fifth second area 205, the seventh second area 207, the eighth second area The second area 208 and the fourteenth second area 214 .
  • the area of the second regions corresponding to the second first hue subsequence is 6 second regions.
  • the second area corresponding to the third first hue sub-sequence includes: the third second area 203, the fourth second area 204, the sixth second area 206, the tenth second area 210, the eleventh second area The second area 211 , the twelfth second area 212 , the thirteenth second area 213 , and the nineteenth second area 219 .
  • the area of the second regions corresponding to the third first hue subsequence is eight second regions.
  • the third area corresponding to the first second hue subsequence includes: the fifth third area 305, the sixth third area 306, the twelfth third area 312, the fourteenth third area 314, the 16th third area The third area 316 , the 17th third area 317 and the 20th third area 320 .
  • the area of the third region corresponding to the first second hue subsequence is seven third regions.
  • the third regions corresponding to the second second hue sub-sequence include: the seventh third region 307, the eighth third region 308, the eleventh third region 311, the thirteenth third region 313, the eighteenth third region The third area 318 and the nineteenth third area 319 .
  • the area of the third region corresponding to the second second hue subsequence is 6 third regions.
  • the third area corresponding to the third second hue subsequence includes: the first third area 301, the second third area 302, the third third area 303, the fourth third area 304, the ninth third area The third area 309 , the tenth third area 310 and the fifteenth third area 315 .
  • the area of the third regions corresponding to the third second hue subsequence is seven third regions.
  • This embodiment of the present application does not limit the order of the first preset area size, and any available area size order can be applied to the embodiment of the present application. For example, the order of areas from large to small, or the order of areas from small to large.
  • the second area corresponding to the first first hue sub-sequence, the second area corresponding to the second first hue sub-sequence, and the second area corresponding to the third first hue sub-sequence are arranged in the order of area Sorting from the smallest order, the second region corresponding to the third first hue subsequence is the first order, the second region corresponding to the first first hue subsequence is the second order, and the second region corresponding to the first first hue subsequence is the second order.
  • the second region corresponding to the two first hue subsequences is the third order.
  • the third area corresponding to the first second hue subsequence, the third area corresponding to the second second hue subsequence, and the third area corresponding to the third second hue subsequence are arranged in the order of area Sorting from the smallest order, the third region corresponding to the first second hue subsequence is the first order, the third region corresponding to the third second hue subsequence is the second order, and the third region corresponding to the third second hue subsequence is the second order.
  • the third region corresponding to the two second hue subsequences is the third order.
  • FIG. 3 is a first schematic diagram of the ranking provided by the embodiment of the present application.
  • the third area corresponding to the first second hue subsequence is determined as the first area. That is, the target area includes the third second area 203, the fourth second area 204, the sixth second area 206, the tenth second area 210, the eleventh second area 211, and the twelfth second area 212, the 13th second area 213 and the 19th second area 219, the first area includes the fifth third area 305, the sixth third area 306, the 12th third area 312, and the 14th The third area 314 , the sixteenth third area 316 , the seventeenth third area 317 , and the twentieth third area 320 .
  • the third area corresponding to the third second hue subsequence is determined as the first area. That is, the target area includes the 9th second area 209, the 15th second area 215, the 16th second area 216, the 17th second area 217, the 18th second area 218 and the 20th second area
  • the first area includes the first third area 301, the second third area 302, the third third area 303, the fourth third area 304, the ninth third area 309, the tenth third area The third area 310 and the fifteenth third area 315 .
  • the third area corresponding to the second second hue subsequence is determined as the first area. That is, the target area includes the first second area 201, the second second area 202, the fifth second area 205, the seventh second area 207, the eighth second area 208 and the 14th second area
  • the first area includes the seventh third area 307, the eighth third area 308, the eleventh third area 311, the thirteenth third area 313, the eighteenth third area 318, and the 19th third area The third area 319 .
  • the color of the first area is used to process the target area to obtain the target image 500 corresponding to the original image 100 .
  • the image processing method provided by the embodiments of the present application may further include: according to an image value of each third area in the plurality of third areas included in the first area color, the average color of the first area is calculated; the average color is determined as the color of the first area.
  • the following target areas include the third second area 203, the fourth second area 204, the sixth second area 206, the tenth second area 210, the eleventh second area 211, the 12 second areas 212 , 13th second areas 213 and 19th second areas 219 , the first area includes the 5th third area 305 , the 6th third area 306 , and the 12th third area 312 , the 14th third area 314 , the 16th third area 316 , the 17th third area 317 , and the 20th third area 320 are described as examples.
  • the average color of the first area is the 5th third area 305, the 6th third area 306, the 12th third area 312, the 14th third area 314, the 16th third area 316, the 17th third area
  • the red component R in the average color of the first region is:
  • the green component G in the average color of the first region is:
  • the blue component B in the average color of the first region is:
  • the average RGB color of the first region of the twentieth third region 320 is (169, 114, 70). This average RGB color (169, 114, 70) is determined as the color of the first region.
  • the color of the first region of the three regions 310 and the fifteenth third region 315 is (125, 92, 124).
  • the color of the first region is (74,151,108).
  • the color of the first area is used to process the target area to obtain the target image 500 corresponding to the original image 100 .
  • S103 may include calculating an average color between the original color of the target area and the color of the first area; and adjusting the color of the target area to an average color.
  • S103 may include, according to preset fusion parameters, fusing the original color of the target area with the color of the first area to obtain a fusion color; and adjusting the color of the target area to a fusion color.
  • formula (1) may be used to calculate the fusion color.
  • F(r, g, b) is the fusion color
  • Rr is the red component of the original color of the target area
  • Gr is the green component of the original color of the target area
  • Br is the blue component of the original color of the target area
  • R1 is the red component of the color of the first area
  • G1 is the green component of the color of the first area
  • B1 is the blue component of the color of the first area
  • a and b are fusion parameters.
  • the fusion parameter a and the fusion parameter b may be set according to actual needs.
  • the following target areas include the third second area 203, the fourth second area 204, the sixth second area 206, the tenth second area 210, the eleventh second area 211, the 12th second area
  • the area 212, the thirteenth second area 213, and the nineteenth second area 219, and the color of the first area is (169, 114, 70) as an example to illustrate.
  • the fusion color corresponding to the third second area 203 is:
  • the target area may include the fourth second area 204, the sixth second area 206, the tenth second area 210, the eleventh second area 211, the twelfth second area 212, the tenth second area 210, The colors of the 13 second areas 213 and the 19th second area 219 are adjusted.
  • the ninth second area 209, the fifteenth second area 215, the sixteenth second area 216, the seventeenth second area 217, the eighteenth second area 218, the 20th second area The second area 220, the first second area 201, the second second area 202, the third second area 203, the fourth second area 204, the ninth second area 209, the tenth second area 210 and the color of the 15th second area 215 to be adjusted.
  • FIG. 4 is a first schematic diagram of a target image provided by an embodiment of the present application.
  • color migration does not need to perform spatial conversion and calculate the mean and standard deviation of the image, which can improve the speed and efficiency of color migration.
  • S102 may include: according to the second preset area division method, respectively dividing the original image and the reference image to obtain a plurality of fourth areas corresponding to the original image and the reference image.
  • a plurality of fifth regions according to the hue information of the fourth region and the plurality of preset hue information divisions, determine a sixth region in the original image corresponding to each preset hue information division, and determine the sixth region according to the hue information of the fifth region and a plurality of preset hue information division intervals, determine a seventh area corresponding to each preset hue information division interval in the reference image; respectively divide the sixth area and a plurality of preset hue information corresponding to the multiple preset hue information division intervals
  • the seventh areas corresponding to the information division intervals are sorted according to the order of the second preset area size, to obtain the sorting order of the sixth areas corresponding to the plurality of preset hue information division intervals and the seventh area corresponding to the plurality of preset hue information division intervals.
  • the second preset area division manner may be set according to actual needs.
  • the second preset area division mode is an average 4*5 area division mode as an example for description.
  • the average 4*5 area division method is 4 equal divisions in the horizontal direction and 5 equal divisions in the vertical direction.
  • both the original image 100 and the reference image 200 include a total of 400 pixels in 25 rows and 16 columns.
  • FIG. 5 is a second schematic diagram of dividing an original image and a reference image according to an embodiment of the present application.
  • the 20 fourth areas are from left to right, and from top to bottom are the first fourth area 401, the second fourth area 402, ..., the 20th fourth area 420.
  • the 20 fifth areas are from the left To the right, from top to bottom are the first fifth area 501 , the second fifth area 502 , . . . , and the twentieth fifth area 520 .
  • each fourth area and each fifth area include a total of 20 pixels in 5 rows and 4 columns.
  • the average RGB colors of the 20 pixels included in the first fourth area 401 to the 20th fourth area 420 are (34, 253, 5), (46, 65, 76), (155, 46, 76) respectively. ), (56,46,54), (46,54,32), (78,65,234), (36,65,49), (136,165,149), (136,87,58), (136,23,65 ), (136,23,65), (136,34,87), (165,57,89), (189,200,43), (200,123,83), (246,234,231), (243,157,138), (254,158,156), (140, 140, 240) and (243, 157, 138).
  • the average RGB colors of the 20 pixels included in the first fifth area 501 to the 20th fifth area 520 are (65, 34, 57), (146, 165, 176), (155, 146, 176), (156, 146, 154), (146, 154, 132) respectively. ), (178,165,34), (136,165,149), (36,165,149), (136,8,58), (16,23,65), (13,123,65), (136,134,87), (65,157,89), (189,200,143), (200,123,183), (246,34,21), (143,57,38), (54,58,56), (140,240,140) and (143,57,38).
  • the hue values corresponding to the first fourth area 401 to the 20th fourth area 420 are: 113°, 202°, 343°, 312°, 82°, 245°, 147°, 147°, 22°, 338°, 338°, 329°, 342°, 64°, 21°, 12°, 11°, 1°, 240° and 11°.
  • the hue values corresponding to the first fifth area 501 to the 20th fifth area 520 are: 315°, 202°, 258°, 312°, 82°, 55°, 147°, 173°, 337°, 231 °, 148°, 58°, 136°, 72°, 313°, 3°, 11°, 150°, 120° and 11°.
  • the preset hue information division interval may be set according to actual requirements.
  • the first preset hue information division interval is [0, 120)
  • the second preset hue information division interval is [120, 240)
  • the third preset hue information division interval is [240, 360 ).
  • the sixth area corresponding to the first preset hue information division interval includes: 1 fourth area 401, 5th fourth area 405, 9th fourth area 409, 14th fourth area 414, 15th fourth area 415, 16th fourth area 416, 17th The fourth area 417 , the 18th fourth area 418 and the 20th fourth area 420 , a total of 9 fourth areas. It is determined that the sixth area corresponding to the second preset hue information division interval includes: the second fourth area 402 , the seventh fourth area 407 and the eighth fourth area 408 , and there are three fourth areas in total.
  • the sixth area corresponding to the third preset hue information division interval includes: the third fourth area 403, the fourth fourth area 404, the sixth fourth area 406, the tenth fourth area 410, The 11th fourth area 411 , the 12th fourth area 412 , the 13th fourth area 413 , and the 19th fourth area 419 , a total of 8 fourth areas.
  • the seventh area corresponding to the first preset hue information division interval includes: 5th fifth zone 505, 6th fifth zone 506, 12th fifth zone 512, 14th fifth zone 514, 16th fifth zone 516, 17th fifth zone 517 and 20th
  • the fifth area 520 has a total of 7 fifth areas.
  • the seventh area determined to correspond to the second preset hue information division interval includes: the second fifth area 502, the seventh fifth area 507, the eighth fifth area 508, the eleventh fifth area 511, The 13th fifth area 513 , the 18th fifth area 518 and the 19th fifth area 519 , a total of 7 fifth areas.
  • the seventh area determined to correspond to the third preset hue information division interval includes: the first fifth area 501 , the third fifth area 503 , the fourth fifth area 504 , the ninth fifth area 509 , The tenth fifth area 510 and the fifteenth fifth area 515 are 6 fifth areas in total.
  • This embodiment of the present application does not limit the order of the second preset area size, and any available area size order can be applied to the embodiment of the present application. For example, the order of areas from large to small, or the order of areas from small to large.
  • the areas are sorted in descending order, the sixth area corresponding to the first preset hue information division interval is the first order, and the sixth area corresponding to the third preset hue information division interval is the second Rank, the sixth area corresponding to the second preset hue information division interval is the third rank.
  • the areas are sorted in descending order, the seventh area corresponding to the first preset hue information division interval is the first order, and the seventh area corresponding to the second preset hue information division interval is the second Rank, the seventh area corresponding to the third preset hue information division interval is the third rank.
  • FIG. 6 is a second schematic diagram of the ranking provided by the embodiment of the present application.
  • the seventh area corresponding to the first preset hue information division interval is determined as the first area. That is, the target area includes the first fourth area 401, the fifth fourth area 405, the ninth fourth area 409, the fourteenth fourth area 414, the fifteenth fourth area 415, and the sixteenth fourth area 416, the 17th fourth area 417, the 18th fourth area 418, and the 20th fourth area 420, the first area includes the fifth fifth area 505, the sixth fifth area 506, and the 12th Fifth region 512 , 14th fifth region 514 , 16th fifth region 516 , 17th fifth region 517 , and 20th fifth region 520 .
  • the seventh area corresponding to the second preset hue information division interval is determined as the first area. That is, the target area includes the third fourth area 403, the fourth fourth area 404, the sixth fourth area 406, the tenth fourth area 410, the eleventh fourth area 411, and the twelfth fourth area 412, the 13th fourth area 413 and the 19th fourth area 419, the first area includes the second fifth area 502, the seventh fifth area 507, the eighth fifth area 508, and the eleventh The fifth area 511 , the thirteenth fifth area 513 , the eighteenth fifth area 518 , and the nineteenth fifth area 519 .
  • the seventh area corresponding to the third preset hue information division interval is determined as the first area. That is, when the target area includes the second fourth area 402, the seventh fourth area 407 and the eighth fourth area 408, the first area includes the first fifth area 501, the third fifth area 503, the 4 fifth areas 504 , ninth fifth areas 509 , tenth fifth areas 510 and fifteenth fifth areas 515 .
  • the color of the first area is used to process the target area to obtain the target image 500 corresponding to the original image 100 .
  • the image processing method provided in the embodiments of the present application may further include: according to an image value of each fifth area in the plurality of fifth areas included in the first area color, the average color of the first area is calculated; the average color is determined as the color of the first area.
  • the following target areas include the first fourth area 401, the fifth fourth area 405, the ninth fourth area 409, the fourteenth fourth area 414, the fifteenth fourth area 415, the 16 fourth areas 416 , 17th fourth area 417 , 18th fourth area 418 and 20th fourth area 420 , the first area includes the fifth fifth area 505 and the sixth fifth area 506 , the 12th fifth region 512 , the 14th fifth region 514 , the 16th fifth region 516 , the 17th fifth region 517 , and the 20th fifth region 520 are described as examples.
  • the average color of the first area is the 5th fifth area 505, the 6th fifth area 506, the 12th fifth area 512, the 14th fifth area 514, the 16th fifth area 516, the 17th fifth area Average color of the fifth region 517 and the twentieth fifth region 520.
  • the red component R in the average color of the first region is:
  • the green component G in the average color of the first region is:
  • the blue component B in the average color of the first region is:
  • the average RGB color of the first region of the 20th fifth region 520 is (169, 114, 70). This average RGB color (169, 114, 70) is determined as the color of the first region.
  • the second fifth region 502 it is determined to include the second fifth region 502, the seventh fifth region 507, the eighth fifth region 508, the eleventh fifth region 511, the thirteenth fifth region 513, and the eighteenth fifth region 513.
  • the color of the five regions 518 and the first region of the nineteenth fifth region 519 is (84, 153, 118).
  • the color of the first region is (121,80,116).
  • the color of the first area is used to process the target area to obtain the target image 500 corresponding to the original image 100 .
  • S103 may include, according to preset fusion parameters, fusing the original color of the target area with the color of the first area to obtain a fusion color; and adjusting the color of the target area to a fusion color.
  • the above formula (1) may be used to calculate the fusion color.
  • the target area includes the first fourth area 401, the fifth fourth area 405, the ninth fourth area 409, the fourteenth fourth area 414, the fifteenth fourth area 415, and the sixteenth fourth area. Taking 416, the 17th fourth area 417, the 18th fourth area 418, and the 20th fourth area 420 as examples, the color of the first area is (169, 114, 70).
  • the fusion color corresponding to the first fourth area 401 is:
  • the third fourth region 403, the fourth fourth region 404, the sixth fourth region 406, the tenth fourth region 410, the eleventh fourth region 411, the twelfth fourth region 411, the 12th fourth region The colors of the fourth area 412, the thirteenth fourth area 413, the nineteenth fourth area 419, the second fourth area 402, the seventh fourth area 407 and the eighth fourth area 408 are adjusted.
  • FIG. 7 is a second schematic diagram of a target image provided by an embodiment of the present application.
  • color migration does not need to perform spatial conversion and calculate the mean and standard deviation of the image, which can improve the speed and efficiency of color migration.
  • the reference image may be an image selected by a user from pre-stored images or an image acquired by using an image acquisition component after acquiring the original image.
  • the user can select a reference image or a captured image, so that the obtained target image can meet the user's needs.
  • the atmosphere at the time of shooting can also be preserved.
  • the execution subject may be an image processing apparatus, or a control module in the image processing apparatus for executing the image processing method.
  • the image processing apparatus provided by the embodiments of the present application is described by taking an image processing apparatus executing an image processing method as an example.
  • FIG. 8 is a schematic structural diagram of an image processing apparatus provided by an embodiment of the present application.
  • the image processing device may include:
  • a determination module 802 configured to determine, according to the hue information, a first area in the reference image corresponding to the target area in the original image;
  • the processing module 803 is configured to process the target area by using the color of the first area to obtain a target image corresponding to the original image.
  • processing module 803 may be specifically used for:
  • the original color of the target area is fused with the color of the first area to obtain a fusion color
  • the determining module 802 may include:
  • a first division sub-module configured to divide the original image and the reference image respectively according to the first preset area division method, so as to obtain a plurality of second regions corresponding to the original image and a plurality of third regions corresponding to the reference image;
  • a generating sub-module for generating a first hue sequence corresponding to the original image according to the hue information of the plurality of second regions, and generating a second hue sequence corresponding to the reference image according to the hue information of the plurality of third regions;
  • the first determination submodule is configured to determine, according to the first hue sequence and the second hue sequence, a first area in the reference image that corresponds to the target area in the original image.
  • the first determination submodule is specifically used for:
  • the first hue sequence and the second hue sequence are segmented respectively to obtain a plurality of first hue subsequences corresponding to the first hue sequence and a plurality of second hue subsequences corresponding to the second hue sequence;
  • An area in the reference image with the same ordering order corresponding to the target area is determined as the first area.
  • the determining module 802 may include:
  • the second division sub-module is configured to divide the original image and the reference image respectively according to the second preset area division method, so as to obtain a plurality of fourth regions corresponding to the original image and a plurality of fifth regions corresponding to the reference image;
  • the second determination sub-module is configured to divide the interval according to the hue information of the fourth area and a plurality of preset hue information, determine a sixth area in the original image corresponding to each preset hue information division interval, and The hue information and a plurality of preset hue information are divided into sections, and a seventh region in the reference image corresponding to each of the preset hue information divided sections is determined;
  • the area sorting submodule is used to sort the sixth area corresponding to the multiple preset hue information division intervals and the seventh area corresponding to the multiple preset hue information division intervals according to the order of the second preset area size, to obtain a plurality of The sorting order of the sixth region corresponding to the preset hue information division interval and the sorting order of the seventh regions corresponding to the plurality of preset hue information division intervals;
  • the third determination sub-module is configured to determine an area in the reference image that corresponds to the target area in the same order as the first area.
  • the image processing apparatus provided by the embodiments of the present application may further include:
  • a calculation module configured to calculate the first area according to the color of each third area in the plurality of third areas included in the first area or the color of each fifth area in the plurality of fifth areas included in the first area The average color of ; determine the average color as the color of the first area.
  • the reference image is an image selected by a user from pre-stored images or an image acquired by using an image acquisition component after acquiring the original image.
  • the image processing apparatus in this embodiment of the present application may be an apparatus, or may be a component, an integrated circuit, or a chip in a terminal.
  • the apparatus may be a mobile electronic device or a non-mobile electronic device.
  • the mobile electronic device may be a mobile phone, a tablet computer, a notebook computer, a palmtop computer, an in-vehicle electronic device, a wearable device, an ultra-mobile personal computer (UMPC), a netbook, or a personal digital assistant (personal digital assistant). assistant, PDA), etc.
  • the non-mobile electronic device can be a server, a network attached storage (NAS), a personal computer (PC), a television (television, TV), a teller machine or a self-service machine, etc. This application Examples are not specifically limited.
  • the image processing apparatus in this embodiment of the present application may be an apparatus having an operating system.
  • the operating system may be an Android (Android) operating system, an ios operating system, or other possible operating systems, which are not specifically limited in the embodiments of the present application.
  • the image processing apparatus provided in this embodiment of the present application can implement each process implemented by the image processing apparatus in the image processing method embodiments of FIG. 1 to FIG. 7 , and to avoid repetition, details are not repeated here.
  • an embodiment of the present application further provides an electronic device 900, including a processor 901, a memory 902, a program or instruction stored in the memory 902 and executable on the processor 901,
  • an electronic device 900 including a processor 901, a memory 902, a program or instruction stored in the memory 902 and executable on the processor 901,
  • the program or instruction is executed by the processor 901
  • each process of the above-mentioned image processing method embodiments can be implemented, and the same technical effect can be achieved. To avoid repetition, details are not repeated here.
  • the electronic devices in the embodiments of the present application include the aforementioned mobile electronic devices and non-mobile electronic devices.
  • FIG. 10 is a schematic diagram of a hardware structure of an electronic device implementing an embodiment of the present application.
  • the electronic device 1000 includes but is not limited to: a radio frequency unit 1001, a network module 1002, an audio output unit 1003, an input unit 1004, a sensor 1005, a display unit 1006, a user input unit 1007, an interface unit 1008, a memory 1009, and a processor 1010, etc. part.
  • the electronic device 1000 may also include a power source (such as a battery) for supplying power to various components, and the power source may be logically connected to the processor 1010 through a power management system, so that the power management system can manage charging, discharging, and power functions. consumption management and other functions.
  • a power source such as a battery
  • the power management system can manage charging, discharging, and power functions. consumption management and other functions.
  • the structure of the electronic device shown in FIG. 10 does not constitute a limitation on the electronic device, and the electronic device may include more or less components than the one shown, or combine some components, or arrange different components, which will not be repeated here. .
  • the processor 1010 is used to obtain the original image and the reference image; according to the hue information, determine the first area in the reference image corresponding to the target area in the original image; use the color of the first area to process the target area to obtain the original image The target image corresponding to the image.
  • the processor 1010 may be specifically configured to:
  • the original color of the target area is fused with the color of the first area to obtain a fusion color
  • the processor 1010 may be specifically configured to:
  • the original image and the reference image are respectively divided into areas to obtain a plurality of second areas corresponding to the original image and a plurality of third areas corresponding to the reference image;
  • a first area in the reference image corresponding to the target area in the original image is determined according to the first hue sequence and the second hue sequence.
  • the processor 1010 may be specifically configured to:
  • the first hue sequence and the second hue sequence are segmented respectively to obtain a plurality of first hue subsequences corresponding to the first hue sequence and a plurality of second hue subsequences corresponding to the second hue sequence;
  • An area in the reference image with the same ordering order corresponding to the target area is determined as the first area.
  • the processor 1010 may be specifically configured to:
  • the original image and the reference image are respectively divided into areas to obtain a plurality of fourth areas corresponding to the original image and a plurality of fifth areas corresponding to the reference image;
  • a sixth region in the original image corresponding to each preset hue information division interval is determined, and according to the hue information of the fifth region and the plurality of preset hue information Information division interval, determining a seventh area corresponding to each preset hue information division interval in the reference image;
  • An area in the reference image with the same ordering order corresponding to the target area is determined as the first area.
  • processor 1010 may also be used to:
  • the input unit 1004 may include a graphics processor (Graphics Processing Unit, GPU) 10041 and a microphone 10042. Such as camera) to obtain still pictures or video image data for processing.
  • the display unit 1006 may include a display panel 10061, which may be configured in the form of a liquid crystal display, an organic light emitting diode, or the like.
  • the user input unit 1007 includes a touch panel 10071 and other input devices 10072 .
  • the touch panel 10071 is also called a touch screen.
  • the touch panel 10071 may include two parts, a touch detection device and a touch controller.
  • Other input devices 10072 may include, but are not limited to, physical keyboards, function keys (such as volume control keys, switch keys, etc.), trackballs, mice, and joysticks, which will not be repeated here.
  • Memory 1009 may be used to store software programs as well as various data, including but not limited to application programs and operating systems.
  • the processor 1010 may integrate an application processor and a modem processor, wherein the application processor mainly processes the operating system, user interface, and application programs, and the like, and the modem processor mainly processes wireless communication. It can be understood that, the above-mentioned modulation and demodulation processor may not be integrated into the processor 1010.
  • Embodiments of the present application further provide a readable storage medium, where a program or an instruction is stored on the readable storage medium.
  • a program or an instruction is stored on the readable storage medium.
  • the processor is the processor in the electronic device described in the foregoing embodiments.
  • the readable storage medium includes a computer-readable storage medium, such as a computer read-only memory (Read-Only Memory, ROM), a random access memory (Random Access Memory, RAM), a magnetic disk or an optical disk, and the like.
  • An embodiment of the present application further provides a chip, where the chip includes a processor and a communication interface, the communication interface is coupled to the processor, and the processor is configured to run a program or an instruction to implement the above image processing method embodiments.
  • the chip includes a processor and a communication interface
  • the communication interface is coupled to the processor
  • the processor is configured to run a program or an instruction to implement the above image processing method embodiments.
  • the chip mentioned in the embodiments of the present application may also be referred to as a system-on-chip, a system-on-chip, a system-on-a-chip, or a system-on-a-chip, or the like.

Abstract

一种图像处理方法、装置及设备。图像处理方法包括:获取原始图像和参考图像(S101);根据色相信息,确定参考图像中与原始图像中的目标区域对应的第一区域(S102);利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像(S103)。

Description

图像处理方法、装置及设备
相关申请的交叉引用
本申请主张在2020年08月31日在中国提交的中国专利申请号No.202010894912.3的优先权,其全部内容通过引用包含于此。
技术领域
本申请属于图像处理技术领域,具体涉及一种图像处理方法、装置及设备。
背景技术
图像处理是用电子设备对图像进行处理,以达到所需结果的技术。图像处理包括但不限于:图像压缩,调整亮度,调整对比度,背景虚化,颜色渐变处理,滤镜处理和颜色迁移处理等等。
颜色迁移是指基于图像A和图像B,合成一幅新的图像C,图像C具有图像A的形状信息和图像B的颜色信息。
相关技术中的颜色迁移过程为先将RGB空间下的图像A和图像B转换到Lab空间下,利用图像的均值和标准差进行颜色迁移,得到Lab空间下的图像C,然后将图像C转换到RGB空间下,得到图像D。此时的图像D具有图像A的形状信息和图像B的颜色信息。
但是,在实现本申请过程中,发明人发现相关技术中至少存在如下问题:颜色迁移速度较慢,效率较低。
发明内容
本申请实施例的目的是提供一种图像处理方法、装置及设备,能够解决颜色迁移速度慢,效率低的问题。
为了解决上述技术问题,本申请是这样实现的:
第一方面,本申请实施例提供了一种图像处理方法,包括:
获取原始图像和参考图像;
根据色相信息,确定参考图像中与原始图像中的目标区域对应的第一区域;
利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像。
第二方面,本申请实施例提供了一种图像处理装置,包括:
获取模块,用于获取原始图像和参考图像;
确定模块,用于根据色相信息,确定参考图像中与原始图像中的目标区域对应的第一区域;
处理模块,用于利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像。
第三方面,本申请实施例提供了一种电子设备,该电子设备包括处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如第一方面所述的方法的步骤。
第四方面,本申请实施例提供了一种可读存储介质,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如第一方面所述的方法的步骤。
第五方面,本申请实施例提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如第一方面所述的方法的步骤。
在本申请实施例中,在获取到原始图像和参考图像后,可以根据色相信息,确定参考图像中与原始图像中的目标区域对应的第一区域,进而可以利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像。如此,在本申请实施例中,可以利用参考图像中与原始图像的目标区域对应的第一区域的颜色直接对该目标区域进行颜色处理,能够在图像的RGB空间内实现不同图像中的颜色迁移,而无需进行空间转换和计算图像的均值和标准差等,因此,相较于相关技术,本申请实施例提高了不同图像之间的颜色迁移速度和效率。
附图说明
图1是本申请实施例提供的一种图像处理方法的流程示意图;
图2是本申请实施例提供的划分原始图像和参考图像的第一种示意图;
图3是本申请实施例提供的排序位次的第一种示意图;
图4是本申请实施例提供的目标图像的第一种示意图;
图5是本申请实施例提供的划分原始图像和参考图像的第二种示意图;
图6是本申请实施例提供的排序位次的第二种示意图;
图7是本申请实施例提供的目标图像的第二种示意图;
图8是本申请实施例提供的一种图像处理装置的结构示意图;
图9是本申请实施例提供的一种电子设备的结构示意图;
图10是实现本申请实施例的一种电子设备的硬件结构示意图。
具体实施方式
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
本申请的说明书和权利要求书中的术语“第一”、“第二”等是用于区别类似的对象,而不用于描述特定的顺序或先后次序。应该理解这样使用的数据在适当情况下可以互换,以便本申请的实施例能够以除了在这里图示或描述的那些以外的顺序实施,且“第一”、“第二”等所区分的对象通常为一类,并不限定对象的个数,例如第一对象可以是一个,也可以是多个。此外,说明书以及权利要求中“和/或”表示所连接对象的至少其中之一,字符“/”,一般表示前后关联对象是一种“或”的关系。
下面结合附图,通过具体的实施例及其应用场景对本申请实施例提供的图像处理方法、装置及设备进行详细地说明。
图1是本申请实施例提供的一种图像处理方法的流程示意图。图像处理方法可以包括:
S101:获取原始图像和参考图像。
S102:根据色相信息,确定参考图像中与原始图像中的目标区域对应的第一区域。
S103:利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像。
上述各步骤的具体实现方式将在下文中进行详细描述。
在本申请实施例中,在获取到原始图像和参考图像后,可以根据色相信息,确定参考 图像中与原始图像中的目标区域对应的第一区域,进而可以利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像。如此,在本申请实施例中,可以利用参考图像中与原始图像的目标区域对应的第一区域的颜色直接对该目标区域进行颜色处理,能够在图像的RGB空间内实现不同图像中的颜色迁移,而无需进行空间转换和计算图像的均值和标准差等,因此,相较于相关技术,本申请实施例提高了不同图像之间的颜色迁移速度和效率。
在本申请实施例的一些可能实现中,S102可以包括:按照第一预设区域划分方式,分别对原始图像和参考图像进行区域划分,得到原始图像对应的多个第二区域和参考图像对应的多个第三区域;根据多个第二区域的色相信息,生成原始图像对应的第一色相序列,以及根据多个第三区域的色相信息,生成参考图像对应的第二色相序列;根据第一色相序列和第二色相序列,确定参考图像中与原始图像中的目标区域对应的第一区域。
在本申请实施例的一些可能实现中,第一预设区域划分方式可以根据实际需要进行设置。
本申请实施例中以第一预设区域划分方式为平均4*5区域划分方式为例进行说明。其中,本申请实施例中平均4*5区域划分方式为水平方向上4等分,竖直方向上5等分。
示例性的,假设原始图像100和参考图像200均包括25行16列共400个像素点。
按照平均4*5区域划分方式,将原始图像100划分为20个第二区域,将参考图像200划分为20个第三区域,如图2所示。图2是本申请实施例提供的划分原始图像和参考图像的示意图。20个第二区域自左至右,自上而下分别为第1个第二区域201、第2个第二区域202、……、第20个第二区域220。20个第三区域自左至右,自上而下分别为第1个第三区域301、第2个第三区域302、……、第20个第三区域320。可以理解的是,每个第二区域和每个第三区域均包括5行4列共20个像素点。
假设,第1个第二区域201至第20个第二区域220包括的20个像素点的平均RGB颜色依次分别为(34,253,5)、(46,65,76)、(155,46,76)、(56,46,54)、(46,54,32)、(78,65,234)、(36,65,49)、(136,165,149)、(136,87,58)、(136,23,65)、(136,23,65)、(136,34,87)、(165,57,89)、(189,200,43)、(200,123,83)、(246,234,231)、(243,157,138)、(254,158,156)、(140,140,240)和(243,157,138)。
第1个第三区域301至第20个第三区域320包括的20个像素点的平均RGB颜色依次分别为(65,34,57)、(146,165,176)、(155,146,176)、(156,146,154)、(146,154,132)、(178,165,34)、(136,165,149)、(36,165,149)、(136,8,58)、(16,23,65)、(13,123,65)、(136,134,87)、(65,157,89)、(189,200,143)、(200,123,183)、(246,34,21)、(143,57,38)、(54,58,56)、(140,240,140)和(143,57,38)。
则第1个第二区域201至第20个第二区域220对应的色相值分别为:113°、202°、343°、312°、82°、245°、147°、147°、22°、338°、338°、329°、342°、64°、21°、12°、11°、1°、240°和11°。
第1个第三区域301至第20个第三区域320对应的色相值分别为:315°、202°、258°、312°、82°、55°、147°、173°、337°、231°、148°、58°、136°、72°、313°、3°、11°、150°、120°和11°。
将第1个第二区域201至第20个第二区域220对应的色相值按照从小到大进行排序,生成原始图像100对应的第一色相序列:1°、11°、12°、21°、22°、64°、82°、113°、147°、202°、240°、245°、312°、329°、338°、342°和343°。
将第1个第三区域301至第20个第三区域320对应的色相值按照从小到大进行排序,生成参考图像200对应的第二色相序列:3°、11°、55°、58°、72°、82°、120°、136°、147°、148°、150°、173°、202°、231°、258°、312°、313°、315°和337°。
当生成原始图像100对应的第一色相序列和参考图像200对应的第二色相序列后,根据第一色相序列和第二色相序列,确定参考图像200中与原始图像100中的目标区域对应的第一区域。
在本申请实施例的一些可能实现中,根据第一色相序列和第二色相序列,确定参考图像中与原始图像中的目标区域对应的第一区域,可以包括:按照预设分割方式,分别对第一色相序列和第二色相序列进行分割,得到第一色相序列对应的多个第一色相子序列和第二色相序列对应的多个第二色相子序列;分别将多个第一色相子序列对应的第二区域和多个第二色相子序列对应的第三区域按照第一预设面积大小顺序进行排序,得到多个第一色相子序列对应的第二区域的排序位次和多个第二色相子序列对应的第三区域的排序位次; 将参考图像中与目标区域对应的排序位次相同的区域,确定为第一区域。
本申请实施例并不对预设分割方式进行限定,任何可用的分割方式均可应用于本申请实施例中。
假设预设分割方式为将色相序列均分为3个色相子序列。当色相序列包括的色相值数量能被3整除时,每个色相子序列包括的色相值数量相等。当色相序列包括的色相值数量不能被3整除时,最后一个色相子序列包括的色相值数量为色相序列包括的色相值数量与3的商和余数之和;除最后一个色相子序列之外的其他色相子序列包括的色相值数量为色相序列包括的色相值数量与3的商。
则上述第一色相序列划分为3个第一色相子序列,其中,第一个第一色相子序列包括5个色相值分别为:1°、11°、12°、21°和22°。第二个第一色相子序列包括5个色相值分别为:64°、82°、113°、147°和202°。第三个第一色相子序列包括7个色相值分别为:240°、245°、312°、329°、338°、342°和343°。
上述第二色相序列划分为3个第一色相子序列,其中,第一个第二色相子序列包括6个色相值分别为:3°、11°、55°、58°、72°和82°。第二个第二色相子序列包括6个色相值分别为:120°、136°、147°、148°、150°和173°。第三个第二色相子序列包括7个色相值分别为:202°、231°、258°、312°、313°、315°和337°。
第一个第一色相子序列对应的第二区域包括:第9个第二区域209、第15个第二区域215、第16个第二区域216、第17个第二区域217、第18个第二区域218和第20个第二区域220。第一个第一色相子序列对应的第二区域的面积为6个第二区域。
第二个第一色相子序列对应的第二区域包括:第1个第二区域201、第2个第二区域202、第5个第二区域205、第7个第二区域207、第8个第二区域208和第14个第二区域214。第二个第一色相子序列对应的第二区域的面积为6个第二区域。
第三个第一色相子序列对应的第二区域包括:第3个第二区域203、第4个第二区域204、第6个第二区域206、第10个第二区域210、第11个第二区域211、第12个第二区域212、第13个第二区域213和第19个第二区域219。第三个第一色相子序列对应的第二区域的面积为8个第二区域。
第一个第二色相子序列对应的第三区域包括:第5个第三区域305、第6个第三区域 306、第12个第三区域312、第14个第三区域314、第16个第三区域316、第17个第三区域317和第20个第三区域320。第一个第二色相子序列对应的第三区域的面积为7个第三区域。
第二个第二色相子序列对应的第三区域包括:第7个第三区域307、第8个第三区域308、第11个第三区域311、第13个第三区域313、第18个第三区域318和第19个第三区域319。第二个第二色相子序列对应的第三区域的面积为6个第三区域。
第三个第二色相子序列对应的第三区域包括:第1个第三区域301、第2个第三区域302、第3个第三区域303、第4个第三区域304、第9个第三区域309、第10个第三区域310和第15个第三区域315。第三个第二色相子序列对应的第三区域的面积为7个第三区域。
本申请实施例并不对第一预设面积大小顺序进行限定,任何可用的面积大小顺序均可应用于本申请实施例中。比如面积由大到小的顺序,或者面积由小到大的顺序。
将与第一个第一色相子序列对应的第二区域、与第二个第一色相子序列对应的第二区域和与第三个第一色相子序列对应的第二区域,按照面积由大到小的顺序进行排序,则与第三个第一色相子序列对应的第二区域为第一位次,与第一个第一色相子序列对应的第二区域为第二位次,与第二个第一色相子序列对应的第二区域为第三位次。
将与第一个第二色相子序列对应的第三区域、与第二个第二色相子序列对应的第三区域和与第三个第二色相子序列对应的第三区域,按照面积由大到小的顺序进行排序,则与第一个第二色相子序列对应的第三区域为第一位次,与第三个第二色相子序列对应的第三区域为第二位次,与第二个第二色相子序列对应的第三区域为第三位次。
排序位次结果如图3所示,图3是本申请实施例提供的排序位次的第一种示意图。
当目标区域为与第三个第一色相子序列对应的第二区域时,将与第一个第二色相子序列对应的第三区域确定为第一区域。即目标区域包括第3个第二区域203、第4个第二区域204、第6个第二区域206、第10个第二区域210、第11个第二区域211、第12个第二区域212、第13个第二区域213和第19个第二区域219时,第一区域包括第5个第三区域305、第6个第三区域306、第12个第三区域312、第14个第三区域314、第16个第三区域316、第17个第三区域317和第20个第三区域320。
当目标区域为与第一个第一色相子序列对应的第二区域时,将与第三个第二色相子序列对应的第三区域确定为第一区域。即目标区域包括第9个第二区域209、第15个第二区域215、第16个第二区域216、第17个第二区域217、第18个第二区域218和第20个第二区域220时,第一区域包括第1个第三区域301、第2个第三区域302、第3个第三区域303、第4个第三区域304、第9个第三区域309、第10个第三区域310和第15个第三区域315。
当目标区域为与第二个第一色相子序列对应的第二区域时,将与第二个第二色相子序列对应的第三区域确定为第一区域。即目标区域包括第1个第二区域201、第2个第二区域202、第5个第二区域205、第7个第二区域207、第8个第二区域208和第14个第二区域214时,第一区域包括第7个第三区域307、第8个第三区域308、第11个第三区域311、第13个第三区域313、第18个第三区域318和第19个第三区域319。
当确定出参考图像200中与原始图像100中的目标区域对应的第一区域后,利用第一区域的颜色对目标区域进行处理,得到原始图像100对应的目标图像500。
在本申请实施例的一些可能实现中,在S102之后,S103之前,本申请实施例提供的图像处理方法还可以包括:根据第一区域包括的多个第三区域中的每个第三区域的颜色,计算第一区域的平均颜色;将该平均颜色,确定为第一区域的颜色。
示例性的,下面以目标区域包括第3个第二区域203、第4个第二区域204、第6个第二区域206、第10个第二区域210、第11个第二区域211、第12个第二区域212、第13个第二区域213和第19个第二区域219,第一区域包括第5个第三区域305、第6个第三区域306、第12个第三区域312、第14个第三区域314、第16个第三区域316、第17个第三区域317和第20个第三区域320为例进行说明。
第一区域的平均颜色即为第5个第三区域305、第6个第三区域306、第12个第三区域312、第14个第三区域314、第16个第三区域316、第17个第三区域317和第20个第三区域320的平均颜色。
第一区域的平均颜色中的红色分量R为:
(146+178+136+189+246+143+143)/7=169。
第一区域的平均颜色中的绿色分量G为:
(154+165+134+200+34+57+57)/7=114。
第一区域的平均颜色中的蓝色分量B为:
(132+34+87+143+21+38+38)/7=70。
则包括第5个第三区域305、第6个第三区域306、第12个第三区域312、第14个第三区域314、第16个第三区域316、第17个第三区域317和第20个第三区域320的第一区域的平均RGB颜色为(169,114,70)。将该平均RGB颜色(169,114,70)确定为第一区域的颜色。
类似的,确定出包括第1个第三区域301、第2个第三区域302、第3个第三区域303、第4个第三区域304、第9个第三区域309、第10个第三区域310和第15个第三区域315的第一区域的颜色为(125,92,124)。
确定出包括第7个第三区域307、第8个第三区域308、第11个第三区域311、第13个第三区域313、第18个第三区域318和第19个第三区域319的第一区域的颜色为(74,151,108)。
在确定出参考图像200中与原始图像100中的目标区域对应的第一区域后,利用第一区域的颜色对目标区域进行处理,得到原始图像100对应的目标图像500。
在本申请实施例的一些可能实现中,S103可以包括计算目标区域的原始颜色与第一区域的颜色的平均颜色;将目标区域的颜色调整为平均颜色。
在本申请实施例的一些可能实现中,S103可以包括根据预设融合参数,将目标区域的原始颜色与第一区域的颜色进行融合,得到融合颜色;将目标区域的颜色调整为融合颜色。
在本申请实施例的一些可能实现中,可以利用公式(1)计算融合颜色。
F(r,g,b)=(b*Rr+a*R1,b*Gr+a*G1,b*Br+a*B1)    (1)
公式(1)中F(r,g,b)为融合颜色,Rr为目标区域的原始颜色中红色分量,Gr为目标区域的原始颜色中绿色分量,Br为目标区域的原始颜色中蓝色分量,R1为第一区域的颜色中红色分量,G1为第一区域的颜色中绿色分量,B1为第一区域的颜色中蓝色分量,a和b为融合参数。
在本申请实施例的一些可能实现中,融合参数a和融合参数b可以根据实际需要进行设置。
假设,融合参数b=100%,融合参数a=60%。
下面以目标区域包括第3个第二区域203、第4个第二区域204、第6个第二区域206、第10个第二区域210、第11个第二区域211、第12个第二区域212、第13个第二区域213和第19个第二区域219,第一区域的颜色为(169,114,70)为例进行说明。
第3个第二区域203对应的融合颜色为:
(155+60%*169,46+60%*114,76+60%*70)=(256,115,118)。然后,由于红色分量等于256,而颜色范围在0-255之间,则(256,115,118)转化为(0,115,118)。将第3个第二区域203颜色由(155,46,76)调整为(0,115,118)。
类似的,可以对目标区域包括的第4个第二区域204、第6个第二区域206、第10个第二区域210、第11个第二区域211、第12个第二区域212、第13个第二区域213和第19个第二区域219的颜色进行调整。
类似的,还可以对第9个第二区域209、第15个第二区域215、第16个第二区域216、第17个第二区域217、第18个第二区域218、第20个第二区域220、第1个第二区域201、第2个第二区域202、第3个第二区域203、第4个第二区域204、第9个第二区域209、第10个第二区域210和第15个第二区域215的颜色进行调整。
颜色调整后得到的图像即为目标图像500,如图4所示。图4是本申请实施例提供的目标图像的第一种示意图。
在本申请实施例中,颜色迁移无需进行空间转换和计算图像的均值和标准差等,能够提高颜色迁移速度和效率。
在本申请实施例的一些可能实现中,S102可以包括:按照第二预设区域划分方式,分别对原始图像和参考图像进行区域划分,得到原始图像对应的多个第四区域和参考图像对应的多个第五区域;根据第四区域的色相信息和多个预设色相信息划分区间,确定原始图像中与每一个预设色相信息划分区间对应的第六区域,以及根据第五区域的色相信息和多个预设色相信息划分区间,确定参考图像中与每一个预设色相信息划分区间对应的第七区域;分别将多个预设色相信息划分区间对应的第六区域和多个预设色相信息划分区间对应的第七区域按照第二预设面积大小顺序进行排序,得到多个预设色相信息划分区间对应的第六区域的排序位次和多个预设色相信息划分区间对应的第七区域的排序位次;将参考图 像中与目标区域对应的排序位次相同的区域,确定为第一区域。
在本申请实施例的一些可能实现中,第二预设区域划分方式可以根据实际需要进行设置。
本申请实施例中以第二预设区域划分方式为平均4*5区域划分方式为例进行说明。其中,本申请实施例中平均4*5区域划分方式为水平方向上4等分,竖直方向上5等分。
示例性的,假设原始图像100和参考图像200均包括25行16列共400个像素点。
按照平均4*5区域划分方式,将原始图像100划分为20个第四区域,将参考图像200划分为20个第五区域,如图5所示。图5是本申请实施例提供的划分原始图像和参考图像的第二种示意图。20个第四区域自左至右,自上而下分别为第1个第四区域401、第2个第四区域402、……、第20个第四区域420。20个第五区域自左至右,自上而下分别为第1个第五区域501、第2个第五区域502、……、第20个第五区域520。可以理解的是,每个第四区域和每个第五区域均包括5行4列共20个像素点。
假设,第1个第四区域401至第20个第四区域420包括的20个像素点的平均RGB颜色依次分别为(34,253,5)、(46,65,76)、(155,46,76)、(56,46,54)、(46,54,32)、(78,65,234)、(36,65,49)、(136,165,149)、(136,87,58)、(136,23,65)、(136,23,65)、(136,34,87)、(165,57,89)、(189,200,43)、(200,123,83)、(246,234,231)、(243,157,138)、(254,158,156)、(140,140,240)和(243,157,138)。
第1个第五区域501至第20个第五区域520包括的20个像素点的平均RGB颜色依次分别为(65,34,57)、(146,165,176)、(155,146,176)、(156,146,154)、(146,154,132)、(178,165,34)、(136,165,149)、(36,165,149)、(136,8,58)、(16,23,65)、(13,123,65)、(136,134,87)、(65,157,89)、(189,200,143)、(200,123,183)、(246,34,21)、(143,57,38)、(54,58,56)、(140,240,140)和(143,57,38)。
则第1个第四区域401至第20个第四区域420对应的色相值分别为:113°、202°、343°、312°、82°、245°、147°、147°、22°、338°、338°、329°、342°、64°、21°、12°、11°、1°、240°和11°。
第1个第五区域501至第20个第五区域520对应的色相值分别为:315°、202°、258°、312°、82°、55°、147°、173°、337°、231°、148°、58°、136°、72°、 313°、3°、11°、150°、120°和11°。
在本申请实施例的一些可能实现中,预设色相信息划分区间可以根据实际需求进行设置。
假设有三个预设色相信息划分区间,第一个预设色相信息划分区间为[0,120),第二个预设色相信息划分区间为[120,240),第三个预设色相信息划分区间为[240,360)。
根据第1个第四区域401至第20个第四区域420对应的色相值和上述三个预设色相信息划分区间,确定与第一个预设色相信息划分区间对应的第六区域包括:第1个第四区域401、第5个第四区域405、第9个第四区域409、第14个第四区域414、第15个第四区域415、第16个第四区域416、第17个第四区域417、第18个第四区域418和第20个第四区域420,共9个第四区域。确定与第二个预设色相信息划分区间对应的第六区域包括:第2个第四区域402、第7个第四区域407和第8个第四区域408,共3个第四区域。确定与第三个预设色相信息划分区间对应的第六区域包括:第3个第四区域403、第4个第四区域404、第6个第四区域406、第10个第四区域410、第11个第四区域411、第12个第四区域412、第13个第四区域413和第19个第四区域419,共8个第四区域。
根据第1个第五区域501至第20个第五区域520对应的色相值和上述三个预设色相信息划分区间,确定与第一个预设色相信息划分区间对应的第七区域包括:第5个第五区域505、第6个第五区域506、第12个第五区域512、第14个第五区域514、第16个第五区域516、第17个第五区域517和第20个第五区域520,共7个第五区域。确定与第二个预设色相信息划分区间对应的第七区域包括:第2个第五区域502、第7个第五区域507、第8个第五区域508、第11个第五区域511、第13个第五区域513、第18个第五区域518和第19个第五区域519,共7个第五区域。确定与第三个预设色相信息划分区间对应的第七区域包括:第1个第五区域501、第3个第五区域503、第4个第五区域504、第9个第五区域509、第10个第五区域510和第15个第五区域515,共6个第五区域。
本申请实施例并不对第二预设面积大小顺序进行限定,任何可用的面积大小顺序均可应用于本申请实施例中。比如面积由大到小的顺序,或者面积由小到大的顺序。
将与第一个预设色相信息划分区间对应的第六区域、与第二个预设色相信息划分区间对应的第六区域和与第三个预设色相信息划分区间对应的第六区域,按照面积由大到小的 顺序进行排序,则与第一个预设色相信息划分区间对应的第六区域为第一位次,与第三个预设色相信息划分区间对应的第六区域为第二位次,与第二个预设色相信息划分区间对应的第六区域为第三位次。
将与第一个预设色相信息划分区间对应的第七区域、与第二个预设色相信息划分区间对应的第七区域和与第三个预设色相信息划分区间对应的第七区域,按照面积由大到小的顺序进行排序,则与第一个预设色相信息划分区间对应的第七区域为第一位次,与第二个预设色相信息划分区间对应的第七区域为第二位次,与第三个预设色相信息划分区间对应的第七区域为第三位次。
排序位次结果如图6所示,图6是本申请实施例提供的排序位次的第二种示意图。
当目标区域为与第一个预设色相信息划分区间对应的第六区域时,将与第一个预设色相信息划分区间对应的第七区域确定为第一区域。即目标区域包括第1个第四区域401、第5个第四区域405、第9个第四区域409、第14个第四区域414、第15个第四区域415、第16个第四区域416、第17个第四区域417、第18个第四区域418和第20个第四区域420时,第一区域包括第5个第五区域505、第6个第五区域506、第12个第五区域512、第14个第五区域514、第16个第五区域516、第17个第五区域517和第20个第五区域520。
当目标区域为与第三个预设色相信息划分区间对应的第六区域时,将与第二个预设色相信息划分区间对应的第七区域确定为第一区域。即目标区域包括第3个第四区域403、第4个第四区域404、第6个第四区域406、第10个第四区域410、第11个第四区域411、第12个第四区域412、第13个第四区域413和第19个第四区域419时,第一区域包括第2个第五区域502、第7个第五区域507、第8个第五区域508、第11个第五区域511、第13个第五区域513、第18个第五区域518和第19个第五区域519。
当目标区域为与第二个预设色相信息划分区间对应的第六区域时,将与第三个预设色相信息划分区间对应的第七区域确定为第一区域。即目标区域包括第2个第四区域402、第7个第四区域407和第8个第四区域408时,第一区域包括第1个第五区域501、第3个第五区域503、第4个第五区域504、第9个第五区域509、第10个第五区域510和第15个第五区域515。
当确定出参考图像200中与原始图像100中的目标区域对应的第一区域后,利用第一区域的颜色对目标区域进行处理,得到原始图像100对应的目标图像500。
在本申请实施例的一些可能实现中,在S102之后,S103之前,本申请实施例提供的图像处理方法还可以包括:根据第一区域包括的多个第五区域中的每个第五区域的颜色,计算第一区域的平均颜色;将该平均颜色,确定为第一区域的颜色。
示例性的,下面以目标区域包括第1个第四区域401、第5个第四区域405、第9个第四区域409、第14个第四区域414、第15个第四区域415、第16个第四区域416、第17个第四区域417、第18个第四区域418和第20个第四区域420,第一区域包括第5个第五区域505、第6个第五区域506、第12个第五区域512、第14个第五区域514、第16个第五区域516、第17个第五区域517和第20个第五区域520为例进行说明。
第一区域的平均颜色即为第5个第五区域505、第6个第五区域506、第12个第五区域512、第14个第五区域514、第16个第五区域516、第17个第五区域517和第20个第五区域520的平均颜色。
第一区域的平均颜色中的红色分量R为:
(146+178+136+189+246+143+143)/7=169。
第一区域的平均颜色中的绿色分量G为:
(154+165+134+200+34+57+57)/7=114。
第一区域的平均颜色中的蓝色分量B为:
(132+34+87+143+21+38+38)/7=70。
则包括第5个第五区域505、第6个第五区域506、第12个第五区域512、第14个第五区域514、第16个第五区域516、第17个第五区域517和第20个第五区域520的第一区域的平均RGB颜色为(169,114,70)。将该平均RGB颜色(169,114,70)确定为第一区域的颜色。
类似的,确定出包括第2个第五区域502、第7个第五区域507、第8个第五区域508、第11个第五区域511、第13个第五区域513、第18个第五区域518和第19个第五区域519的第一区域的颜色为(84,153,118)。
确定出包括第1个第五区域501、第3个第五区域503、第4个第五区域504、第9个 第五区域509、第10个第五区域510和第15个第五区域515的第一区域的颜色为(121,80,116)。
在确定出参考图像200中与原始图像100中的目标区域对应的第一区域后,利用第一区域的颜色对目标区域进行处理,得到原始图像100对应的目标图像500。
在本申请实施例的一些可能实现中,S103可以包括根据预设融合参数,将目标区域的原始颜色与第一区域的颜色进行融合,得到融合颜色;将目标区域的颜色调整为融合颜色。
在本申请实施例的一些可能实现中,可以利用上述公式(1)计算融合颜色。
假设融合参数b=100%,a=60%。
以目标区域包括第1个第四区域401、第5个第四区域405、第9个第四区域409、第14个第四区域414、第15个第四区域415、第16个第四区域416、第17个第四区域417、第18个第四区域418和第20个第四区域420为例,第一区域的颜色为(169,114,70)。
第1个第四区域401对应的融合颜色为:
(34+60%*169,253+60%*114,5+60%*70)=(135,322,47)。然后,由于绿色分量322大于255,而颜色范围在0-255之间,则(135,322,47)转化为(135,66,47)。将第1个第四区域401颜色由(34,253,5)调整为(135,66,47)。
类似的,可以对目标区域包括的第5个第四区域405、第9个第四区域409、第14个第四区域414、第15个第四区域415、第16个第四区域416、第17个第四区域417、第18个第四区域418和第20个第四区域420的颜色进行调整。
类似的,还可以对第3个第四区域403、第4个第四区域404、第6个第四区域406、第10个第四区域410、第11个第四区域411、第12个第四区域412、第13个第四区域413、第19个第四区域419、第2个第四区域402、第7个第四区域407和第8个第四区域408的颜色进行调整。
颜色调整后得到的图像即为目标图像500,如图7所示。图7是本申请实施例提供的目标图像的第二种示意图。
在本申请实施例中,颜色迁移无需进行空间转换和计算图像的均值和标准差等,能够提高颜色迁移速度和效率。
在本申请实施例的一些可能实现中,参考图像可以为用户从预先存储的图像中选择的 图像或在获取到原始图像之后利用图像采集组件采集到的图像。
在本申请实施例中,用户可以选择参考图像或拍摄图像,使得得到的目标图像能够满足用户需求。在用户拍摄图像的情况下,还能够保留拍摄时的氛围感。
需要说明的是,本申请实施例提供的图像处理方法,执行主体可以为图像处理装置,或者该图像处理装置中的用于执行图像处理方法的控制模块。本申请实施例中以图像处理装置执行图像处理方法为例,说明本申请实施例提供的图像处理装置。
图8是本申请实施例提供的一种图像处理装置的结构示意图。图像处理装置可以包括:
获取模块801,用于获取原始图像和参考图像;
确定模块802,用于根据色相信息,确定参考图像中与原始图像中的目标区域对应的第一区域;
处理模块803,用于利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像。
在本申请实施例的一些可能实现中,处理模块803,具体可以用于:
根据预设融合参数,将目标区域的原始颜色与第一区域的颜色进行融合,得到融合颜色;
将目标区域的颜色调整为融合颜色。
在本申请实施例的一些可能实现中,确定模块802,可以包括:
第一划分子模块,用于按照第一预设区域划分方式,分别对原始图像和参考图像进行区域划分,得到原始图像对应的多个第二区域和参考图像对应的多个第三区域;
生成子模块,用于根据多个第二区域的色相信息,生成原始图像对应的第一色相序列,以及根据多个第三区域的色相信息,生成参考图像对应的第二色相序列;
第一确定子模块,用于根据第一色相序列和第二色相序列,确定参考图像中与原始图像中的目标区域对应的第一区域。
在本申请实施例的一些可能实现中,第一确定子模块,具体用于:
按照预设分割方式,分别对第一色相序列和第二色相序列进行分割,得到第一色相序列对应的多个第一色相子序列和第二色相序列对应的多个第二色相子序列;
分别将多个第一色相子序列对应的第二区域和多个第二色相子序列对应的第三区域 按照第一预设面积大小顺序进行排序,得到多个第一色相子序列对应的第二区域的排序位次和多个第二色相子序列对应的第三区域的排序位次;
将参考图像中与目标区域对应的排序位次相同的区域,确定为第一区域。
在本申请实施例的一些可能实现中,确定模块802,可以包括:
第二划分子模块,用于按照第二预设区域划分方式,分别对原始图像和参考图像进行区域划分,得到原始图像对应的多个第四区域和参考图像对应的多个第五区域;
第二确定子模块,用于根据第四区域的色相信息和多个预设色相信息划分区间,确定原始图像中与每一个预设色相信息划分区间对应的第六区域,以及根据第五区域的色相信息和多个预设色相信息划分区间,确定参考图像中与每一个预设色相信息划分区间对应的第七区域;
区域排序子模块,用于分别将多个预设色相信息划分区间对应的第六区域和多个预设色相信息划分区间对应的第七区域按照第二预设面积大小顺序进行排序,得到多个预设色相信息划分区间对应的第六区域的排序位次和多个预设色相信息划分区间对应的第七区域的排序位次;
第三确定子模块,用于将参考图像中与目标区域对应的排序位次相同的区域,确定为第一区域。
在本申请实施例的一些可能实现中,本申请实施例提供的图像处理装置还可以包括:
计算模块,用于根据第一区域包括的多个第三区域中的每个第三区域的颜色或第一区域包括的多个第五区域中的每个第五区域的颜色,计算第一区域的平均颜色;将平均颜色,确定为第一区域的颜色。
在本申请实施例的一些可能实现中,参考图像为用户从预先存储的图像中选择的图像或在获取到原始图像之后利用图像采集组件采集到的图像。
本申请实施例中的图像处理装置可以是装置,也可以是终端中的部件、集成电路、或芯片。该装置可以是移动电子设备,也可以为非移动电子设备。示例性的,移动电子设备可以为手机、平板电脑、笔记本电脑、掌上电脑、车载电子设备、可穿戴设备、超级移动个人计算机(ultra-mobile personal computer,UMPC)、上网本或者个人数字助理(personal digital assistant,PDA)等,非移动电子设备可以为服务器、网络附属存储器(Network  Attached Storage,NAS)、个人计算机(personal computer,PC)、电视机(television,TV)、柜员机或者自助机等,本申请实施例不作具体限定。
本申请实施例中的图像处理装置可以为具有操作系统的装置。该操作系统可以为安卓(Android)操作系统,可以为ios操作系统,还可以为其他可能的操作系统,本申请实施例不作具体限定。
本申请实施例提供的图像处理装置能够实现图1至图7的图像处理方法实施例中图像处理装置实现的各个过程,为避免重复,这里不再赘述。
可选的,如图9所示,本申请实施例还提供一种电子设备900,包括处理器901,存储器902,存储在存储器902上并可在所述处理器901上运行的程序或指令,该程序或指令被处理器901执行时实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
需要注意的是,本申请实施例中的电子设备包括上述所述的移动电子设备和非移动电子设备。
图10是实现本申请实施例的一种电子设备的硬件结构示意图。
该电子设备1000包括但不限于:射频单元1001、网络模块1002、音频输出单元1003、输入单元1004、传感器1005、显示单元1006、用户输入单元1007、接口单元1008、存储器1009、以及处理器1010等部件。
本领域技术人员可以理解,电子设备1000还可以包括给各个部件供电的电源(比如电池),电源可以通过电源管理系统与处理器1010逻辑相连,从而通过电源管理系统实现管理充电、放电、以及功耗管理等功能。图10中示出的电子设备结构并不构成对电子设备的限定,电子设备可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件布置,在此不再赘述。
其中,处理器1010,用于获取原始图像和参考图像;根据色相信息,确定参考图像中与原始图像中的目标区域对应的第一区域;利用第一区域的颜色对目标区域进行处理,得到原始图像对应的目标图像。
在本申请实施例的一些可能实现中,处理器1010,具体可以用于:
根据预设融合参数,将目标区域的原始颜色与第一区域的颜色进行融合,得到融合颜 色;
将目标区域的颜色调整为融合颜色。
在本申请实施例的一些可能实现中,处理器1010,具体可以用于:
按照第一预设区域划分方式,分别对原始图像和参考图像进行区域划分,得到原始图像对应的多个第二区域和参考图像对应的多个第三区域;
根据多个第二区域的色相信息,生成原始图像对应的第一色相序列,以及根据多个第三区域的色相信息,生成参考图像对应的第二色相序列;
根据第一色相序列和第二色相序列,确定参考图像中与原始图像中的目标区域对应的第一区域。
在本申请实施例的一些可能实现中,处理器1010,具体可以用于:
按照预设分割方式,分别对第一色相序列和第二色相序列进行分割,得到第一色相序列对应的多个第一色相子序列和第二色相序列对应的多个第二色相子序列;
分别将多个第一色相子序列对应的第二区域和多个第二色相子序列对应的第三区域按照第一预设面积大小顺序进行排序,得到多个第一色相子序列对应的第二区域的排序位次和多个第二色相子序列对应的第三区域的排序位次;
将参考图像中与目标区域对应的排序位次相同的区域,确定为第一区域。
在本申请实施例的一些可能实现中,处理器1010,具体可以用于:
按照第二预设区域划分方式,分别对原始图像和参考图像进行区域划分,得到原始图像对应的多个第四区域和参考图像对应的多个第五区域;
根据第四区域的色相信息和多个预设色相信息划分区间,确定原始图像中与每一个预设色相信息划分区间对应的第六区域,以及根据第五区域的色相信息和多个预设色相信息划分区间,确定参考图像中与每一个预设色相信息划分区间对应的第七区域;
分别将多个预设色相信息划分区间对应的第六区域和多个预设色相信息划分区间对应的第七区域按照第二预设面积大小顺序进行排序,得到多个预设色相信息划分区间对应的第六区域的排序位次和多个预设色相信息划分区间对应的第七区域的排序位次;
将参考图像中与目标区域对应的排序位次相同的区域,确定为第一区域。
在本申请实施例的一些可能实现中,处理器1010,还可以用于:
根据第一区域包括的多个第三区域中的每个第三区域的颜色或第一区域包括的多个第五区域中的每个第五区域的颜色,计算第一区域的平均颜色;将平均颜色,确定为第一区域的颜色。
应理解的是,本申请实施例中,输入单元1004可以包括图形处理器(Graphics Processing Unit,GPU)10041和麦克风10042,图形处理器10041对在视频捕获模式或图像捕获模式中由图像捕获装置(如摄像头)获得的静态图片或视频的图像数据进行处理。显示单元1006可包括显示面板10061,可以采用液晶显示器、有机发光二极管等形式来配置显示面板10061。用户输入单元1007包括触控面板10071以及其他输入设备10072。触控面板10071,也称为触摸屏。触控面板10071可包括触摸检测装置和触摸控制器两个部分。其他输入设备10072可以包括但不限于物理键盘、功能键(比如音量控制按键、开关按键等)、轨迹球、鼠标、操作杆,在此不再赘述。存储器1009可用于存储软件程序以及各种数据,包括但不限于应用程序和操作系统。处理器1010可集成应用处理器和调制解调处理器,其中,应用处理器主要处理操作系统、用户界面和应用程序等,调制解调处理器主要处理无线通信。可以理解的是,上述调制解调处理器也可以不集成到处理器1010中。
本申请实施例还提供一种可读存储介质,所述可读存储介质上存储有程序或指令,该程序或指令被处理器执行时实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
其中,所述处理器为上述实施例中所述的电子设备中的处理器。所述可读存储介质,包括计算机可读存储介质,如计算机只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等。
本申请实施例另提供了一种芯片,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现上述图像处理方法实施例的各个过程,且能达到相同的技术效果,为避免重复,这里不再赘述。
应理解,本申请实施例提到的芯片还可以称为系统级芯片、系统芯片、芯片系统或片上系统芯片等。
需要说明的是,在本文中,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者装置不仅包括那些要素, 而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者装置所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括该要素的过程、方法、物品或者装置中还存在另外的相同要素。此外,需要指出的是,本申请实施方式中的方法和装置的范围不限按示出或讨论的顺序来执行功能,还可包括根据所涉及的功能按基本同时的方式或按相反的顺序来执行功能,例如,可以按不同于所描述的次序来执行所描述的方法,并且还可以添加、省去、或组合各种步骤。另外,参照某些示例所描述的特征可在其他示例中被组合。
通过以上的实施方式的描述,本领域的技术人员可以清楚地了解到上述实施例方法可借助软件加必需的通用硬件平台的方式来实现,当然也可以通过硬件,但很多情况下前者是更佳的实施方式。基于这样的理解,本申请的技术方案本质上或者说对相关技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品存储在一个存储介质(如ROM/RAM、磁碟、光盘)中,包括若干指令用以使得一台终端(可以是手机,计算机,服务器,空调器,或者网络设备等)执行本申请各个实施例所述的方法。
上面结合附图对本申请的实施例进行了描述,但是本申请并不局限于上述的具体实施方式,上述的具体实施方式仅仅是示意性的,而不是限制性的,本领域的普通技术人员在本申请的启示下,在不脱离本申请宗旨和权利要求所保护的范围情况下,还可做出很多形式,均属于本申请的保护之内。。

Claims (17)

  1. 一种图像处理方法,所述方法包括:
    获取原始图像和参考图像;
    根据色相信息,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域;
    利用所述第一区域的颜色对所述目标区域进行处理,得到所述原始图像对应的目标图像。
  2. 根据权利要求1所述的方法,其中,所述利用所述第一区域的颜色对所述目标区域进行处理,包括:
    根据预设融合参数,将所述目标区域的原始颜色与所述第一区域的颜色进行融合,得到融合颜色;
    将所述目标区域的颜色调整为所述融合颜色。
  3. 根据权利要求1所述的方法,其中,所述根据色相信息,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域,包括:
    按照第一预设区域划分方式,分别对所述原始图像和所述参考图像进行区域划分,得到所述原始图像对应的多个第二区域和所述参考图像对应的多个第三区域;
    根据所述多个第二区域的色相信息,生成所述原始图像对应的第一色相序列,以及根据所述多个第三区域的色相信息,生成所述参考图像对应的第二色相序列;
    根据所述第一色相序列和所述第二色相序列,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域。
  4. 根据权利要求3所述的方法,其中,所述根据所述第一色相序列和所述第二色相序列,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域,包括:
    按照预设分割方式,分别对所述第一色相序列和所述第二色相序列进行分割,得到所述第一色相序列对应的多个第一色相子序列和所述第二色相序列对应的多个第二色相子序列;
    分别将所述多个第一色相子序列对应的第二区域和所述多个第二色相子序列对应的第三区域按照第一预设面积大小顺序进行排序,得到所述多个第一色相子序列对应 的第二区域的排序位次和所述多个第二色相子序列对应的第三区域的排序位次;
    将所述参考图像中与所述目标区域对应的排序位次相同的区域,确定为所述第一区域。
  5. 根据权利要求1所述的方法,其中,所述根据色相信息,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域,包括:
    按照第二预设区域划分方式,分别对所述原始图像和所述参考图像进行区域划分,得到所述原始图像对应的多个第四区域和所述参考图像对应的多个第五区域;
    根据所述第四区域的色相信息和多个预设色相信息划分区间,确定所述原始图像中与每一个所述预设色相信息划分区间对应的第六区域,以及根据所述第五区域的色相信息和所述多个预设色相信息划分区间,确定所述参考图像中与所述每一个所述预设色相信息划分区间对应的第七区域;
    分别将所述多个预设色相信息划分区间对应的第六区域和所述多个预设色相信息划分区间对应的第七区域按照第二预设面积大小顺序进行排序,得到所述多个预设色相信息划分区间对应的第六区域的排序位次和所述多个预设色相信息划分区间对应的第七区域的排序位次;
    将所述参考图像中与所述目标区域对应的排序位次相同的区域,确定为所述第一区域。
  6. 根据权利要求4或5所述的方法,其中,在所述根据色相信息,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域之后,所述利用所述第一区域的颜色对所述目标区域进行处理之前,所述方法还包括:
    根据所述第一区域包括的多个第三区域中的每个第三区域的颜色或所述第一区域包括的多个第五区域中的每个第五区域的颜色,计算所述第一区域的平均颜色;
    将所述平均颜色,确定为所述第一区域的颜色。
  7. 一种图像处理装置,所述装置包括:
    获取模块,用于获取原始图像和参考图像;
    确定模块,用于根据色相信息,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域;
    处理模块,用于利用所述第一区域的颜色对所述目标区域进行处理,得到所述原始图像对应的目标图像。
  8. 根据权利要求7所述的装置,其中,所述处理模块,具体用于:
    根据预设融合参数,将所述目标区域的原始颜色与所述第一区域的颜色进行融合,得到融合颜色;
    将所述目标区域的颜色调整为所述融合颜色。
  9. 根据权利要求7所述的装置,其中,所述确定模块,包括:
    第一划分子模块,用于按照第一预设区域划分方式,分别对所述原始图像和所述参考图像进行区域划分,得到所述原始图像对应的多个第二区域和所述参考图像对应的多个第三区域;
    生成子模块,用于根据所述多个第二区域的色相信息,生成所述原始图像对应的第一色相序列,以及根据所述多个第三区域的色相信息,生成所述参考图像对应的第二色相序列;
    第一确定子模块,用于根据所述第一色相序列和所述第二色相序列,确定所述参考图像中与所述原始图像中的目标区域对应的第一区域。
  10. 根据权利要求9所述的装置,其中,所述第一确定子模块,具体用于:
    按照预设分割方式,分别对所述第一色相序列和所述第二色相序列进行分割,得到所述第一色相序列对应的多个第一色相子序列和所述第二色相序列对应的多个第二色相子序列;
    分别将所述多个第一色相子序列对应的第二区域和所述多个第二色相子序列对应的第三区域按照第一预设面积大小顺序进行排序,得到所述多个第一色相子序列对应的第二区域的排序位次和所述多个第二色相子序列对应的第三区域的排序位次;
    将所述参考图像中与所述目标区域对应的排序位次相同的区域,确定为所述第一区域。
  11. 根据权利要求7所述的装置,其中,所述确定模块,包括:
    第二划分子模块,用于按照第二预设区域划分方式,分别对所述原始图像和所述参考图像进行区域划分,得到所述原始图像对应的多个第四区域和所述参考图像对应 的多个第五区域;
    第二确定子模块,用于根据所述第四区域的色相信息和多个预设色相信息划分区间,确定所述原始图像中与每一个所述预设色相信息划分区间对应的第六区域,以及根据所述第五区域的色相信息和所述多个预设色相信息划分区间,确定所述参考图像中与所述每一个所述预设色相信息划分区间对应的第七区域;
    区域排序子模块,用于分别将所述多个预设色相信息划分区间对应的第六区域和所述多个预设色相信息划分区间对应的第七区域按照第二预设面积大小顺序进行排序,得到所述多个预设色相信息划分区间对应的第六区域的排序位次和所述多个预设色相信息划分区间对应的第七区域的排序位次;
    第三确定子模块,用于将所述参考图像中与所述目标区域对应的排序位次相同的区域,确定为所述第一区域。
  12. 根据权利要求10或11所述的装置,其中,所述装置还包括:
    计算模块,用于根据所述第一区域包括的多个第三区域中的每个第三区域的颜色或所述第一区域包括的多个第五区域中的每个第五区域的颜色,计算所述第一区域的平均颜色;将所述平均颜色,确定为所述第一区域的颜色。
  13. 一种电子设备,所述电子设备包括:处理器、存储器及存储在所述存储器上并可在所述处理器上运行的程序或指令,所述程序或指令被所述处理器执行时实现如权利要求1至6任一项所述的图像处理方法的步骤。
  14. 一种图像处理装置,其特征在于,包括所述装置被配置成用于执行如权利要求1至6中任一项所述的图像处理方法。
  15. 一种芯片,其特征在于,所述芯片包括处理器和通信接口,所述通信接口和所述处理器耦合,所述处理器用于运行程序或指令,实现如权利要求1至6中任一项所述的图像处理方法。
  16. 一种可读存储介质,其特征在于,所述可读存储介质上存储程序或指令,所述程序或指令被处理器执行时实现如权利要求1-6任一项所述的图像处理方法的步骤。
  17. 一种计算机程序产品,其特征在于,所述程序产品被至少一个处理器执行以实现如权利要求1-6任一项所述的图像处理方法。
PCT/CN2021/115837 2020-08-31 2021-08-31 图像处理方法、装置及设备 WO2022042754A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202010894912.3 2020-08-31
CN202010894912.3A CN112037160B (zh) 2020-08-31 2020-08-31 图像处理方法、装置及设备

Publications (1)

Publication Number Publication Date
WO2022042754A1 true WO2022042754A1 (zh) 2022-03-03

Family

ID=73587673

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2021/115837 WO2022042754A1 (zh) 2020-08-31 2021-08-31 图像处理方法、装置及设备

Country Status (2)

Country Link
CN (1) CN112037160B (zh)
WO (1) WO2022042754A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230005112A1 (en) * 2021-06-30 2023-01-05 V5 Technologies Co., Ltd. Image matching method

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112037160B (zh) * 2020-08-31 2024-03-01 维沃移动通信有限公司 图像处理方法、装置及设备
CN112686355B (zh) * 2021-01-12 2024-01-05 树根互联股份有限公司 一种图像处理方法、装置、电子设备及可读存储介质

Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102164238A (zh) * 2006-01-10 2011-08-24 松下电器产业株式会社 颜色校正处理装置、动态摄像机颜色校正装置以及使用其的影像检索装置
US20110249863A1 (en) * 2010-04-09 2011-10-13 Sony Corporation Information processing device, method, and program
CN102542544A (zh) * 2010-12-30 2012-07-04 北京大学 一种色彩匹配的方法和系统
CN102694958A (zh) * 2012-02-10 2012-09-26 华为终端有限公司 一种确定图像色相的方法和无线手持设备
CN103617596A (zh) * 2013-10-12 2014-03-05 中山大学 一种基于流型转换的图像色彩风格变换方法
US20140270514A1 (en) * 2013-03-14 2014-09-18 Ili Technology Corporation Image processing method
CN104899909A (zh) * 2015-05-12 2015-09-09 福建天晴数码有限公司 颜色映射方法和装置
US20160048536A1 (en) * 2014-08-12 2016-02-18 Paypal, Inc. Image processing and matching
CN107093168A (zh) * 2017-03-10 2017-08-25 厦门美图之家科技有限公司 皮肤区域图像的处理方法、装置和系统
CN107862657A (zh) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 图像处理方法、装置、计算机设备及计算机可读存储介质
CN107945135A (zh) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 图像处理方法、装置、存储介质和电子设备
CN112037160A (zh) * 2020-08-31 2020-12-04 维沃移动通信有限公司 图像处理方法、装置及设备

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2036047A1 (en) * 2006-06-16 2009-03-18 E.I. Du Pont De Nemours And Company Color chips prepared by color clustering used for matching refinish paints
US9378542B2 (en) * 2011-09-28 2016-06-28 The United States Of America As Represented By The Secretary Of The Army System and processor implemented method for improved image quality and generating an image of a target illuminated by quantum particles
CN102611897B (zh) * 2012-03-04 2015-01-07 侯克杰 对彩色数字图像进行视觉感知高保真变换的方法及系统
CN109479087B (zh) * 2017-01-19 2020-11-17 华为技术有限公司 一种图像处理的方法及装置

Patent Citations (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102164238A (zh) * 2006-01-10 2011-08-24 松下电器产业株式会社 颜色校正处理装置、动态摄像机颜色校正装置以及使用其的影像检索装置
US20110249863A1 (en) * 2010-04-09 2011-10-13 Sony Corporation Information processing device, method, and program
CN102542544A (zh) * 2010-12-30 2012-07-04 北京大学 一种色彩匹配的方法和系统
CN102694958A (zh) * 2012-02-10 2012-09-26 华为终端有限公司 一种确定图像色相的方法和无线手持设备
US20140270514A1 (en) * 2013-03-14 2014-09-18 Ili Technology Corporation Image processing method
CN103617596A (zh) * 2013-10-12 2014-03-05 中山大学 一种基于流型转换的图像色彩风格变换方法
US20160048536A1 (en) * 2014-08-12 2016-02-18 Paypal, Inc. Image processing and matching
CN104899909A (zh) * 2015-05-12 2015-09-09 福建天晴数码有限公司 颜色映射方法和装置
CN107093168A (zh) * 2017-03-10 2017-08-25 厦门美图之家科技有限公司 皮肤区域图像的处理方法、装置和系统
CN107862657A (zh) * 2017-10-31 2018-03-30 广东欧珀移动通信有限公司 图像处理方法、装置、计算机设备及计算机可读存储介质
CN107945135A (zh) * 2017-11-30 2018-04-20 广东欧珀移动通信有限公司 图像处理方法、装置、存储介质和电子设备
CN112037160A (zh) * 2020-08-31 2020-12-04 维沃移动通信有限公司 图像处理方法、装置及设备

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20230005112A1 (en) * 2021-06-30 2023-01-05 V5 Technologies Co., Ltd. Image matching method

Also Published As

Publication number Publication date
CN112037160A (zh) 2020-12-04
CN112037160B (zh) 2024-03-01

Similar Documents

Publication Publication Date Title
WO2022042754A1 (zh) 图像处理方法、装置及设备
US9727960B2 (en) Image processing method and apparatus
WO2022012657A1 (zh) 图像编辑方法、装置和电子设备
CN104076928B (zh) 一种调整文字显示区域色调的方法
CN108701351B (zh) 一种图像显示增强方法及装置
WO2023016320A1 (zh) 图像处理方法、装置、设备及介质
WO2021114684A1 (zh) 图像处理方法、装置、计算设备和存储介质
WO2019056986A1 (zh) 肤色检测方法、装置及存储介质
CN111953955B (zh) 白平衡补偿方法、装置及电子设备
US20200409996A1 (en) Video abstract generating method, apparatus, and storage medium
CN102280096A (zh) 一种融合图像缩放与颜色空间转换的方法
CN102456223B (zh) 图像细节增强与缩放装置,以及图像细节增强与缩放方法
WO2020135224A1 (zh) 色彩空间映射方法、装置、计算机可读存储介质及设备
CN110335279A (zh) 实时绿幕抠像方法、装置、设备及存储介质
CN113870100A (zh) 图像处理方法和电子设备
CN113112428A (zh) 图像处理方法、装置、电子设备及可读存储介质
CN112419218A (zh) 图像处理方法、装置及电子设备
CN112199149A (zh) 界面渲染方法、装置及电子设备
CN103021375B (zh) 影像亮度调整电路
CN103974051A (zh) 影像处理装置及影像处理方法
JP5865517B2 (ja) 画像表示方法及び装置
US10026201B2 (en) Image classifying method and image displaying method
KR102215607B1 (ko) 어두운 이미지의 밝기를 개선하기 위한 보정 처리가 가능한 전자 장치 및 그 동작 방법
US9681064B1 (en) Lookup table interpolation in a film emulation camera system
CN112053277B (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: 21860586

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 21860586

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 02.08.2023)