CN106709171A - Repeat mode discovery-based printed pattern generation method - Google Patents
Repeat mode discovery-based printed pattern generation method Download PDFInfo
- Publication number
- CN106709171A CN106709171A CN201611144424.0A CN201611144424A CN106709171A CN 106709171 A CN106709171 A CN 106709171A CN 201611144424 A CN201611144424 A CN 201611144424A CN 106709171 A CN106709171 A CN 106709171A
- Authority
- CN
- China
- Prior art keywords
- oimg
- foreground object
- template
- grid
- image
- 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 35
- 230000009466 transformation Effects 0.000 claims abstract description 17
- PXFBZOLANLWPMH-UHFFFAOYSA-N 16-Epiaffinine Natural products C1C(C2=CC=CC=C2N2)=C2C(=O)CC2C(=CC)CN(C)C1C2CO PXFBZOLANLWPMH-UHFFFAOYSA-N 0.000 claims abstract description 16
- 230000015572 biosynthetic process Effects 0.000 claims abstract description 15
- 238000003786 synthesis reaction Methods 0.000 claims abstract description 13
- 238000004144 decalcomania Methods 0.000 claims description 60
- 238000004891 communication Methods 0.000 claims description 14
- 239000000203 mixture Substances 0.000 claims description 12
- 238000010422 painting Methods 0.000 claims description 11
- 230000011218 segmentation Effects 0.000 claims description 10
- 238000012217 deletion Methods 0.000 claims description 6
- 230000037430 deletion Effects 0.000 claims description 6
- 238000010276 construction Methods 0.000 claims description 3
- 235000019580 granularity Nutrition 0.000 description 11
- 238000007639 printing Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 5
- 238000013461 design Methods 0.000 description 4
- 238000004043 dyeing Methods 0.000 description 4
- 230000008569 process Effects 0.000 description 4
- 238000006243 chemical reaction Methods 0.000 description 3
- 238000011960 computer-aided design Methods 0.000 description 3
- 239000004744 fabric Substances 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 238000009826 distribution Methods 0.000 description 2
- 238000000605 extraction Methods 0.000 description 2
- 238000004519 manufacturing process Methods 0.000 description 2
- 238000011160 research Methods 0.000 description 2
- 239000004753 textile Substances 0.000 description 2
- 241000282994 Cervidae Species 0.000 description 1
- 241000283973 Oryctolagus cuniculus Species 0.000 description 1
- 238000013459 approach Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000000903 blocking effect Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 239000012141 concentrate Substances 0.000 description 1
- 230000008878 coupling Effects 0.000 description 1
- 238000010168 coupling process Methods 0.000 description 1
- 238000005859 coupling reaction Methods 0.000 description 1
- 238000005520 cutting process Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000001514 detection method Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000018109 developmental process Effects 0.000 description 1
- 235000013399 edible fruits Nutrition 0.000 description 1
- 238000005530 etching Methods 0.000 description 1
- 230000002452 interceptive effect Effects 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000003973 paint Substances 0.000 description 1
- 238000002360 preparation method Methods 0.000 description 1
- 210000001747 pupil Anatomy 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F30/00—Computer-aided design [CAD]
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Theoretical Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Computer Hardware Design (AREA)
- Evolutionary Computation (AREA)
- Geometry (AREA)
- General Engineering & Computer Science (AREA)
- Processing Or Creating Images (AREA)
Abstract
The invention discloses a repeat mode discovery-based printed pattern generation method. The method comprises the following steps of: carrying out repeat mode discovery on an input printed image set so as to discover an object-class image mode which repeatedly emerges in the image set; constructing a layout template for a repeat object, carrying out multi-granularity quadrilateral mesh generation and optimum layout solution on the profile of an input printed pattern through iterative loop, and calculating an object optimum layout which satisfies a printed pattern constraint condition; and calculating affine transformation of living example of the object and a hierarchical relationship between the living examples during the splicing according to the position and dimension of the template in the layout, so as to carry out living example drawing to realize the synthesis of the printed pattern.
Description
Technical field
The present invention relates to a kind of decalcomania generation method, belong to Computer-aided Design Technology field, specifically
A kind of decalcomania generation method found based on repeat pattern.
Background technology
With the high speed development of textile printing and dyeing industry, purchaser and user are more and more diversified to the demand of decalcomania,
The popular cycle of dyeing and printing products is shorter and shorter, and decalcomania change is increasingly faster, the importance more and more higher of printing pattern designing.
At present, by digital printing technology, textile printing and dyeing industry can realize the printing and dyeing of the small lot decalcomania of user's customization,
This imparts the feasibility that user voluntarily creates decalcomania while ordering amount threshold is reduced.But, user's creation
What the intention of decalcomania was often obscured, if without reference to example, user is difficult clearly specific design content;Meanwhile, it is right
Printing pattern designing process is generally too complicated for layman, and operation is more difficult;Also, due to current stamp
Design is mainly directed towards mass production, and pattern contour is mostly rectangle to meet the periodicity of arrangement, and user is specific
The cloth shape of demand is mostly irregular under occasion, by original decalcomania carry out cutting will certainly to pattern aesthetic property and
Integrality is damaged.Therefore, extract structural heavy from existing decalcomania example using Computer-aided Design Technology
Multiple object, and the decalcomania of the personalized shape for directly meeting user's use demand is generated, decalcomania can be reduced and set
The difficulty of meter, enriches the application category of digital printing technology.
There are many researchers to attempt carrying out from different angles the generation of area of computer aided decalcomania, example at present
Such as:Document 1:Zhao Haiying, Peng Hong, Yang Yifan, the positive light of Xu are based on carpet pattern generation method [J] computer aided manufacturings of topology configuration
Help design and graphics journal, 2013,25 (4):The Xinjiang ethnic groups carpet style decalcomania synthesis side proposed in 502-509.
Method;Document 2:Djibril M O,Thami R O H.IsLamic geometrical patterns indexing and
classification using discrete symmetry groups[J].Journal on Computing and
Cultural Heritage,2008,1(2):The Islamic theme novel pattern generation method proposed in Article No.10.;
Document 3:Research [J] the computer research of the creation of Bu Jiajun, Xu Duanqing, Chen Chun, Ma Lingzhou moire patterns and preparation method and hair
Exhibition, 2001,38 (1):Moire pattern generation method proposed in 105-110. etc..These methods are all from decalcomania style or reality
The angle of example content is set out, inherent characteristicses layout layout and generating algorithm according to example, and single algorithm is to different type
Decalcomania adaptability it is poor, it is impossible to meet to the reconstruction of various decalcomania examples and synthesis.
On the other hand, document 4:The composition art and its computer of the small inscription fractal patterns of king realize [J] area of computer aided
Design and graphics journal, 2001,13 (1):The fractal pattern formative method proposed in 83-86.;Document 5:Wang Qi, Liu Hong, Nie
Application [J] CAD and graphics journal, 2010,22 (1) of the brilliant evolution art in wall paints design:
24-29;Cycloid configuration generating algorithm based on the art of evolving of middle proposition etc..These methods are all from the angle of geometric space layout
Set out, by the primitive geometric element to representative pattern example carry out logic repeatedly, conversion or the combined crosswise of position formed
Different layout results symmetrically or non-symmetrically, therefore the decalcomania outline of generation is all fixed, is mostly rectangle, it is impossible to
To the more uniform decalcomania layout of user-defined non-rectangular pattern profile generation example distribution.
The content of the invention
Goal of the invention:The technical problems to be solved by the invention are directed to the deficiencies in the prior art, there is provided one kind is based on weight
The automation decalcomania generation method that complex pattern finds, for supporting that area of computer aided finds to repeat mould from decalcomania example
Formula, and reproduce decalcomania.
In order to solve the above-mentioned technical problem, the invention discloses a kind of decalcomania generation side found based on repeat pattern
Method, comprises the following steps:
Step 1, repeating objects find:Input picture collection, is partitioned into foreground object, to the foreground object that is partitioned into iteratively
Similarity mode between any two is carried out, so that the object level image model repeated in calculating image set.
Repeating objects are arranged by step 2:The template being made up of quadrilateral mesh to the repeating objects construction for excavating,
And by iterative cycles, the decalcomania profile to giving carries out many granularity quadrilateral mesh subdivisions and discrete compact arrangement is asked
Solution, calculates the object optimal location for meeting decalcomania constraints.
Step 3, synthesizes decalcomania:Template position and yardstick in object optimal location, calculate layout real
The affine transformation of example synthesis, and hierarchical relationship when there is covering between layout example, so as to be laid out the drafting of example,
To realize the synthesis of decalcomania.
Step 1 of the present invention is comprised the following steps:
Step 1-1, Object Segmentation:Input picture collection S, calculates each saliency map of image I in image set S
PSaliency, and a mask image, background before mask image is carried out into image as initialization condition are generated to its thresholding
Segmentation, the parameter setting of wherein thresholding is as follows:
Wherein PSaliency (p) is the value of pixel p in saliency map picture, and PMask (p) is pixel p in mask image
Value, GC_FGD represents PMask (p) for foreground pixel, and GC_BGD represents PMask (p) for background pixel, and GC_PRFGD is represented
PMask (p) may be foreground pixel, and the interior zone that each the outermost layer profile in preceding background segment result is included is used as one
The mask OMask of individual foreground object, if OMask (p)=0, pi is background pixel, and otherwise pi is foreground pixel, foreground pixel
Region is foreground object OImg in corresponding image I.All foreground objects composition foreground object set O of image II。
Step 1-2, similitude matching:To the foreground object set O of arbitrary image I in image set SI, appoint and take two of which
Foreground object OImgiAnd OImgj, 0≤i≤j≤NI, NIIt is OIMiddle foreground object sum, calculates foreground object OImg respectivelyiWith
OImgjSet of characteristic points FiAnd Fj.For foreground object OImgiSet of characteristic points FiIn each characteristic point fi,kf, 0≤kf
≤ni, wherein niIt is FiComprising feature point number, calculate foreground object OImgjSet of characteristic points FjIn closest therewith spy
Levy a littlefj,l∈Fj, and secondary neighbouring characteristic pointfj,l∈
Fj-fj,lIf,Then by fi,kfAnd fj,lThe point for regarding one group of correct matching as is right.If set of characteristic points FiIn just
Really the characteristic point of matching is to number ni,j>0.3ni, then foreground object OImgiWith OImgjIt is mutually matched, is classified as cluster, and compare
Compared with its set of characteristic points FiAnd FjIn feature point number, selection feature point number relatively large number of foreground object generation therebetween
The repeating objects of table this cluster, repeating objects OImgRRepresent, and in foreground object set OIMiddle deletion foreground object OImgi
And OImgj.Iteratively to repeating objects OImgRWith foreground object set OIIn remaining foreground object carry out similitude successively
Match somebody with somebody, and update repeating objects OImgRWith the foreground object for deleting matching.
Step 1-3, judges whether to complete:Check foreground object set OIWhether it is sky, if it is empty, or foreground object set
OIMiddle foreground object number is equal to 1, then go to step 2-1;Otherwise, 1-2 is gone to step.
Step 2 of the present invention is comprised the following steps:
Step 2-1, generates template:To representational repeating objects OImgRCorresponding mask image OMaskRCarry out uniform
Rectangular mesh subdivision, the granularity of subdivision isWherein WidthR、HeightRRespectively mask figure
As OMaskRWide and height.The grid generated after subdivision is designated as MR, calculate mask image OMaskRIn each dough sheet bR,kbIt is corresponding
The foreground area ratio R in regionR,kb:
Wherein, OMaskRP () is mask image OMaskRThe value of middle pixel p, if RR,kb<25%, then by dough sheet bR,kbFrom MR
Middle deletion.
Template TRTopological structure be defined as follows:To grid MRIn all nodes set up by VBIn all nodes compositions
Communication path and VIIn all nodes composition minimum spanning tree, wherein VBIt is grid MRIn boundary node set, VIIt is grid
MRIn non-boundary node set, calculate in communication path and minimum spanning tree each node motion to the coordinate side of next node
To being stored as sequence LR, LR=(l1,l2,…ln), lk∈ { 0,1,2,3,4 }, wherein 1≤k≤n-1, n are grid MRIn section
Point sum, lkRepresent k-th node v in communication pathkWith+1 vertex v of kthk+1Between spatial relation, its value be 0 generation
Table xk>xk+1, it is 1 to represent yk>yk+1, it is 2 to represent xk≤xk+1, it is 3 to represent yk≤yk+1, wherein xk、ykV is represented respectivelykHorizontal seat
Mark and ordinate, xk+1、yk+1V is represented respectivelyk+1Abscissa and ordinate, while calculating all branches section in minimum spanning tree
Point is in LRIn sequence number, be stored as sequence BR, LRAnd BRCollectively constitute repeating objects OImgRCorresponding template TRTopological structure,
l1Corresponding grid node is anchor point;
Step 2-2, quadrilateral mesh subdivision:What user was given is carried out for generating the two-dimensional silhouette region of decalcomania
Quadrilateral mesh subdivision, subdivision granularity Q is initialized as 100, generates the quadrilateral mesh M of profile.
Step 2-3, discrete compact arrangement:Calculate each template TRAll layout realities for meeting topological structure in grid M
Example TR,a, wherein a is the position of anchor point in the communication path of the layout example in grid M, TR,a∈ { 0,1 }, wherein TR,a=
1 represents during the layout example appears in final layout result, TR,a=0 represents layout example quilt in final layout result
Abandon, layout example T is calculated by equation belowR,aWeight wR,a:
Wherein rand is any random integers, and b is any dough sheet in grid M, and following about to layout example addition
Beam condition:
WhereinIt is average foreground object number, N contained by every image in image setTIt is template number.By calculating prospect
Example under specifying constraint discretization global optimum layout, obtain repeating objects current grid and constraint under the conditions of
Optimal discrete compact arrangement, i.e. value are 1 prospect example TR,aSet.
Step 2-4, judges whether to receive:The layout example T that the value for obtaining is 1 is solved in statistic procedure 2-3R,aNumber
C, ifThen go to step 3-1;Otherwise, update the value of Q in step 2-2 for Q 1.2, and go to step 2-2.
Step 3 of the present invention is comprised the following steps:
Step 3-1, object transformation:Value to being produced in each step 2-3 is 1 layout example TR,aCorresponding repetition
Object is rotated and is scaled equiaffine conversion.OImgREntering behavior carries out angle for r (OImgR, rotation and ratio a) are s
(OImgR, a) it is the scaling of ratio, the rendered object OImg after generation affine transformationrs,a, and determine the drafting center on painting canvas
vc,a;
Anglec of rotation r (OImgR, computing formula a) is:
Wherein vkv,aIt is layout example TR,aIn grid MRIn any summit,Respectively vkv,aIt is horizontal, vertical
Coordinate, vc,aIt is layout example TR,aThe centre of form,Respectively vc,aAbscissa and ordinate, vkvIt is template TRIn
Any summit,Respectively vkvAbscissa and ordinate, vc,RIt is template TRThe centre of form,Respectively vc,R
Abscissa and ordinate, nvRIt is template TRThe node total number that includes of grid.Pantograph ratio s is calculated by equation below
(OImgR,a):
Wherein emIt is template TRGrid in any a line.
Step 3-2, hierarchical ranking:The rendered object area that all layout examples are crossed according to corresponding affine transformation is from small
To big sequence, formation sequence Q, wherein for arbitrary placement example TR,a, the real area S (T in painting canvasR,a) be:
S(TR,a)=s (OImgR,a)×p∈OMaskR[OMaskR(p)=255]
Step 3-3, objects draw:According to the sequence Q produced in step 3-2, product in all step 3-1 is drawn on painting canvas
Rendered object after raw affine transformation, wherein for arbitrarily drawn object OImgrs,a, position is drawn with vc,aCentered on, with reality
The generation of existing decalcomania.
Beneficial effect:The present invention has advantages below:First, the present invention can concentrate discovery to meet in given graphic image
The pattern sample of decalcomania demand, that is, the subject area for repeating, for generating new decalcomania.Secondly, the present invention
The decalcomania of object compact arrangement can be quickly realized on the premise of the abundant pattern contour of User Defined is met.Finally,
In the decalcomania of the present invention generation same target dispersed distribution in a given area, and different object distributed quantity more
Uniformly.
Brief description of the drawings
The present invention is done with reference to the accompanying drawings and detailed description further is illustrated, it is of the invention above-mentioned or
Otherwise advantage will become apparent.
Fig. 1 is handling process schematic diagram of the invention.
Fig. 2 a and Fig. 2 b are the input graphic image collection example schematic diagrams of embodiment.
Fig. 2 c and Fig. 2 d are the schematic diagrames that Object Segmentation is carried out to the input picture collection of embodiment.
Fig. 3 a are that ground similarity mode is iterated to the input picture collection of embodiment, and repeating objects shows obtained from
It is intended to.
Fig. 3 b are the schematic diagrames of the corresponding mask image of foreground object of Fig. 3 a.
Fig. 4 a are the schematic diagrames that corresponding templates grid is generated to the foreground image of Fig. 3 a.
Fig. 4 b are the decalcomania outline drawings of embodiment.
Fig. 4 c are the schematic diagrames that quadrilateral mesh subdivision is carried out to the decalcomania profile of Fig. 4 b.
Fig. 4 d are, to Fig. 4 c quadrilateral mesh, the schematic diagram of discrete compact arrangement to be carried out in the template of Fig. 4 a.
Fig. 5 draws the schematic diagram of decalcomania on the basis of discrete compact arrangement.
Specific embodiment
As shown in figure 1, disclosed by the invention is a kind of decalcomania generation method found based on repeat pattern, specific bag
Include following steps:
Step one, repeating objects find:To existing image set, foreground object is partitioned into, and two are made iteratively to it
Similarity mode between two, so that the object level image model repeated in calculating image set.
Step 2, repeating objects arrangement:The template being made up of quadrilateral mesh to the repeating objects construction for excavating, and pass through
Iterative cycles, the decalcomania profile to giving carries out many granularity quadrilateral mesh subdivisions and discrete compact arrangement is solved, and calculates
Go out to meet the object optimal location of decalcomania constraints.
Step 3, decalcomania synthesis:Template position and yardstick in layout, calculate layout example synthesis
Affine transformation, and hierarchical relationship when there is covering between layout example, so as to be laid out the drafting of example, to realize print
The synthesis of floral pattern.
Lower mask body introduces the main flow of each step:
Step 1, repeating objects find:
Repeating objects discovery procedure carries out the other repeat pattern of object level to input picture collection and excavates, and in each repetition
A representative object is chosen in the cluster of object, for decalcomania generation provides pattern source.Including following steps:
Step 11, Object Segmentation:Document 6 is used to each image I in image set S:Efficient Salient
Region Detection with Soft Image Abstraction[C].International Conference on
Computer Vision,2013:Global Uniqueness methods generation saliency map described in 1529-1536.
PSaliency, and a mask image, background before mask image is carried out into image as initialization condition are generated to its thresholding
Segmentation, the parameter setting of wherein thresholding is as follows:
Wherein PSaliency (p) is the value of pixel p in saliency map picture, and PMask (p) is pixel p in mask image
Value, GC_FGD represents PMask (p) for foreground pixel, and GC_BGD represents PMask (p) for background pixel, and GC_PRFGD is expression
PMask (p) may be foreground pixel, and preceding background segment method uses document 7:“Grabcut”–Interactiveforegroun
d extraction using iterated graph cuts[J].ACMTransactions onGraphics2004,23
(3):The Grabcut algorithms proposed in 309-314., iteration carries out four segmentations, carries out one to mask image after segmentation every time
Secondary expansion and etching operation.The interior zone that each outermost layer profile in preceding background segment result is included is used as a prospect
The mask OMask of object, the situation of background area is included with foreground area in adapting to segmentation result, if OMask (p)=0,
P is background pixel, and otherwise p is foreground pixel, and region is foreground object OImg in the corresponding image I of foreground pixel.The institute of image I
Foreground object set O is constituted by foreground objectI。
Step 12, similitude matching:To the foreground object set O of arbitrary image I in image setI, appoint and take two foreground objects
OImgiAnd OImgj, 0≤i≤j≤NI, NIIt is OIMiddle foreground object sum, calculates set of characteristic points F respectivelyiAnd Fj, feature point extraction
Method uses document 8:Distinctive Image Features from Scale-Invariant Keypoints[J]
.International Journal of Computer Vision,2004,60(2):The SIFT feature description that 91-110. is proposed
Son.For FiIn each characteristic point fi,kf, 0≤kf≤ni, wherein niIt is FiComprising feature point number, calculate FjIn therewith most
Neighbouring characteristic pointfj,l∈Fj, and secondary neighbouring characteristic point
fj,l∈Fj-fj,lIf,Then by fi,kfAnd fj,lThe point for regarding one group of correct matching as is right.If FiIn correct
The characteristic point matched somebody with somebody is to number ni,j>0.3ni, then OImgiWith OImgjIt is mutually matched, is classified as cluster, and compare its characteristic point
Set FiAnd FjIn feature point number, selection therebetween the relatively large number of foreground object of feature point number represent this cluster
Repeating objects, repeating objects OImgRRepresent, and in OIMiddle deletion OImgiAnd OImgj.Iteratively to repeating objects OImgRWith
Foreground object set OIIn remaining foreground object carry out similitude matching successively, and update repeating objects OImgRMatched with deleting
Foreground object.
Step 13, judges whether to complete:Check OIWhether it is sky, if it is empty, or OIMiddle foreground object number is equal to 1, then turn
Step 21;Otherwise, 12 are gone to step.
Step 2, repeating objects arrangement:
During repeating objects arrangement, the template of the repeating objects generation quadrilateral mesh composition first to finding, while
Decalcomania profile to being input into carries out the quadrilateral mesh subdivision and discrete compact arrangement of many granularities, by a mistake for iteration
Journey, realization meets the compact arrangement result of repeating objects quantitative requirement.Including following steps:
Step 21, template generation:First to representative repeating objects OImgRCorresponding mask image OMaskRCarry out uniform
Rectangular mesh subdivision, the granularity of subdivision isWherein WidthR、HeightRRespectively
OMaskRWide and height, so as to by OMaskRIt is divided into a series of completely the same rectangular block of shapes.For the net generated after subdivision
Lattice MR, in order that the shape in template fitting repeating objects region, calculates each dough sheet b in mask imageR,kbBefore corresponding region
Scape area ratio RR,kb, computing formula is as follows:
Wherein OMaskRP () is the value of mask image pixel p, if RR,kb<25%, then by dough sheet fR,kbFrom MRMiddle deletion.
Due to MRThere is communication path in middle boundary node, non-boundary node may not exist communication path, therefore to grid MR
In all nodes set up by VBIn all nodes composition communication path and VIIn all nodes composition minimum spanning tree, its
Middle VBIt is grid MRIn boundary node set, VIIt is grid MRIn non-boundary node set, calculate communication path and most your pupil
Each node motion of Cheng Shuzhong is stored as sequence L to the coordinate direction of next nodeR, LR=(l1,l2,…ln), lk∈{0,1,
2,3,4 }, 1≤k≤n-1, wherein n are grid MRIn node total number, lkRepresent k-th node v in communication pathkWith kth+1
Individual vertex vk+1Between spatial relation, its value represents x for 0k>xk+1, it is 1 to represent yk>yk+1, it is 2 to represent xk≤xk+1, it is 3
Represent yk≤yk+1, wherein xk、ykV is represented respectivelykAbscissa and ordinate, xk+1、yk+1V is represented respectivelyk+1Abscissa and vertical
Coordinate, while all branch nodes are in L in calculating minimum spanning treeRIn sequence number, be stored as sequence BR, LRAnd BRCollectively constitute
Repeating objects OImgRCorresponding template TRTopological structure, l1Corresponding grid node is anchor point;
Step 22, quadrilateral mesh subdivision:What user was given is carried out for generating the two-dimensional silhouette region of decalcomania
Quadrilateral mesh subdivision, subdivision algorithm is using using document 9:Data-Driven Interactive Quadrangulation
[J].Acm Transactions on Graphics,2015,34(4):Subdivision algorithm in 1-10., subdivision granularity Q initialization
It is 100, generates the quadrilateral mesh M of profile.
Step 23, discrete compact arrangement:Calculate each template TRAll layout examples for meeting topological structure in grid M
TR,a, wherein a is the position of anchor point in the communication path of the layout example in grid M, TR,a∈ { 0,1 }, wherein TR,a=1
Represent during the layout example appears in final layout result, TR,a=0 represents the layout example is thrown in final layout result
Abandon, layout example T is calculated by equation belowR,aWeight wR,a:
Wherein rand is any random integers, and f is any dough sheet in M.Using document 10:Computing Layouts
with Deformable Templates[J],Acm Transactions on Graphics,2014,33(4):In 70-79.
Discretization global optimum placement algorithm, be calculated as follows the globally optimal solution of Objective function:
Wherein bkbIt is any one dough sheet in M,It is average foreground object number, N contained by every image in image setT
It is template number, first function is the object function of discrete optimal location, and second and third inequality is constraint inequality, can
Solve the prospect example T that optimal discrete compact arrangement of the repeating objects under the conditions of current grid and constraint, i.e. value are for 1R,aCollection
Close.
Step 24, judges whether to receive:The layout example T that the value for obtaining is 1 is solved in statistic procedure 23R,aNumber C,
IfThe requirement that layout result meets decalcomania layout is represented, then goes to step 31;Otherwise, quadrilateral mesh subdivision is reduced
Granularity, that is, update the value of Q in step 22 for Q 1.2, and go to step 22.
Step 3, decalcomania synthesis:
In decalcomania building-up process, the result first according to discrete compact arrangement calculates each repeating objects and is plotted in cloth
The affine transformation to be carried out in the corresponding canvas location of office's example, and the real area in painting canvas is plotted according to layout example
The hierarchical relationship between object is calculated, so as to realize the synthesis of decalcomania.Including following steps:
Step 31, object transformation:Value to being produced in each step 23 is 1 layout example TR,aCorresponding repetition is right
As being rotated and being scaled equiaffine conversion, OImgREntering behavior carries out angle for r (OImgR, rotation and ratio a) are s
(OImgR, a) it is the scaling of ratio, the rendered object OImg after generation affine transformationrs,a, and determine the drafting center on painting canvas
vc,a;The numerical value of affine transformation is solved by the concrete condition of template instances in grid M and obtained.Anglec of rotation r (OImgR, meter a)
Calculating formula is:
Wherein vkv,aIt is layout example TR,aIn grid MRIn any summit,Respectively vkv,aIt is horizontal, vertical
Coordinate, vc,aIt is layout example TR,aThe centre of form,Respectively vc,aAbscissa and ordinate, vkvIt is template TRIn
Any summit,Respectively vkvAbscissa and ordinate, vc,RIt is template TRThe centre of form, Respectively
vc,RAbscissa and ordinate, nvRIt is template TRThe node total number that includes of grid.Pantograph ratio s is calculated by equation below
(OImgR,a):
Wherein emIt is template TRGrid in any a line.
Step 32, hierarchical ranking:Situation about blocking is there may be between the corresponding repeating objects of layout example, for existing
The larger repeating objects of region area are plotted in upper strata by two repeating objects of hiding relation, meet near big and far smaller perspective
Relation.Therefore, all layout examples are sorted from small to large according to the rendered object area that corresponding affine transformation is crossed, generates sequence
Row Q, for arbitrary placement example TR,a, the real area S (T in painting canvasR,a) be:
Step 33, objects draw:According to the sequence Q produced in step 32, generation in all step 3-1 is drawn on painting canvas
Affine transformation after rendered object, wherein for arbitrarily drawn object OImgrs,a, position is drawn with vc,aCentered on, to realize
The generation of decalcomania.
Embodiment
In the present embodiment, to the image set being made up of two width printing images of Fig. 2 a and Fig. 2 b inputs, Fig. 2 c and Fig. 2 d are
The mask image generated after Object Segmentation, wherein each white portion represents a foreground object, it is made iteratively two-by-two
Between match and similitude and find repeating objects described in Fig. 3 a.The different repeating objects of 7 classes are found that in the present embodiment altogether, respectively
It is five kinds of rabbits of different shape, deer and five-pointed stars, Fig. 3 b are the corresponding mask image of repeating objects of Fig. 3 a.Fig. 4 a be based on
The template mesh of the quadrilateral mesh composition of Fig. 3 b generations.Fig. 4 a are the profile of the target decalcomania of user input, and it is entered
Row quadrilateral mesh subdivision generates grid described in Fig. 4 c, and based on quadrilateral mesh and template described in Fig. 4 a carries out discrete tight cloth
Office to solve and be laid out optimal solution described in generation Fig. 4 d, generates 46 layout examples in the present embodiment altogether.Fig. 5 is the stamp figure of synthesis
Case result.
Specific implementation process is as follows:
In step one, every image to input picture collection shown in Fig. 2 a and Fig. 2 b calculates saliency map, and according to notable
Degree figure thresholding generates a mask image as initialization condition, and background segment, knot before image are carried out using Grabcut algorithms
Fruit is as shown in Fig. 2 c and Fig. 2 d;To each image in Fig. 2 c and Fig. 2 d, iteratively match similar between wherein each two object
Property, as a result the most object of selected characteristic point number such as schemes as repeating objects in foreground object of every cluster coupling number more than 1
Shown in 3a, the corresponding mask image of each repeating objects is as shown in Figure 3 b.
In step 2, repeating objects are arranged according to given decalcomania profile.First to the weight shown in Fig. 3 b
The template of multiple object mask generation quadrilateral mesh composition, network result is as shown in fig. 4 a;Meanwhile, to defeated shown in Fig. 4 b
Entering decalcomania profile carries out quadrilateral mesh subdivision, and subdivision granularity is initialized as 100, and in the quadrilateral mesh of subdivision generation
Template shown in upper discrete compact arrangement Fig. 4 a.If the layout example number of each template reaches print in the result of discrete compact arrangement
The requirement of floral pattern, then using the layout result as generation decalcomania layout;Subdivision granularity is otherwise reduced, again to print
Floral pattern profile carries out quadrilateral mesh subdivision and calculates discrete compact arrangement.Fig. 4 c are to meet stamp based on Fig. 4 a generations
Quadrilateral mesh under the subdivision granularity of pattern requirement, Fig. 4 d are based on the mould shown in the quadrilateral mesh shown in Fig. 4 c and Fig. 4 a
The discrete compact arrangement result that plate is calculated is illustrated, wherein black silhouette of different shapes represents different template types, wheel
Gray area in exterior feature represents the layout example centered on position of form center, by rotating and scale in discrete compact arrangement.
In step 3, to the layout example in discrete compact arrangement shown in Fig. 4 d according to the real area in painting canvas from big
To small sequence, and based on each layout example positions, the anglec of rotation and scaling in Fig. 4 d, sequentially painted on painting canvas according to this
Rendered object after repeating objects affine transformation shown in drawing 3a, the decalcomania of synthesis is as shown in Figure 5.
The invention provides a kind of decalcomania generation method found based on repeat pattern, the technical scheme is implemented
Method and approach it is a lot, the above is only the preferred embodiment of the present invention, it is noted that general for the art
For logical technical staff, under the premise without departing from the principles of the invention, some improvements and modifications can also be made, these improve and
Retouching also should be regarded as protection scope of the present invention.Each part being not known in the present embodiment can use prior art to be subject to reality
It is existing.
Claims (7)
1. it is a kind of based on repeat pattern find decalcomania generation method, it is characterised in that comprise the following steps:
Step 1, finds repeating objects:Input picture collection, is partitioned into foreground object, and the foreground object to being partitioned into is made iteratively
Similarity mode between any two, so that the object level image model repeated in calculating image set;
Repeating objects are arranged by step 2:The template being made up of quadrilateral mesh to the repeating objects construction for excavating, and lead to
Iterative cycles are crossed, the decalcomania profile to giving carries out many granularity quadrilateral mesh subdivisions and discrete compact arrangement is solved, meter
Calculate the object optimal location for meeting decalcomania constraints;
Step 3, synthesizes decalcomania:Template position and yardstick in object optimal location, calculate layout example and close
Into affine transformation, and exist covering when layout example between hierarchical relationship, so as to be laid out the drafting of example, realize
The synthesis of decalcomania.
2. method according to claim 1, it is characterised in that step 1 is comprised the following steps:
Step 1-1, Object Segmentation:Input picture collection S, calculates any one saliency map of image I in image set S
PSaliency, and a mask image is generated to its thresholding, each the outermost layer profile in preceding background segment result is surrounded
Interior zone as a mask OMask for foreground object, in mask image in the corresponding image I of foreground area region for preceding
All foreground objects composition foreground object set O of scape object OImg, image II;
Step 1-2, similitude matching:To the foreground object set O of arbitrary image I in image set SI, appoint and take two of which prospect pair
As OImgiAnd OImgj, foreground object OImg is calculated respectivelyiAnd OImgjSet of characteristic points FiAnd Fj, 0≤i≤j≤NI, NIFor preceding
Scape object set OIMiddle foreground object sum;
For foreground object OImgiSet of characteristic points FiIn each characteristic point fi,kf, 0≤kf≤ni, niIt is characterized point set
FiComprising feature point number, calculate foreground object OImgjSet of characteristic points FjIn with characteristic point fi,kfMost Euclidean distance is most adjacent
Near characteristic point fj,l, and the neighbouring characteristic point f of Euclidean distance timej,mIf,Then by fi,kfAnd fj,lRegard as
The point of one group of correct matching is right, the feature point number that point set is included is characterized, if set of characteristic points FiIn correct matching spy
Levy a little to number ni,j>0.3ni, then foreground object OImgiWith OImgjIt is mutually matched, is classified as cluster, and compare its characteristic point
Set FiAnd FjIn feature point number, selection therebetween the relatively large number of foreground object of feature point number represent this cluster
Repeating objects, repeating objects OImgRRepresent, in foreground object set OIMiddle deletion foreground object OImgiAnd OImgj, iteration
Ground is to repeating objects OImgRWith foreground object set OIIn remaining foreground object carry out similitude matching successively, and update repetition
Object OImgRWith the foreground object for deleting matching;
Step 1-3, judges whether to complete:Check foreground object set OIWhether it is sky, if it is empty, or foreground object set OIIn
Foreground object number is equal to 1, then go to step 2-1;Otherwise, 1-2 is gone to step.
3. method according to claim 2, it is characterised in that step 2 is comprised the following steps:
Step 2-1, generates template:To representational repeating objects OImgRCorresponding mask image OMaskRCarry out uniform rectangle
Mesh generation, the granularity of subdivision isWherein WidthR、HeightRRespectively mask image
OMaskRWide and height, after subdivision generate grid be designated as MR, calculate mask image OMaskRIn each dough sheet bR,kbCorresponding area
The foreground area ratio R in domainR,kb:
Wherein, OMaskRP () is mask image OMaskRThe value of middle pixel p, if RR,kb<25%, then by dough sheet bR,kbFrom grid MR
Middle deletion, and set up repeating objects OImgRCorresponding template TR, TRTopological structure in first appearance grid vertex be anchor
Point;
Step 2-2, quadrilateral mesh subdivision:What user was given carries out four sides for generating the two-dimensional silhouette region of decalcomania
Shape mesh generation, subdivision granularity Q is initialized as 100, generates the quadrilateral mesh M of profile;
Step 2-3, discrete compact arrangement:Calculate each template TRAll layout example T for meeting topological structure in grid MR,a,
Wherein a is the position of anchor point in the communication path of the layout example in grid M, TR,a∈ { 0,1 }, wherein TR,a=1 represents
The layout example is appeared in final layout result, TR,a=0 represents the layout example is abandoned in final layout result,
Layout example T is calculated by equation belowR,aWeight wR,a:
Wherein rand is any random integers, and b is any dough sheet in grid M, and to the layout following constraint bar of example addition
Part:
WhereinIt is average foreground object number, N contained by every image in image set STIt is template number, it is real by calculating layout
Example under specifying constraint discretization global optimum layout, obtain repeating objects current grid and constraint under the conditions of most
Excellent discrete compact arrangement, i.e. value are 1 layout example TR,aSet;
Step 2-4, judges whether to receive:The layout example T that the value for obtaining is 1 is solved in statistic procedure 2-3R,aNumber C, ifThen go to step 3-1;Otherwise, update the value of Q in step 2-2 for Q 1.2, and go to step 2-2.
4. method according to claim 3, it is characterised in that in step 2-1, template TRTopological structure be defined as follows:
To grid MRIn all nodes set up by VBIn all nodes composition communication path and VIIn all nodes composition most
Small spanning tree, wherein VBIt is grid MRIn boundary node set, VIIt is grid MRIn non-boundary node set, calculate first
Each node motion is stored as sequence L to the coordinate direction of next node in communication path and minimum spanning treeR, LR=(l1,
l2,…ln), lk∈ { 0,1,2,3,4 }, wherein 1≤k≤n-1, n are grid MRIn node total number, lkRepresent in communication path
K node vkWith+1 vertex v of kthk+1Between spatial relation, its value represents x for 0k>xk+1, it is 1 to represent yk>yk+1, it is
2 represent xk≤xk+1, it is 3 to represent yk≤yk+1, wherein xk、ykV is represented respectivelykAbscissa and ordinate, xk+1、yk+1Represent respectively
vk+1Abscissa and ordinate, while calculate minimum spanning tree in all branch nodes in LRIn sequence number, be stored as sequence BR,
LRAnd BRCollectively constitute repeating objects OImgRCorresponding template TRTopological structure.
5. method according to claim 4, it is characterised in that step 3 is comprised the following steps:
Step 3-1, object transformation:Value to being produced in each step 2-3 is 1 layout example TR,aCorresponding repeating objects
OImgRAngle is carried out for r (OImgR, rotation and ratio a) are s (OImgR, a) it is the scaling of ratio, after generation affine transformation
Rendered object OImgrs,a, and determine the drafting center v on painting canvasc,a;
Step 3-2, hierarchical ranking:The rendered object area that all layout examples are crossed according to corresponding affine transformation is from small to large
Sequence, formation sequence Q;
Step 3-3, objects draw:According to the order of Q, after the affine transformation produced in all step 3-1 is drawn on painting canvas
Rendered object, wherein for arbitrarily drawn object OImgrs,a, position is drawn with vc,aCentered on.
6. method according to claim 5, it is characterised in that in step 3-1, anglec of rotation r is calculated by equation below
(OImgR,a):
Wherein vkv,aIt is layout example TR,aIn grid MRIn any summit,Respectively vkv,aHorizontal stroke, ordinate,
vc,aIt is layout example TR,aThe centre of form,Respectively vc,aAbscissa and ordinate, vkvIt is template TRIn it is any
Summit,Respectively vkvAbscissa and ordinate, vc,RIt is template TRThe centre of form, Respectively vC,RHorizontal stroke
Coordinate and ordinate, nvRIt is template TRThe node total number that includes of grid.
7. method according to claim 6, it is characterised in that in step 3-1, pantograph ratio s is calculated by equation below
(OImgR):
Wherein emIt is template TRGrid in any a line.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611144424.0A CN106709171B (en) | 2016-12-13 | 2016-12-13 | A kind of decalcomania generation method based on repeat pattern discovery |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201611144424.0A CN106709171B (en) | 2016-12-13 | 2016-12-13 | A kind of decalcomania generation method based on repeat pattern discovery |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106709171A true CN106709171A (en) | 2017-05-24 |
CN106709171B CN106709171B (en) | 2019-05-03 |
Family
ID=58937262
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201611144424.0A Active CN106709171B (en) | 2016-12-13 | 2016-12-13 | A kind of decalcomania generation method based on repeat pattern discovery |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106709171B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107247846A (en) * | 2017-06-14 | 2017-10-13 | 拓卡奔马机电科技有限公司 | A kind of cut-parts screening technique, method of cutting out and system |
CN109785283A (en) * | 2018-11-27 | 2019-05-21 | 佛山市奥策科技有限公司 | A kind of textural characteristics matching process and device for fabric segmentation |
CN111507946A (en) * | 2020-04-02 | 2020-08-07 | 浙江工业大学之江学院 | Element data driven flower type pattern rapid generation method based on similarity sample |
CN112686918A (en) * | 2020-12-16 | 2021-04-20 | 山东大学 | Method and system for generating single-connected nested graph structure |
CN114861247A (en) * | 2022-07-06 | 2022-08-05 | 广东时谛智能科技有限公司 | Method, device, equipment and storage medium for generating shoe body model based on simple design |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101777178A (en) * | 2010-01-28 | 2010-07-14 | 南京大学 | Image restoring method |
CN102770864A (en) * | 2010-01-29 | 2012-11-07 | 香港科技大学 | Architectural pattern detection and modeling in images |
CN102857739A (en) * | 2012-08-20 | 2013-01-02 | 上海光亮光电科技有限公司 | Distributed panorama monitoring system and method thereof |
CN104160408A (en) * | 2011-12-29 | 2014-11-19 | 派尔高公司 | Method and system for video composition |
CN104268580A (en) * | 2014-10-15 | 2015-01-07 | 南京大学 | Class cartoon layout image management method based on scene classification |
CN104715477A (en) * | 2015-03-05 | 2015-06-17 | 浙江工业大学之江学院 | Image analysis method based on multi-scale and multi-zone woven fabric knitting tightness |
-
2016
- 2016-12-13 CN CN201611144424.0A patent/CN106709171B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101777178A (en) * | 2010-01-28 | 2010-07-14 | 南京大学 | Image restoring method |
CN102770864A (en) * | 2010-01-29 | 2012-11-07 | 香港科技大学 | Architectural pattern detection and modeling in images |
CN104160408A (en) * | 2011-12-29 | 2014-11-19 | 派尔高公司 | Method and system for video composition |
CN102857739A (en) * | 2012-08-20 | 2013-01-02 | 上海光亮光电科技有限公司 | Distributed panorama monitoring system and method thereof |
CN104268580A (en) * | 2014-10-15 | 2015-01-07 | 南京大学 | Class cartoon layout image management method based on scene classification |
CN104715477A (en) * | 2015-03-05 | 2015-06-17 | 浙江工业大学之江学院 | Image analysis method based on multi-scale and multi-zone woven fabric knitting tightness |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107247846A (en) * | 2017-06-14 | 2017-10-13 | 拓卡奔马机电科技有限公司 | A kind of cut-parts screening technique, method of cutting out and system |
CN107247846B (en) * | 2017-06-14 | 2021-01-22 | 拓卡奔马机电科技有限公司 | Cut piece screening method, cutting method and cutting system |
CN109785283A (en) * | 2018-11-27 | 2019-05-21 | 佛山市奥策科技有限公司 | A kind of textural characteristics matching process and device for fabric segmentation |
CN109785283B (en) * | 2018-11-27 | 2021-05-04 | 佛山市奥策科技有限公司 | Texture feature matching method and device for fabric segmentation |
CN111507946A (en) * | 2020-04-02 | 2020-08-07 | 浙江工业大学之江学院 | Element data driven flower type pattern rapid generation method based on similarity sample |
CN112686918A (en) * | 2020-12-16 | 2021-04-20 | 山东大学 | Method and system for generating single-connected nested graph structure |
CN112686918B (en) * | 2020-12-16 | 2022-10-14 | 山东大学 | Method and system for generating single-connection nested graph structure |
CN114861247A (en) * | 2022-07-06 | 2022-08-05 | 广东时谛智能科技有限公司 | Method, device, equipment and storage medium for generating shoe body model based on simple design |
CN114861247B (en) * | 2022-07-06 | 2022-12-30 | 广东时谛智能科技有限公司 | Method, device, equipment and storage medium for generating shoe body model based on simple design |
Also Published As
Publication number | Publication date |
---|---|
CN106709171B (en) | 2019-05-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106709171B (en) | A kind of decalcomania generation method based on repeat pattern discovery | |
Hartmann et al. | Streetgan: Towards road network synthesis with generative adversarial networks | |
CN104933757B (en) | A kind of three-dimensional garment modeling method based on style description symbol | |
CN108010134A (en) | A kind of real-time three-dimensional virtual fit method based on mobile terminal | |
CN104123753A (en) | Three-dimensional virtual fitting method based on garment pictures | |
CN105069226A (en) | Three-dimensional modeling method based on template | |
CN107623594A (en) | A kind of three-dimensional level network topology method for visualizing of geographical location information constraint | |
CN107292234A (en) | It is a kind of that method of estimation is laid out based on information edge and the indoor scene of multi-modal feature | |
CN101719140A (en) | Figure retrieving method | |
CN109118588B (en) | Automatic color LOD model generation method based on block decomposition | |
CN102542593A (en) | Interactive video stylized rendering method based on video interpretation | |
CN111028335B (en) | Point cloud data block surface patch reconstruction method based on deep learning | |
CN107045551A (en) | A kind of Hunan embroidery image is gene constructed and Hunan embroidery image digitazation processing method | |
CN101320487B (en) | Scene pretreatment method for fire disaster simulation | |
JP4475606B2 (en) | Mesh pattern rendering device and mesh pattern rendering method | |
Wang et al. | From designing products to fabricating them from planar materials | |
CN108062758B (en) | A kind of crowd's generation emulation mode and system based on image segmentation algorithm | |
Chowdhury et al. | Garment ideation: Iterative view-aware sketch-based garment modeling | |
CN111260755B (en) | Digital tie-dyeing pattern generation method based on deep learning and digital image processing | |
CN113870406A (en) | Free-form model making and material pasting method and readable storage medium | |
CN113076571A (en) | Three-dimensional clothes real-time simulation editing method and system | |
Li et al. | Example-based realistic terrain generation | |
Yu et al. | Example-based Road Network Synthesis. | |
Zhang et al. | 3D design platform of virtual national costume based on digital nonlinear random matrix | |
Oda et al. | Interactive skeleton extraction using geodesic distance |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |