CN105096249A - Image processing method and image processing apparatus - Google Patents

Image processing method and image processing apparatus Download PDF

Info

Publication number
CN105096249A
CN105096249A CN201410222467.0A CN201410222467A CN105096249A CN 105096249 A CN105096249 A CN 105096249A CN 201410222467 A CN201410222467 A CN 201410222467A CN 105096249 A CN105096249 A CN 105096249A
Authority
CN
China
Prior art keywords
image
dictionary
image block
class
lambda
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
Application number
CN201410222467.0A
Other languages
Chinese (zh)
Other versions
CN105096249B (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.)
Peking University
Original Assignee
Peking University
Peking University Founder Group Co Ltd
Beijing Founder Electronics 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 Peking University, Peking University Founder Group Co Ltd, Beijing Founder Electronics Co Ltd filed Critical Peking University
Priority to CN201410222467.0A priority Critical patent/CN105096249B/en
Publication of CN105096249A publication Critical patent/CN105096249A/en
Application granted granted Critical
Publication of CN105096249B publication Critical patent/CN105096249B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Image Analysis (AREA)

Abstract

The present invention provides an image processing method and an image processing apparatus. The method includes the steps as follows: dividing photographs or sketch images to be processed into N first image blocks with a same size through a division rule, wherein, an image pair in a training set is pre-processed by adapting the division rule; determining a corresponding relation of each first image block and M categories, wherein, the image pair in the training set is pre-processed by the application of a clustering algorithm so as to acquire the M categories; acquiring a second image block corresponding to each first image block according to pre-trained training parameters corresponding to the category to which each first block is attributed; and finally synthesizing sketch images or photographs corresponding to the photographs or sketch images to be processed according to the acquired N second image blocks corresponding to the N first image blocks. The image processing method and apparatus realizes the mutual synthesizing of the photographs or sketch images through a dictionary learning method, avoids patches made by hands, and increases a sharpness of the synthesizing effect.

Description

