CN105069465A - Color conversion method based on L0 gradient maintenance - Google Patents
Color conversion method based on L0 gradient maintenance Download PDFInfo
- Publication number
- CN105069465A CN105069465A CN201510433574.2A CN201510433574A CN105069465A CN 105069465 A CN105069465 A CN 105069465A CN 201510433574 A CN201510433574 A CN 201510433574A CN 105069465 A CN105069465 A CN 105069465A
- Authority
- CN
- China
- Prior art keywords
- sample
- color
- original image
- dominant hue
- gradient
- 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.)
- Granted
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/23—Clustering techniques
- G06F18/232—Non-hierarchical techniques
- G06F18/2321—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions
- G06F18/23213—Non-hierarchical techniques using statistics or function optimisation, e.g. modelling of probability density functions with fixed number of clusters, e.g. K-means clustering
Landscapes
- Engineering & Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Artificial Intelligence (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Computational Biology (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Evolutionary Biology (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Probability & Statistics with Applications (AREA)
- Image Processing (AREA)
Abstract
The invention discloses a color conversion method based on L0 gradient maintenance. The method comprises the steps of: firstly according to color characteristics, carrying out clustering on an original image and a reference image, and extracting main colors so as to establish a color mapping relation between the original image and the reference image; then sampling the original image, and converting mappings of different colors to corresponding samples; utilizing the similarity between the samples and the main colors and the similarity among the samples to carry out optimization on sample editing; and finally considering gradients of different object edges to depict details. According to the invention, an optimization module is established based on the L0 gradient maintenance is adopted for optimizing details and edges of the image. The method ensures that pixels similar in color of the original image are still similar after editing, the details and edge structures of the image can be maintained, and that is to say, the editing differences among different colors are relatively large.
Description
Technical field
The present invention relates to technical field of image processing, particularly relate to a kind of color changeover method kept based on L0 gradient.
Background technology
Color conversion revises the color of original image to be edited, and to looking for novelty, image its new color while maintenance original image content is consistent with the domain color of reference picture.Main consideration two aspects: one is color map, how exactly with reference to the color map of image on original image.Two is Hemifusus ternatanus, how to make the details of newly-generated image consistent with original image.
In order to make the color of new images and the consistent of reference picture, there has been proposed various scheme, but still have some problems to need to solve.One is the selection that the effect of new images is overly dependent upon reference picture, when the color distribution of reference picture and the matching degree of original image lower time, still similar after similar color map can not be ensured; Two is due between each component of color and non-fully linear independence or due to mapping techniques, and improper new color may be had after mapping to occur.
In order to keep the details of original image, the technology that various local feature keeps comes into question.But, in color conversion processes, various dominant hue maps usually in different ways, there is at adjacent two the edges of regions of different dominant hue, their structure will no longer keep, and existing be that explicit gradient keeps constraint or implicit Filtering Model all to adopt unified mode to treat all pixels, the edge of image may be occurred, and fuzzy or details can not much keep.Because most of pixel keeps its local feature, and the feature of these edge pixels will change.
Summary of the invention
The object of the invention is the defect in order to overcome prior art, proposing a kind of color changeover method kept based on L0 gradient.The present invention adopt extract dominant hue and the mapping techniques set up between the corresponding dominant hue of original image and reference picture to reduce the conforming requirement of color probability distribution treating manuscript map picture and reference picture.The scheme that L0 gradient keeps the no longer all pixels of mandatory requirement keeps original Grad, and compare with method in the past, it has desirable edge retention performance, even if the conversion regime in adjacent two regions differs greatly.
For achieving the above object, present invention employs a kind of color changeover method kept based on L0 gradient, comprise three parts: dominant hue maps, sample of color conversion and details optimization, be specially: first according to color characteristic cluster carried out to original image and reference picture and extract dominant hue to set up the color map relation between original image and reference picture, then to original image sampling and by the Mapping and Converting of different dominant hue in respective sample, the similarity between the similarity of sample and dominant hue and sample is utilized to be optimized sample editor, finally adopt and keep setting up Optimized model based on L0 gradient, to details and the edge optimization of image.
Preferably, when dominant hue maps: original image and reference picture use k-means algorithm to carry out cluster, and calculate average corresponding to each class and variance, each class represents a kind of dominant hue; Utilize these dominant hue information, set up a similar matrix, obtain similarity between any two, then adopt two term diagram maximum matching algorithms to set up mapping between original image and reference picture dominant hue.
Preferably, when sample of color maps: super-pixel segmentation is done to original image, and the center of extracting each super-pixel is as sample.The initial conversion color of this sample of mapping calculation of class dominant hue belonging to each sample, then the similarity according to sample point and corresponding cluster centre is higher, and the more accurate and Similar color of initial conversion color follows the sample conversion color correction of principle to cluster mistake of similarity transformation.
Preferably, when details is optimized: the converting colors of each sample is diffused into all pixels of corresponding super-pixel, set up L0 gradient based on the transformable thought of edge pixel gradient and keep Optimized model.This model is a non-convex problem, alternative manner substep is adopted to solve, first estimate the Grad of each pixel, then be convex optimization direct solution by model conversation, Grad is recalculated again according to trying to achieve result, loop iteration is until parameter reaches given threshold value, and the final pixel color value calculated is transformation result.
Beneficial effect of the present invention:
(1) color changeover method of the present invention is still similar after can making similar color conversion, even and if the conversion regime of each domain color of the clear maintenance of the marginal texture of image differ greatly.
(2) optimal way adopting L0 gradient to keep not only can solve previous methods edge blurring problem can keep image detail simultaneously well.
(3) Dominant Color Matching mode is adopted, and matching result is first tentatively mapped to sample corrects again, then still similar after technology correction result being diffused into all pixels can guarantee similar color conversion, and new color and reference picture solid colour.
Accompanying drawing explanation
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, be briefly described to the accompanying drawing used required in embodiment or description of the prior art below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, under the prerequisite not paying creative work, other accompanying drawing can also be obtained according to these accompanying drawings.
Fig. 1 is the process flow diagram of the color changeover method based on the maintenance of L0 gradient of the present invention;
In Fig. 2, a-d is the design sketch based on the color changeover method of L0 gradient maintenance in the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, be clearly and completely described the technical scheme in the embodiment of the present invention, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiments.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtained under creative work prerequisite, belong to the scope of protection of the invention.
The present invention proposes a kind of color changeover method kept based on L0 gradient, it comprises three steps: dominant hue maps, sample of color is changed and details optimization.Be illustrated in figure 1 method flow diagram of the present invention, be specially: first according to color characteristic cluster carried out to original image and reference picture and extract dominant hue to set up the color map relation between original image and reference picture, then to original image sampling and by the Mapping and Converting of different dominant hue in respective sample, consider may there is mistake correspondence between sample and dominant hue, the similarity between the similarity of sample and dominant hue and sample is utilized to be optimized sample editor, finally consider that the gradient at different objects edge portrays the details of object, adopt and keep setting up Optimized model based on L0 gradient, to details and the edge optimization of image.Concrete steps are as follows:
(1) dominant hue maps
Adopt K-means algorithm by the original image I of input
swith reference picture I
rgather respectively for n
sand n
rclass, the color average of the i-th class
with variance δ
ibe expressed as
Wherein P
irepresent the i-th class pixel, | P
i| represent the number of pixel, I (p) represents the color value of pixel p.
Every class represents a kind of dominant hue, and every class color average represents dominant hue color, adopts two term diagram maximum matching algorithms to set up mapping between original image and reference picture dominant hue.Define a n
s× n
rsimilar matrix S
sR, wherein
measure former dominant hue
with reference dominant hue
between similarity.Then two term diagram maximum matching algorithms are adopted to find an optimum coupling π: { 1 .., n
s} → { 1 ..., n
r, make
maximize.
(2) sample of color conversion
Owing to may there is the pixel of cluster by mistake during cluster, it will depart from correct color conversion mode, thus cause obvious flaw.In order to correct such pixel, considering that adjacent color similar pixel in position follows similar conversion regime, super-pixel segmentation being done to original image, selects the pixel of each super-pixel center as sample, first these samples are processed.
The dominant hue mapping mode that class η (k) is corresponding belonging to sample k, calculates the initial editing value q of these samples
k, its computing method are
According to sample and dominant hue color more close, thought still similar after the sample editor that initial editing value is more accurate and position adjacent color is similar is corrected cluster error sample editing value.Using these samples as summit, adopt Delaunay algorithm to build two-dimentional triangle gridding, search the adjacent sample point of each sample according to these triangle griddings.So the optimization method that sample is corrected is:
Wherein
β
kl=exp (-(I
s(k)-I
s(l))/δ), Q
sbe sample set, N (k) is the k neighborhood of sample,
be the color average of current sample k place class, solve this equation and can obtain rectification sample of color g
kvalue.
(3) details optimization
By the new color value g of each sample after rectification
kother pixels of its place super-pixel of direct imparting, obtain color map image
such image lacks detailed information, needs to do further details optimization.Consider that different dominant hues may adopt different conversion regimes, for two regions that locus adjacent main tone is different, the gradient at its edge will change.And L0 gradient keeps allowing the gradient of partial pixel no longer to keep, compare with method in the past, it has desirable edge retention performance.
If the new images after color conversion is I
t, its should as far as possible with color map result
color value consistent, meet most pixel simultaneously and retain original image I
sgradient, adopt L0 gradient to keep the majorized function set up to be
Equation (1) cannot direct solution, first does it reasonably lax, then adopts the mode of loop iteration to solve.Its process is
I () introduces companion matrix t, equation (1) can be rewritten as
Wherein L (t)=|| t
t||
1,0the L of transposed matrix t
1,0norm, its statistics | t (i, 1) |+| t (i, 2) |, i=1 ..., N
sin the number of non-zero element.
(ii) equation (2) adopts the method for loop iteration to solve, in each cyclic process, t and I
tinterleaved computation, weights v increases gradually, as v → ∞, equation (2) and equation (1) equivalence.When realizing, the maximal value arranging weights v is 10
5.
The first stage of each circulation, first calculate t, I
tfor the iteration result of last time, under initial situation
equation (2) is rewritten as
Its optimization is
Subordinate phase, fixing t, equation (2) is about I
tmajorized function can be written as
Adopt fast fourier transform speed-up computation I
tfor
When weights v reaches given threshold value, according to the I that equation (6) calculates
tclose to equation (1), now new images color is consistent with reference picture, and keeps original image details.
Be illustrated in figure 2 in the embodiment of the present invention based on the design sketch that the color changeover method of L0 gradient maintenance produces, a-d is former figure respectively, reference diagram, color conversion effect figure and the color conversion effect figure kept based on L0 gradient, therefrom can find out that color is changed well from reference diagram to come, and original image details is also recovered in good condition, even if for tiny details.
In specific embodiment of the invention process, the color conversion effect figure based on the maintenance of L0 gradient that μ value difference obtains is different, when μ is less, more gradient can not keep, occur the situation of loss in detail, and the gradient stricter when μ is excessive keeps making to occur color blend between different switching pattern.
Above a kind of color changeover method kept based on L0 gradient that the embodiment of the present invention provides is described in detail, apply specific case herein to set forth principle of the present invention and embodiment, the explanation of above embodiment just understands method of the present invention and core concept thereof for helping; Meanwhile, for one of ordinary skill in the art, according to thought of the present invention, all will change in specific embodiments and applications, in sum, this description should not be construed as limitation of the present invention.
Claims (5)
1. the color changeover method kept based on L0 gradient, it is characterized in that, the method comprises three steps: dominant hue maps, sample of color conversion and details optimization, be specially: first according to color characteristic cluster carried out to original image and reference picture and extract dominant hue to set up the color map relation between original image and reference picture, then to original image sampling and by the Mapping and Converting of different dominant hue in respective sample, the similarity between the similarity of sample and dominant hue and sample is utilized to be optimized sample editor, finally adopt and keep setting up Optimized model based on L0 gradient, to details and the edge optimization of image.
2. method according to claim 1, is characterized in that, when dominant hue maps, original image and reference picture use k-means algorithm to carry out cluster, and calculate average corresponding to each class and variance, each class represents a kind of dominant hue; Utilize these dominant hue information, set up a similar matrix, obtain similarity between any two, then adopt two term diagram maximum matching algorithms to set up mapping between original image and reference picture dominant hue.
3. method according to claim 1 and 2, it is characterized in that, super-pixel segmentation is done to original image, and the center of extracting each super-pixel is as sample, the initial conversion color of this sample of mapping calculation of class dominant hue belonging to each sample, then the similarity according to sample point and corresponding cluster centre is higher, and the more accurate and Similar color of initial conversion color follows the sample conversion color correction of principle to cluster mistake of similarity transformation.
4. method according to claim 3, it is characterized in that, using the center of each super-pixel as sample, using this sample as summit, adopt Delaunay algorithm to build two-dimentional triangle gridding, search the adjacent sample point of each sample according to these triangle griddings; So the optimization method that sample is corrected is:
Wherein
β
kl=exp (-(I
s(k)-I
s(l))/δ), Q
sbe sample set, N (k) is the k neighborhood of sample,
it is the color average of current sample k place class.
5. method according to claim 4, is characterized in that, when details is optimized, the converting colors of each sample is diffused into all pixels of corresponding super-pixel, sets up L0 gradient keep Optimized model based on the transformable thought of edge pixel gradient; The majorized function adopting the maintenance of L0 gradient to set up is:
Alternative manner substep is adopted to solve, first estimating the Grad of each pixel, is then convex optimization direct solution by model conversation, then recalculates Grad according to trying to achieve result, loop iteration is until parameter reaches given threshold value, and the final pixel color value calculated is transformation result.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510433574.2A CN105069465B (en) | 2015-07-21 | 2015-07-21 | A kind of color changeover method kept based on L0 gradients |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201510433574.2A CN105069465B (en) | 2015-07-21 | 2015-07-21 | A kind of color changeover method kept based on L0 gradients |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105069465A true CN105069465A (en) | 2015-11-18 |
CN105069465B CN105069465B (en) | 2018-06-08 |
Family
ID=54498826
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201510433574.2A Active CN105069465B (en) | 2015-07-21 | 2015-07-21 | A kind of color changeover method kept based on L0 gradients |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105069465B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106898026A (en) * | 2017-03-15 | 2017-06-27 | 腾讯科技(深圳)有限公司 | The dominant hue extracting method and device of a kind of picture |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102360506A (en) * | 2011-09-30 | 2012-02-22 | 北京航空航天大学 | Local linear preserver-based scene color style uniformizing method |
CN102521807A (en) * | 2011-12-02 | 2012-06-27 | 中国科学院自动化研究所 | Method for transferring colors by utilizing color space distribution |
-
2015
- 2015-07-21 CN CN201510433574.2A patent/CN105069465B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102360506A (en) * | 2011-09-30 | 2012-02-22 | 北京航空航天大学 | Local linear preserver-based scene color style uniformizing method |
CN102521807A (en) * | 2011-12-02 | 2012-06-27 | 中国科学院自动化研究所 | Method for transferring colors by utilizing color space distribution |
Non-Patent Citations (3)
Title |
---|
XUEZHONG,XIAO ET AL.: "Gradient-Preserving Color Transfer", 《COMPUTER GRAPHICS FORUM》 * |
王少荣等: "一种图像之间的颜色传输方法", 《计算机辅助设计与图形学学报》 * |
陈海等: "保持细节的局部颜色迁移改进算法", 《计算机科学》 * |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106898026A (en) * | 2017-03-15 | 2017-06-27 | 腾讯科技(深圳)有限公司 | The dominant hue extracting method and device of a kind of picture |
CN106898026B (en) * | 2017-03-15 | 2019-02-05 | 腾讯科技(深圳)有限公司 | A kind of the dominant hue extracting method and device of picture |
Also Published As
Publication number | Publication date |
---|---|
CN105069465B (en) | 2018-06-08 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108921786B (en) | Image super-resolution reconstruction method based on residual convolutional neural network | |
CN108734659B (en) | Sub-pixel convolution image super-resolution reconstruction method based on multi-scale label | |
CN103093444B (en) | Image super-resolution reconstruction method based on self-similarity and structural information constraint | |
CN106780367B (en) | HDR photo style transfer method dictionary-based learning | |
CN112435191B (en) | Low-illumination image enhancement method based on fusion of multiple neural network structures | |
CN107507138A (en) | A kind of underwater picture Enhancement Method based on Retinex model | |
CN110728640B (en) | Fine rain removing method for double-channel single image | |
CN109785236B (en) | Image super-resolution method based on super-pixel and convolutional neural network | |
CN105631807A (en) | Single-frame image super resolution reconstruction method based on sparse domain selection | |
CN103617596A (en) | Image color style transformation method based on flow pattern transition | |
CN113870124B (en) | Weak supervision-based double-network mutual excitation learning shadow removing method | |
CN116485785A (en) | Surface defect detection method for solar cell | |
CN105761292A (en) | Image rendering method based on color shift and correction | |
CN116797468A (en) | Low-light image enhancement method based on self-calibration depth curve estimation of soft-edge reconstruction | |
CN113870130A (en) | Low-rank tensor completion method based on three-dimensional total variation and Tucker decomposition | |
CN105069465A (en) | Color conversion method based on L0 gradient maintenance | |
CN104143203A (en) | Image editing and communication method | |
CN110111342A (en) | A kind of optimum option method and device of stingy nomography | |
CN106504203B (en) | Block matching image restoration method applying screening strategy | |
CN111275620B (en) | Image super-resolution method based on Stacking integrated learning | |
CN117333359A (en) | Mountain-water painting image super-resolution reconstruction method based on separable convolution network | |
CN104240197A (en) | Achromatic algorithm capable of maintaining contrast ratio, color consistency and gray pixel characteristics | |
CN115908178A (en) | Underwater image restoration method based on dark channel prior | |
CN101938661B (en) | Method and device for processing image and video image frame | |
CN115689871A (en) | Unsupervised portrait image color migration method based on generation countermeasure network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |