CN106780367A - HDR photo style transfer methods based on dictionary learning - Google Patents
HDR photo style transfer methods based on dictionary learning Download PDFInfo
- Publication number
- CN106780367A CN106780367A CN201611058620.6A CN201611058620A CN106780367A CN 106780367 A CN106780367 A CN 106780367A CN 201611058620 A CN201611058620 A CN 201611058620A CN 106780367 A CN106780367 A CN 106780367A
- Authority
- CN
- China
- Prior art keywords
- photo
- color
- hdr
- dictionary
- 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
- 238000000034 method Methods 0.000 title claims abstract description 53
- 238000012546 transfer Methods 0.000 title claims abstract description 46
- 238000012549 training Methods 0.000 claims abstract description 30
- 238000010422 painting Methods 0.000 claims description 14
- 238000005457 optimization Methods 0.000 claims description 13
- 239000011159 matrix material Substances 0.000 claims description 12
- 238000013507 mapping Methods 0.000 claims description 9
- 238000000354 decomposition reaction Methods 0.000 claims description 6
- 239000000284 extract Substances 0.000 claims description 6
- 238000011282 treatment Methods 0.000 claims description 6
- 238000012545 processing Methods 0.000 claims description 5
- 239000000203 mixture Substances 0.000 claims description 3
- 239000013598 vector Substances 0.000 claims description 3
- 231100000289 photo-effect Toxicity 0.000 abstract 1
- 230000002708 enhancing effect Effects 0.000 description 8
- 230000000694 effects Effects 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 4
- 239000003086 colorant Substances 0.000 description 3
- 238000003709 image segmentation Methods 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000001914 filtration Methods 0.000 description 2
- 238000010428 oil painting Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 241000208340 Araliaceae Species 0.000 description 1
- 235000005035 Panax pseudoginseng ssp. pseudoginseng Nutrition 0.000 description 1
- 235000003140 Panax quinquefolius Nutrition 0.000 description 1
- 230000006978 adaptation Effects 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000000605 extraction Methods 0.000 description 1
- 239000004744 fabric Substances 0.000 description 1
- 230000004927 fusion Effects 0.000 description 1
- 235000008434 ginseng Nutrition 0.000 description 1
- 238000009499 grossing Methods 0.000 description 1
- 230000003760 hair shine Effects 0.000 description 1
- 238000005286 illumination Methods 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 108090000623 proteins and genes Proteins 0.000 description 1
- 238000009877 rendering Methods 0.000 description 1
- 238000005728 strengthening Methods 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Classifications
-
- G06T5/92—
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T2207/00—Indexing scheme for image analysis or image enhancement
- G06T2207/20—Special algorithmic details
- G06T2207/20081—Training; Learning
Abstract
The present invention relates to a kind of HDR photo style transfer methods based on dictionary learning.Photo is referred to by giving a HDR, by color transfer and dictionary learning, HDR style and features is transferred on the photo of source, so as to automatically generate HDR photo effects.The method it is as follows including step:(1) the color transfer method kept by gradient, HDR is transferred on the photo of source with reference to the color characteristic of photo;(2) minutia is extracted with reference to photo to HDR, dictionary training is carried out using K_SVD algorithms, form the excessively complete wordbook of details;(3) sparse reconstruction is carried out to source photo using the excessively complete wordbook of details, generation refers to the consistent details of photo eigen with HDR;(4) result that the result and details for shifting color are rebuild merges, and ultimately generates the new photo of HDR styles.The inventive method clear process, structural integrity, realize efficiency high.
Description
Technical field
The present invention relates to a kind of HDR (High Dynamic Range, HDR) photo wind based on dictionary learning
Lattice transfer method, belongs to image processing field.
Background technology
Stylized technology, (i.e. NPR, Non-Photorealistic Rendering) is rendered also known as feeling of unreality, is meter
The research field that calculation machine technology and drawing techniques are combined, refers to using computer figure skill of the generation with artistic style
Art.At present, many high-performance cameras are (for example:Canon 5D Mark III, Nikon D800 etc.) can be by three different journeys
The exposure (owing exposure, normal, overexposure) of degree, is automatically synthesized a series of HDR photos.There is the photo of these HDR styles style to show
The features such as work, details are abundant, color is full, presents abundant art features, and typical HDR photos style includes:It is natural, floating
Carving, drawing, oil painting etc..The HDR effects of camera shooting are different from, people are more desirable to realize various HDR photos in common photo
Style, makes common photo also to represent the artistic charm of uniqueness, thus many HDR photos generation software (for example:HDR
Making, Dynamic Photo HDRI etc.) gradually come into vogue, wherein most is entering to color and details manually
Row adjustment realizes, not only interact it is cumbersome, waste time and energy, and the HDR effect stabilities of generation are poor, in contrast to actual photographed
HDR effect gaps it is larger, it is impossible to ideally show the artistry of photo.
Current researcher both domestic and external has been proposed many methods on color of image transfer and image enhaucament:
Reinhard et al. proposes the color branching algorithm based on statistics on the basis of color space l α β, in l α β colors
Statistical information --- average and the variance of spatial match two images each Color Channels, then change the color point in source images
Cloth makes it match the distribution of reference picture.
Chang et al. proposes a kind of color transfer method based on sample, and the color characteristic according to sample image is to source
The color of image is adjusted, and source images is possessed the color similar to sample image while own profile is kept, the calculation
Method improves the accuracy of color transfer matching process, improves the effect of color transfer.
Xiao et al. proposes the color branching algorithm of gradient holding, the optimization mould kept by Histogram Matching and gradient
Type improves the effect of color transfer.
Luan et al. develops an interactive tool and is shifted for local color, maintains global continuity.Wen
Et al. propose a color transfer system based on paintbrush, user can change its Color Style with designated local region.
Tai et al. proposes the color branching algorithm based on image segmentation, mainly by image segmentation, cut zone match colors
Three parts are combined with cut zone to constitute.Wherein pixel is estimated in mixed Gaussian in image segmentation part using improved EM algorithms
Distribution of color under model.Improved EM obtains more accurate pixel color distribution by the way of iteration renewal.
Fattal et al. does smoothing processing to image and obtains Primary layer and levels of detail using the wave filter that border keeps, finally
The details enhancing of image is realized by adjusting zoom factor.
Qin et al. proposes the Retinex structure light images enhancing algorithm of HSV color spaces.First by traditional rgb space
Multi-Scale Retinex Algorithm be transformed into hsv color space;Then in strengthening model by analyzing hsv color spatial model
V component, while making S components with the enhancing self-adaptative adjustment of V component using coefficient correlation;Finally HSV model conversions are arrived
Rgb space, makes enhanced color of image be maintained.
Xiao et al. proposes that a kind of rapid image based on different color spaces fusion strengthens algorithm, and the algorithm exists first
HSV space carries out enhancing treatment to luminance component V passages, while in the log-domain reflecting component that obtains of stretching to certain dynamic
During scope, enhancing Dynamic gene is introduced, adjust the enhancing degree of different brightness values to avoid noise from amplifying and color distortion phenomenon;
Then, in rgb color space, halation Producing reason is analyzed, and halation is eliminated using improved Gaussian filter, and in meter
When calculating reflecting component, by the fidelity of parameter adjustment color of image.Finally, the result in two kinds of different colours spaces is entered
Row weighted average enhancing image the most final.
Zhou et al. proposes a kind of Retinex Algorithm of color image enhancement based on improvement Mean Shift filtering, first
Soft image is decomposed into by brightness and color two parts using PCA, by the existing Mean Shift that take on a new look
Filtering method realizes the self adaptation enhancing of illumination component, and color channel is recovered, finally enterprising on global analysis basis
Row image compensation.
In order to solve the above problems, the research based on more than, we are on the basis of color of image transfer and image enhaucament
Propose a kind of HDR photo style transfer methods based on dictionary learning.
The content of the invention
It is the defect existed for prior art that the purpose of the present invention is, there is provided a kind of HDR based on dictionary learning shines
Piece style transfer method.Two aspects are paid close attention in the invention:First, how to avoid the manual interaction of complexity;Second, how to give birth to
Into high-quality HDR effects.With reference to the treatment technology based on sample, i.e., characteristic information extraction is carried out certainly to source information from sample
Dynamic adjustment and treatment, we are generated it is also contemplated that being interacted to simplify using HDR photo samples with effect, that is, giving one has
The sample photo of HDR styles, therefrom extracts required color and minutia, and these features is automatically transferred into source and shine
On piece, so as to generate the new photo with HDR styles.
To reach above-mentioned purpose, the present invention is adopted the following technical scheme that:
A kind of HDR photo style transfer methods based on dictionary learning, concrete operation step is as follows:
(1) the color transfer method kept by gradient, HDR is transferred on the photo of source with reference to the color characteristic of photo;
(2) minutia is extracted with reference to photo to HDR, dictionary training is carried out using K_SVD algorithms, form the excessively complete of details
Standby wordbook;
(3) sparse reconstruction is carried out to source photo using the excessively complete wordbook of details, generation refers to photo eigen one with HDR
The details of cause;
(4) result that the result and details for shifting color are rebuild merges, and ultimately generates the new photo of HDR styles.
The algorithm kept using gradient in the step (1) carries out color transfer to source HDR photos, the ginseng that user is admired
The style for examining photo is transferred on the photo of source, source photo is had the Color Style with reference to photo, while keeping the ladder of source photo
Degree feature, comprises the following steps that:
By solving the energy equation related to color, the two energy terms of gradient, retain the structural information of source photo, most
The color transfer result of high-fidelity is obtained eventually, the problem that color is shifted is converted into and solves following energy equation:
Wherein Ec, EdAt the end of representing that the energy term related to color, gradient, Φ, R, I represent that color is shifted respectively respectively
Output image, reference picture, source images;H () is represented and Histogram Matching is done to image, and G () is represented and obtained image gradient,
ωc, ωdColor component, the weight of gradient component are represented respectively;
1) color mapping
In (1) formula, the energy term E of color mapping is definedc, solved by following formula (2):
Wherein H () represents the Color histogram distribution of image, and k represents histogram sequence number, and n represents interval sum;
In order to obtain color mapping result, the Color histogram distribution of output image must be with the Color histogram distribution phase of reference picture
Matching;In order to solve conveniently, the histogram of source images is matched with the histogram of reference picture, obtained a middle graph
Picture, the accurate distribution of color for maintaining reference picture of the image;Simultaneously in order to avoid the influence to structure, to intermediate image
Decomposed, obtained levels of detail and Hue layer F, color treatments are done in Hue layer, therefore formula (2) is newly defined as:
Wherein Φ represents the image of output, and p represents the pixel of image, and the knot that color maps is obtained by solution formula (3)
Really;
2) gradient keeps
Levels of detail has been separated when being mapped due to color, therefore the result for obtaining loses structural fidelity, according to solution formula
(1) the energy term E of statement indThe Gradient Features of source images can be kept, is represented with following formula (4):
WhereinGradient operator is represented, p represents the pixel on image, and m represents total pixel, and λ represents regulation image pair
Than the parameter of degree;Work as λ>When 1, increase contrast;Work as λ<When 1, reduce contrast;When λ=1, keep contrast constant;
Optimization can effectively keep the prototype structure feature of source images in gradient field, in order to keep the ladder of source images
Degree, the gradient of source images is calculated first with Sobel difference operator, then according to the demand of user, determines the parameter of contrast
λ, obtains the result of source images gradient holding, obtains EcAnd EdAfterwards, substitute into formula (1) and obtain color transfer result.
The step (2) extracts minutia to HDR with reference to photo, and dictionary training is carried out using K_SVD algorithms, obtains thin
The excessively complete wordbook D of section, concretely comprises the following steps:
One HDR embossment of selection or painting style photo, in order to improve the quality of reconstruction image, are needed as reference picture
Reference picture pre-processed, first extract its minutia with weighted least-squares method WLS wave filters, then taken at random
100000 fritters of 5x5, as training sample set Y;
By the training sample set Y for extracting, learn an excessively complete dictionary with HDR embossments or painting style feature
D;Using K_SVD Algorithm for Training, to the training process of HDR photo styles, represented using equation below:
Wherein D={ d1,d2…dk}∈Rr×k(k > r) is that excessively complete the redundant dictionary D, α obtained by study are training
Sparse coefficient vectors of the sample set Y on dictionary D, δ represents αiThe upper limit of middle nonzero element number,Represent training
The total reconfiguration error of sample set Y;
Using Y as K_SVD algorithms input, two stages according to dictionary learning, in the sparse coding stage, by initial
Change dictionary D, then normalize dictionary D, rarefaction representation coefficient squares of the Y on dictionary D is obtained using orthogonal matching pursuit OMP algorithms
Battle array α;In the dictionary updating stage, according to the sparse matrix factor alpha obtained, dictionary atom is updated by column;Meet k iteration or
When meeting the condition of convergence, the excessively complete dictionary D of final optimization pass is obtained;During dictionary D is updated, it is assumed that dkExpression will be more
The kth row of new dictionary, αkThe corresponding sparse coefficient of the row is represented, formula (5) is rewritten as follows:
Wherein D α are broken down into the sum of the matrix that k order is 1, it is assumed that wherein k-1 is all fixed, and remaining 1 row are just
It is the kth to be updated row;(6) the matrix E in formulakRepresent and remove removal atom dkError of the remaining composition in sample set Y afterwards;
E is updated using the method for singular value decomposition SVDkWithFound by the method and EkDifference is minimum and order is 1
Matrix, can effectively reduce the global reconstruction error of training sample;But due to what is obtained by singular value decompositionIt is not
Sparse, i.e.,Before renewalThe position of nonzero element and in different size, causes the dictionary for obtaining not compact;Therefore,
Using only retainingIn nonzero term, recycle SVD methods to update αkAnd dk, until completing dictionary updating by column, by this
The dictionary D that method is obtained can well represent the characteristic of sample.
The step (3) uses the thought of sparse expression, and the dictionary obtained using step (2) learning is carried out to source photo
Sparse reconstruction, the generation details consistent with reference photo eigen, comprises the following steps that:
The FSS algorithms that Lee is proposed are used for reference in rarefaction representation part, and algorithm flow is as follows:
(1) it is input into:The source photo X of common style, with reference to the training dictionary D of photo;
(2) minutia is gone out to source photo X profit WLS filter equalizers, and carries out optimization processing, obtain image X1;
(3) bad process is followed:From image X1The image block x that size is 5 × 5 is taken out in the upper left corner successively, and each fritter is extracted
Minutia, then each fritter is become 25 × 1 column signalObtain rarefaction representation system of each column signal under dictionary D
Number α, specially:
Step 1. calculates the average value m of image block x;
D known to step 2. andSparse coefficient α is solved by following expression formula,
Wherein, λ1Regularization parameter is represented, for Equilibrium fitting error term and sparse constraint, λ1Span is 0 and 1
Between;
The relief style image block that step 3. is estimated is D α, and the embossment/painting style image block of output is x*=m+D α;
(4) export:The fritter of sparse reconstruction is recovered by original position, obtain with details enrich embossment or
Person's painting style image X*。
The result that the result and details that the step (4) shifts color are rebuild merges, and ultimately generates the new photograph of HDR styles
Piece, concretely comprises the following steps:
Because HDR photos have two features of aspect of color and details, by using the color and details of reference picture
The tutorial message of aspect, has respectively obtained the result of source photo color transfer and the result of the sparse reconstruction of source photo;Finally, need
By the two results merge, make source photo on tone and details all have HDR styles the characteristics of;Merging process reality etc.
Imitate in an energy equation comprising data item and gradient terms is solved, wherein data item is the result of color transfer, and gradient terms
It is the result of details reconstruction, is represented with following formula:
Wherein Φ*, Φ, X*The HDR style photos for ultimately generating are represented respectively, and source photo color shifts result, source photo
Sparse reconstructed results;P represents the pixel on photo, λ*Gradient constraint coefficient is represented, ▽ represents the gradient for obtaining photo, passes through
The result that optimization energy equation above is merged, that is, obtain new HDR style photos.
Compared with the prior art the present invention has following features:
(1) what the present invention was provided realize algorithm flow is clear, structural integrity, realizes efficiency high.
(2) the minutia dictionary obtained with reference to photo is trained by the method for dictionary learning.
(3) source images are rebuild using the method for sparse expression, makes source images that there is the minutia of reference picture.
Brief description of the drawings
Fig. 1 is the HDR photo style transfer method flow charts based on dictionary learning.
Fig. 2 is that HDR relief styles shift result (a) expression source photo (b) expression with reference to photo (c) expression color transfer
As a result (d) represents that the result (e) of sparse reconstruction represents final output result.
Fig. 3 is that HDR painting styles shift result (a) expression source photo (b) expression with reference to photo (c) expression color transfer
As a result (d) represents that the result (e) of sparse reconstruction represents final output result.
Specific embodiment
Preferred embodiments of the invention are described with reference to the drawings as follows:
Referring to Fig. 1, a kind of HDR photo style transfer methods based on dictionary learning, concrete operation step is as follows:
(1) the color transfer method kept by gradient, HDR is transferred on the photo of source with reference to the color characteristic of photo;
Comprise the following steps that:
By solving the energy equation related to color, the two energy terms of gradient, retain the structural information of source photo, most
The color transfer result of high-fidelity is obtained eventually, the problem that color is shifted is converted into and solves following energy equation:
Wherein Ec, EdAt the end of representing that the energy term related to color, gradient, Φ, R, I represent that color is shifted respectively respectively
Output image, reference picture, source images;H () is represented and Histogram Matching is done to image, and G () is represented and obtained image gradient,
ωc, ωdColor component, the weight of gradient component are represented respectively;
1) color mapping
In (1) formula, the energy term E of color mapping is definedc, solved by following formula (2):
Wherein H () represents the Color histogram distribution of image, and k represents histogram sequence number, and n represents interval sum;
In order to obtain color mapping result, the Color histogram distribution of output image must be with the Color histogram distribution phase of reference picture
Matching;In order to solve conveniently, the histogram of source images is matched with the histogram of reference picture, obtained a middle graph
Picture, the accurate distribution of color for maintaining reference picture of the image;Simultaneously in order to avoid the influence to structure, to intermediate image
Decomposed, obtained levels of detail and Hue layer F, color treatments are carried out to Hue layer, therefore formula (2) is newly defined as:
Wherein Φ represents the image of output, and p represents the pixel of image, and the knot that color maps is obtained by solution formula (3)
Really;
2) gradient keeps
Levels of detail has been separated when being mapped due to color, therefore the result for obtaining loses structural fidelity, according to solution formula
(1) the energy term E of statement indThe Gradient Features of source images can be kept, is represented with following formula (4):
WhereinGradient operator is represented, p represents the pixel on image, and m represents the total pixel of image, and λ represents regulation
The parameter of picture contrast;Work as λ>When 1, increase contrast;Work as λ<When 1, reduce contrast;When λ=1, contrast is kept not
Become;
Optimization can effectively keep the prototype structure feature of source images in gradient field, in order to keep the ladder of source images
Degree, the gradient of source images is calculated first with Sobel difference operator, then according to the demand of user, determines the parameter of contrast
λ, obtains the result of source images gradient holding, obtains EcAnd EdAfterwards, substitute into formula (1) and obtain color transfer result.
(2) minutia is extracted with reference to photo to HDR, dictionary training is carried out using K_SVD algorithms, obtain the excessively complete of details
Standby wordbook D, concretely comprises the following steps:
One HDR embossment of selection or painting style photo, in order to improve the quality of reconstruction image, are needed as reference picture
Reference picture pre-processed, first extract its minutia with weighted least-squares method WLS wave filters, then taken at random
100000 fritters of 5x5, as training sample set Y;
By the training sample set Y for extracting, learn an excessively complete dictionary with HDR embossments or painting style feature
D;Using K_SVD Algorithm for Training, to the training process of HDR photo styles, represented using equation below:
Wherein D={ d1,d2…dk}∈Rr×k(k > r) is that excessively complete the redundant dictionary D, α obtained by study are training
Sparse coefficient vectors of the sample set Y on dictionary D, δ represents αiThe upper limit of middle nonzero element number,Represent training
The total reconfiguration error of sample set Y;
Using Y as K_SVD algorithms input, two stages according to dictionary learning, in the sparse coding stage, by initial
Change dictionary D, then normalize dictionary D, rarefaction representation coefficient squares of the Y on dictionary D is obtained using orthogonal matching pursuit OMP algorithms
Battle array α;In the dictionary updating stage, according to the sparse matrix factor alpha obtained, dictionary atom is updated by column;Meet k iteration or
When meeting the condition of convergence, the excessively complete dictionary D of final optimization pass is obtained;During dictionary D is updated, it is assumed that dkExpression will be more
The kth row of new dictionary, αkThe corresponding sparse coefficient of the row is represented, formula (5) is rewritten as follows:
Wherein D α are broken down into the sum of the matrix that k order is 1, it is assumed that wherein k-1 is all fixed, and remaining 1 row are just
It is the kth to be updated row;(6) the matrix E in formulakRepresent and remove removal atom dkError of the remaining composition in sample set Y afterwards;
E is updated using the method for singular value decomposition SVDkWithFound by the method and EkDifference is minimum and order is 1
Matrix, can effectively reduce the global reconstruction error of training sample;But due to what is obtained by singular value decompositionIt is not
Sparse, i.e.,Before renewalThe position of nonzero element and in different size, causes the dictionary for obtaining not compact;Therefore,
Using only retainingIn nonzero term, recycle SVD methods to update αkAnd dk, until completing dictionary updating by column, by this
The dictionary D that method is obtained can well represent the characteristic of sample.
(3) sparse reconstruction is carried out to source photo using the excessively complete wordbook of details, generation refers to photo eigen one with HDR
The details of cause;Comprise the following steps that:
The FSS algorithms that Lee is proposed are used for reference in rarefaction representation part, and algorithm flow is as follows:
(1) it is input into:The source photo X of common style, with reference to the training dictionary D of photo;
(2) minutia is gone out to source photo X profit WLS filter equalizers, and carries out optimization processing, obtain image X1;
(3) bad process is followed:From image X1The image block x that size is 5 × 5 is taken out in the upper left corner successively, and each fritter is extracted
Minutia, then each fritter is become 25 × 1 column signalObtain rarefaction representation system of each column signal under dictionary D
Number α, specially:
Step 1. calculates the average value m of image block x;
D known to step 2. andSparse coefficient α is solved by following expression formula,
Wherein, λ1Regularization parameter is represented, for Equilibrium fitting error term and sparse constraint, λ1Span is 0 and 1
Between;
The relief style image block that step 3. is estimated is D α, and the embossment/painting style image block of output is x*=m+D α;
(4) export:The fritter of sparse reconstruction is recovered by original position, obtain with details enrich embossment or
Person's painting style image X*。
(4) result that the result and details for shifting color are rebuild merges, and ultimately generates the new photo of HDR styles, specifically
Step is:
Because HDR photos have two features of aspect of color and details, by using the color and details of reference picture
The tutorial message of aspect, has respectively obtained the result of source photo color transfer and the result of the sparse reconstruction of source photo;Finally, need
By the two results merge, make source photo on tone and details all have HDR styles the characteristics of;Merging process reality etc.
Imitate in an energy equation comprising data item and gradient terms is solved, wherein data item is the result of color transfer, and gradient terms
It is the result of details reconstruction, is represented with following formula:
Wherein Φ*, Φ, X*The HDR style photos for ultimately generating are represented respectively, and source photo color shifts result, source photo
Sparse reconstructed results;P represents the pixel on photo, λ*Gradient constraint coefficient is represented,The gradient for obtaining photo is represented, is passed through
The result that optimization energy equation above is merged, that is, obtain new HDR style photos.
The method is adapted to all of HDR styles transfer, and user only need to be according to selected reference photo type by upper
State step to be processed, it is possible to which source photo is become into new HDR style photos.If the HDR photos style of reference is embossment
Style, then the experimental result of corresponding HDR relief styles transfer is as shown in Figure 2.If the HDR photos style of reference is oil painting wind
Lattice, then the experimental result of corresponding HDR painting styles transfer is as shown in Figure 3.
Claims (5)
1. a kind of HDR photo style transfer methods based on dictionary learning, it is characterised in that concrete operation step is as follows:
(1) the color transfer method kept by gradient, HDR is transferred on the photo of source with reference to the color characteristic of photo;
(2) minutia is extracted with reference to photo to HDR, dictionary training is carried out using K_SVD algorithms, form the excessively complete word of details
Allusion quotation collection;
(3) sparse reconstruction is carried out to source photo using the excessively complete wordbook of details, generation is consistent with reference to photo eigen with HDR
Details;
(4) result that the result and details for shifting color are rebuild merges, and ultimately generates the new photo of HDR styles.
2. HDR photo style transfer methods based on dictionary learning according to claim 1, it is characterised in that the step
Suddenly the algorithm for being kept using gradient in (1) carries out color transfer to source HDR photos, and the style of the reference photo that user is admired turns
Move on on the photo of source, make source photo that there is the Color Style with reference to photo, while keeping the Gradient Features of source photo, specific steps
It is as follows:
By solving the energy equation related to color, the two energy terms of gradient, retain the structural information of source photo, it is final to obtain
Color to high-fidelity shifts result, the problem that color is shifted is converted into and solves following energy equation:
Wherein Ec, EdRepresent the energy term related to color, gradient respectively, Φ, R, I represent defeated at the end of color transfer respectively
Go out image, reference picture, source images;H () is represented and Histogram Matching is done to image, and G () is represented and obtained image gradient, ωc,
ωdColor component, the weight of gradient component are represented respectively;
1) color mapping
In (1) formula, the energy term E of color mapping is definedc, solved by following formula (2):
Wherein H () represents the Color histogram distribution of image, and k represents histogram sequence number, and n represents interval sum;In order to
Color mapping result is obtained, the Color histogram distribution of output image must be with the Color histogram distribution phase of reference picture
Match somebody with somebody;In order to solve conveniently, the histogram of source images is matched with the histogram of reference picture, is obtained an intermediate image,
The accurate distribution of color for maintaining reference picture of the image;Simultaneously in order to avoid the influence to structure, intermediate image is entered
Row is decomposed, and obtains levels of detail and Hue layer F, and color treatments are done in Hue layer, therefore formula (2) is newly defined as:
Wherein Φ represents the image of output, and p represents the pixel of image, and the result that color maps is obtained by solution formula (3);
2) gradient keeps
Levels of detail has been separated when being mapped due to color, therefore the result for obtaining loses structural fidelity, according in solution formula (1)
The energy term E of statementdThe Gradient Features of source images can be kept, is represented with following formula (4):
Wherein ▽ represents gradient operator, and p represents the pixel on image, and m represents total pixel, and λ represents regulation image comparison
The parameter of degree;Work as λ>When 1, increase contrast;Work as λ<When 1, reduce contrast;When λ=1, keep contrast constant;
Optimization can effectively keep the prototype structure feature of source images in gradient field, first in order to keep the gradient of source images
The gradient of source images is calculated first with Sobel difference operator, then according to the demand of user, the parameter lambda of contrast is determined, obtained
To the result that source images gradient keeps, E is obtainedcAnd EdAfterwards, substitute into formula (1) and obtain color transfer result.
3. HDR photo style transfer methods based on dictionary learning according to claim 1, it is characterised in that the step
Suddenly (2) extract minutia to HDR with reference to photo, and dictionary training is carried out using K_SVD algorithms, obtain the excessively complete dictionary of details
Collection D, concretely comprises the following steps:
A HDR embossment or painting style photo are selected as reference picture, in order to improve the quality of reconstruction image, it is necessary to right
Reference picture is pre-processed, and first extracts its minutia with weighted least-squares method WLS wave filters, and 100000 are then taken at random
The fritter of 5x5, as training sample set Y;
By the training sample set Y for extracting, learn an excessively complete dictionary D with HDR embossments or painting style feature;Profit
K_SVD Algorithm for Training is used, to the training process of HDR photo styles, is represented using equation below:
Wherein D={ d1,d2…dk}∈Rr×k(k > r) is that excessively complete the redundant dictionary D, α obtained by study are training sample sets
Sparse coefficient vectors of the Y on dictionary D, δ represents αiThe upper limit of middle nonzero element number,Represent training sample set Y
Total reconfiguration error;
Using Y as K_SVD algorithms input, two stages according to dictionary learning, in the sparse coding stage, by initializing word
Allusion quotation D, then normalizes dictionary D, and rarefaction representation coefficient matrix αs of the Y on dictionary D is obtained using orthogonal matching pursuit OMP algorithms;
In the dictionary updating stage, according to the sparse matrix factor alpha obtained, dictionary atom is updated by column;Meeting k iteration or satisfaction
During the condition of convergence, the excessively complete dictionary D of final optimization pass is obtained;During dictionary D is updated, it is assumed that dkExpression will update word
The kth row of allusion quotation, αkThe corresponding sparse coefficient of the row is represented, formula (5) is rewritten as follows:
Wherein D α are broken down into the sum of the matrix that k order is 1, it is assumed that wherein k-1 is all fixed, and remaining 1 row seek to
The kth row of renewal;(6) the matrix E in formulakRepresent and remove removal atom dkError of the remaining composition in sample set Y afterwards;
E is updated using the method for singular value decomposition SVDkWithFound by the method and EkDifference is minimum and order be 1 square
Battle array, can effectively reduce the global reconstruction error of training sample;But due to what is obtained by singular value decompositionIt is not sparse
, i.e.,Before renewalThe position of nonzero element and in different size, causes the dictionary for obtaining not compact;Therefore, use
Only retainIn nonzero term, recycle SVD methods to update αkAnd dk, until completing dictionary updating by column, by this method
The dictionary D for obtaining can well represent the characteristic of sample.
4. HDR photo style transfer methods based on dictionary learning according to claim 1, it is characterised in that the step
Suddenly (3) use the thought of sparse expression, and the dictionary obtained using step (2) learning carries out sparse reconstruction to source photo, generate
The details consistent with reference photo eigen, comprises the following steps that:
The FSS algorithms that Lee is proposed are used for reference in rarefaction representation part, and algorithm flow is as follows:
(1) it is input into:The source photo X of common style, with reference to the training dictionary D of photo;
(2) minutia is gone out to source photo X profit WLS filter equalizers, and carries out optimization processing, obtain image X1;
(3) bad process is followed:From image X1The image block x that size is 5 × 5 is taken out in the upper left corner successively, and it is special to extract details to each fritter
Levy, then each fritter is become 25 × 1 column signalRarefaction representation coefficient α of each column signal under dictionary D is obtained, is had
Body is:
Step 1. calculates the average value m of image block x;
D known to step 2. andSparse coefficient α is solved by following expression formula,
Wherein, λ1Regularization parameter is represented, for Equilibrium fitting error term and sparse constraint, λ1Span is between 0 and 1;
The relief style image block that step 3. is estimated is D α, and the embossment/painting style image block of output is x*=m+D α;
(4) export:The fritter of sparse reconstruction is recovered by original position, the embossment or oil enriched with details is obtained
Painting style table images X*。
5. HDR photo style transfer methods based on dictionary learning according to claim 1, it is characterised in that the step
Suddenly the result that the result and details that (4) shift color are rebuild merges, and ultimately generates the new photo of HDR styles, concretely comprises the following steps:
Because HDR photos have two features of aspect of color and details, by using color and the details aspect of reference picture
Tutorial message, respectively obtained the result of source photo color transfer and the result of the sparse reconstruction of source photo;Finally, it is necessary to will
The two results merge, make source photo on tone and details all have HDR styles the characteristics of;The merging process is actual to be equivalent to
An energy equation comprising data item and gradient terms is solved, wherein data item is the result of color transfer, and gradient terms are thin
The result rebuild is saved, is represented with following formula:
Wherein Φ*, Φ, X*Represent the HDR style photos for ultimately generating respectively, source photo color transfer result, source photo it is sparse
Reconstructed results;P represents the pixel on photo, λ*Gradient constraint coefficient is represented, ▽ represents the gradient for obtaining photo, by optimization
The result that energy equation above is merged, that is, obtain new HDR style photos.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611058620.6A CN106780367B (en) | 2016-11-28 | 2016-11-28 | HDR photo style transfer method dictionary-based learning |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611058620.6A CN106780367B (en) | 2016-11-28 | 2016-11-28 | HDR photo style transfer method dictionary-based learning |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106780367A true CN106780367A (en) | 2017-05-31 |
CN106780367B CN106780367B (en) | 2019-11-15 |
Family
ID=58912507
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611058620.6A Active CN106780367B (en) | 2016-11-28 | 2016-11-28 | HDR photo style transfer method dictionary-based learning |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106780367B (en) |
Cited By (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107705242A (en) * | 2017-07-20 | 2018-02-16 | 广东工业大学 | A kind of image stylization moving method of combination deep learning and depth perception |
CN107730479A (en) * | 2017-08-30 | 2018-02-23 | 中山大学 | High dynamic range images based on compressed sensing go artifact fusion method |
CN107832843A (en) * | 2017-10-30 | 2018-03-23 | 上海寒武纪信息科技有限公司 | A kind of information processing method and Related product |
CN109064434A (en) * | 2018-06-28 | 2018-12-21 | 广州视源电子科技股份有限公司 | Method, apparatus, storage medium and the computer equipment of image enhancement |
CN109308679A (en) * | 2018-08-13 | 2019-02-05 | 深圳市商汤科技有限公司 | A kind of image style conversion side and device, equipment, storage medium |
CN111164563A (en) * | 2017-08-02 | 2020-05-15 | 深圳传音通讯有限公司 | Image color adjusting system and method of intelligent terminal |
CN112560960A (en) * | 2020-12-16 | 2021-03-26 | 北京影谱科技股份有限公司 | Hyperspectral image classification method and device and computing equipment |
CN113269223A (en) * | 2021-03-16 | 2021-08-17 | 重庆市地理信息和遥感应用中心 | City style classification method based on spatial culture modular factorial analysis |
WO2021169945A1 (en) * | 2020-02-24 | 2021-09-02 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method and device for picture generation, electronic device, and storage medium |
CN114359083A (en) * | 2021-12-24 | 2022-04-15 | 北京航空航天大学 | High-dynamic thermal infrared image self-adaptive preprocessing method for interference environment |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120133664A1 (en) * | 2010-11-29 | 2012-05-31 | Lotus Hill Institute For Computer Vision And Information Science | System and method for painterly rendering based on image parsing |
CN103093445A (en) * | 2013-01-17 | 2013-05-08 | 西安电子科技大学 | Unified feature space image super-resolution reconstruction method based on joint sparse constraint |
CN105989584A (en) * | 2015-01-29 | 2016-10-05 | 北京大学 | Image stylized reconstruction method and device |
CN106023098A (en) * | 2016-05-12 | 2016-10-12 | 西安电子科技大学 | Image repairing method based on tensor structure multi-dictionary learning and sparse coding |
-
2016
- 2016-11-28 CN CN201611058620.6A patent/CN106780367B/en active Active
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20120133664A1 (en) * | 2010-11-29 | 2012-05-31 | Lotus Hill Institute For Computer Vision And Information Science | System and method for painterly rendering based on image parsing |
CN103093445A (en) * | 2013-01-17 | 2013-05-08 | 西安电子科技大学 | Unified feature space image super-resolution reconstruction method based on joint sparse constraint |
CN105989584A (en) * | 2015-01-29 | 2016-10-05 | 北京大学 | Image stylized reconstruction method and device |
CN106023098A (en) * | 2016-05-12 | 2016-10-12 | 西安电子科技大学 | Image repairing method based on tensor structure multi-dictionary learning and sparse coding |
Non-Patent Citations (10)
Title |
---|
HONGLAK LEE等: ""Efficient sparse coding algorithms"", 《INTERNATIONAL CONFERENCE ON NEURAL INFORMATION PROCESSING SYSTEMS》 * |
MICHAL AHARON等: ""K-SVD: An Algorithm for Designing Overcomplete Dictionaries for Sparse Representation"", 《IEEE TRANSACTIONS ON SIGNAL PROCESSING》 * |
SABOYA YANG等: ""Hierarchical Oil Painting Stylization with Limited Reference via Sparse Representation"", 《2015 IEEE 17TH INTERNATIONAL WORKSHOP ON MULTIMEDIA SIGNAL PROCESSING (MMSP)》 * |
XU SHI HONG等: ""Infrared and Low-Light-Level Image Fusion Method Based on Sparse Representation and Color Transfer"", 《APPLIED MECHANICS & MATERIALS》 * |
XUEZHONG XIAO等: ""gradient-preserving color transfer"", 《PACIFIC GRAPHICS》 * |
ZHIFENG XIE等: ""DETAIL-PRESERVING FIDELITY REFINEMENT FOR TONE MAPPING"", 《2016 INTERNATIONAL CONFERENCE ON AUDIO, LANGUAGE AND IMAGE PROCESSING (ICALIP)》 * |
王丽丹: ""基于配准融合及色彩迁移的新图像生成"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
肖学中: ""基于实例的颜色处理新技术研究"", 《中国博士学位论文全文数据库 信息科技辑》 * |
陈磊: ""异类图像多级混合融合技术研究"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
马平平: ""基于区域自适应的图像间颜色迁移算法与性能评价"", 《中国优秀硕士学位论文全文数据库 信息科技辑》 * |
Cited By (18)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107705242A (en) * | 2017-07-20 | 2018-02-16 | 广东工业大学 | A kind of image stylization moving method of combination deep learning and depth perception |
CN107705242B (en) * | 2017-07-20 | 2021-12-17 | 广东工业大学 | Image stylized migration method combining deep learning and depth perception |
CN111164563B (en) * | 2017-08-02 | 2024-02-20 | 深圳传音通讯有限公司 | Image color adjusting system and color adjusting method of intelligent terminal |
CN111164563A (en) * | 2017-08-02 | 2020-05-15 | 深圳传音通讯有限公司 | Image color adjusting system and method of intelligent terminal |
CN107730479A (en) * | 2017-08-30 | 2018-02-23 | 中山大学 | High dynamic range images based on compressed sensing go artifact fusion method |
CN107730479B (en) * | 2017-08-30 | 2021-04-20 | 中山大学 | High dynamic range image artifact-removing fusion method based on compressed sensing |
CN107832843A (en) * | 2017-10-30 | 2018-03-23 | 上海寒武纪信息科技有限公司 | A kind of information processing method and Related product |
US11762631B2 (en) | 2017-10-30 | 2023-09-19 | Shanghai Cambricon Information Technology Co., Ltd. | Information processing method and terminal device |
US11922132B2 (en) | 2017-10-30 | 2024-03-05 | Shanghai Cambricon Information Technology Co., Ltd. | Information processing method and terminal device |
CN109064434A (en) * | 2018-06-28 | 2018-12-21 | 广州视源电子科技股份有限公司 | Method, apparatus, storage medium and the computer equipment of image enhancement |
CN109308679A (en) * | 2018-08-13 | 2019-02-05 | 深圳市商汤科技有限公司 | A kind of image style conversion side and device, equipment, storage medium |
CN109308679B (en) * | 2018-08-13 | 2022-08-30 | 深圳市商汤科技有限公司 | Image style conversion method and device, equipment and storage medium |
WO2021169945A1 (en) * | 2020-02-24 | 2021-09-02 | Guangdong Oppo Mobile Telecommunications Corp., Ltd. | Method and device for picture generation, electronic device, and storage medium |
CN112560960A (en) * | 2020-12-16 | 2021-03-26 | 北京影谱科技股份有限公司 | Hyperspectral image classification method and device and computing equipment |
CN113269223A (en) * | 2021-03-16 | 2021-08-17 | 重庆市地理信息和遥感应用中心 | City style classification method based on spatial culture modular factorial analysis |
CN113269223B (en) * | 2021-03-16 | 2022-04-22 | 重庆市地理信息和遥感应用中心 | City style classification method based on spatial culture modular factorial analysis |
CN114359083B (en) * | 2021-12-24 | 2022-11-29 | 北京航空航天大学 | High-dynamic thermal infrared image self-adaptive preprocessing method for interference environment |
CN114359083A (en) * | 2021-12-24 | 2022-04-15 | 北京航空航天大学 | High-dynamic thermal infrared image self-adaptive preprocessing method for interference environment |
Also Published As
Publication number | Publication date |
---|---|
CN106780367B (en) | 2019-11-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106780367B (en) | HDR photo style transfer method dictionary-based learning | |
Hao et al. | Low-light image enhancement with semi-decoupled decomposition | |
CN111784602B (en) | Method for generating countermeasure network for image restoration | |
CN111080511B (en) | End-to-end face exchange method for high-resolution multi-feature extraction | |
CN110378985B (en) | Animation drawing auxiliary creation method based on GAN | |
CN109064423B (en) | Intelligent image repairing method for generating antagonistic loss based on asymmetric circulation | |
CN112614077B (en) | Unsupervised low-illumination image enhancement method based on generation countermeasure network | |
CN103279936B (en) | Human face fake photo based on portrait is synthesized and modification method automatically | |
WO2021022929A1 (en) | Single-frame image super-resolution reconstruction method | |
CN110570377A (en) | group normalization-based rapid image style migration method | |
Huang et al. | Deep learning for image colorization: Current and future prospects | |
CN111626918B (en) | Method and system for carrying out style change on digital image based on semantic segmentation network technology | |
CN113222875B (en) | Image harmonious synthesis method based on color constancy | |
CN107123088A (en) | A kind of method of automatic replacing photo background color | |
CN113192055B (en) | Harmonious method and model for synthesizing image | |
CN111986075A (en) | Style migration method for target edge clarification | |
CN110322530A (en) | It is a kind of based on depth residual error network can interaction figure picture coloring | |
CN109829925A (en) | A kind of method and model training method for extracting clean prospect in scratching figure task | |
CN110853119A (en) | Robust reference picture-based makeup migration method | |
CN110276753A (en) | Objective self-adapting hidden method based on the mapping of feature space statistical information | |
Li et al. | Flexible piecewise curves estimation for photo enhancement | |
Zhang et al. | A real-time semi-supervised deep tone mapping network | |
Chen et al. | Quality evaluation of arbitrary style transfer: Subjective study and objective metric | |
CN116740281A (en) | Three-dimensional head model generation method, three-dimensional head model generation device, electronic equipment and storage medium | |
CN115018729B (en) | Content-oriented white box image enhancement method |
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 |