Image processing method and device
Technical field
The present invention relates to communication technical field, particularly relate to a kind of image processing method and device.
Background technology
Photo and sketch synthetic method refer to according to photographic intelligence, automatically generate the sketch image of its correspondence, or according to sketch image, automatically generate the pictures of its correspondence.Traditional synthetic method is the synthetic method based on calculating, to be described as follows according to human face photo synthesis sketch image: first extract facial contours from photo, amplify some details by some specific rules again, make the picture of generation more similar with sketch in shape.But this synthetic method, make the details of face in photo be difficult to embody in sketch image, and this synthetic method can not realize the synthesis from sketch to photo.
In prior art, a kind of method that the people such as Liu are embedded by local linear based on study, utilize existing photo and sketch image to data set, for known photo or sketch image, a most similar K picture block is searched at data set for each little image block, and utilize this K picture block to try to achieve linearly to express coefficient, thus photo corresponding to synthesis and sketch image.But because this method is based on similar piece search, easily occurs the problem being difficult to find similar piece, in addition, in the picture finally synthesized, also there will be the fritter manually caused.The picture that result in synthesis is comparatively fuzzy.
Summary of the invention
For the above-mentioned defect of prior art, the embodiment of the present invention provides a kind of image processing method and device.
One aspect of the present invention provides a kind of image processing method, comprising:
Receive pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, by the first image block that described pending photo or sketch image are divided into N number of size identical, determine each first image block and in advance to the image in described training set to the corresponding relation applied between M class that clustering algorithm process obtains;
According to training in advance, obtain second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary;
Synthesize and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained.
The present invention provides a kind of image processing apparatus on the other hand, comprising:
Segmentation module, for receiving pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, by the first image block that described pending photo or sketch image are divided into N number of size identical;
Cluster module, for determine each first image block and in advance to the image in described training set to the corresponding relation applied between M class that clustering algorithm process obtains;
Processing module, for according to training in advance, obtain second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary;
Synthesis module, for synthesizing according to N number of second image block corresponding with described N number of first image block obtained and described pending photo or sketch image corresponding to sketch image or photo.
The image processing method that the embodiment of the present invention provides and device, first regular to adopted segmentation according to the image of anticipating in training set, the first image block being divided into N number of size identical in pending photo or sketch image, then determine each first image block and in advance to the image in training set to the corresponding relation applied between M class that clustering algorithm process obtains, according to training in advance, second image block corresponding with each first image block is obtained with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, second image dictionary, error dictionary, and the coefficient mapping function between described first image dictionary and described second image dictionary, finally synthesize and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained, achieve the mutual synthesis being undertaken between photo and sketch picture by dictionary learning method, avoid occurring made fritter, improve the sharpness of synthetic effect.
Accompanying drawing explanation
The process flow diagram of the image processing method that Fig. 1 provides for the embodiment of the present invention;
The process flow diagram of another image processing method that Fig. 2 provides for the embodiment of the present invention;
The process flow diagram of another image processing method that Fig. 3 provides for the embodiment of the present invention;
The structural representation of the image processing apparatus that Fig. 4 provides for the embodiment of the present invention;
The structural representation of another image processing apparatus that Fig. 5 provides for the embodiment of the present invention.
Embodiment
The process flow diagram of the image processing method that Fig. 1 provides for the embodiment of the present invention, as shown in Figure 1, the method comprises:
Step 100, receive pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, by the first image block that described pending photo or sketch image are divided into N number of size identical, determine each first image block and in advance to the image in described training set to the corresponding relation applied between M class that clustering algorithm process obtains;
Image processing apparatus receives pending photo or the sketch image of user's transmission, the image obtained in process training set is regular to adopted segmentation, concrete segmentation rule carries out setting according to the size of pretreatment image and type, such as comprise row and the row of segmentation, whether can repeat segmentation etc., need to set according to concrete practical application.Then regular to adopted segmentation according to the image of anticipating in training set, the first image block being divided into N number of size identical in pending photo or sketch image, after having split, determine each first image block and in advance to the image in training set to the corresponding relation applied between M class that clustering algorithm process obtains, concrete, can by with anticipate clustering algorithm that training set adopts and first clustering processing carried out to N number of first image block after splitting and obtain m class, the similarity between m class and M class is obtained again by proper vector pairing comparision, thus determine the concrete corresponding relation of each first image block and M class, or by obtaining the center vector corresponding with each class in M class, can then obtain the distance of the first image block and each center vector, will be the class of described first image block ownership apart from the class corresponding to minimum center vector.Be understandable that, those skilled in the art can determine the concrete corresponding relation of each first image block and M class in several ways, and namely which kind of in M the class obtained in advance each first image block belong to.It should be noted that the clustering algorithm adopted in the present embodiment comprises: sparse subspace clustering algorithm, hierarchical clustering algorithm, segmentation clustering algorithm, based on constraint clustering algorithm, can select according to practical application.
Step 101, according to training in advance, obtain second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary;
Concrete, the treatment scheme of this step is illustrated for first the first image block, if image processing apparatus is determining that first the first image block belongs to the Equations of The Second Kind in M the class obtained in advance, then obtain training in advance, with the training parameter corresponding to Equations of The Second Kind, this training parameter comprises: the first image dictionary, second image dictionary, error dictionary, and the coefficient mapping function between described first image dictionary and described second image dictionary, then applied mathematical model processes these training parameters, thus obtain second image block corresponding with first the first image block.
Step 102, synthesizes and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained.
Image processing apparatus is according to training in advance, apply after the first formula obtains the second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, synthesize and pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with N number of first image block obtained, concrete synthetic method is depending on concrete segmentation strategy, such as, if segmentation strategy is not for repeating segmentation, then synthetic method directly can be applied composition algorithm of the prior art according to N number of second image block and synthesizes, if segmentation strategy is attached most importance to, subdivision is cut, then lap first adds and averages by synthetic method, apply composition algorithm of the prior art again to synthesize.Because concrete synthetic method belongs to prior art, repeat no more herein.
The image processing method that the present embodiment provides, first regular to adopted segmentation according to the image of anticipating in training set, the first image block being divided into N number of size identical in pending photo or sketch image, then determine each first image block and in advance to the image in training set to the corresponding relation applied between M class that clustering algorithm process obtains, according to training in advance, second image block corresponding with each first image block is obtained with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, second image dictionary, error dictionary, and the coefficient mapping function between described first image dictionary and described second image dictionary, finally synthesize and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained, achieve the mutual synthesis being undertaken between photo and sketch picture by dictionary learning method, avoid occurring made fritter, improve the sharpness of synthetic effect.
The process flow diagram of another image processing method that Fig. 2 provides for the embodiment of the present invention, as shown in Figure 2, the method comprises:
Step 200, receive pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, by the first image block that described pending photo or sketch image are divided into N number of size identical, determine each first image block and in advance to the image in described training set to the corresponding relation applied between M class that clustering algorithm process obtains;
Image processing apparatus receives pending photo or the sketch image of user's transmission, the image obtained in process training set is regular to adopted segmentation, concrete segmentation rule carries out setting according to the size of pretreatment image and type, such as comprise row and the row of segmentation, whether can repeat segmentation etc., need to set according to concrete practical application.Then regular to adopted segmentation according to the image of anticipating in training set, the first image block being divided into N number of size identical in pending photo or sketch image, after having split, determine each first image block and in advance to the image in training set to the corresponding relation applied between M class that clustering algorithm process obtains, concrete, can by with anticipate clustering algorithm that training set adopts and first clustering processing carried out to N number of first image block after splitting and obtain m class, the similarity between m class and M class is obtained again by proper vector pairing comparision, thus determine the concrete corresponding relation of each first image block and M class, or by obtaining the center vector corresponding with each class in M class, can then obtain the distance of the first image block and each center vector, will be the class of described first image block ownership apart from the class corresponding to minimum center vector.Be understandable that, those skilled in the art can determine the concrete corresponding relation of each first image block and M class in several ways, and namely which kind of in M the class obtained in advance each first image block belong to.It should be noted that the clustering algorithm adopted in the present embodiment comprises: sparse subspace clustering algorithm, hierarchical clustering algorithm, segmentation clustering algorithm, based on constraint clustering algorithm, can select according to practical application.
Step 201, according to training in advance, apply the first formula with the training parameter corresponding to the class that each first image block belongs to and obtain second image block corresponding with each first image block, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary, and described first formula is:
s i=D sa s-E s(p i-D pα p),
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sit is regularization coefficient;
Concrete, the treatment scheme of this step is illustrated for first the first image block, if image processing apparatus is determining that first the first image block belongs to the Equations of The Second Kind in M the class obtained in advance, then according to training in advance, with the training parameter corresponding to Equations of The Second Kind, this training parameter comprises: the first image dictionary, second image dictionary, error dictionary, and the coefficient mapping function between described first image dictionary and described second image dictionary, then apply the first formula and obtain the second image block corresponding with first the first image block, wherein, described first formula is:
s i=D sa s-E s(p i-D pα p),
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sbe regularization coefficient, obtain N number of second image block corresponding with N number of first image block according to above-mentioned steps.
Step 202, synthesizes and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained.
Image processing apparatus is according to training in advance, apply after the first formula obtains the second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, synthesize and pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with N number of first image block obtained, concrete synthetic method is depending on concrete segmentation strategy, such as, if segmentation strategy is not for repeating segmentation, then synthetic method directly can be applied composition algorithm of the prior art according to N number of second image block and synthesizes, if segmentation strategy is attached most importance to, subdivision is cut, then lap first adds and averages by synthetic method, apply composition algorithm of the prior art again to synthesize.Because concrete synthetic method belongs to prior art, repeat no more herein.
The image processing method that the present embodiment provides, first regular to adopted segmentation according to the image of anticipating in training set, the first image block being divided into N number of size identical in pending photo or sketch image, then determine each first image block and in advance to the image in training set to the corresponding relation applied between M class that clustering algorithm process obtains, according to training in advance, apply the first formula with the training parameter corresponding to the class that each first image block belongs to and obtain second image block corresponding with each first image block, wherein, described training parameter comprises: the first image dictionary, second image dictionary, error dictionary, and the coefficient mapping function between described first image dictionary and described second image dictionary, described first formula is: s i=D sa s-E s(p i-D pα p), wherein, Ds is the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sit is regularization coefficient, finally synthesize and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained, achieve the mutual synthesis being undertaken between photo and sketch picture by dictionary learning method, avoid occurring made fritter, improve the sharpness of synthetic effect.
Based on above-described embodiment, it should be noted that, concrete segmentation rule carries out setting according to the size of pretreatment image and type, such as, comprise row and the row of segmentation, whether can repeat segmentation etc., needs to set according to concrete practical application.In order to improve the sharpness of Images uniting further, be specially the image block that repeatedly can be divided into fixed size be specifically described by embodiment illustrated in fig. 3 to split rule, the process flow diagram of another image processing method that Fig. 3 provides for the embodiment of the present invention, as shown in Figure 3, the method comprises:
Step 300, according to the segmentation rule preset by training set, the photo of each image pair and the sketch image corresponding with described photo all can repeatedly be divided into the image block that N number of size is identical, application clustering algorithm carries out clustering processing to all image blocks and obtains M class;
Image processing apparatus according to the segmentation rule preset by training set, the photo of each image pair and the sketch image corresponding with described photo all can repeatedly be divided into the image block that N number of size is identical, after having split, application clustering algorithm carries out clustering processing to all image blocks and obtains M class.Be understandable that, those skilled in the art adopt the clustering algorithm of prior art, specifically comprise: sparse subspace clustering algorithm, hierarchical clustering algorithm, segmentation clustering algorithm, based on constraint clustering algorithm, can select according to practical application, thus clustering processing acquisition M class is carried out to all image blocks, repeat no more herein.
Step 301, apply the 3rd formula and obtain the training parameter corresponding with each class in a described M class, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary, and described 3rd formula is:
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, P ibe the first image block, γ, λ p, λ s, λ wit is regularization coefficient;
Particularly, after image processing apparatus application clustering algorithm carries out clustering processing acquisition M class to all image blocks, apply the 3rd formula and obtain the training parameter corresponding with each class in a described M class, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary, and described 3rd formula is:
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, P ibe the first image block, γ, λ p, λ s, λ wit is regularization coefficient.
Step 302, receives pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, described pending photo or sketch image repeatedly can be divided into the first image block that N number of size is identical;
Image processing apparatus receives pending photo or the sketch image of user's transmission, the image obtained in process training set is regular to adopted segmentation, then regular to adopted segmentation according to the image of anticipating in training set, pending photo or sketch image repeatedly can be divided into the first image block that N number of size is identical.
Step 303, obtains the center vector corresponding with each class in a described M class, obtains the distance of the first image block and each center vector, will be the class of described first image block ownership apart from the class corresponding to minimum center vector;
After having split, image processing apparatus obtains the center vector corresponding with each class in M class, then obtains the distance of the first image block and each center vector, will be the class of described first image block ownership apart from the class corresponding to minimum center vector.
Step 304, according to training in advance, apply the first formula with the training parameter corresponding to the class that each first image block belongs to and obtain second image block corresponding with each first image block, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary, and described first formula is:
s i=D sa s-E s(p i-D pα p),
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sit is regularization coefficient;
Concrete, the treatment scheme of this step is illustrated for first the first image block, if image processing apparatus is determining that first the first image block belongs to the Equations of The Second Kind in M the class obtained in advance, then according to training in advance, with the training parameter corresponding to Equations of The Second Kind, this training parameter comprises: the first image dictionary, second image dictionary, error dictionary, and the coefficient mapping function between described first image dictionary and described second image dictionary, then apply the first formula and obtain the second image block corresponding with first the first image block, wherein, described first formula is:
s i=D sa s-E s(p i-D pα p),
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sbe regularization coefficient, obtain N number of second image block corresponding with N number of first image block according to above-mentioned steps.
Step 305, applied dynamic programming method obtains the minimum border of value differences in the overlapping region of two the second image blocks, border as two the second image blocks is split, and synthesizes and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained.
The disposal route added due to the direct overlapping region by two the second image blocks and average can cause the result of generation comparatively fuzzy, therefore, image processing apparatus is after obtaining second image block corresponding with each first image block, applied dynamic programming method obtains the minimum border of value differences in the overlapping region of two the second image blocks, border as two the second image blocks is split, apply composition algorithm of the prior art again to synthesize N number of second image block, because concrete synthetic method belongs to prior art, repeat no more herein.
The image processing method that the present embodiment provides, first pending photo or sketch image can be repeated the first image block being divided into N number of size identical, then determine each first image block and in advance to the image in training set to the corresponding relation applied between M class that clustering algorithm process obtains, according to training in advance, apply the first formula with the training parameter corresponding to the class that each first image block belongs to and obtain second image block corresponding with each first image block, wherein, described training parameter comprises: the first image dictionary, second image dictionary, error dictionary, and the coefficient mapping function between described first image dictionary and described second image dictionary, described first formula is: s i=D sa s-E s(p i-D pα p), wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sit is regularization coefficient, last applied dynamic programming method obtains the minimum border of value differences in the overlapping region of two the second image blocks, border as two the second image blocks is split, again synthesis process is carried out to N number of second image block, achieve the mutual synthesis being undertaken between photo and sketch picture by dictionary learning method, avoid occurring made fritter, further increasing the sharpness of synthetic effect.
One of ordinary skill in the art will appreciate that: all or part of step realizing said method embodiment can have been come by the hardware that programmed instruction is relevant, aforesaid program can be stored in a computer read/write memory medium, this program, when performing, performs the step comprising said method embodiment; And aforesaid storage medium comprises: ROM, RAM, magnetic disc or CD etc. various can be program code stored medium.
The structural representation of the image processing apparatus that Fig. 4 provides for the embodiment of the present invention, as shown in Figure 4, this device comprises: segmentation module 11, cluster module 12, processing module 13 and synthesis module 14, wherein, segmentation module 11 is for receiving pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, by the first image block that described pending photo or sketch image are divided into N number of size identical; Cluster module 12 for determine each first image block and in advance to the image in described training set to the corresponding relation applied between M class that clustering algorithm process obtains; Processing module 13 for according to training in advance, obtain second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary;
Synthesis module 14 is for synthesizing according to N number of second image block corresponding with described N number of first image block obtained and described pending photo or sketch image corresponding to sketch image or photo.
The function of each module and treatment scheme in the image processing apparatus that the present embodiment provides, can see the embodiment of the method shown in above-mentioned Fig. 1, and it realizes principle and technique effect is similar, repeats no more herein.
Based on above-described embodiment, processing module 13, specifically for according to training in advance, apply the first formula with the training parameter corresponding to the class that each first image block belongs to and obtain second image block corresponding with each first image block, described first formula is:
s i=D sa s-E s(p i-D pα p),
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sit is regularization coefficient.
The function of each module and treatment scheme in the image processing apparatus that the present embodiment provides, can see the embodiment of the method shown in above-mentioned Fig. 2, and it realizes principle and technique effect is similar, repeats no more herein.
The structural representation of another image processing apparatus that Fig. 5 provides for the embodiment of the present invention, as shown in Figure 5, based on embodiment illustrated in fig. 4, this device also comprises: pretreatment module 15, for before the pending photo of described reception or sketch image, according to the segmentation rule preset by training set, the photo of each image pair and the sketch image corresponding with described photo be divided into the identical image block of N number of size;
Application clustering algorithm carries out clustering processing to all image blocks and obtains M class;
Apply the 3rd formula and obtain the training parameter corresponding with each class in a described M class, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary, and described 3rd formula is:
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, P ibe the first image block, γ, λ p, λ s, λ wit is regularization coefficient.
Particularly, described cluster module 12 specifically for:
Obtain the center vector corresponding with each class in a described M class;
Obtaining the distance of the first image block and each center vector, will be the class of described first image block ownership apart from the class corresponding to minimum center vector.
Further, if described segmentation rule is specially: the image block that repeatedly can be divided into fixed size, described synthesis module 14 also for:
Applied dynamic programming method obtains the minimum border of value differences in the overlapping region of two the second image blocks, the border as two the second image blocks is split.
The function of each module and treatment scheme in the image processing apparatus that the present embodiment provides, can see the embodiment of the method shown in above-mentioned Fig. 3, and it realizes principle and technique effect is similar, repeats no more herein.
Last it is noted that above embodiment is only in order to illustrate technical scheme of the present invention, be not intended to limit; Although with reference to previous embodiment to invention has been detailed description, those of ordinary skill in the art is to be understood that: it still can be modified to the technical scheme described in foregoing embodiments, or carries out equivalent replacement to wherein portion of techniques feature; And these amendments or replacement, do not make the essence of appropriate technical solution depart from the spirit and scope of various embodiments of the present invention technical scheme.

