CN106530370A - Inlaid picture simulation method and apparatus - Google Patents

Inlaid picture simulation method and apparatus Download PDF

Info

Publication number
CN106530370A
CN106530370A CN201610959825.5A CN201610959825A CN106530370A CN 106530370 A CN106530370 A CN 106530370A CN 201610959825 A CN201610959825 A CN 201610959825A CN 106530370 A CN106530370 A CN 106530370A
Authority
CN
China
Prior art keywords
voronoi
seed point
polygonal
default
distance
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
CN201610959825.5A
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.)
Beijing Forestry University
Original Assignee
Beijing Forestry University
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 Beijing Forestry University filed Critical Beijing Forestry University
Priority to CN201610959825.5A priority Critical patent/CN106530370A/en
Publication of CN106530370A publication Critical patent/CN106530370A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/40Filling a planar surface by adding surface attributes, e.g. colour or texture
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T11/002D [Two Dimensional] image generation
    • G06T11/001Texturing; Colouring; Generation of texture or colour

Abstract

The embodiments of the invention provide an inlaid picture simulation method and apparatus. The method comprises the following steps: detecting texture features of an image to be inlaid; according to the texture features, segmenting the image to be inlaid to a target inlay area; generating a preset quantity of Voronoi polygons in the target inlay area; and inlay pixels at positions superposed with the Voronoi polygons so as to obtain an inlaid picture. According to the invention, the generated inlaid picture is enabled to realize corresponding arrangement according to the texture features of the image to be inlaid, and inlaid picture simulation with a more lifelike effect is realized.

Description

Mosaic analogy method and device
Technical field
The present embodiments relate to field of Computer Graphics, more particularly to a kind of mosaic analogy method and device.
Background technology
Mosaic is a kind of decorative art, coloured stone, pottery piece, shell or coloured glass etc. is usually used and is combined into pattern effect Really.This artistic form is long-standing, and in terms of being widely used in the decoration on wall, floor, implements surface etc..Fritter figure The repetition close-packed arrays of case are a kind of unique artistic creation maneuvers, and its artistic work one side presents overall vision effect Really, on the other hand then give spectators a kind of strong local material sense by discrete element.
If this mosaic effect of method automatic imitation of computer simulation can be utilized, for design, skill All it is a kind of greatly breakthrough for art creation and computer graphicss.
However, prior art is in mosaic simulation process is carried out, the arrangement effect of pel is relatively simple and analog result There is larger distortion.
The content of the invention
The embodiment of the present invention provides a kind of mosaic analogy method and device, to solve mosaic simulation in prior art The defect of distortion.
The embodiment of the present invention provides a kind of mosaic analogy method, including:
The textural characteristics of mosaic image are treated in detection;
Treat that mosaic image obtains target and inlays region according to textural characteristics segmentation;
The Voronoi polygons of predetermined number are generated in the target inlays region;
Pel will be inlayed and be placed on the position acquisition mosaic with the Voronoi polygon coincidings.
The embodiment of the present invention provides a kind of mosaic analog, including:
Detector unit, treats the textural characteristics of mosaic image for detection;
Area acquisition unit is inlayed, for treating that mosaic image obtains target mosaic area according to textural characteristics segmentation Domain;
Patterning unit, for the Voronoi polygons that predetermined number is generated in region are inlayed in the target;
Inlay element, is placed on the position acquisition mosaic with the Voronoi polygon coincidings for will inlay pel.
Mosaic analogy method provided in an embodiment of the present invention and device, in mosaic simulation process, detect and wait to inlay The textural characteristics of image simultaneously obtain target based on the textural characteristics and inlay region so that the mosaic of generation is according to treating mosaic image Textural characteristics present it is corresponding arrange, so as to ensure that mosaic simulates the verity of effect.
Description of the drawings
In order to be illustrated more clearly that the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing Accompanying drawing to be used needed for having technology description is briefly described, it should be apparent that, drawings in the following description are these Some bright embodiments, for those of ordinary skill in the art, on the premise of not paying creative work, can be with root Other accompanying drawings are obtained according to these accompanying drawings.
Fig. 1 is a kind of mosaic analogy method flow chart that the embodiment of the present application one is provided;
Exemplary plots of the Fig. 1-1 for the embodiment of the present application one;
Another exemplary plots of the Fig. 1-2 for the embodiment of the present application one;
Fig. 2 is a kind of mosaic analogy method flow chart that the embodiment of the present application two is provided;
Exemplary plots of the Fig. 2-1 for the embodiment of the present application two;
Another exemplary plots of the Fig. 2-2 for the embodiment of the present application two;
Another exemplary plots of the Fig. 2-3 for the embodiment of the present application two;
Another exemplary plots of the Fig. 2-4 for the embodiment of the present application two;
Another exemplary plots of the Fig. 2-5 for the embodiment of the present application two;
Another exemplary plots of the Fig. 2-6 for the embodiment of the present application two;
Fig. 3 is a kind of mosaic analogy method flow chart that the embodiment of the present application three is provided;
Exemplary plots of the Fig. 3-1 for the embodiment of the present application three;
Another exemplary plots of the Fig. 3-2 for the embodiment of the present application three;
Another exemplary plots of the Fig. 3-3 for the embodiment of the present application three;
Fig. 4 is a kind of mosaic analogy method flow chart that the embodiment of the present application four is provided;
Exemplary plots of the Fig. 4-1 for the embodiment of the present application four;
Another exemplary plots of the Fig. 4-2 for the embodiment of the present application four;
Another exemplary plots of the Fig. 4-3 for the embodiment of the present application four;
Fig. 5 is a kind of structural representation of mosaic analog that the embodiment of the present application five is provided.
Specific embodiment
To make purpose, technical scheme and the advantage of the embodiment of the present invention clearer, below in conjunction with the embodiment of the present invention In accompanying drawing, the technical scheme in the embodiment of the present invention is clearly and completely described, it is clear that described embodiment is The a part of embodiment of the present invention, rather than the embodiment of whole.Based on the embodiment in the present invention, those of ordinary skill in the art The every other embodiment obtained under the premise of creative work is not made, belongs to the scope of protection of the invention.
In reality, existing block material random close is generally stitched together by mosaic when making, the application reality When applying active computer graphics simulation mosaic, on mosaic image is treated, to inlay pel, to draw which corresponding in advance Voronoi polygons, each polygon represent a shape for inlaying pel and inlay space shared by pel.In simulation When inlaying, select and pel is inlayed with Voronoi polygonal adhered shapes, will inlay pel and be put in these polygons with regard to energy The close-packed arrays of pel are formed enough.Wherein, described pel of inlaying is a computer graphicss layer in the embodiment of the present application Concept on face, material used when making equivalent to actual mosaic, such as stone, sheet glass, shell etc., similarly hereinafter, no longer Repeat.
Fig. 1 is a kind of techniqueflow chart of mosaic analogy method embodiment one that the application is provided, with reference to Fig. 1, this reality Applying example includes following feasible step:
Step 101, detection treat the textural characteristics of mosaic image;
Step 102, according to the textural characteristics segmentation described in treat that mosaic image obtains target and inlays region;
Step 103, in the target inlays region generate predetermined number Voronoi polygons;
Step 104, pel will be inlayed be placed on and mosaic be obtained with the position of the Voronoi polygon coincidings.
Specifically, in a step 101, it is described treat mosaic image be user provide be modeled object, can be a width tool The paintings of body, or random geometrical pattern.The textural characteristics, are that a kind of vision of homogeneity phenomenon in response diagram picture is special Levy, it embody body surface with slowly varying or periodically variable surface textural alignment attribute.Generally, stricture of vagina Reason feature includes following six attribute:Roughness (Coarseness), contrast (Contrast), direction degree (Directionality), line picture degree (Linelikeness), regularity (Regularity) and rough degree (Roughness). In one width artistic work, its abundant texture is capable of the third dimension of emboding works, and art atmosphere is stronger.Carrying out mosaic Simulation when, if can show to be panelized the textural characteristics of image, then inlay works artistry and verity will Further lifted.
Optionally, in a step 102, extract and treat that the textural characteristics of mosaic image can be according to the six of above-mentioned textural characteristics kinds Any one or more combination in attribute is extracted.Specifically, obtain textural characteristics to adopt with Gabor filter For the Spectrum Method of representative, gray level co-occurrence matrixes (GLCM) method, auto-relativity function method, gray scale haul distance method (Gray LevelRun Length), it would however also be possible to employ wavelet theory, fractal model, Markov random field (MRF) model etc..Due to said method it is equal For ripe prior art, repeat no more in the embodiment of the present application, certainly, the texture information of the embodiment of the present application extract comprising but It is not limited in said method.
Following part will be specifically illustrated to the texture blending method of the embodiment of the present application by taking typing model as an example.Point Shape model can realize the extraction of roughness (Coarseness) and direction degree (Directionality) both textural characteristics, So as to according to roughness and direction degree, both attributes are realized treating the region division of mosaic image.
When being extracted to roughness features using fractal model, mainly using fractal dimension.Fractal dimension measurement be Complexity changes in distribution of the imaging surface under different scale.In general, different types of form material has in nature Different fractal dimensions, its perception with human vision to imaging surface coarse texture degree is consistent, i.e., fractal dimension is got over Greatly, corresponding imaging surface is more coarse.In a kind of optional embodiment, split when the mosaic image using fractal dimension, Default at least two threshold ranges, and the pixel that fractal dimension belongs to same threshold range is divided into into the same area, so as to reality The segmentation of mosaic image is treated now.
When being extracted to direction degree feature using fractal model, mainly managed with steerable pyramid using fractal theory Method by combining, extracts the image fractal dimension with directional information, you can effectively represent the multiple dimensioned many of texture Direction character, realization treat the segmentation of mosaic image.
Specifically, in step 103, the Voronoi polygons have certain shape, size and direction.Pass through N misaligned seed point is placed in the plane, using specifically apart from computation rule, plane is divided into n region so that each The distance of the point in region to distance ratio to other region seed points of the seed point of its region is near, and a region is one Voronoi polygons.Draw the Voronoi polygons, its object is to by target inlay region be divided into it is little one by one Region, each little region is used to placing that one onesize and the pel in direction.
The texture features and size self adaptation that the predetermined number can inlay region according to target are obtained, Can also be user-defined.For example, currently treat mosaic image be divided into the sparse first object of texture inlay region with And intensive the second target of texture inlays region, then generate in first object inlays region less and larger-size Voronoi polygons, inlay in the second target that Area generation is more and the less Voronoi polygons of size, so as to by compared with Many small size Voronoi polygons represent the second target and inlay the fine and smooth texture features in region and by Voronoi polygons The lines of mosaic image edge contour are treated in the change performance of size, are really demonstrated by treating the content of mosaic image.As in Fig. 1-1 Shown, the animal pattern texture for scheming central authorities relatively enriches, therefore sketches the contours of its shape by undersized pel, and the region of periphery is then Inlayed using the pel of large-size, the analog result inlayed is closer to true paintings.
Specifically, at step 104, pel will be inlayed to be placed on Voronoi polygons, as shown in Figure 1-2, will be carried first Take the polygonal profile informations of the Voronoi;The polygonal sizes of the Voronoi and side are obtained according to the profile information To;According to the size and direction, scale and/or rotate and default described inlay pel;Scale described and/or postrotational Pel is inlayed described in Voronoi and is placed on the position with the Voronoi polygon coincidings.
The mosaic analogy method that the present embodiment is provided, in mosaic simulation process, the texture of mosaic image is treated in detection Feature simultaneously inlays region based on textural characteristics acquisition target so that the mosaic of generation is according to the textural characteristics for treating mosaic image Corresponding arrangement is presented, so as to ensure that mosaic simulates the verity of effect.
Fig. 2 is a kind of techniqueflow chart of mosaic analogy method embodiment two that the application is provided, with reference to Fig. 2, this reality Applying example includes following feasible step:
Step 201, in target inlays region generate predetermined number seed point;
Step 202, the corresponding Voronoi polygons of the seed point are generated with default distance metric rule;
Step 203, the vectorial field direction according to the seed point in default vector field are by the Voronoi polygons Accordingly rotated;
Step 204, the polygonal position of centre of gravitys of the acquisition Voronoi, and the seed is updated with the position of centre of gravity The position of point;
Iteration 202~step 204 of execution step, until it reaches default iterationses, obtains the described of the predetermined number Voronoi polygons.
Specifically, in step 202., described distance metric rule include equal space line distance, Euclidean distance, Manhattan away from With a distance from, Chebyshev, axially Chebyshev's distance of scaling and axial one or more in the Euclidean distance of scaling.Its In, Euclidean distance, manhatton distance, axially Chebyshev's distance, Chebyshev's distance of scaling, the Euclidean distance of axial direction scaling Equidistant computation rule is the existing computing formula of maturation, does not repeat herein.
It should be noted that except it is above-mentioned apart from computation rule in addition to, the embodiment of the present application also proposed a kind of " equal space line " away from From computation rule.
Fig. 2-1 is the schematic diagram of equal space line distance metric, the Voronoi polygons that " equal space line " distance can be ultimately generated Be shaped as equilateral triangle.According to equal space line apart from this metric form, the distance between 2 points is by a kind of equilateral triangle The form of equal space line is calculating, it is stipulated that the equilateral triangle direction in this space is as shown in Fig. 2-1.A known length of side is La's Equilateral triangle, origin position are its center of gravity, draw the equilateral triangle similar to which inside the former equilateral triangle, and ensure each three Angular center of gravity then specifies that any point in each triangular rim is equal to initial point distance, is all in origin position Center of gravity is to triangular apex apart from length.Using the distance between range range mode metric point P (x1, y1) and point Q (x0, y0) When, need then to build positive triangle by center of gravity of point P using wherein as origin (it is assumed here that using point P points as origin) Shape so that point Q falls on the equilateral triangle edge, then point P be the distance between point P and Q to the distance of triangular apex.It is right Any point A (x1, y1) on former equilateral triangle side, the distance to origin O (x0, y0) areUsing this away from Measure from metric form, the final Voronoi polygonal shapes for obtaining are subtriangular dodecagons.
It is above-mentioned in computation rule, each is apart from a kind of computation rule Voronoi polygons of shape of correspondence, as follows Shown in form:
Apart from computation rule The polygonal shapes of Voronoi
Euclidean distance Regular hexagon
Manhatton distance Square
Chebyshev's distance Square
The Chebyshev's distance for axially scaling Rectangle
The Euclidean distance for axially scaling It is oval
Equal space line distance Triangle
It should be noted that in the technical scheme of the embodiment of the present application offer, it is above-mentioned to be applied in combination apart from rule, from And when inlaying region to target and inlaying, can be inlayed using pel of inlaying of different shapes, enrich the spy of mosaic Levy, lift the overall visual effect of mosaic, for example it is, in Fig. 2-2, various to be applied in combination apart from computation rule, and correspondingly Carry out inlaying simulation with the pel of inlaying of various shapes, effect is very attractive in appearance.
In actual mosaic works, how in mosaic image is treated arrangement inlay pel often rely on it is artistical Experience or aesthetic hobby, and during computer realizes that mosaic is simulated, before pel is inlayed in arrangement, obtain in advance and use The vector field that family is specified, then the orientation of pel just can be inlayed according to the vector field control, is met customer need, so as to The mosaic that simulation is obtained can reach and the analogous effect of actual mosaic works.
The vector field can be user preset, characterize the vectorial field direction of each seed point position.Specifically , the Voronoi polygons of predetermined number are generated according to default vector field, it can be understood as, referred to according to the direction of vector field Show, each Voronoi polygons adjusted to corresponding direction, and reaches certain aesthetic effect, such as Fig. 2-3 and figure Shown in 2-4.
Specifically, in step 203, any direction in the vector field and vector field can be user-defined. Vector field as shown in Figure 2-5.The vectorial field direction of seed point p (x, y) position is represented by ψ (x, y), will in building-up process It is many that the corresponding Voronoi polygons of seed point p (x, y) rotate the Voronoi that can obtain meeting vector field to ψ (x, y) direction Side shape distributed effect.As shown in figures 2-6, obtain after adding the vector field shown in Fig. 2-5 under Chebyshev's distance metric Voronoi polygon effect figures.
Specifically, in step 204, after the corresponding Voronoi polygons of the seed point are obtained, further obtain The polygonal centers of gravity of Voronoi, accordingly, with the position of seed point described in the location updating of center of gravity, naturally it is also possible to be interpreted as, The seed point is moved to into the polygonal position of centre of gravitys of Voronoi, and after movement, regenerates the seed point Voronoi polygon diagrams.
The iterationses of step 202~step 204 can be pre-set by user, or the effect for wanting to obtain according to target Fruit is adjusted.Iterationses are empirical values, are usually subjected to test of many times and can obtain that can to balance Voronoi polygonal The reasonable value of regular shape degree and Voronoi polygon formation efficiencies, the embodiment of the present application are not limited.
In the present embodiment, during the Voronoi for obtaining seed point is polygonal, using different apart from computation rule The calculating of distance between carrying out a little pair, so as to get Voronoi polygons of different shapes, so as to when pel is inlayed, can Obtain various shapes inlays effect, more improves the artistic feeling of mosaic.
Fig. 3 is a kind of techniqueflow chart of mosaic analogy method embodiment three that the application is provided, with reference to Fig. 3, this reality Applying example includes following feasible step:
Step 301, the seed point that the predetermined number is generated in the target inlays region;
Step 302, with the seed point as summit, solid is placed at the seed point;Wherein, the solid root It is regular according to default distance metric and default slope value is generated;
The solid is carried out phase by step 303, the vectorial field direction according to the seed point in default vector field Should rotate;
Step 304, enter horizontal blanking to the solid and obtain corresponding Voronoi polygons;
Step 305, the polygonal position of centre of gravitys of the acquisition Voronoi, and the seed is updated with the position of centre of gravity The position of point.
Iteration 302~step 305 of execution step, until it reaches default iterationses, obtains the described of the predetermined number Voronoi polygons.
Different from the corresponding embodiments of Fig. 2, the present embodiment is employed based on GPU (Graphics Processing Unit) The Voronoi polygon method of formation of acceleration, using the computation capability of GPU, realizes quick Voronoi polygons life Into.
Method described in the corresponding embodiments of Fig. 2, generating Voronoi diagram needs to iterate, and each iteration is required for time All of distributed points are gone through, this process is than relatively time-consuming.Optionally, the progressively generation of Voronoi diagram is converted into one by the present embodiment Kind of graphic plotting flow process, i.e., determine the distribution of seed point first, places a solid in each seed point, and according to Amount field is controlled to solid travel direction, therewith, is entered horizontal blanking to solid and is obtained Voronoi polygons, wherein, solid Shape is corresponded with the polygonal shapes of the Voronoi for ultimately generating.
As shown in Fig. 3-1 and Fig. 3-2, Fig. 3-1 is represented in three dimensions, after placing solid in the seed point Schematic diagram, accordingly, Fig. 3-2 is corresponding Voronoi polygons after the solid blanking of Fig. 3-1.The solid is according to pre- If distance metric it is regular and default slope value is generated.Wherein, the default distance metric rule determines solid Shape, and in the case where the quantity of the seed point determines, the slope value determines corresponding after solid blanking The polygonal sizes of Voronoi.
In the embodiment of the present application, using solid of different shapes, regular hexagon, square, rectangle, ellipse is realized altogether The polygonal GPU Fast Drawings of circle, five kinds of shapes Voronoi of triangle are generated, and below will be obtained with Euclidean distance computation rule The technical scheme of the embodiment of the present application is described in detail as a example by orthohexagonal Voronoi polygons.Determine first initial The distribution of seed point, then places a height with radius identical circular cone, the vertex of a cone of circular cone in each initial seed point I.e. initial seed point, all circular cones other specification all same in addition to color is different, can thus utilize circular cone side The height in face weighs the distance at correspondence bottom surface Shang Diandaoqi centers.Thus, all of circular cone is drawn, it is (a kind of using Z-buffer The algorithm of each pixel depth on tracking screen) Automatic Hiding can be obtained by correct Voronoi diagram effect.It is so fully sharp With the computation capability of GPU, acceleration is played a part of in the generation to Voronoi diagram.
In the embodiment of the present application, the generation of Voronoi diagram is completed using geometry volume drawing and Z-buffer blankings, its pass Key is that the distance in subpoint to the center of circle of the height of any point on geometry body side surface with which on bottom surface is identical.With Fig. 3- As a example by cone shown in 2, cone height and bottom surface radius are La, and any point A on side is projected as A0 in bottom surface, A0 with The distance between bottom surface center of circle uses yellow line segment | OA0 | to represent, the height of point A with blue line segment | AB | expressions, by | TB |=| AB | and | TB |=| OA0 | understands, | AB |=| OA0 |.
Fig. 3-3 lists the computation rule of the corresponding solid of different distance computation rule and geomery, wherein, Europe Formula is circular cone apart from corresponding solid, and the bottom surface radius of circular cone is La, and the height of its corresponding circular cone is La;Manhatton distance And Chebyshev, apart from the positive rectangular pyramid of correspondence, the bottom surface length of side of rectangular pyramid is La, wherein, manhatton distance corresponding positive four Pyramid, which is highlyApart from corresponding positive rectangular pyramid, which is highly ChebyshevThe Chebyshev for axially scaling Distance, its corresponding solid is pyramid, and the bottom surface of pyramid is rectangle, a length of length of rectangleA width of β La, are highly La; The axial Euclidean distance of scaling, its corresponding solid is elliptic cone, the major axis of the ellipse of its bottom surfaceShort axleIt is high Spend for La;Equal space line is triangular pyramid apart from corresponding solid, and its bottom surface is triangle, length of side La, and the height of triangular pyramid isWherein, β is scale factor, is a constant.
Specifically, in the present embodiment, after placing solid at seed point, according to seed point p (x, y) described The solid is carried out the rotation of respective direction in direction ψ (x, y) in vector field.After rotation, to each solid Enter horizontal blanking, obtain the shape of the corresponding bottom surface of solid, you can obtain the corresponding Voronoi polygons of seed point.Further , the polygonal centers of gravity of current Voronoi, and the position being located with the location updating seed point of center of gravity are obtained, and in seed point Position updated after corresponding solid is placed at the seed point.
In the present embodiment, Voronoi polygonal progressively generating process is converted into into graphic plotting flow process, by solid Constitution realization various shapes Voronoi is polygonal quickly generates, the significant increase analog rate of mosaic.
Fig. 4 is a kind of techniqueflow chart of mosaic analogy method example IV that the application is provided, with reference to Fig. 4, this reality Applying example includes following feasible step:
Step 401, basis treat that the textural characteristics of mosaic image treat that mosaic image obtains first object mosaic area described in splitting Domain and the second target inlay region;
Wherein, it is to treat the sparse region of texture in mosaic image, second target that the first object inlays region It is the region for treating texture comparatively dense in mosaic image to inlay region.
Step 402, judge that current time target to be inlayed inlays the type in region, if the first object mosaic area Domain, execution step 403, if second target inlays region, execution step 404;
Step 403, the polygonal sizes of increase Voronoi.
Generally, increase the polygonal sizes of the Voronoi to inlay in region in the first object, reduce described The quantity of seed point.Each seed point one Voronoi polygon of correspondence, and multiple seed points are mutually misaligned, then work as mesh Mark inlay region area it is constant when, the quantity of seed point is fewer, and the polygonal quantity of Voronoi of generation is fewer, each The polygonal sizes of Voronoi are also bigger.
Accelerating to generate in the polygonal situations of Voronoi using GPU, inlaying in region in the first object, reduce The quantity of the seed point and/or reduce the slope value of the solid to increase the polygonal sizes of the Voronoi. When accelerating to generate Voronoi polygons using GPU, if polygon to increase Voronoi only by the quantity for reducing seed point , then in the polygonal intersections of various sizes of Voronoi, can there is the situation of size gradual change, easily cause side in the size of shape Irregular polygon at boundary, as shown in the Fig. 4-2.Therefore, optionally, it is many when Voronoi is generated using solid auxiliary acceleration Can inlay in region in the first object during shape of side, the quantity for reducing the seed point and the institute for reducing the solid State slope value to increase the polygonal sizes of the Voronoi.So as to generating the different Voronoi polygons of size and existing The boundary of change in size is seamlessly transitted, it is to avoid generate a large amount of unwanted irregularly shaped, effects as shown in Fig. 4-3.
Step 404, the polygonal sizes of reduction Voronoi.
Accelerate to generate in the polygonal situations of Voronoi GPU is provided without, reduce the polygonal sizes of the Voronoi Can inlay in region in second target, increase the quantity of the seed point.In the same manner, each seed point correspondence one Voronoi polygons, and multiple seed points are mutually misaligned, then when the area that target inlays region is constant, the number of seed point Amount is more, and the polygonal quantity of Voronoi of generation is more, and the polygonal sizes of each Voronoi are also less.
When accelerating to generate Voronoi polygons using GPU, to avoid the polygonal boundaries of various sizes of Voronoi The situation of the size gradual change that place is present.Optionally, when accelerating to generate Voronoi polygons using solid auxiliary, Ke Yi Second target is inlayed in region, increases the quantity of the seed point and increases the slope value of the solid to subtract The polygonal size of the little Voronoi.So as to the different Voronoi polygons of the size of, generation are in change in size Boundary is seamlessly transitted, it is to avoid generated a large amount of unwanted irregularly shaped.
In the present embodiment, will treat that mosaic image is divided and by the quantity of seed point being controlled for treating mosaic map mosaic in advance The specific part of picture carries out the polygonal generations of Voronoi, realizes adaptively basis and treats that mosaic image characteristic is adjusted The polygonal sizes of Voronoi, remain the texture features for treating mosaic image, the really degree of the mosaic for improving;With This simultaneously, by solid accelerate generate Voronoi polygons when, by control seed point quantity and solid it is oblique Rate, while Voronoi polygon sizes is changed, it is to avoid the feelings of various sizes of polygon intersection size gradual change Shape so that mosaic it is better.
Fig. 5 is a kind of apparatus structure schematic diagram of mosaic simulation that the application is provided, and with reference to Fig. 5, described device includes Detector unit 51, inlay area acquisition unit 52, patterning unit 53, inlay element 54.
The detector unit 51, treats the textural characteristics of mosaic image for detection;
It is described to inlay area acquisition unit 52, for treating that mosaic image obtains target according to textural characteristics segmentation Inlay region;
The patterning unit 53, for the Voronoi polygons that predetermined number is generated in region are inlayed in the target;
The inlay element 54, is placed on the position acquisition with the Voronoi polygon coincidings for will inlay pel Mosaic.
Further, the patterning unit 53, is used for:The kind of the predetermined number is generated in the target inlays region It is sub-, the Voronoi polygons of the predetermined number are obtained by the iterative process of following default iterationses:
The corresponding Voronoi polygons of the seed point are generated with default distance metric rule;According to the seed point The Voronoi polygons are accordingly rotated by the vectorial field direction in default vector field;Obtain the Voronoi many The position of centre of gravity of side shape, and the position of the seed point is updated with the position of centre of gravity.
Further, the patterning unit 53, is used for:The kind of the predetermined number is generated in the target inlays region It is sub-, the Voronoi polygons of the predetermined number are obtained by the iterative process of following default iterationses:
With the seed point as summit, solid is placed at the seed point;Wherein, the solid is according to default Distance metric is regular and default slope value is generated;Vectorial field direction according to the seed point in default vector field will The solid is accordingly rotated;Enter horizontal blanking to the solid and obtain corresponding Voronoi polygons;Obtain described The polygonal position of centre of gravitys of Voronoi, and the position of the seed point is updated with the position of centre of gravity.
Further, the patterning unit 53, is additionally operable to:According to the textural characteristics, inlay in region in the target, Increase the quantity of the seed point to reduce the polygonal sizes of the Voronoi;Or, reducing the quantity of the seed point to increase The polygonal size of the big Voronoi.
Further, the patterning unit 53, is additionally operable to:According to the textural characteristics, inlay in region in the target, Increase the quantity of the seed point and increase the slope value of the solid to reduce the polygonal chis of the Voronoi It is very little;Or, reducing the quantity of the seed point and reducing the slope value of the solid to increase the Voronoi polygons Size.
Further, the default distance metric rule, including one or more in following distance metric rule:Deng Scale away from linear distance, Euclidean distance, manhatton distance, Chebyshev's distance, the Chebyshev's distance for axially scaling and axially Euclidean distance.
Further, the inlay element 54, is used for:Extract the polygonal profile informations of the Voronoi;According to described Profile information obtains the polygonal sizes of the Voronoi and direction;According to the size and direction, scale and/or rotate and be pre- If described inlay pel;By the scaling and/or postrotational described inlay pel and be placed on and the Voronoi polygons The position of coincidence.
Correlation function mould can be realized by hardware processor (hardware processor) in the embodiment of the present invention Block.
Fig. 5 can perform the technical scheme of Fig. 1~embodiment illustrated in fig. 4, embodiments thereof and technique effect referring to Fig. 1~ Shown in 4, repeat no more.
Device embodiment described above is only schematic, wherein the unit as separating component explanation can To be or may not be physically separate, as the part that unit shows can be or may not be physics list Unit, you can local to be located at one, or can also be distributed on multiple NEs.Which is selected according to the actual needs can In some or all of module realizing the purpose of this embodiment scheme.Those of ordinary skill in the art are not paying creativeness Work in the case of, you can to understand and implement.
Through the above description of the embodiments, those skilled in the art can be understood that each embodiment can By software plus required general hardware platform mode realizing, naturally it is also possible to by hardware.Based on such understanding, on State the part that technical scheme substantially contributes prior art in other words to embody in the form of software product, should Computer software product can be stored in a computer-readable storage medium, such as ROM/RAM, magnetic disc, CD etc., including some fingers Order is used so that a computer equipment (can be personal computer, server, or network equipment etc.) performs each enforcement Method described in some parts of example or embodiment.
Finally it should be noted that:Above example only to illustrate technical scheme, rather than a limitation;Although With reference to the foregoing embodiments the present invention has been described in detail, it will be understood by those within the art that:Which still may be used To modify to the technical scheme described in foregoing embodiments, or equivalent is carried out to which part technical characteristic; And these modification or replace, do not make appropriate technical solution essence depart from various embodiments of the present invention technical scheme spirit and Scope.

Claims (14)

1. a kind of mosaic analogy method, it is characterised in that include:
The textural characteristics of mosaic image are treated in detection;
Treat that mosaic image obtains target and inlays region according to textural characteristics segmentation;
The Voronoi polygons of predetermined number are generated in the target inlays region;
Pel will be inlayed and be placed on the position acquisition mosaic with the Voronoi polygon coincidings.
2. method according to claim 1, it is characterised in that generate the Voronoi polygons of predetermined number, including:
The seed point of the predetermined number is generated in the target inlays region, by the iteration mistake of following default iterationses Journey obtains the Voronoi polygons of the predetermined number:
The corresponding Voronoi polygons of the seed point are generated with default distance metric rule;
The Voronoi polygons are accordingly revolved by the vectorial field direction according to the seed point in default vector field Turn;
The polygonal position of centre of gravitys of the Voronoi are obtained, and the position of the seed point is updated with the position of centre of gravity.
3. method according to claim 1, it is characterised in that generate the Voronoi polygons of predetermined number, including:
The seed point of the predetermined number is generated in the target inlays region, by the iteration mistake of following default iterationses Journey obtains the Voronoi polygons of the predetermined number:
With the seed point as summit, solid is placed at the seed point;Wherein, the solid is according to default distance Measure regular and default slope value to generate;
The solid is accordingly rotated by the vectorial field direction according to the seed point in default vector field;
Enter horizontal blanking to the solid and obtain corresponding Voronoi polygons;
The polygonal position of centre of gravitys of the Voronoi are obtained, and the position of the seed point is updated with the position of centre of gravity.
4. the method stated according to claim 2, it is characterised in that methods described also includes:
According to the textural characteristics, inlay in region in the target, the quantity for increasing the seed point is described to reduce The polygonal sizes of Voronoi;Or, reducing the quantity of the seed point to increase the polygonal sizes of the Voronoi.
5. method according to claim 3, it is characterised in that methods described also includes:
According to the textural characteristics, inlay in region in the target, increase the quantity of the seed point and increase the geometry The slope value of body is reducing the polygonal sizes of the Voronoi;Or,
The slope value for reducing the quantity of the seed point and reducing the solid is polygonal to increase the Voronoi Size.
6. the method according to any one of claim 2-5, it is characterised in that the default distance metric rule, including One or more in following distance metric rule:
Equal space line distance, Euclidean distance, manhatton distance, Chebyshev's distance, the Chebyshev's distance for axially scaling and axle To the Euclidean distance of scaling.
7. method according to claim 1, it is characterised in that pel will be inlayed and be placed on and the Voronoi polygons The position of coincidence obtains mosaic, including:
Extract the polygonal profile informations of the Voronoi;
The polygonal sizes of the Voronoi and direction are obtained according to the profile information;
According to the size and direction, scale and/or rotate and default described inlay pel;
By the scaling and/or postrotational described inlay pel and be placed on the position with the Voronoi polygon coincidings.
8. a kind of mosaic analog, it is characterised in that include:
Detector unit, treats the textural characteristics of mosaic image for detection;
Area acquisition unit is inlayed, for treating that mosaic image obtains target and inlays region according to textural characteristics segmentation;
Patterning unit, for the Voronoi polygons that predetermined number is generated in region are inlayed in the target;
Inlay element, is placed on the position acquisition mosaic with the Voronoi polygon coincidings for will inlay pel.
9. device according to claim 8, it is characterised in that the patterning unit, is used for:
The seed point of the predetermined number is generated in the target inlays region, by the iteration mistake of following default iterationses Journey obtains the Voronoi polygons of the predetermined number:
The corresponding Voronoi polygons of the seed point are generated with default distance metric rule;
The Voronoi polygons are accordingly revolved by the vectorial field direction according to the seed point in default vector field Turn;
The polygonal position of centre of gravitys of the Voronoi are obtained, and the position of the seed point is updated with the position of centre of gravity.
10. method according to claim 8, it is characterised in that the patterning unit, is used for:
The seed point of the predetermined number is generated in the target inlays region, by the iteration mistake of following default iterationses Journey obtains the Voronoi polygons of the predetermined number:
With the seed point as summit, solid is placed at the seed point;Wherein, the solid is according to default distance Measure regular and default slope value to generate;
The solid is accordingly rotated by the vectorial field direction according to the seed point in default vector field;
Enter horizontal blanking to the solid and obtain corresponding Voronoi polygons;
The polygonal position of centre of gravitys of the Voronoi are obtained, and the position of the seed point is updated with the position of centre of gravity.
11. devices stated according to claim 9, it is characterised in that the patterning unit, are additionally operable to:
According to the textural characteristics, inlay in region in the target, the quantity for increasing the seed point is described to reduce The polygonal sizes of Voronoi;Or, reducing the quantity of the seed point to increase the polygonal sizes of the Voronoi.
12. devices according to claim 10, it is characterised in that the patterning unit, are additionally operable to:
According to the textural characteristics, inlay in region in the target, increase the quantity of the seed point and increase the geometry The slope value of body is reducing the polygonal sizes of the Voronoi;Or,
The slope value for reducing the quantity of the seed point and reducing the solid is polygonal to increase the Voronoi Size.
13. devices according to any one of claim 9-12, it is characterised in that the default distance metric rule, bag Include one or more in following distance metric rule:
Equal space line distance, Euclidean distance, manhatton distance, Chebyshev's distance, the Chebyshev's distance for axially scaling and axle To the Euclidean distance of scaling.
14. devices according to claim 8, it is characterised in that the inlay element, are used for:
Extract the polygonal profile informations of the Voronoi;
The polygonal sizes of the Voronoi and direction are obtained according to the profile information;
According to the size and direction, scale and/or rotate and default described inlay pel;
By the scaling and/or postrotational described inlay pel and be placed on the position with the Voronoi polygon coincidings.
CN201610959825.5A 2016-11-02 2016-11-02 Inlaid picture simulation method and apparatus Pending CN106530370A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610959825.5A CN106530370A (en) 2016-11-02 2016-11-02 Inlaid picture simulation method and apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610959825.5A CN106530370A (en) 2016-11-02 2016-11-02 Inlaid picture simulation method and apparatus

