CN104778311A - Automatic patch image generation algorithm based on random sampling - Google Patents

Automatic patch image generation algorithm based on random sampling Download PDF

Info

Publication number
CN104778311A
CN104778311A CN201510139851.9A CN201510139851A CN104778311A CN 104778311 A CN104778311 A CN 104778311A CN 201510139851 A CN201510139851 A CN 201510139851A CN 104778311 A CN104778311 A CN 104778311A
Authority
CN
China
Prior art keywords
factor
sampling
divergence
stochastic
local
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.)
Pending
Application number
CN201510139851.9A
Other languages
Chinese (zh)
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.)
ZHEJIANG HUIGU INFORMATION TECHNOLOGY Co Ltd
Original Assignee
ZHEJIANG HUIGU INFORMATION TECHNOLOGY Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZHEJIANG HUIGU INFORMATION TECHNOLOGY Co Ltd filed Critical ZHEJIANG HUIGU INFORMATION TECHNOLOGY Co Ltd
Priority to CN201510139851.9A priority Critical patent/CN104778311A/en
Publication of CN104778311A publication Critical patent/CN104778311A/en
Pending legal-status Critical Current

Links

Abstract

The invention discloses an automatic patch image generation algorithm based on random sampling. The original pure sampling process is used as an optimization process, the unsatisfactory of the design scheme, i.e. the number of factors which cannot satisfy the sampling condition is used as an optimizing target, and the design produced by each random sampling is used as a to-be-optimized variable. The entire sampling process can be adopted as an optimum problem for minimizing the number of the factors which cannot satisfy the condition by searching an appropriate design scheme. Meanwhile, the original sampling algorithm is improved in the method, and the sampling match can be recalled in a first-order manner, so that the local optimum probability can be reduced to certain extent. The invention also provides a local similarity parameter on the basis of the algorithm, sampling results are sequenced by combining the parameters and KL divergence, and a result with the real reference significance is selected from an optimum solution.

Description

A kind of paster image automatic generating calculation based on stochastic sampling
Technical field
What the present invention relates to is a kind of method that image generates automatically, specifically a kind of Computer image genration optimization method based on factor graph, Local Symmetries and stochastic sampling.
Background technology
The artistic work produced by the comparatively dull pattern of some colors of repeated arrangement is all there is in the culture of many countries.The wood windows of such as ancient Chinese, room beam carving, silk cloth, pottery, basketry that American Indian is traditional, all include a large amount of pattern repeated, but the less shape of these number of patterns and pattern comparatively regular.Mosaic, tattooing and other some vision class artworks all have this common feature.Now, some new methods can be selected to generate more useful design by rearranging less discrete pattern block.Such as can carry out modeling at the Architectural Elements such as window and door by this method and carry out reconstruction.In virtual world, this design based on grid is often more popular, should be and virtual world environment can be made to comprise corresponding semanteme while the good visual effect of guarantee like this, such as more famous sandbox game " my world " namely adopts this design.
Generate newly-designed method for this by paster split, have more correlative study.As: the paper Wang tiles for image and texture generation that the people such as Cohen delivered in 2003 uses scan-line algorithm to carry out the generation of non-periodic pattern.The paper Aconnection between partial symmetry and inverse procedural modeling that the people such as Bokeloh delivered in 2010 goes out regular symmetric by the model inference of input and proposes to formulate the difficulty of the valid shape syntax.The paper Example-based model synthesis that Merrell delivered in 2007 describes the method generating new model by resolving input amendment.
The people such as YEH are published in the paper Synthesis of Tiled Patterns usingFactor Graphs of SIGGRAPH 2013 and propose a kind of method of as probability graph model, pattern being carried out to modeling by usage factor figure.Usage factor represents can not relax logical constraint and the statistical relationship that can relax between paster respectively.YEH is according to the principle of MC-SAT sampling algorithm simultaneously, propose a kind of stochastic sampling mode inputted for factor graph and small-scale sample being called BlockSS, the paster of complexity to input of this stochastic sampling method linearly increases, and has good scale expansion.But this method exists single direction sampling mates the problem that can not recall, be easily absorbed in locally optimal solution, the situation that algorithm do not restrain very easily is produced for comparatively complicated design requirement.
Summary of the invention
Technical matters to be solved by this invention is exactly for existing method above shortcomings, provides a kind of paster image automatic generating calculation based on stochastic sampling,
For solving the problems of the technologies described above, the present invention adopts following technical scheme: a kind of paster image automatic generating calculation based on stochastic sampling, comprises the steps:
The first step, reads in design sample sequence, resolves sample, extract two category informations, the first kind is meet relaxing and not relaxed constraints condition of factor shape, and according to the probability distribution function of the factor calculated factor of statistics, Equations of The Second Kind is the various block information in sample input;
Second step, according to probability distribution function and Slice Sampling method stochastic generation one group of auxiliary variable of the factor;
3rd step, carries out a large amount of stochastic sampling, forms new design proposal;
4th step, to design proposal calculating K L divergence and local asymmetry parameter, and adjust parameter according to the satisfaction of design proposal, determine whether locally optimal solution or globally optimal solution, limited step repeats second and third, four steps generate multiple design proposal;
5th step, sorts to the design proposal produced according to KL divergence, local similarity and satisfaction, selects optimum.
Preferably, in the first step, probability model is expressed as following form by the probability graph model formed by factor graph:
P ( X = x ) = 1 Z Π s Π i φ s , i ( d s , i )
Wherein x is design proposal, and Z is normalization coefficient, φ s,ifor saturation, d s,ifor local syntople, s is factor shape, and i is anchor point position.
Preferably, in second step, according to the design sample of stochastic generation, by being uniformly distributed u s,j~ U [0, φ s,j(d s,j)] in each factor, generate a stochastic variable.
Preferably, the computing method of KL divergence are expressed as:
D KL ( P | | Q ) = ΣP ( i ) ln P ( i ) Q ( i )
Probability distribution P, Q represent the paster frequency histogram of input amendment and generative approach scheme respectively, and computing method are:
P ( C s ) = F ( C s ) Σ b s ∈ Σ s F ( b s )
Wherein ∑ srepresent all factor set for factor shape s, F () represents the number of times that certain factor occurs in current design;
First Local Symmetries calculates the symmetrical degree between any two pasters, according to symmetric relation between paster, all rectangular areas then in exhaustive design proposal judge that whether it is symmetrical, finally calculate symmetric parameter.
Preferably, in 5th step, first standardization is carried out to KL divergence and local asymmetry parameter and merge acquisition ranking factor: ranking factor=[(KL loose degree ?E (KL divergence))/Var (KL divergence)] * [(symmetry ginseng number ?E (asymmetry parameter))/Var (asymmetry parameter)]; Then foundation satisfaction is to schemes ranking, and the scheme identical for satisfaction sorts according to ranking factor again, obtains final plan sequence and optimum.
The present invention regards original simple sampling process as an optimizing process, by the not satisfaction of design proposal, does not namely meet the factor number of stochastic sampling condition, as optimization aim, using the design of stochastic sampling generation each time as variable to be optimized.Whole sampling process like this just can be considered by searching for the minimum optimization problem of factor number that suitable design proposal makes not satisfy condition.The method improve original sampling algorithm simultaneously, sampling coupling can be recalled by single order, decrease the possibility being absorbed in local optimum to a certain extent.The present invention also proposes a kind of local similarity parameter on this algorithm basis, to be combined and sampled result to be sorted, select the result having more actual reference significance in optimum solution by this parameter with KL divergence.
Compared with prior art, novelty of the present invention and practicality are mainly reflected in four aspects:
1. the present invention regards original simple sampling process as an optimizing process, and can judge whether to be absorbed in locally optimal solution;
2. the present invention adopts the alternative manner of dynamic parameter, makes parameter to be adapted to current state;
3. the present invention once produces multiple design result, and from wherein extract meet primitive request most scheme as optimum.
The sampling algorithm that 4.YEH proposes is a kind of unidirectional matching algorithm, owing to recalling in the other direction, very easily occur not mating phenomenon at boundary, situation for complex boundary is difficult to produce good effect, and the sampling algorithm that the present invention improves, by carrying out single order backtracking to the unmatched detection in border, boundary problem can be solved preferably, not producing extra computation complexity simultaneously.
Accompanying drawing explanation
Below in conjunction with the drawings and specific embodiments, the invention will be further described:
Fig. 1 is the process flow diagram of the inventive method.
Embodiment
Principle of the present invention is, design proposal is as a variable to be optimized, and itself is extremely complicated and do not possess stronger logical relation between any two design proposals, and heuritic approach therefore cannot be used to carry out optimal solution search.But advantage is to judge whether to reach globally optimal solution by meeting property, can thinks for the solution producing concussion in local and reach local optimum, and jump out in time, again search for.Algorithm of the present invention have employed the alternative manner of dynamic parameter simultaneously, makes parameter to be adapted to current state, can according to current solution Problems existing dynamic conditioning sampling process.
Elaborate to embodiments of the invention below in conjunction with Fig. 1, the present embodiment is implemented under premised on technical solution of the present invention, and give detailed embodiment and concrete operating process, the present embodiment comprises the following steps:
The first step, read in design sample sequence, resolve sample, extract two category informations, the first kind is meet relaxing and not relaxed constraints condition of factor shape, according to the probability distribution function of the factor calculated factor of statistics, Equations of The Second Kind is the various block information in sample input.
In this example, relaxed constraints refers to whole transverse direction in the sample sequence read in and longitudinal second order syntople, not relaxed constraints refer to laterally with longitudinal quadravalence syntople.Probability model can be expressed as following form by the probability graph model formed by factor graph:
P ( X = x ) = 1 Z Π s Π i φ s , i ( d s , i )
Wherein x is design proposal, and Z is normalization coefficient, φ s,ifor saturation, d s,ifor local syntople, s is factor shape, and i is anchor point position.
The block information that the block information extracted in this example and YEH propose in paper is identical.
Second step, according to the probability distribution function of the factor and Slice Sampling method stochastic generation one group of auxiliary variable.According to the design sample of stochastic generation, by being uniformly distributed u s,j~ U [0, φ s,j(d s,j)] in each factor, generate a stochastic variable.
3rd step, the method for sampling proposed by the present invention carry out a large amount of stochastic sampling, form new design proposal.
The new method of sampling algorithm that this example proposes is as follows:
Make cold be the quantity that current design scheme meets Slice Sampling threshold value, Stochastic choice anchor point, Stochastic choice block information upgrades, and makes cnew be the quantity that after upgrading, design proposal meets Slice Sampling threshold value.
4th step, to design proposal calculating K L divergence and local asymmetry parameter, and according to the satisfaction of design proposal adjustment parameter, determine whether locally optimal solution or globally optimal solution, limited step repeats second and third, four steps generate multiple design proposal.
The computing method of KL divergence can be expressed as:
D KL ( P | | Q ) = ΣP ( i ) ln P ( i ) Q ( i )
Probability distribution P, Q represent the paster frequency histogram of input amendment and generative approach scheme respectively, and computing method are:
P ( C s ) = F ( C s ) Σ b s ∈ Σ s F ( b s )
Wherein ∑ srepresent all factor set for factor shape s, F () represents the number of times that certain factor occurs in current design.
First Local Symmetries calculates the symmetrical degree between any two pasters, according to symmetric relation between paster, all rectangular areas then in exhaustive design proposal judge that whether it is symmetrical, finally calculate symmetric parameter.
5th step, according to KL divergence, Local Symmetries and satisfaction to produce design proposal sort, select optimum.
First this example carries out standardization to KL divergence and local asymmetry parameter and merges acquisition ranking factor:
Ranking factor=[(KL San Du ?E (KL divergence))/Var (KL divergence)] * [(symmetry Can Shuo ?E (asymmetry parameter))/Var (asymmetry parameter)]
Then foundation satisfaction is to schemes ranking, and the scheme identical for satisfaction sorts according to ranking factor again, obtains final plan sequence and optimum
Implementation result
According to above-mentioned steps, this example is selected to devise experiment sample and constraint voluntarily, and experiment sample comprises 56 pieces of paster files and 6 design proposal samples, and shape constraining condition is the irregular obstacle body region of 13 × 26, carries out 30 iteration.All tests all realize on PC computing machine, and the major parameter of this PC computing machine is: central processing unit AMD Phenom (tm) II N830Triple ?Core Proccessor 2.10GHz, internal memory 2GB.
Experiment shows, this example generates automatically to comparatively complicated image has good effect.