Claims (10)

1. an image processing method, is characterized in that, comprising:
Receive pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, by the first image block that described pending photo or sketch image are divided into N number of size identical, determine each first image block and in advance to the image in described training set to the corresponding relation applied between M class that clustering algorithm process obtains;
According to training in advance, obtain second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary;
Synthesize and described pending photo or sketch image corresponding to sketch image or photo according to N number of second image block corresponding with described N number of first image block obtained.
2. image processing method according to claim 1, is characterized in that, described according to training in advance, obtain second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to and specifically comprise:
According to training in advance, apply the first formula with the training parameter corresponding to the class that each first image block belongs to and obtain second image block corresponding with each first image block, described first formula is:
s i=D sa s-E s(p i-D pα p),
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
min { α p , α s } | | p i - D p α p | | 2 2 + | | s i - D s α s - E s ( p i - D p α p ) | | 2 2 + γ | | α s - W p α p | | 2 2 + λ p | | α p | | 1 + λ s | | α s | | 1 ;
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sit is regularization coefficient.
3. image processing method according to claim 1, is characterized in that, before the pending photo of described reception or sketch image, described method also comprises:
According to the segmentation rule preset by training set, the photo of each image pair and the sketch image corresponding with described photo be divided into the identical image block of N number of size;
Application clustering algorithm carries out clustering processing to all image blocks and obtains M class;
Apply the 3rd formula and obtain the training parameter corresponding with each class in a described M class, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary, and described 3rd formula is:
min { D p , D s , E p , W p } | | P i - D p Λ p | | 2 2 + | | S i - D s Λ s - E s ( P i - D p Λ p ) | | 2 2 + γ | | Λ s - W p Λ p | | 2 2 + λ p | | Λ x | | 1 + λ s | | Λ y | | 1 + λ w | | W p | | 2 2
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, P ibe the first image block, γ, λ p, λ s, λ wit is regularization coefficient.
4. according to the arbitrary described image processing method of claim 1-3, it is characterized in that, describedly determine each first image block and in advance the image in described training set specifically comprised the corresponding relation applied between M class that clustering algorithm process obtains:
Obtain the center vector corresponding with each class in a described M class;
Obtaining the distance of the first image block and each center vector, will be the class of described first image block ownership apart from the class corresponding to minimum center vector.
5., according to the arbitrary described image processing method of claim 1-3, it is characterized in that, if described segmentation rule is specially: the image block that repeatedly can be divided into fixed size,
Described N number of second image block corresponding with described N number of first image block according to obtaining synthesize with described pending photo or sketch image corresponding to sketch image or photo before, described method also comprises:
Applied dynamic programming method obtains the minimum border of value differences in the overlapping region of two the second image blocks, the border as two the second image blocks is split.
6. an image processing apparatus, is characterized in that, comprising:
Segmentation module, for receiving pending photo or sketch image, according to the image of anticipating in training set to adopted segmentation rule, by the first image block that described pending photo or sketch image are divided into N number of size identical;
Cluster module, for determine each first image block and in advance to the image in described training set to the corresponding relation applied between M class that clustering algorithm process obtains;
Processing module, for according to training in advance, obtain second image block corresponding with each first image block with the training parameter corresponding to the class that each first image block belongs to, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary;
Synthesis module, for synthesizing according to N number of second image block corresponding with described N number of first image block obtained and described pending photo or sketch image corresponding to sketch image or photo.
7. image processing apparatus according to claim 6, is characterized in that, comprising:
Described processing module, specifically for according to training in advance, apply the first formula with the training parameter corresponding to the class that each first image block belongs to and obtain second image block corresponding with each first image block, described first formula is:
s i=D sa s-E s(p i-D pα p),
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, p ibe the first image block, s ibe the second image block, α p, α smeet the second formula, described second formula is:
min { α p , α s } | | p i - D p α p | | 2 2 + | | s i - D s α s - E s ( p i - D p α p ) | | 2 2 + γ | | α s - W p α p | | 2 2 + λ p | | α p | | 1 + λ s | | α s | | 1 ;
Wherein, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, γ, λ p, λ sit is regularization coefficient.
8. image processing apparatus according to claim 6, is characterized in that, described device also comprises:
Pretreatment module, for before the pending photo of described reception or sketch image, according to the segmentation rule preset by training set, the photo of each image pair and the sketch image corresponding with described photo be divided into the identical image block of N number of size;
Application clustering algorithm carries out clustering processing to all image blocks and obtains M class;
Apply the 3rd formula and obtain the training parameter corresponding with each class in a described M class, wherein, described training parameter comprises: the first image dictionary, the second image dictionary, error dictionary and the coefficient mapping function between described first image dictionary and described second image dictionary, and described 3rd formula is:
min { D p , D s , E p , W p } | | P i - D p Λ p | | 2 2 + | | S i - D s Λ s - E s ( P i - D p Λ p ) | | 2 2 + γ | | Λ s - W p Λ p | | 2 2 + λ p | | Λ x | | 1 + λ s | | Λ y | | 1 + λ w | | W p | | 2 2
Wherein, D sbe the second image dictionary, E sfor error dictionary, D pbe the first image dictionary, W pfor the coefficient mapping function between described first image dictionary and described second image dictionary, P ibe the first image block, γ, λ p, λ s, λ wit is regularization coefficient.
9., according to the arbitrary described image processing apparatus of claim 6-8, it is characterized in that, described cluster module specifically for:
Obtain the center vector corresponding with each class in a described M class;
Obtaining the distance of the first image block and each center vector, will be the class of described first image block ownership apart from the class corresponding to minimum center vector.
10., according to the arbitrary described image processing apparatus of claim 6-8, it is characterized in that, if described segmentation rule is specially: the image block that repeatedly can be divided into fixed size, described synthesis module also for:
Applied dynamic programming method obtains the minimum border of value differences in the overlapping region of two the second image blocks, the border as two the second image blocks is split.
CN201410222467.0A 2014-05-23 2014-05-23 Image processing method and device Expired - Fee Related CN105096249B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410222467.0A CN105096249B (en) 2014-05-23 2014-05-23 Image processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410222467.0A CN105096249B (en) 2014-05-23 2014-05-23 Image processing method and device

Publications (2)

Publication Number Publication Date
CN105096249A true CN105096249A (en) 2015-11-25
CN105096249B CN105096249B (en) 2018-06-26

Family

ID=54576603

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410222467.0A Expired - Fee Related CN105096249B (en) 2014-05-23 2014-05-23 Image processing method and device

Country Status (1)

Country Link
CN (1) CN105096249B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106530221A (en) * 2016-11-21 2017-03-22 西安电子科技大学 Image synthesizing method and device
CN106919885A (en) * 2015-12-24 2017-07-04 掌赢信息科技(上海)有限公司 A kind of face stylizing method and electronic equipment based on machine learning
CN108986028A (en) * 2018-06-28 2018-12-11 福州瑞芯微电子股份有限公司 A kind of method and system of high-definition picture processing
CN110830322A (en) * 2019-09-16 2020-02-21 北京大学 Network flow measuring method and system based on probability measurement data structure Sketch with approximate zero error
CN113658283A (en) * 2021-08-18 2021-11-16 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN115082709A (en) * 2022-07-21 2022-09-20 济南星睿信息技术有限公司 Remote sensing big data processing method and system and cloud platform

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110311157A1 (en) * 2010-06-17 2011-12-22 Samsung Electronics Co., Ltd. Method for generating sketch image and display apparatus applying the same
CN103080979A (en) * 2010-09-03 2013-05-01 王晓刚 System and method for synthesizing portrait sketch from photo

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110311157A1 (en) * 2010-06-17 2011-12-22 Samsung Electronics Co., Ltd. Method for generating sketch image and display apparatus applying the same
CN103080979A (en) * 2010-09-03 2013-05-01 王晓刚 System and method for synthesizing portrait sketch from photo

