CN115587930B - Image color style migration method, device and medium - Google Patents

Image color style migration method, device and medium Download PDF

Info

Publication number
CN115587930B
CN115587930B CN202211587298.1A CN202211587298A CN115587930B CN 115587930 B CN115587930 B CN 115587930B CN 202211587298 A CN202211587298 A CN 202211587298A CN 115587930 B CN115587930 B CN 115587930B
Authority
CN
China
Prior art keywords
color
image
source image
pixel
space
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.)
Active
Application number
CN202211587298.1A
Other languages
Chinese (zh)
Other versions
CN115587930A (en
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.)
Chengdu Sobey Digital Technology Co Ltd
Original Assignee
Chengdu Sobey Digital 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 Chengdu Sobey Digital Technology Co Ltd filed Critical Chengdu Sobey Digital Technology Co Ltd
Priority to CN202211587298.1A priority Critical patent/CN115587930B/en
Publication of CN115587930A publication Critical patent/CN115587930A/en
Application granted granted Critical
Publication of CN115587930B publication Critical patent/CN115587930B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T3/00Geometric image transformations in the plane of the image
    • G06T3/04Context-preserving transformations, e.g. by using an importance map
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02TCLIMATE CHANGE MITIGATION TECHNOLOGIES RELATED TO TRANSPORTATION
    • Y02T10/00Road transport of goods or passengers
    • Y02T10/10Internal combustion engine [ICE] based vehicles
    • Y02T10/40Engine management systems

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Facsimile Image Signal Circuits (AREA)
  • Color Image Communication Systems (AREA)
  • Image Processing (AREA)

Abstract

The invention discloses an image color style migration method, equipment and a medium, belonging to the field of image color migration and comprising the following steps: extracting color information of a source image and a color style target image and converting a color space; constructing a pixel-level color Gaussian mixture model; continuous color migration iterative optimization; and converting the image color space after color migration. The invention realizes smooth and stable image color style transfer.

Description