Publications (1)

Publication Number Publication Date
CN106530370A true CN106530370A (en) 2017-03-22

Family

ID=58325572

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610959825.5A Pending CN106530370A (en) 2016-11-02 2016-11-02 Inlaid picture simulation method and apparatus

Country Status (1)

Country Link
CN (1) CN106530370A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107665275A (en) * 2017-09-08 2018-02-06 北京林业大学 A kind of design method and system of natural garden style landscape
CN112967360A (en) * 2021-04-23 2021-06-15 自然资源部国土卫星遥感应用中心 Synthetic aperture radar image Voronoi polygon mosaic method considering multiple dimensions

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1564201A (en) * 2004-04-13 2005-01-12 复旦大学 Three-D texture chartlet method based on master drawing covering and separating
CN104933675A (en) * 2015-07-02 2015-09-23 浙江大学 Generation method of complex inlaid pattern controllable in periodicity

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1564201A (en) * 2004-04-13 2005-01-12 复旦大学 Three-D texture chartlet method based on master drawing covering and separating
CN104933675A (en) * 2015-07-02 2015-09-23 浙江大学 Generation method of complex inlaid pattern controllable in periodicity

Non-Patent Citations (6)

* Cited by examiner, † Cited by third party
Title
ALEJO HAUSNER: "Simulating Decorative Mosaics", 《ACM SIGGRAPH 2001》 *
KALEIGH SMITH 等: "Animosaics", 《EUROGRAPHICS/ACM SIGGRAPH SYMPOSIUM ON COMPUTER ANIMATION (2005)》 *
KENNETH E. HOFF III 等: "Fast Computation of Generalized Voronoi Diagrams Using Graphics Hardware", 《SIGGRAPH "99 PROCEEDINGS OF THE 26TH ANNUAL CONFERENCE ON COMPUTER GRAPHICS AND INTERACTIVE TECHNIQUES》 *
LARS-PETER FRITZSCHE 等: "Interactive design of authentic looking mosaics using Voronoi structures", 《IN PROC. 2ND INTERNATIONAL SYMPOSIUM ON VORONOI DIAGRAMS IN SCIENCE AND ENGINEERING VD 2005 CONFERENCE》 *
YOSHINORI DOBASHI 等: "A Method for Creating Mosaic Images Using Voronoi Diagrams", 《EUROGRAPHICS 2002》 *
杨占龙 等: "一种新的碎片图像镶嵌技术", 《西安电子科技大学学报(自然科学版)》 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107665275A (en) * 2017-09-08 2018-02-06 北京林业大学 A kind of design method and system of natural garden style landscape
CN107665275B (en) * 2017-09-08 2020-10-16 北京林业大学 Design method and system of natural garden landscape
CN112967360A (en) * 2021-04-23 2021-06-15 自然资源部国土卫星遥感应用中心 Synthetic aperture radar image Voronoi polygon mosaic method considering multiple dimensions

Similar Documents

Publication Publication Date Title
Turk Generating textures on arbitrary surfaces using reaction-diffusion
CN105374007B (en) Merge the pencil drawing generation method and device of skeleton stroke and textural characteristics
CN110223387A (en) A kind of reconstructing three-dimensional model technology based on deep learning
EP3035291B1 (en) Rendering based generation of occlusion culling models
US20060077208A1 (en) Method of creating texture capable of continuous mapping
CN106780642A (en) The generation method and device of dense fog shade textures
CN110115841B (en) Rendering method and device for vegetation object in game scene
CN105760073B (en) A method of realizing graphical perspectives in interactive electric whiteboard software
Zhang et al. Real-time bas-relief generation from a 3D mesh
CN109712223A (en) A kind of threedimensional model automatic colouring method based on textures synthesis
Guo et al. Foggy scene rendering based on transmission map estimation
CN106709171B (en) A kind of decalcomania generation method based on repeat pattern discovery
CN103218846A (en) Ink painting simulation method of three-dimensional tree model
CN106127847B (en) A method of it generating real-time landscape painting characteristic line and suitably renders
CN106530370A (en) Inlaid picture simulation method and apparatus
CN107610236A (en) A kind of exchange method and system based on figure identification
CN108280870A (en) A kind of point cloud model texture mapping method and system
Wang et al. A review of digital relief generation techniques
CN107862749A (en) One kind point cloud geometric detail feature minimizing technology
CN109829962B (en) Object space hidden line elimination calculation acceleration method using OPENGL
CN108230430A (en) The processing method and processing device of cloud layer shade figure
Li et al. Image stylization with enhanced structure on GPU
Wang et al. An improving algorithm for generating real sense terrain and parameter analysis based on fractal
CN112700538B (en) LOD generation method and system
CN108038835A (en) The image important area mosaic automatic generation method of conspicuousness driving

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for 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: 20170322