Non-Patent Citations (5)

* Cited by examiner, † Cited by third party
Title
Q. LIU ET AL: "《A nonlinear approach for face sketch synthesis and recognition》", 《IN IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR)》 *
S. WANG ET AL: "《Semi-coupled dictionary learning with applications to image super resolution and photo-sketch synthesis》", 《IN IEEE CONFERENCE ON COMPUTER VISION AND PATTERN RECOGNITION (CVPR)》 *
X. WANG ET AL: "《Face photo-sketch synthesis and recognition》", 《IEEE TRANSACTIONS ON PATTERN ANALYSIS AND MACHINE INTELLIGENCE》 *
梁阳: "《基于子空间学习的人脸模态变换》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
沙腾: "《基于子空间学习的人脸特征分析及应用》", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106919885A (en) * 2015-12-24 2017-07-04 掌赢信息科技(上海)有限公司 A kind of face stylizing method and electronic equipment based on machine learning
CN106530221A (en) * 2016-11-21 2017-03-22 西安电子科技大学 Image synthesizing method and device
CN106530221B (en) * 2016-11-21 2019-03-19 西安电子科技大学 A kind of image composition method and device
CN108986028A (en) * 2018-06-28 2018-12-11 福州瑞芯微电子股份有限公司 A kind of method and system of high-definition picture processing
CN108986028B (en) * 2018-06-28 2022-12-16 瑞芯微电子股份有限公司 Method and system for processing high-resolution image
CN110830322A (en) * 2019-09-16 2020-02-21 北京大学 Network flow measuring method and system based on probability measurement data structure Sketch with approximate zero error
CN110830322B (en) * 2019-09-16 2021-07-06 北京大学 Network flow measuring method and system based on probability measurement data structure Sketch
CN113658283A (en) * 2021-08-18 2021-11-16 北京达佳互联信息技术有限公司 Image processing method, image processing device, electronic equipment and storage medium
CN113658283B (en) * 2021-08-18 2023-11-28 北京达佳互联信息技术有限公司 Image processing method, device, electronic equipment and storage medium
CN115082709A (en) * 2022-07-21 2022-09-20 济南星睿信息技术有限公司 Remote sensing big data processing method and system and cloud platform

Also Published As

Publication number Publication date
CN105096249B (en) 2018-06-26

Similar Documents

Publication Publication Date Title
Iizuka et al. Globally and locally consistent image completion
Ružić et al. Context-aware patch-based image inpainting using Markov random field modeling
CN105096249A (en) Image processing method and image processing apparatus
CN110458957B (en) Image three-dimensional model construction method and device based on neural network
US20200357099A1 (en) Video inpainting with deep internal learning
US10902571B2 (en) Automated image synthesis using a comb neural network architecture
CN113658051A (en) Image defogging method and system based on cyclic generation countermeasure network
CN103366400B (en) A kind of three-dimensional head portrait automatic generation method
Yin et al. Highly accurate image reconstruction for multimodal noise suppression using semisupervised learning on big data
CN112102303B (en) Semantic image analogy method for generating antagonistic network based on single image
US20140185924A1 (en) Face Alignment by Explicit Shape Regression
CN108124489B (en) Information processing method, apparatus, cloud processing device and computer program product
CN109584327B (en) Face aging simulation method, device and equipment
CN104978764A (en) Three-dimensional face mesh model processing method and three-dimensional face mesh model processing equipment
Satoshi et al. Globally and locally consistent image completion
CN109146061A (en) The treating method and apparatus of neural network model
CN111383232A (en) Matting method, matting device, terminal equipment and computer-readable storage medium
CN109920021A (en) A kind of human face sketch synthetic method based on regularization width learning network
CN111127668A (en) Role model generation method and device, electronic equipment and storage medium
CN113034355A (en) Portrait image double-chin removing method based on deep learning
Governi et al. Digital bas-relief design: A novel shape from shading-based method
US20160189339A1 (en) Adaptive 3d registration
Maeng et al. Age-aware guidance via masking-based attention in face aging
US20220101122A1 (en) Energy-based variational autoencoders
Chen et al. Structure guided texture inpainting through multi-scale patches and global optimization for image completion

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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220622

Address after: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee after: Peking University

Patentee after: New founder holdings development Co.,Ltd.

Patentee after: BEIJING FOUNDER ELECTRONICS Co.,Ltd.

Address before: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee before: Peking University

Patentee before: PEKING UNIVERSITY FOUNDER GROUP Co.,Ltd.

Patentee before: BEIJING FOUNDER ELECTRONICS Co.,Ltd.

TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20230328

Address after: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee after: Peking University

Address before: 100871 No. 5, the Summer Palace Road, Beijing, Haidian District

Patentee before: Peking University

Patentee before: New founder holdings development Co.,Ltd.

Patentee before: BEIJING FOUNDER ELECTRONICS Co.,Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20180626