Claims (5)

1., based on a paster image automatic generating calculation for stochastic sampling, it is characterized in that comprising the steps:
The first step, reads in design sample sequence, resolves sample, extract two category informations, the first kind is meet relaxing and not relaxed constraints condition of factor shape, and according to the probability distribution function of the factor calculated factor of statistics, Equations of The Second Kind is the various block information in sample input;
Second step, according to probability distribution function and Slice Sampling method stochastic generation one group of auxiliary variable of the factor;
3rd step, carries out a large amount of stochastic sampling, forms new design proposal;
4th step, to design proposal calculating K L divergence and local asymmetry parameter, and adjust parameter according to the satisfaction of design proposal, determine whether locally optimal solution or globally optimal solution, limited step repeats second and third, four steps generate multiple design proposal;
5th step, sorts to the design proposal produced according to KL divergence, local similarity and satisfaction, selects optimum.
2. a kind of paster image automatic generating calculation based on stochastic sampling according to claim 1, it is characterized in that: in the first step, probability model is expressed as following form by the probability graph model formed by factor graph:
P ( X = x ) = 1 Z Π s Π i φ s , i ( d s , i )
Wherein x is design proposal, and Z is normalization coefficient, φ s,ifor saturation, d s,ifor local syntople, s is factor shape, and i is anchor point position.
3. a kind of paster image automatic generating calculation based on stochastic sampling according to claim 1, is characterized in that: in second step, according to the design sample of stochastic generation, by being uniformly distributed u s,j~ U [0, φ s,j(d s,j)] in each factor, generate a stochastic variable.
4. a kind of paster image automatic generating calculation based on stochastic sampling according to claim 1, is characterized in that: the computing method of KL divergence are expressed as:
D KL ( P | | Q ) = ΣP ( i ) ln P ( i ) Q ( i )
Probability distribution P, Q represent the paster frequency histogram of input amendment and generative approach scheme respectively, and computing method are:
P ( C s ) = f ( C s ) Σ b s ∈ Σ s F ( b s )
Wherein Σ srepresent all factor set for factor shape s, F () represents the number of times that certain factor occurs in current design;
First Local Symmetries calculates the symmetrical degree between any two pasters, according to symmetric relation between paster, all rectangular areas then in exhaustive design proposal judge that whether it is symmetrical, finally calculate symmetric parameter.
5. a kind of paster image automatic generating calculation based on stochastic sampling according to claim 1, it is characterized in that: in the 5th step, first standardization is carried out to KL divergence and local asymmetry parameter and merge acquisition ranking factor: ranking factor=[(KL loose degree ?E (KL divergence))/Var (KL divergence)] * [(symmetry ginseng number ?E (asymmetry parameter))/Var (asymmetry parameter)]; Then foundation satisfaction is to schemes ranking, and the scheme identical for satisfaction sorts according to ranking factor again, obtains final plan sequence and optimum.
CN201510139851.9A 2015-03-27 2015-03-27 Automatic patch image generation algorithm based on random sampling Pending CN104778311A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201510139851.9A CN104778311A (en) 2015-03-27 2015-03-27 Automatic patch image generation algorithm based on random sampling

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201510139851.9A CN104778311A (en) 2015-03-27 2015-03-27 Automatic patch image generation algorithm based on random sampling

Publications (1)

Publication Number Publication Date
CN104778311A true CN104778311A (en) 2015-07-15

Family

ID=53619772

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201510139851.9A Pending CN104778311A (en) 2015-03-27 2015-03-27 Automatic patch image generation algorithm based on random sampling

Country Status (1)

Country Link
CN (1) CN104778311A (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11175751A (en) * 1997-12-11 1999-07-02 Dainippon Printing Co Ltd Method and device for generating image
CN103021025A (en) * 2012-12-27 2013-04-03 浙江农林大学 Image generating method by means of computer program

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11175751A (en) * 1997-12-11 1999-07-02 Dainippon Printing Co Ltd Method and device for generating image
CN103021025A (en) * 2012-12-27 2013-04-03 浙江农林大学 Image generating method by means of computer program

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
YI-TING YEH 等: "Synthesis of Tiled Patterns using Factor Graphs", 《ACM TRANSACTIONS ON GRAPHICS》 *

Similar Documents

Publication Publication Date Title
CN106685716B (en) Network topology adaptive data visualization method and device
CN106203506B (en) A kind of pedestrian detection method based on depth learning technology
CN103413133B (en) Automatically-extracting power line method in random laser point cloud data
CN109377448A (en) A kind of facial image restorative procedure based on generation confrontation network
CN103310481B (en) A kind of point cloud compressing method based on fuzzy entropy iteration
CN107392875A (en) A kind of cloud data denoising method based on the division of k neighbours domain
CN103207856A (en) Ontology concept and hierarchical relation generation method
Yeh et al. Synthesis of tiled patterns using factor graphs
CN101783016B (en) Crown appearance extract method based on shape analysis
Li Global transport on a spherical multiple-cell grid
CN107146251A (en) A kind of symmetrical analysis method of three-dimensional face model
CN101877034B (en) Land utilization automatic division method
CN103824259B (en) The image composition beautification method of a kind of view-based access control model region specific gravity balance rule and system
CN109299301A (en) A kind of method for searching three-dimension model based on distribution of shapes and curvature
CN105894553A (en) Street spatial form layout method based on grid selection
Remacle et al. Fast and robust mesh generation on the sphere—Application to coastal domains
Sun Design and optimization of indoor space layout based on deep learning
CN104778311A (en) Automatic patch image generation algorithm based on random sampling
CN104794750A (en) Tree point cloud three-dimensional reconstruction method based on space colonizing algorithm
CN105426626A (en) Similar data style cluster based multiple-point geostatistics modeling method
Bai Sustainable Development Garden Landscape Design Based on Data Mining and Virtual Reality
CN100552722C (en) Method for extracting multi-dimension curvature characteristic on triangle gridding
Sahputra et al. Aceh ornaments exploration as ideas of contemporary building form through digital transformation
CN108920501A (en) A kind of relation table nonbonding attributive character extracts and data creation method
CN103150360B (en) A kind of social networks layered approach based on domination set innovatory algorithm

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
EXSB Decision made by sipo to initiate substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20150715