Image color style migration method, device and medium
Technical Field
The present invention relates to the field of image color migration, and more particularly, to an image color style migration method, device, and medium.
Background
With the popularity of self-media and the widespread streaming of short videos in recent years, there has been a new demand for short video-related image and video editing technologies. Color is an important way to convey information visually, for example: white can transmit cold and pure, and red can transmit enthusiasm and mania. Different visual information can be transmitted between the image works and the video works by utilizing different color styles, so that differentiated impression is generated. When we need a certain style of image content, we can make manual color adjustment by color matching software to achieve the same color expression as the target color style. A great deal of time and energy are consumed by relying on manual color adjustment, and the technical requirement threshold for an operator is high; a series of algorithms have been developed that automatically migrate the color style of an image to be consistent with a target image.
However, the existing color style migration methods have various problems, such as: (1) Only global color migration can be carried out, and local colors are easy to distort; (2) The color migration effect is discontinuous, and color faults are easy to appear; (3) Color migration failure can be caused when the target color distribution is more complex; and (4) the color migration timeliness is low, and the processing speed is slow.
Disclosure of Invention
The invention aims to overcome the defects of the prior art, and provides an image color style migration method, equipment and a medium, which realize smooth and stable image color style migration and the like.
The purpose of the invention is realized by the following scheme:
an image color style migration method comprises the following steps:
A. extracting color information of a source image and a color style target image, and converting the color information into the same image color space;
B. setting the color probability distribution of any pixel point of a color style target image in the same image color space to obey a Gaussian mixture model taking all pixel points of a source image as a Gaussian centroid, and constructing a pixel-level color Gaussian mixture model;
C. calculating the discrete approximation of Laplacian operators of all pixel points of the source image in the same image color space by using the constructed pixel-level color Gaussian mixture model; carrying out continuous color migration by using a result of Laplace discrete approximation calculation;
D. and after the color migration is finished, performing image color space conversion to obtain an image subjected to color style migration.
Further, the extracting the color information of the source image and the color style target image, and then converting to the same image color space, includes the substeps:
first, an input source image is recorded as
Figure 88080DEST_PATH_IMAGE001
The total number of pixels is recorded as
Figure 670371DEST_PATH_IMAGE002
Reading the RGB values of all the pixels and recording the values as
Figure 674231DEST_PATH_IMAGE003
M represents the pixel sequence number of the source image, wherein
Figure 226435DEST_PATH_IMAGE004
Represents the source image
Figure 632139DEST_PATH_IMAGE005
The RGB values of the individual pixels are then compared,
Figure 385332DEST_PATH_IMAGE006
respectively representing numerical values of three color channels of an m-th pixel point Red, green and Blue; the total number of pixels of the input color style target image is recorded as
Figure 860175DEST_PATH_IMAGE007
Reading the RGB values of all the pixels and recording the RGB values as
Figure 357016DEST_PATH_IMAGE008
Wherein
Figure 614297DEST_PATH_IMAGE009
Representing a color-style object image
Figure 397446DEST_PATH_IMAGE010
RGB values of individual pixel points; k represents the serial number of pixel points of the color style target image;
then, the source image is processed
Figure 766110DEST_PATH_IMAGE001
And all pixel points of the color style target image
Figure 410849DEST_PATH_IMAGE003
And
Figure 40414DEST_PATH_IMAGE008
conversion to LAB color space, respectively
Figure 869829DEST_PATH_IMAGE011
And
Figure 69998DEST_PATH_IMAGE012
wherein
Figure 33274DEST_PATH_IMAGE013
Figure 392712DEST_PATH_IMAGE014
For identifying variables before and after the differential transformation.
Further, the color probability distribution of any pixel point of the set color style target image in the same image color space obeys a Gaussian mixture model taking all pixel points of the source image as a Gaussian centroid, and a pixel-level color Gaussian mixture model is constructed, comprising the substeps of:
firstly, setting any pixel point of color style target image
Figure 268395DEST_PATH_IMAGE010
Obeying a color probability distribution in an LAB color space to a source image
Figure 470706DEST_PATH_IMAGE001
All pixel points are used as a Gaussian mixture model of a Gaussian centroid, namely:
Figure 581882DEST_PATH_IMAGE015
wherein
Figure 674121DEST_PATH_IMAGE016
Is recorded as
Figure 235552DEST_PATH_IMAGE017
Figure 534947DEST_PATH_IMAGE018
Figure 325179DEST_PATH_IMAGE019
Is a unit matrix;
Figure 49422DEST_PATH_IMAGE020
the variance value of the mth pixel point of the source image is obtained; p represents a probability distribution function, and e represents a natural constant; t represents transposition;
then, let M = h.w, where
Figure 391541DEST_PATH_IMAGE021
The number of pixels in each column of the source image, namely the image height,
Figure 788019DEST_PATH_IMAGE022
The number of pixels in each line of the source image is the image width, then the source image
Figure 896789DEST_PATH_IMAGE001
All the pixel points have unique correspondence
Figure 85325DEST_PATH_IMAGE023
Coordinates, memory
Figure 739291DEST_PATH_IMAGE001
To (1)
Figure 872332DEST_PATH_IMAGE005
Of a pixel
Figure 394581DEST_PATH_IMAGE023
The coordinates are
Figure 310059DEST_PATH_IMAGE024
And the coordinate of the 1 st pixel point of S is recorded as
Figure 259561DEST_PATH_IMAGE025
And finishing constructing the pixel-level color Gaussian mixture model.
Further, after completing the construction of the pixel-level color gaussian mixture model, the method comprises the following steps:
the calculation of the discrete approximation of the Laplacian operator of all pixel points of the source image in the same image color space comprises the following substeps:
computing a source image
Figure 145477DEST_PATH_IMAGE001
Discrete approximation of Laplacian operator of all pixel points in LAB space is recorded as
Figure 81203DEST_PATH_IMAGE026
In which
Figure 244332DEST_PATH_IMAGE027
Is a discrete laplacian operator.
Further, the performing continuous color migration by using the result of the laplacian discrete approximation calculation includes the sub-steps of:
C1. let us remember
Figure 489368DEST_PATH_IMAGE028
The probability set obtained after the secondary iteration optimization is
Figure 347734DEST_PATH_IMAGE029
(ii) a Let us remember
Figure 211785DEST_PATH_IMAGE028
The variance obtained after the secondary iteration optimization is
Figure 354053DEST_PATH_IMAGE030
To remember the first
Figure 645357DEST_PATH_IMAGE028
The numerical value of each pixel of the color style image obtained after the secondary iteration optimization in the LAB space is
Figure 991019DEST_PATH_IMAGE031
Setting the optimization coefficient
Figure 783394DEST_PATH_IMAGE032
Setting the maximum number of iterations
Figure 655535DEST_PATH_IMAGE033
And setting an initialization iteration count
Figure 7755DEST_PATH_IMAGE028
C2. In the first place
Figure 89981DEST_PATH_IMAGE028
In the second iteration, the source image is processed
Figure 561414DEST_PATH_IMAGE005
Pixel point and color style target image
Figure 163427DEST_PATH_IMAGE010
Each pixel point is defined according to the following formula
Figure 796534DEST_PATH_IMAGE017
Performing updating, after updating
Figure 366056DEST_PATH_IMAGE017
Is marked as
Figure 250966DEST_PATH_IMAGE034
Figure 832120DEST_PATH_IMAGE035
M 'is used for identifying and distinguishing M, and the value range of M' is still 1,2.. Multidot.M;
C3. in that
Figure 26341DEST_PATH_IMAGE028
In iteration, executing the step C2 to all pixel points of the source image and all pixel points of the color style target image to obtain optimized pixel points
Figure 568312DEST_PATH_IMAGE029
C4. In the first place
Figure 381547DEST_PATH_IMAGE028
In the second iteration, the first to the source image
Figure 941842DEST_PATH_IMAGE005
Each pixel point is calculated according to the following formula
Figure 182330DEST_PATH_IMAGE036
Figure 208667DEST_PATH_IMAGE037
C5. In the first place
Figure 684648DEST_PATH_IMAGE028
In the sub-iteration, the process is repeated,c4, executing all pixel points of the source image to obtain the optimized source image
Figure 240394DEST_PATH_IMAGE038
C6. In the first place
Figure 527150DEST_PATH_IMAGE028
In the second iteration, the first to the source image
Figure 433926DEST_PATH_IMAGE005
Each pixel point is calculated according to the following formula
Figure 448019DEST_PATH_IMAGE039
Figure 733638DEST_PATH_IMAGE040
Wherein, | | | represents a modular length calculation operation;
C7. in the first place
Figure 315929DEST_PATH_IMAGE028
In the secondary iteration, the step C6 is executed on all pixel points of the source image to obtain the optimized source image
Figure 569056DEST_PATH_IMAGE041
C8. The iteration number q is increased by 1;
C9. repeating steps C2 to C8 until
Figure 527784DEST_PATH_IMAGE042
Stopping the operation; the representation of the image obtained by transferring the source image through the color style in the LAB color space is as follows:
Figure 933489DEST_PATH_IMAGE043
wherein
Figure 280157DEST_PATH_IMAGE044
Wherein, in the step (A),
Figure 161525DEST_PATH_IMAGE045
representing the set of all pixel points corresponding to the source image in the LAB color space after qmax iterations are executed,
Figure 271082DEST_PATH_IMAGE046
the numerical values of the three channels are respectively expressed under L, A and B.
Further, after the color migration is completed, performing image color space conversion to obtain an image subjected to color style migration, including the substeps of:
D1. for is to
Figure 780561DEST_PATH_IMAGE047
First, the
Figure 704655DEST_PATH_IMAGE005
The pixel points are linearly transformed according to the following formula:
Figure 683106DEST_PATH_IMAGE048
Figure 577113DEST_PATH_IMAGE049
Figure 82043DEST_PATH_IMAGE050
wherein the content of the first and second substances,
Figure 52405DEST_PATH_IMAGE051
Figure 501840DEST_PATH_IMAGE052
Figure 340483DEST_PATH_IMAGE053
respectively representing the numerical value pairs after linear transformation and respective numerical values under the three XYZ channels;
D2. to pair
Figure 575287DEST_PATH_IMAGE047
First, the
Figure 841183DEST_PATH_IMAGE005
The non-linear transformation is carried out on each pixel point according to the following formula:
Figure 777915DEST_PATH_IMAGE054
Figure 27106DEST_PATH_IMAGE055
wherein, the first and the second end of the pipe are connected with each other,
Figure 241050DEST_PATH_IMAGE056
respectively representing the values of the mth pixel point in XYZ three channels after nonlinear transformation; a represents the argument of the function and,
Figure 802481DEST_PATH_IMAGE057
representing a non-linear variation function;
D3. to pair
Figure 367455DEST_PATH_IMAGE047
First, the
Figure 157687DEST_PATH_IMAGE005
The pixel points are subjected to inverse normalization according to the following formula:
Figure 350771DEST_PATH_IMAGE058
wherein, the first and the second end of the pipe are connected with each other,
Figure 958470DEST_PATH_IMAGE059
respectively representing the numerical value pairs of the pixel points m corresponding to the source image in the XYZ space after the reverse normalization;
D4. to pair
Figure 886106DEST_PATH_IMAGE047
First, the
Figure 870243DEST_PATH_IMAGE005
The inverse conversion operation is carried out on each pixel point according to the following formula:
Figure 917833DEST_PATH_IMAGE060
wherein
Figure 571799DEST_PATH_IMAGE061
Representing a matrix inversion operation;
Figure 845786DEST_PATH_IMAGE062
representing a numerical value pair of a corresponding pixel point m of the source image in an RGB space after inverse transformation operation;
D5. to pair
Figure 492668DEST_PATH_IMAGE047
First, the
Figure 402287DEST_PATH_IMAGE005
The pixel points perform inverse gamma conversion and cutting operation according to the following formula:
Figure 86210DEST_PATH_IMAGE063
Figure 972126DEST_PATH_IMAGE064
Figure 907852DEST_PATH_IMAGE065
wherein the content of the first and second substances,
Figure 805401DEST_PATH_IMAGE066
respectively representing the source images after inverse gamma conversion and clipping operationThe image corresponds to a numerical value pair of a pixel point m in an RGB space;
Figure 316017DEST_PATH_IMAGE067
which represents an inverse gamma transformation of the gamma-ray image,
Figure 174383DEST_PATH_IMAGE068
representing a clipping operation;
D6. to pair
Figure 38433DEST_PATH_IMAGE047
First, the
Figure 180702DEST_PATH_IMAGE005
The RGB estimation is carried out on each pixel point according to the following formula:
Figure 81793DEST_PATH_IMAGE069
wherein the content of the first and second substances,
Figure 817668DEST_PATH_IMAGE070
representing the RGB estimated value pair of the mth pixel point of the source image,
Figure 344464DEST_PATH_IMAGE071
respectively represent
Figure 89041DEST_PATH_IMAGE072
Values under three channels R, G, B;
D7. for is to
Figure 551247DEST_PATH_IMAGE047
Performing the steps D1 to D7 on all the pixel points to obtain a final pixel set subjected to color style migration
Figure 633472DEST_PATH_IMAGE073
D8. Arrangement of
Figure 839326DEST_PATH_IMAGE074
All the pixels inThe final color-style transferred format can be obtained as
Figure 441339DEST_PATH_IMAGE075
An RGB image of (1); r, G, B represent the red, green, blue channel symbolic representation of the image, respectively.
Further, the source image
Figure 464659DEST_PATH_IMAGE001
And all pixel points of the color style target image
Figure 909547DEST_PATH_IMAGE003
And
Figure 528878DEST_PATH_IMAGE008
conversion to LAB color space, comprising the sub-steps of:
(1) RGB normalization:
Figure 500245DEST_PATH_IMAGE076
wherein the content of the first and second substances,
Figure 304253DEST_PATH_IMAGE077
respectively representing the normalized numerical values of Red, green and Blue channels of a source image;
(2) Carrying out gamma conversion:
Figure 377383DEST_PATH_IMAGE078
Figure 659459DEST_PATH_IMAGE079
Figure 750912DEST_PATH_IMAGE080
the function argument is represented by a value of,
Figure 991401DEST_PATH_IMAGE081
representing a gamma transformation function;
Figure 23597DEST_PATH_IMAGE082
Figure 499578DEST_PATH_IMAGE083
Figure 55324DEST_PATH_IMAGE084
respectively representing numerical values of Red, green and Blue channels after gamma conversion is carried out on the mth pixel point of the source image;
Figure 342080DEST_PATH_IMAGE077
respectively representing the normalized numerical values of Red, green and Blue channels of a source image;
(3) Conversion from RGB space to XYZ space:
Figure 107911DEST_PATH_IMAGE085
Figure 997370DEST_PATH_IMAGE086
Figure 548568DEST_PATH_IMAGE087
Figure 989913DEST_PATH_IMAGE088
respectively representing the values of the mth pixel point of the source image in an XYZ space;
Figure 383986DEST_PATH_IMAGE082
Figure 686922DEST_PATH_IMAGE083
Figure 217261DEST_PATH_IMAGE084
respectively representing the number of Red, green and Blue channels after gamma conversion of the mth pixel point of the source imageA value;
(4) XYZ space normalization:
Figure 829507DEST_PATH_IMAGE089
Figure 583312DEST_PATH_IMAGE090
respectively representing the normalized numerical values of the mth pixel point of the source image in an XYZ space;
Figure 80153DEST_PATH_IMAGE086
Figure 589631DEST_PATH_IMAGE087
Figure 248146DEST_PATH_IMAGE088
respectively representing the values of the mth pixel point of the source image in an XYZ space;
(5) Carrying out nonlinear change:
Figure 226597DEST_PATH_IMAGE091
Figure 386183DEST_PATH_IMAGE092
Figure 891114DEST_PATH_IMAGE093
respectively representing the normalized values of the mth pixel point of the source image in an XYZ space, a representing a function independent variable,
Figure 595896DEST_PATH_IMAGE057
representing a non-linear variation function;
(6) Conversion from XYZ space to LAB space:
Figure 310911DEST_PATH_IMAGE094
Figure 149554DEST_PATH_IMAGE095
Figure 384357DEST_PATH_IMAGE096
Figure 384674DEST_PATH_IMAGE097
Figure 586986DEST_PATH_IMAGE098
Figure 229320DEST_PATH_IMAGE099
respectively representing the numerical values of three corresponding channels after the mth pixel point of the source image is converted into the LAB space,
Figure 333278DEST_PATH_IMAGE100
respectively representing the normalized numerical values of the mth pixel point of the source image in an XYZ space;
r, G, B represent red, green, blue channel symbolic representations of the R image, respectively.
Further, in step C1, the sub-step of: initializing variance
Figure 629130DEST_PATH_IMAGE101
Figure 194104DEST_PATH_IMAGE102
Setting optimization coefficient and maximum iteration number
Figure 249915DEST_PATH_IMAGE033
(ii) a Setting initialization iteration count
Figure 442999DEST_PATH_IMAGE103
Is shown by
Figure 50698DEST_PATH_IMAGE104
It represents the m-th initialization variance,
Figure 978334DEST_PATH_IMAGE105
a set of representations is presented that are,
Figure 431312DEST_PATH_IMAGE106
indicating the value of the initialized pixel point.
A computer device comprising a processor and a memory, the memory having stored therein a computer program which, when loaded by the processor and executed, carries out the method of any preceding claim.
A readable storage medium, in which a computer program is stored, which computer program is loaded by a processor and executes a method according to any of the above.
The beneficial effects of the invention include:
the technical scheme of the embodiment of the invention adopts a Gaussian mixture model to carry out pixel-level modeling on the source image and the color style target image to ensure the stability of local color migration, and utilizes a Laplace operator to ensure the smoothness and continuity of the color migration.
The technical scheme of the embodiment of the invention quickly performs optimization iteration based on the maximum expectation algorithm to meet the high efficiency of color migration.
The technical scheme of the embodiment of the invention utilizes the Gaussian mixture model to model the color distribution of the image, iteratively optimizes the pixel-level color mapping relation between the source image and the color style target image based on the maximum expectation algorithm, realizes the smooth and stable image color style migration technical scheme, and solves the technical problems in the background.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to these drawings without creative efforts.
FIG. 1 is a flow chart of steps of a method according to an embodiment of the present invention.
Detailed Description
All features disclosed in all embodiments in this specification, or all methods or process steps implicitly disclosed, may be combined and/or expanded, or substituted, in any way, except for mutually exclusive features and/or steps.
As shown in fig. 1, the image color style migration method provided by the technical solution of the embodiment of the present invention includes the following steps:
A. extracting color information of a source image and a color style target image and converting a color space;
B. constructing a pixel-level color Gaussian mixture model;
C. continuous color migration iterative optimization;
D. and converting the image color space after color migration.
In some alternative embodiments, step a includes the following substeps:
A1. noting the input source image as
Figure 478903DEST_PATH_IMAGE001
The total number of pixels is recorded as
Figure 132869DEST_PATH_IMAGE002
Reading the RGB values of all the pixel points according to the order from top to bottom and from left to right, and recording the RGB values as
Figure 531489DEST_PATH_IMAGE003
In which
Figure 53737DEST_PATH_IMAGE004
Represents the source image
Figure 234796DEST_PATH_IMAGE005
RGB values of the individual pixel points;
A2. input ofColor style target image with total number of pixels recorded as
Figure 918718DEST_PATH_IMAGE007
Reading the RGB values of all the pixel points according to the order from top to bottom and from left to right, and recording the RGB values as
Figure 804634DEST_PATH_IMAGE008
Wherein
Figure 130573DEST_PATH_IMAGE009
Representing a color-style object image
Figure 903488DEST_PATH_IMAGE010
RGB values of individual pixel points;
A3. a source image
Figure 148525DEST_PATH_IMAGE001
And all pixel points of the color style target image
Figure 397104DEST_PATH_IMAGE003
And
Figure 870941DEST_PATH_IMAGE008
conversion to LAB color space, respectively
Figure 13210DEST_PATH_IMAGE011
And
Figure 304514DEST_PATH_IMAGE012
wherein
Figure 915755DEST_PATH_IMAGE013
Figure 442551DEST_PATH_IMAGE014
(ii) a The specific conversion formula is as follows (in order
Figure 314692DEST_PATH_IMAGE107
Switch to
Figure 655193DEST_PATH_IMAGE108
For example, the conversion of the remaining pixels is analogized to this example:
(1) RGB normalization:
Figure 878364DEST_PATH_IMAGE076
(2) Carrying out gamma conversion:
Figure 208852DEST_PATH_IMAGE078
Figure 810865DEST_PATH_IMAGE109
(3) Conversion from RGB space to XYZ space:
Figure 709551DEST_PATH_IMAGE110
(4) XYZ space normalization:
Figure 13494DEST_PATH_IMAGE111
(5) Carrying out nonlinear change:
Figure 23038DEST_PATH_IMAGE112
Figure 745137DEST_PATH_IMAGE113
(6) Conversion from XYZ space to LAB space:
Figure 673779DEST_PATH_IMAGE094
Figure 605963DEST_PATH_IMAGE095
Figure 28985DEST_PATH_IMAGE114
in some alternative embodiments, step B includes the following sub-steps:
B1. setting any pixel point of color style target image
Figure 854859DEST_PATH_IMAGE010
Obeying a color probability distribution in an LAB color space to a source image
Figure 829768DEST_PATH_IMAGE001
All pixel points are used as a Gaussian mixture model of a Gaussian centroid, namely:
Figure 121685DEST_PATH_IMAGE015
wherein
Figure 473032DEST_PATH_IMAGE016
Is recorded as
Figure 418991DEST_PATH_IMAGE017
Figure 440168DEST_PATH_IMAGE018
Figure 346944DEST_PATH_IMAGE019
Is a unit matrix;
B2. let M = H.W, wherein
Figure 95457DEST_PATH_IMAGE021
The number (height) of pixels in each column of the source image,
Figure 36868DEST_PATH_IMAGE022
The number (i.e. width) of pixels of each line of the source image is the source image
Figure 228946DEST_PATH_IMAGE001
All the pixel points have unique correspondence
Figure 482073DEST_PATH_IMAGE023
Coordinates, memory
Figure 909643DEST_PATH_IMAGE001
To (1)
Figure 580927DEST_PATH_IMAGE005
Of a pixel
Figure 334119DEST_PATH_IMAGE023
The coordinates are
Figure 340122DEST_PATH_IMAGE024
And the coordinate of the 1 st pixel point of S is recorded as
Figure 172381DEST_PATH_IMAGE025
B3. Computing a source image
Figure 822805DEST_PATH_IMAGE001
And (5) performing discrete approximation on Laplacian operators of all pixel points in LAB space, and recording the discrete approximation as
Figure 871532DEST_PATH_IMAGE026
In which
Figure 974618DEST_PATH_IMAGE027
Is a discrete Laplacian operator, to
Figure 884936DEST_PATH_IMAGE108
The calculation formula for example is as follows:
Figure 248921DEST_PATH_IMAGE115
wherein the content of the first and second substances,
Figure 343916DEST_PATH_IMAGE116
as a coordinate
Figure 809664DEST_PATH_IMAGE117
The value of the corresponding pixel in the LAB color space (e.g.:
Figure 382727DEST_PATH_IMAGE118
=
Figure 132378DEST_PATH_IMAGE108
) (ii) a If it is
Figure 398274DEST_PATH_IMAGE119
Or
Figure 85738DEST_PATH_IMAGE120
Or
Figure 852706DEST_PATH_IMAGE121
Or
Figure 66650DEST_PATH_IMAGE122
When it is used, make
Figure 375884DEST_PATH_IMAGE123
In some alternative embodiments, step C comprises the following substeps:
C1. let us remember
Figure 799912DEST_PATH_IMAGE028
The probability set obtained after the secondary iteration optimization is
Figure 714778DEST_PATH_IMAGE029
(ii) a Let us remember
Figure 924174DEST_PATH_IMAGE028
The variance obtained after the secondary iteration optimization is
Figure 531873DEST_PATH_IMAGE030
In particular, let the variance be initialized
Figure 443197DEST_PATH_IMAGE101
(ii) a Let us remember
Figure 37120DEST_PATH_IMAGE028
The numerical value of each pixel of the color style image obtained after the secondary iteration optimization in the LAB space is
Figure 491235DEST_PATH_IMAGE031
Specially, order
Figure 128890DEST_PATH_IMAGE102
(ii) a Setting optimization coefficients
Figure 278243DEST_PATH_IMAGE124
(ii) a Setting a maximum number of iterations
Figure 800491DEST_PATH_IMAGE033
(ii) a Setting initialization iteration count
Figure 233746DEST_PATH_IMAGE103
C2. In the first place
Figure 917669DEST_PATH_IMAGE028
In the second iteration, the source image is processed
Figure 557247DEST_PATH_IMAGE005
Pixel point and color style target image
Figure 742241DEST_PATH_IMAGE010
Each pixel point is defined as the following formula
Figure 905369DEST_PATH_IMAGE017
Performing updating, after updating
Figure 901138DEST_PATH_IMAGE017
Is marked as
Figure 149717DEST_PATH_IMAGE034
Figure 138401DEST_PATH_IMAGE035
C3. In the first place
Figure 765823DEST_PATH_IMAGE028
In the secondary iteration, the step C2 is executed for all pixel points of the source image and all pixel points of the color style target image, and the optimized pixel points are obtained
Figure 57127DEST_PATH_IMAGE029
C4. In the first place
Figure 652056DEST_PATH_IMAGE028
In the second iteration, the first to the source image
Figure 929585DEST_PATH_IMAGE005
Each pixel point is calculated according to the following formula
Figure 801726DEST_PATH_IMAGE036
Figure 654144DEST_PATH_IMAGE037
C5. In the first place
Figure 953014DEST_PATH_IMAGE028
In the secondary iteration, the step C4 is executed on all pixel points of the source image to obtain the optimized source image
Figure 283501DEST_PATH_IMAGE038
C6. In the first place
Figure 10149DEST_PATH_IMAGE028
In the second iteration, the first to the source image
Figure 253043DEST_PATH_IMAGE005
Each pixel point is calculated according to the following formula
Figure 88143DEST_PATH_IMAGE039
Figure 832108DEST_PATH_IMAGE040
C7. In the first place
Figure 554208DEST_PATH_IMAGE028
In the secondary iteration, step C6 is executed on all pixel points of the source image to obtain optimized pixel points
Figure 482850DEST_PATH_IMAGE041
C8. The iteration number q is increased by 1;
C9. repeating steps C2 to C8 until
Figure 415034DEST_PATH_IMAGE042
Stopping the operation; the representation of the image obtained by the color style migration of the source image in the LAB color space is as follows:
Figure 103635DEST_PATH_IMAGE043
wherein
Figure 804875DEST_PATH_IMAGE044
In some alternative embodiments, step D includes the following sub-steps:
D1. to pair
Figure 904418DEST_PATH_IMAGE047
First, the
Figure 26413DEST_PATH_IMAGE005
A pixelThe points are linearly transformed according to the following formula:
Figure 112180DEST_PATH_IMAGE048
Figure 58140DEST_PATH_IMAGE049
Figure 203950DEST_PATH_IMAGE050
wherein the content of the first and second substances,
Figure 986092DEST_PATH_IMAGE051
Figure 185DEST_PATH_IMAGE052
Figure 410438DEST_PATH_IMAGE053
respectively representing the numerical value pairs after linear transformation and respective numerical values under the three XYZ channels;
D2. for is to
Figure 868095DEST_PATH_IMAGE047
First, the
Figure 121222DEST_PATH_IMAGE005
The pixel points are subjected to nonlinear transformation according to the following formula:
Figure 814371DEST_PATH_IMAGE054
Figure 220076DEST_PATH_IMAGE055
wherein the content of the first and second substances,
Figure 973268DEST_PATH_IMAGE056
are respectively shown inThe values of the mth pixel point in XYZ three channels after nonlinear transformation; a represents the argument of the function and,
Figure 448112DEST_PATH_IMAGE057
representing a non-linear variation function;
D3. to pair
Figure 817389DEST_PATH_IMAGE047
First, the
Figure 467813DEST_PATH_IMAGE005
The pixel points are subjected to inverse normalization according to the following formula:
Figure 250961DEST_PATH_IMAGE058
D4. to pair
Figure 229413DEST_PATH_IMAGE047
First, the
Figure 264365DEST_PATH_IMAGE005
The pixel points are subjected to inverse conversion operation according to the following formula:
Figure 628350DEST_PATH_IMAGE060
wherein
Figure 333132DEST_PATH_IMAGE061
Representing a matrix inversion operation;
D5. to pair
Figure 923513DEST_PATH_IMAGE047
First, the
Figure 621211DEST_PATH_IMAGE005
The pixel points perform inverse gamma conversion and cutting operation according to the following formula:
Figure 856014DEST_PATH_IMAGE063
Figure 121910DEST_PATH_IMAGE064
Figure 324222DEST_PATH_IMAGE065
D6. to pair
Figure 435397DEST_PATH_IMAGE047
First, the
Figure 527637DEST_PATH_IMAGE005
The RGB estimation is carried out on each pixel point according to the following formula:
Figure 89068DEST_PATH_IMAGE069
D7. for is to
Figure 388462DEST_PATH_IMAGE047
All the pixel points execute the steps D1 to D7 to obtain a pixel set subjected to color style migration finally
Figure 444274DEST_PATH_IMAGE073
D8. Arranged according to the order of priority from top to bottom and from left to right
Figure 902937DEST_PATH_IMAGE074
All the pixel points can obtain the final breadth after color style migration
Figure 245057DEST_PATH_IMAGE075
The RGB image of (a).
Thus, in conclusion of the steps A to D, the color style of the given source image can be migrated to be consistent with that of the target image. In addition, the method adopts a Gaussian mixture model to carry out pixel-level modeling on the source image and the color style target image to ensure the stability of local color migration, utilizes a Laplacian operator to ensure the smoothness and continuity of the color migration, and carries out optimization iteration quickly based on a maximum expectation algorithm to meet the high efficiency of the color migration.
It should be noted that the following embodiments can be combined and/or expanded, replaced in any way that is logical in any way from the above detailed description, such as the technical principles disclosed, the technical features disclosed or the technical features implicitly disclosed, etc., within the scope of protection defined by the claims of the present invention.
Example 1
An image color style migration method is characterized by comprising the following steps:
A. extracting color information of a source image and a color style target image, and converting the color information into the same image color space;
B. setting the color probability distribution of any pixel point of a color style target image in the same image color space to obey a Gaussian mixture model taking all pixel points of a source image as a Gaussian centroid, and constructing a pixel-level color Gaussian mixture model;
C. calculating the discrete approximation of Laplacian operators of all pixel points of the source image in the same image color space by using the constructed pixel-level color Gaussian mixture model; carrying out continuous color migration by using a result of Laplace discrete approximation calculation;
D. and after the color migration is finished, performing image color space conversion to obtain an image subjected to color style migration.
Example 2
On the basis of the embodiment 1, the extracting of the color information of the source image and the color style target image and the converting to the same image color space comprises the following substeps:
first, an input source image is written as
Figure 641534DEST_PATH_IMAGE001
The total number of pixels is recorded as
Figure 750305DEST_PATH_IMAGE002
Reading the RGB values of all the pixels and recording the values as
Figure 204420DEST_PATH_IMAGE003
M represents the pixel sequence number of the source image, wherein
Figure 858386DEST_PATH_IMAGE004
Representing a source image
Figure 866793DEST_PATH_IMAGE005
The RGB values of the individual pixels are then compared,
Figure 513675DEST_PATH_IMAGE006
respectively representing numerical values of three color channels of an m-th pixel point Red, green and Blue; the total number of pixels of the input color style target image is recorded as
Figure 429154DEST_PATH_IMAGE007
Reading the RGB values of all the pixels and recording the values as
Figure 378656DEST_PATH_IMAGE008
In which
Figure 264572DEST_PATH_IMAGE009
Representing a color-style object image
Figure 324932DEST_PATH_IMAGE010
RGB values of individual pixel points; k represents the serial number of pixel points of the color style target image;
then, the source image is processed
Figure 629006DEST_PATH_IMAGE001
And all pixel points of the color style target image
Figure 608463DEST_PATH_IMAGE003
And
Figure 857042DEST_PATH_IMAGE008
conversion to LAB color space, respectively
Figure 330879DEST_PATH_IMAGE011
And
Figure 614093DEST_PATH_IMAGE012
in which
Figure 764452DEST_PATH_IMAGE013
Figure 375693DEST_PATH_IMAGE014
For identifying variables before and after the differential transformation.
Example 3
On the basis of the embodiment 2, the color probability distribution of any pixel point of the set color style target image in the same image color space obeys a gaussian mixture model taking all pixel points of the source image as a gaussian centroid, and a pixel-level color gaussian mixture model is constructed, including the substeps of:
firstly, setting any pixel point of color style target image
Figure 43435DEST_PATH_IMAGE010
Obeying a color probability distribution in an LAB color space to a source image
Figure 40209DEST_PATH_IMAGE001
All pixel points are used as a Gaussian mixture model of a Gaussian centroid, namely:
Figure 502415DEST_PATH_IMAGE015
wherein
Figure 326584DEST_PATH_IMAGE016
Is recorded as
Figure 922650DEST_PATH_IMAGE017
Figure 914877DEST_PATH_IMAGE018
Figure 423350DEST_PATH_IMAGE019
Is an identity matrix;
Figure 868238DEST_PATH_IMAGE020
the variance value of the mth pixel point of the source image is obtained; p represents a probability distribution function, and e represents a natural constant; t represents transposition;
then, let M = h.w, where
Figure 736836DEST_PATH_IMAGE021
The number of pixels in each column of the source image, namely the image height,
Figure 458936DEST_PATH_IMAGE022
The number of pixels in each line of the source image is the image width, then the source image
Figure 528523DEST_PATH_IMAGE001
All the pixel points have unique correspondence
Figure 585341DEST_PATH_IMAGE023
Coordinates and notes
Figure 132997DEST_PATH_IMAGE001
To (1) a
Figure 709603DEST_PATH_IMAGE005
Of a pixel
Figure 809146DEST_PATH_IMAGE023
Having coordinates of
Figure 228626DEST_PATH_IMAGE024
And the coordinate of the 1 st pixel point of S is recorded as
Figure 186830DEST_PATH_IMAGE025
And finishing constructing the pixel-level color Gaussian mixture model.
Example 4
On the basis of embodiment 3, after completing the construction of the pixel-level color gaussian mixture model, the method comprises the following steps:
the calculation of the Laplacian discrete approximation of all pixel points of the source image in the same image color space comprises the following substeps:
computing a source image
Figure 8156DEST_PATH_IMAGE001
And (5) performing discrete approximation on Laplacian operators of all pixel points in LAB space, and recording the discrete approximation as
Figure 544179DEST_PATH_IMAGE026
Wherein
Figure 60742DEST_PATH_IMAGE027
Is a discrete laplacian operator.
Example 5
On the basis of embodiment 4, the performing continuous color migration by using the result of the laplace discrete approximation calculation includes the sub-steps of:
C1. let us remember
Figure 215780DEST_PATH_IMAGE028
The probability set obtained after the secondary iteration optimization is
Figure 16246DEST_PATH_IMAGE029
(ii) a Let us remember
Figure 332958DEST_PATH_IMAGE028
The variance obtained after the secondary iteration optimization is
Figure 602396DEST_PATH_IMAGE030
To remember the first
Figure 295546DEST_PATH_IMAGE028
The numerical value of each pixel of the color style image obtained after the secondary iteration optimization in the LAB space is
Figure 950518DEST_PATH_IMAGE031
Setting the optimization coefficient
Figure 47918DEST_PATH_IMAGE032
Setting the maximum number of iterations
Figure 929286DEST_PATH_IMAGE033
And setting an initialization iteration count
Figure 550761DEST_PATH_IMAGE028
C2. In the first place
Figure 813901DEST_PATH_IMAGE028
In the second iteration, the source image is processed
Figure 472416DEST_PATH_IMAGE005
Pixel point and color style target image
Figure 700135DEST_PATH_IMAGE010
Each pixel point is defined as the following formula
Figure 735087DEST_PATH_IMAGE017
Performing updating, after updating
Figure 380963DEST_PATH_IMAGE017
Is marked as
Figure 335013DEST_PATH_IMAGE034
Figure 925394DEST_PATH_IMAGE035
M 'is used for identifying and distinguishing M, and the value range of M' is still 1,2.. Multidot.M;
C3. in that
Figure 373824DEST_PATH_IMAGE028
In iteration, all pixel points and color style target map of source imageC2, all pixel points of the image are executed, and the optimized pixel points are obtained
Figure 857895DEST_PATH_IMAGE029
C4. In the first place
Figure 123791DEST_PATH_IMAGE028
In the second iteration, the first to the source image
Figure 811256DEST_PATH_IMAGE005
Each pixel point is calculated according to the following formula
Figure 188010DEST_PATH_IMAGE036
Figure 792167DEST_PATH_IMAGE037
C5. In the first place
Figure 835822DEST_PATH_IMAGE028
In the secondary iteration, the step C4 is executed on all pixel points of the source image to obtain the optimized source image
Figure 135216DEST_PATH_IMAGE038
C6. In the first place
Figure 440295DEST_PATH_IMAGE028
In the second iteration, the first to the source image
Figure 774325DEST_PATH_IMAGE005
Each pixel point is calculated according to the following formula
Figure 257390DEST_PATH_IMAGE039
Figure 168714DEST_PATH_IMAGE040
Wherein, | | | represents a modular length calculation operation;
C7. in the first place
Figure 887271DEST_PATH_IMAGE028
In the secondary iteration, step C6 is executed on all pixel points of the source image to obtain optimized pixel points
Figure 951173DEST_PATH_IMAGE041
C8. The iteration number q is increased by 1;
C9. repeating steps C2 to C8 until
Figure 729774DEST_PATH_IMAGE042
Stopping the operation; the representation of the image obtained by the color style migration of the source image in the LAB color space is as follows:
Figure 128394DEST_PATH_IMAGE043
wherein
Figure 526008DEST_PATH_IMAGE044
Wherein, in the step (A),
Figure 569051DEST_PATH_IMAGE045
representing the set of all pixel points corresponding to the source image in the LAB color space after qmax iterations are executed,
Figure 643186DEST_PATH_IMAGE046
the values of the three channels are respectively expressed under L, A and B.
Example 6
On the basis of embodiment 5, after the color migration is completed, performing image color space conversion to obtain an image subjected to color style migration, including the substeps of:
D1. for is to
Figure 670048DEST_PATH_IMAGE047
First, the
Figure 354843DEST_PATH_IMAGE005
A pixelThe points are linearly transformed according to the following formula:
Figure 642605DEST_PATH_IMAGE048
Figure 763008DEST_PATH_IMAGE049
Figure 886953DEST_PATH_IMAGE050
wherein, the first and the second end of the pipe are connected with each other,
Figure 610058DEST_PATH_IMAGE051
Figure 893272DEST_PATH_IMAGE052
Figure 59942DEST_PATH_IMAGE053
respectively representing the numerical value pairs after linear transformation and respective numerical values under the three XYZ channels;
D2. to pair
Figure 530238DEST_PATH_IMAGE047
First, the
Figure 322613DEST_PATH_IMAGE005
The pixel points are subjected to nonlinear transformation according to the following formula:
Figure 70121DEST_PATH_IMAGE054
Figure 532326DEST_PATH_IMAGE055
wherein the content of the first and second substances,
Figure 880131DEST_PATH_IMAGE056
respectively representThe values of the mth pixel point in XYZ three channels after nonlinear transformation; a represents the argument of the function and,
Figure 820405DEST_PATH_IMAGE057
representing a non-linear variation function;
D3. to pair
Figure 419489DEST_PATH_IMAGE047
First, the
Figure 442809DEST_PATH_IMAGE005
The pixel points are subjected to inverse normalization according to the following formula:
Figure 153276DEST_PATH_IMAGE058
wherein the content of the first and second substances,
Figure 772607DEST_PATH_IMAGE059
respectively representing the numerical value pairs of the pixel points m corresponding to the source image in the XYZ space after the reverse normalization;
D4. to pair
Figure 619340DEST_PATH_IMAGE047
First, the
Figure 282403DEST_PATH_IMAGE005
The pixel points are subjected to inverse conversion operation according to the following formula:
Figure 355532DEST_PATH_IMAGE060
wherein
Figure 637609DEST_PATH_IMAGE061
Representing a matrix inversion operation;
Figure 463482DEST_PATH_IMAGE062
representing a numerical value pair of a corresponding pixel point m of the source image in an RGB space after inverse transformation operation;
D5. for is to
Figure 579337DEST_PATH_IMAGE047
First, the
Figure 998817DEST_PATH_IMAGE005
Carrying out inverse gamma conversion and cutting operation on each pixel point according to the following formula:
Figure 474798DEST_PATH_IMAGE063
Figure 30544DEST_PATH_IMAGE064
Figure 320230DEST_PATH_IMAGE065
wherein the content of the first and second substances,
Figure 86060DEST_PATH_IMAGE066
respectively representing the numerical value pairs of the corresponding pixel points m of the source image in the RGB space after inverse gamma conversion and cutting operation;
Figure 975519DEST_PATH_IMAGE067
which represents an inverse gamma transformation of the gamma-ray image,
Figure 526717DEST_PATH_IMAGE068
representing a clipping operation;
D6. for is to
Figure 109008DEST_PATH_IMAGE047
First, the
Figure 362135DEST_PATH_IMAGE005
The RGB estimation is carried out on each pixel point according to the following formula:
Figure 930651DEST_PATH_IMAGE069
wherein the content of the first and second substances,
Figure 195410DEST_PATH_IMAGE070
representing the RGB estimated value pair of the mth pixel point of the source image,
Figure 73236DEST_PATH_IMAGE071
respectively represent
Figure 564391DEST_PATH_IMAGE072
Values under three channels R, G, B;
D7. to pair
Figure 61232DEST_PATH_IMAGE047
Performing the steps D1 to D7 on all the pixel points to obtain a final pixel set subjected to color style migration
Figure 570711DEST_PATH_IMAGE073
D8. Arrangement of
Figure 229225DEST_PATH_IMAGE074
All the pixel points can obtain the final breadth after color style migration
Figure 204747DEST_PATH_IMAGE075
An RGB image of (1); r, G, B represent the red, green, blue channel symbolic representation of the image, respectively.
Example 7
Based on embodiment 2, the source image
Figure 364333DEST_PATH_IMAGE001
And all pixel points of the color style target image
Figure 134843DEST_PATH_IMAGE003
And
Figure 839625DEST_PATH_IMAGE008
conversion to LAB color space, comprising the sub-steps of:
(1) RGB normalization:
Figure 430006DEST_PATH_IMAGE076
wherein the content of the first and second substances,
Figure 393283DEST_PATH_IMAGE077
respectively representing the normalized numerical values of Red, green and Blue channels of a source image;
(2) Carrying out gamma conversion:
Figure 362507DEST_PATH_IMAGE078
Figure 628403DEST_PATH_IMAGE079
Figure 830714DEST_PATH_IMAGE080
the function argument is represented by a function of,
Figure 207469DEST_PATH_IMAGE081
representing a gamma transformation function;
Figure 296779DEST_PATH_IMAGE082
Figure 858210DEST_PATH_IMAGE083
Figure 157605DEST_PATH_IMAGE084
respectively representing numerical values of Red, green and Blue channels after gamma conversion is carried out on the mth pixel point of the source image;
Figure 204627DEST_PATH_IMAGE077
respectively representing the normalized numerical values of Red, green and Blue channels of a source image;
(3) Conversion from RGB space to XYZ space:
Figure 397711DEST_PATH_IMAGE085
Figure 5410DEST_PATH_IMAGE086
Figure 667467DEST_PATH_IMAGE087
Figure 386024DEST_PATH_IMAGE088
respectively representing the values of the mth pixel point of the source image in an XYZ space;
Figure 964773DEST_PATH_IMAGE082
Figure 353160DEST_PATH_IMAGE083
Figure 892726DEST_PATH_IMAGE084
respectively representing numerical values of Red, green and Blue channels after gamma conversion is carried out on the mth pixel point of the source image;
(4) XYZ space normalization:
Figure 539608DEST_PATH_IMAGE089
Figure 582650DEST_PATH_IMAGE090
respectively representing the normalized numerical values of the mth pixel point of the source image in an XYZ space;
Figure 141939DEST_PATH_IMAGE086
Figure 27855DEST_PATH_IMAGE087
Figure 353794DEST_PATH_IMAGE088
respectively representing the values of the mth pixel point of the source image in an XYZ space;
(5) Carrying out nonlinear change:
Figure 123779DEST_PATH_IMAGE091
Figure 385128DEST_PATH_IMAGE092
Figure 758340DEST_PATH_IMAGE093
respectively representing the normalized values of the mth pixel point of the source image in an XYZ space, a represents a function independent variable,
Figure 622391DEST_PATH_IMAGE057
representing a non-linear variation function;
(6) Conversion from XYZ space to LAB space:
Figure 249813DEST_PATH_IMAGE094
Figure 931330DEST_PATH_IMAGE095
Figure 401625DEST_PATH_IMAGE096
Figure 679154DEST_PATH_IMAGE097
Figure 675929DEST_PATH_IMAGE098
Figure 403713DEST_PATH_IMAGE099
respectively representing the numerical values of three corresponding channels after the mth pixel point of the source image is converted into the LAB space,
Figure 239601DEST_PATH_IMAGE100
respectively representing the normalized numerical values of the mth pixel point of the source image in an XYZ space;
r, G, B represent red, green, blue channel symbolic representations of the R image, respectively.
Example 8
On the basis of embodiment 5, in step C1, the substeps of: initializing variance
Figure 445454DEST_PATH_IMAGE101
Figure 296736DEST_PATH_IMAGE102
Setting optimization coefficient and maximum iteration number
Figure 70788DEST_PATH_IMAGE033
(ii) a Setting initialization iteration count
Figure 250096DEST_PATH_IMAGE103
Is shown by
Figure 384274DEST_PATH_IMAGE104
It represents the m-th initialization variance,
Figure 106374DEST_PATH_IMAGE105
a set of representations is presented that are,
Figure 644803DEST_PATH_IMAGE106
indicating the value of the initialized pixel.
Example 9
A computer arrangement comprising a processor and a memory, the memory having stored thereon a computer program which, when loaded by the processor and executed, carries out the method of any one of embodiments 1 to 8.
Example 10
A readable storage medium, in which a computer program is stored, which computer program is loaded by a processor and executes a method according to any of embodiments 1-8.
The units described in the embodiments of the present invention may be implemented by software or hardware, and the described units may also be disposed in a processor. Wherein the names of the elements do not in some way constitute a limitation on the elements themselves.
According to an aspect of an embodiment of the present invention, there is provided a computer program product or a computer program comprising computer instructions stored in a computer readable storage medium. The processor of the computer device reads the computer instructions from the computer-readable storage medium, and the processor executes the computer instructions to cause the computer device to perform the method provided in the various alternative implementations described above.
As another aspect, an embodiment of the present invention further provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist separately without being assembled into the electronic device. The computer readable medium carries one or more programs which, when executed by an electronic device, cause the electronic device to implement the method described in the above embodiments.
The parts not involved in the present invention are the same as or can be implemented using the prior art.
The above-described embodiment is only one embodiment of the present invention, and it will be apparent to those skilled in the art that various modifications and variations can be easily made based on the application and principle of the present invention disclosed in the present application, and the present invention is not limited to the method described in the above-described embodiment of the present invention, so that the above-described embodiment is only preferred, and not restrictive.
Other embodiments than the above examples may be devised by those skilled in the art based on the foregoing disclosure, or by adapting and using knowledge or techniques of the relevant art, and features of various embodiments may be interchanged or substituted and such modifications and variations that may be made by those skilled in the art without departing from the spirit and scope of the present invention are intended to be within the scope of the following claims.

Claims (8)

1. An image color style migration method is characterized by comprising the following steps:
A. extracting color information of a source image and a color style target image, and converting the color information into the same image color space;
B. setting the color probability distribution of any pixel point of a color style target image in the same image color space to obey a Gaussian mixture model taking all pixel points of a source image as a Gaussian centroid, and constructing a pixel-level color Gaussian mixture model;
C. calculating the discrete approximation of Laplacian operators of all pixel points of the source image in the same image color space by using the constructed pixel-level color Gaussian mixture model; carrying out continuous color migration by using a Laplace discrete approximation calculation result;
the calculation of the discrete approximation of the Laplacian operator of all pixel points of the source image in the same image color space comprises the following substeps:
computing a source image
Figure QLYQS_1
Discrete approximation of Laplacian operator of all pixel points in LAB space is recorded as
Figure QLYQS_2
In which>
Figure QLYQS_3
Is a discrete Laplace operator;
the continuous color migration using the result of the laplacian discrete approximation calculation includes the substeps of:
C1. let us remember
Figure QLYQS_5
The resulting set of probabilities after the sub-iterative optimization is combined into @>
Figure QLYQS_8
(ii) a Marking the fifth->
Figure QLYQS_10
The variance obtained after the sub-iterative optimization is ^ er>
Figure QLYQS_6
On a first or second basis>
Figure QLYQS_9
The value of each pixel of the color style image obtained after the secondary iteration optimization in the LAB space is->
Figure QLYQS_11
Setting an optimization coefficient->
Figure QLYQS_12
Setting a maximum number of iterations->
Figure QLYQS_4
And setting an initialization iteration count ≧ or>
Figure QLYQS_7
C2. In the first place
Figure QLYQS_13
In a sub-iteration, a source image is first +>
Figure QLYQS_14
Number ^ greater or less than or equal to pixel point and color style target image>
Figure QLYQS_15
Each pixel point is used for combining the following formula>
Figure QLYQS_16
Update is performed, the updated->
Figure QLYQS_17
Is recorded as->
Figure QLYQS_18
Figure QLYQS_19
;
M 'is used for identifying and distinguishing M, and the value range of M' is still 1,2.. Multidot.M;
C3. in that
Figure QLYQS_20
In iteration, executing the step C2 on all pixel points of the source image and all pixel points of the color style target image, and acquiring optimized ^ greater than or equal to>
Figure QLYQS_21
C4. In the first place
Figure QLYQS_22
In a sub-iteration, the ^ th or ^ th of the source image>
Figure QLYQS_23
Each pixel point is calculated according to the following formula>
Figure QLYQS_24
Figure QLYQS_25
;
C5. In the first place
Figure QLYQS_26
In the secondary iteration, the step C4 is executed on all pixel points of the source image to obtain the optimized source image
Figure QLYQS_27
C6. In the first place
Figure QLYQS_28
In a sub-iteration, a first +of source images>
Figure QLYQS_29
Each pixel point is calculated according to the following formula>
Figure QLYQS_30
:/>
Figure QLYQS_31
;
Wherein, | | | represents a modular length calculation operation;
C7. in the first place
Figure QLYQS_32
In the secondary iteration, executing the step C6 on all pixel points of the source image to obtain optimized->
Figure QLYQS_33
C8. The iteration number q is increased by 1;
C9. repeating steps C2 to C8 until
Figure QLYQS_34
Stopping the operation; the representation of the image obtained by transferring the source image through the color style in the LAB color space is as follows: />
Figure QLYQS_35
Wherein
Figure QLYQS_36
Wherein is present>
Figure QLYQS_37
Representing that after qmax iterations are executed, all pixel points corresponding to the source image are collected in the LAB color space and then are subjected to the judgment of the judgment result, and expressing that all pixel points corresponding to the source image are collected in the LAB color space and are subjected to the judgment of the judgment result in the judgment of the judgment result>
Figure QLYQS_38
Respectively representing the numerical values of the three channels of L, A and B;
D. and after the color migration is finished, performing image color space conversion to obtain an image subjected to color style migration.
2. The image color style migration method according to claim 1, wherein the extracting of the color information of the source image and the color style target image and the converting to the same image color space comprises the sub-steps of:
first, an input source image is recorded as
Figure QLYQS_40
The total number of pixels is recorded as->
Figure QLYQS_44
Reading the RGB values of all the pixels and recording the values as
Figure QLYQS_47
M represents the serial number of the pixel point of the source image, wherein>
Figure QLYQS_41
Represents the source image ^ h->
Figure QLYQS_43
The RGB value of each pixel point is greater or less>
Figure QLYQS_46
Respectively representing numerical values of three color channels of an m-th pixel point Red, green and Blue; the total number of pixels of the input color-style target image is recorded as->
Figure QLYQS_48
Reading the RGB values of all the pixel points and recording the values as->
Figure QLYQS_39
Wherein
Figure QLYQS_42
Representing the ^ th or greater of a color-style target image>
Figure QLYQS_45
RGB values of individual pixel points; k represents the serial number of pixel points of the color style target image;
then, the source image is processed
Figure QLYQS_49
And all pixels of the color-style target image->
Figure QLYQS_50
And &>
Figure QLYQS_51
Conversion into LAB color space, respectively { }>
Figure QLYQS_52
And &>
Figure QLYQS_53
In which>
Figure QLYQS_54
Figure QLYQS_55
For identifying variables before and after the differential transformation.
3. The image color style migration method according to claim 2, wherein the color probability distribution of any pixel point of the set color style target image in the same image color space obeys a gaussian mixture model with all pixel points of the source image as the gaussian centroid, and a pixel-level color gaussian mixture model is constructed, comprising the sub-steps of:
firstly, setting any pixel point of a color style target image
Figure QLYQS_56
The color probability distribution in the LAB color space is obeyed with the source image->
Figure QLYQS_57
All pixel points are used as a Gaussian mixture model of a Gaussian centroid, namely:
Figure QLYQS_58
(ii) a Wherein it is present>
Figure QLYQS_59
Is recorded as->
Figure QLYQS_60
;/>
Figure QLYQS_61
,/>
Figure QLYQS_62
Is a unit matrix; />
Figure QLYQS_63
The variance value of the mth pixel point of the source image is obtained; p represents a probability distribution function, and e represents a natural constant; t represents transposition;
then, let M = h.w, where
Figure QLYQS_65
For each column of pixels of the source image, i.e. the image height>
Figure QLYQS_68
For the number of pixels per line of the source image, i.e. the image width, the source image>
Figure QLYQS_71
All the pixel points have unique corresponding->
Figure QLYQS_66
Coordinates, recording->
Figure QLYQS_69
In a first or second section>
Figure QLYQS_70
Of a pixel
Figure QLYQS_72
Coordinate is->
Figure QLYQS_64
And the coordinate of the 1 st pixel point of S is recorded as->
Figure QLYQS_67
And finishing constructing the pixel-level color Gaussian mixture model.
4. The image color style migration method according to claim 1, wherein after the color migration is completed, performing image color space conversion to obtain an image subjected to color style migration, comprising the substeps of:
D1. for is to
Figure QLYQS_73
Is/are>
Figure QLYQS_74
The pixel points are linearly transformed according to the following formula:
Figure QLYQS_75
;
Figure QLYQS_76
;
Figure QLYQS_77
;
wherein the content of the first and second substances,
Figure QLYQS_78
、/>
Figure QLYQS_79
、/>
Figure QLYQS_80
respectively representing the numerical value pairs after linear transformation and respective numerical values under the three XYZ channels;
D2. to pair
Figure QLYQS_81
A fifth or fifth letter>
Figure QLYQS_82
The non-linear transformation is carried out on each pixel point according to the following formula:
Figure QLYQS_83
;
Figure QLYQS_84
;
wherein the content of the first and second substances,
Figure QLYQS_85
respectively representing the values of the mth pixel point in XYZ three channels after nonlinear transformation; a denotes a function argument, <' > greater or lesser>
Figure QLYQS_86
Representing a non-linear variation function;
D3. to pair
Figure QLYQS_87
Is/are>
Figure QLYQS_88
The pixel points are subjected to inverse normalization according to the following formula: />
Figure QLYQS_89
;
Wherein the content of the first and second substances,
Figure QLYQS_90
respectively representing the values of the corresponding pixel points m of the source image in XYZ space after the reverse normalization;
D4. to pair
Figure QLYQS_91
Is/are>
Figure QLYQS_92
The inverse conversion operation is carried out on each pixel point according to the following formula:
Figure QLYQS_93
;
wherein
Figure QLYQS_94
Representing a matrix inversion operation; />
Figure QLYQS_95
Representing the numerical value pair of the corresponding pixel point m of the source image in the RGB space after the inverse transformation operation;
D5. to pair
Figure QLYQS_96
Is/are>
Figure QLYQS_97
The pixel points perform inverse gamma conversion and cutting operation according to the following formula:
Figure QLYQS_98
;
Figure QLYQS_99
;
Figure QLYQS_100
;
wherein the content of the first and second substances,
Figure QLYQS_101
respectively representing the numerical value pairs of the corresponding pixel points m of the source image in the RGB space after inverse gamma conversion and cutting operation; />
Figure QLYQS_102
Represents an inverse gamma change, and>
Figure QLYQS_103
representing a clipping operation;
D6. to pair
Figure QLYQS_104
Is/are>
Figure QLYQS_105
The RGB estimation is carried out on each pixel point according to the following formula:
Figure QLYQS_106
;
wherein the content of the first and second substances,
Figure QLYQS_107
an RGB pre-evaluation value pair representing an mth pixel point in a source image, based on a pixel value in the image sensor>
Figure QLYQS_108
Respectively represent
Figure QLYQS_109
Values under three channels R, G, B;
D7. to pair
Figure QLYQS_110
All the pixel points execute the steps D1 to D7 to obtain a pixel set subjected to color style migration finally
Figure QLYQS_111
D8. Arrangement of
Figure QLYQS_112
All the pixel points can obtain the final breadth of the color style transferred based on the judgment result of the judgment result>
Figure QLYQS_113
An RGB image of (1); r, G, B represent the red, green, blue channel symbolic representation of the image, respectively.
5. The method for migrating image color style according to claim 2, characterized in that the source image is migrated
Figure QLYQS_114
And all pixel points of a color-style target image->
Figure QLYQS_115
And &>
Figure QLYQS_116
Conversion to LAB color space, comprising the sub-steps of:
(1) RGB normalization:
Figure QLYQS_117
;
wherein the content of the first and second substances,
Figure QLYQS_118
respectively representing sourcesNormalizing the Red, green and Blue channels of the image to obtain normalized values;
(2) Carrying out gamma conversion:
Figure QLYQS_119
;
Figure QLYQS_120
;
Figure QLYQS_121
represents a function argument, <' > or>
Figure QLYQS_122
Representing a gamma transformation function; />
Figure QLYQS_123
,/>
Figure QLYQS_124
,/>
Figure QLYQS_125
Respectively representing numerical values of Red, green and Blue channels after gamma conversion is carried out on the mth pixel point of the source image; />
Figure QLYQS_126
Respectively representing the normalized numerical values of Red, green and Blue channels of a source image;
(3) Conversion from RGB space to XYZ space:
Figure QLYQS_127
;
Figure QLYQS_128
,/>
Figure QLYQS_129
,/>
Figure QLYQS_130
respectively representing the values of the mth pixel point of the source image in an XYZ space; />
Figure QLYQS_131
,/>
Figure QLYQS_132
,/>
Figure QLYQS_133
Respectively representing numerical values of Red, green and Blue channels after gamma conversion is carried out on the mth pixel point of the source image;
(4) XYZ space normalization:
Figure QLYQS_134
;
Figure QLYQS_135
respectively representing the normalized numerical values of the mth pixel point of the source image in an XYZ space; />
Figure QLYQS_136
,/>
Figure QLYQS_137
Figure QLYQS_138
Respectively representing the values of the mth pixel point of the source image in an XYZ space;
(5) Carrying out nonlinear change:
Figure QLYQS_139
;
Figure QLYQS_140
;/>
Figure QLYQS_141
respectively represents the normalized value of the mth pixel point of the source image in an XYZ space, a represents the function independent variable and the device>
Figure QLYQS_142
Representing a non-linear variation function;
(6) Conversion from XYZ space to LAB space:
Figure QLYQS_143
;
Figure QLYQS_144
;
Figure QLYQS_145
;
Figure QLYQS_146
,/>
Figure QLYQS_147
,/>
Figure QLYQS_148
respectively representing the numerical values of three corresponding channels after the mth pixel point of the source image is converted into an LAB space,
Figure QLYQS_149
respectively representing the normalized numerical values of the mth pixel point of the source image in an XYZ space;
r, G, B represent red, green, blue channel symbolic representations of the R image, respectively.
6. The image color style migration method according to claim 1, characterized in that in step C1, it comprises the sub-steps of: initializing variance
Figure QLYQS_150
,/>
Figure QLYQS_151
Setting an optimization factor and setting a maximum number of iterations>
Figure QLYQS_152
(ii) a Setting an initialization iteration count ≧>
Figure QLYQS_153
Means->
Figure QLYQS_154
Represents the mth initialization variance, < >>
Figure QLYQS_155
Represents a set, <' > based on>
Figure QLYQS_156
Indicating the value of the initialized pixel.
7. A computer arrangement comprising a processor and a memory, in which a computer program is stored which, when loaded by the processor, carries out the method according to any one of claims 1 to 6.
8. A readable storage medium, in which a computer program is stored which, when being loaded by a processor, is adapted to carry out the method according to any one of claims 1 to 6.
CN202211587298.1A 2022-12-12 2022-12-12 Image color style migration method, device and medium Active CN115587930B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211587298.1A CN115587930B (en) 2022-12-12 2022-12-12 Image color style migration method, device and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211587298.1A CN115587930B (en) 2022-12-12 2022-12-12 Image color style migration method, device and medium

Publications (2)

Publication Number Publication Date
CN115587930A CN115587930A (en) 2023-01-10
CN115587930B true CN115587930B (en) 2023-04-18

Family

ID=84783218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211587298.1A Active CN115587930B (en) 2022-12-12 2022-12-12 Image color style migration method, device and medium

Country Status (1)

Country Link
CN (1) CN115587930B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116934936A (en) * 2023-09-19 2023-10-24 成都索贝数码科技股份有限公司 Three-dimensional scene style migration method, device, equipment and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110009708A (en) * 2019-04-10 2019-07-12 上海大学 Color development transform method, system and terminal based on color segmentation
CN111476831A (en) * 2020-03-20 2020-07-31 清华大学 PCB image color migration device and method based on cluster analysis

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9516197B2 (en) * 2014-10-21 2016-12-06 Pixspan, Inc. Apparatus and method for lossless compression of raw color sensor data from a color array filtered image sensor
CN104732506B (en) * 2015-03-27 2018-04-10 浙江大学 A kind of portrait photographs' Color Style conversion method based on face semantic analysis
US11544823B2 (en) * 2019-06-12 2023-01-03 Intel Corporation Systems and methods for tone mapping of high dynamic range images for high-quality deep learning based processing
CN111696062A (en) * 2020-06-14 2020-09-22 荆门汇易佳信息科技有限公司 Color-balanced non-deformable DOM local repair aggregation method
CN113298704B (en) * 2021-07-27 2021-11-09 成都索贝数码科技股份有限公司 Skin color segmentation and beautification method by utilizing graph migration under broadcast television news
CN113656627B (en) * 2021-08-20 2024-04-19 北京达佳互联信息技术有限公司 Skin color segmentation method and device, electronic equipment and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110009708A (en) * 2019-04-10 2019-07-12 上海大学 Color development transform method, system and terminal based on color segmentation
CN111476831A (en) * 2020-03-20 2020-07-31 清华大学 PCB image color migration device and method based on cluster analysis

Also Published As

Publication number Publication date
CN115587930A (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN108428229B (en) Lung texture recognition method based on appearance and geometric features extracted by deep neural network
CN102982544B (en) Many foreground object image interactive segmentation method
WO2020005650A1 (en) Image colorization based on reference information
CN109849576B (en) Method for assisting drawing by referring to gray level diagram
CN104732506A (en) Character picture color style converting method based on face semantic analysis
CN115587930B (en) Image color style migration method, device and medium
CN111325750B (en) Medical image segmentation method based on multi-scale fusion U-shaped chain neural network
CN105631807A (en) Single-frame image super resolution reconstruction method based on sparse domain selection
CN105957124B (en) With the natural image color edit methods and device for repeating situation elements
CN110400275A (en) One kind being based on full convolutional neural networks and the pyramidal color calibration method of feature
WO2022062164A1 (en) Image classification method using partial differential operator-based general-equivariant convolutional neural network model
CN108198196A (en) The design and implementation methods of quantum Image Edge-Detection based on Sobel operators
CN112884758A (en) Defective insulator sample generation method and system based on style migration method
CN115760552A (en) Face image makeup migration method and system based on image makeup migration network
CN103413331A (en) High-resolution video image content sparse expression method supporting edition and propagation
CN103500447B (en) Video foreground and background partition method based on incremental high-order Boolean energy minimization
CN115601744B (en) License plate detection method for vehicle body and license plate with similar colors
CN116469103A (en) Automatic labeling method for medical image segmentation data
CN115019038B (en) Similar image pixel level semantic matching method
CN115018729A (en) White box image enhancement method for content
CN105957013B (en) A kind of single image super-resolution reconstruction method
CN116823700A (en) Image quality determining method and device
Dai et al. Automatic image vectorization using superpixels and random walkers
CN113344771A (en) Multifunctional image style migration method based on deep learning
CN106204451B (en) Based on the Image Super-resolution Reconstruction method for constraining fixed neighborhood insertion

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant