CN107844240A - A kind of masking-out auto-erasing method based on template - Google Patents

A kind of masking-out auto-erasing method based on template Download PDF

Info

Publication number
CN107844240A
CN107844240A CN201711007651.3A CN201711007651A CN107844240A CN 107844240 A CN107844240 A CN 107844240A CN 201711007651 A CN201711007651 A CN 201711007651A CN 107844240 A CN107844240 A CN 107844240A
Authority
CN
China
Prior art keywords
mrow
msub
mtd
masking
shape
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN201711007651.3A
Other languages
Chinese (zh)
Other versions
CN107844240B (en
Inventor
王�华
楚世理
卢冰
徐明亮
李绅绅
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Zhengzhou University of Light Industry
Original Assignee
Zhengzhou University of Light Industry
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 Zhengzhou University of Light Industry filed Critical Zhengzhou University of Light Industry
Priority to CN201711007651.3A priority Critical patent/CN107844240B/en
Publication of CN107844240A publication Critical patent/CN107844240A/en
Application granted granted Critical
Publication of CN107844240B publication Critical patent/CN107844240B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Processing Or Creating Images (AREA)

Abstract

The invention discloses a kind of masking-out auto-erasing method based on template, pre-selected images are reconstructed base figure by this method, the base figure is carried out to the vector data of grid scanning calculating user's request shape again, then by the vector data matrixing, complete the extraction of shape, the matrix data is translated and/or scaled processing generation again and draws template, mode is finally drawn using three dimensions orthogonal projection component layer, realizes final auto-erasing effect.Pass through above-mentioned technical proposal, erasing the self-defined and erase process of shape is realized in erase process and is automatically processed, compared with prior art, expands the scope of application of masking-out method for deleting, interactive mode is also no longer limited to the operation to screen or button.

Description

A kind of masking-out auto-erasing method based on template
Technical field
The present invention relates to Computer Image Processing field, more particularly to a kind of masking-out auto-erasing method based on template.
Background technology
With developing rapidly for interactive multimedia, increasing businessman starts to focus on carrying by interactive multimedia Rise participation and experience effect of the user in business activity.Realize that interactive masking-out is wiped using mobile terminal, also in business Widely used in family's activity.
In the prior art, common masking-out method for deleting, in sweepstake, user sets finger in movement for more uses Slided on standby screen, the region illiteracy figure that finger slips over disappears and indicated a need for the content of the bottom plate shown, but this mode User is needed to specify erasure location, and erasing shape (the mainly erasing shape of finger) is single, is not enough to tackle a variety of differences The application demand of occasion.Such as in new product release, display is by the new products exhibition figure of illiteracy map combining, scene on giant-screen Spectators participate in jointly, by rock mobile device or press specific button it is synchronous on giant-screen specifically to wipe shape Shape auto-erasing covers figure, gradually shows new products exhibition figure.For such case, above-mentioned masking-out method for deleting can not just be handled. For this reason, it may be necessary to providing a kind of permission User Defined wipes shape, the masking-out auto-erasing method that erasing processing is carried out automatically.
The content of the invention
The present invention solves the technical problem of a kind of masking-out auto-erasing method based on template is provided, solve existing There are in technology the problem of erasing shape is single, a variety of conversion can not be carried out to erasing shape and then carry out auto-erasing to masking-out.
In order to solve the above technical problems, a kind of technical scheme that the present invention uses is to provide a kind of masking-out based on template Auto-erasing method, comprises the following steps:Shape is extracted, shape needed for user is obtained from pre-selected images, and handle and wrapped Containing the user's request shape and the base figure that is represented with raster data;Change data, by the grid of the user's request shape in the base figure Lattice data are converted to vector data, and the vector data further is converted into vector matrix;Template is drawn in generation, and this is sweared Moment matrix is translated and/or scaling processing, obtains drawing template;Input picture, input need bottom plate image and the use shown In the masking-out image for covering the bottom plate image;Drawing image, using the drafting template on the masking-out image auto-erasing, from And correspond to and show the bottom plate image.
It is first in the extraction shape step in masking-out auto-erasing method another embodiment of the present invention based on template First pre-selected images of the input with user's request shape, then the user's request shape is taken out from the pre-selected images, with the use Foreground picture of the inside of the shape border of family demand shape as the base figure, with the outer of the shape border of the user's request shape Portion is the Background of the base figure, and the Background is filled with the first fill color, and the foreground picture is filled with the second fill color, and this first Fill color is the pure color of single color, and second fill color is another pure colors different from first fill color or is free of The combination of other multicolour of first fill color.
, will in the change data step in masking-out auto-erasing method another embodiment of the present invention based on template The raster data of user's request shape in the base figure is converted into the vector data and comprised the following steps:Intersection point is determined, to the base The raster data of figure is scanned with behavior unit, it is determined that having the grid line y of intersection point with each side of the user's request shapei, i ∈ [1, t], i are the sequence number of the grid line, and t is total line number of the grid line;Intersection point sorting, by the friendship in each grid line Point (xi,j, yi) along grid line yiCarry out sort ascending;Matched by row, since first intersection point in each grid line Carry out adjoining nodes pairing, i.e. (xi,2m-1, yi) and (xi,2m, yi) it is an intersection point pair, i ∈ [1, t], m ∈ [1, si], each Intersection point is to representing that the grid line in the intersecting section in one, the sideline of the user's request shape, obtains (xi,1, yi)、 (xi,2, yi)、…(xi,j, yi)、j∈[1,2si], 2siRepresent grid line yiHanded over each side of the user's request shape The number of point, obtaining vector data collection is:
Wherein, p is worked asij=(xi,j,yi), i ∈ [1, t], j ∈ [1,2si],
, will in the change data step in masking-out auto-erasing method another embodiment of the present invention based on template The method that the vector data is converted to the vector matrix comprises the following steps:Fill the vector data collection so that the vector data The number of the often capable data of collection is identical, and obtaining the vector matrix is:
Wherein, n=max { 2si| i ∈ [1, t] }, fill method be forIf j ∈ (2si, n], then pij=(- 10000, -10000).
In masking-out auto-erasing method another embodiment of the present invention based on template, template step is drawn in the generation In, to vector matrix P2The method for zooming in and out processing comprises the following steps:By vector matrix P2A scaling is multiplied by become Change matrix A, i.e. P2A, wherein, the scale transformation matrix A is n × n square formations, i.e.,K represents scaling Coefficient;The foundation that zoom factor k chooses maximum is vector matrix P2After amplification, the obtained drafting template Width is less than or equal to the width of the masking-out image, and the length of the drafting template is less than or equal to the length of the masking-out image Degree.
In masking-out auto-erasing method another embodiment of the present invention based on template, template step is drawn in the generation In, to vector matrix P2The method for carrying out translating processing is by vector matrix P2After increasing to the right a row 1, multiplied by with one Translation transformation matrix B, i.e. [P21] B, wherein, translation transformation matrix B is (n+1) × n matrix,Wherein, p0=(x0,y0), x0Represent the distance that x moves in direction of principal axis, y0Represent in y-axis direction Mobile distance.
In masking-out auto-erasing method another embodiment of the present invention based on template, in the drawing image step, profit With the drafting template, the method for auto-erasing is in the masking-out:First, in the three dimensions that orthogonal projection is formed, along sight The masking-out image is first drawn on the person's of examining direction of visual lines;Then, it is random right according to bottom plate content in the front of the masking-out image The drafting shape of template draws shape image using Texture Mapping Technology;Finally, the masking-out image and the shape image are folded Add fusion, obtain the graphing in masking-out, and the bottom plate is shown in the correspondence position of the graphing and the bottom plate Pixel content.
The solution have the advantages that:The embodiment of the present invention discloses a kind of masking-out auto-erasing method based on template, should Pre-selected images are reconstructed base figure by method, then base figure progress grid is scanned to obtain the vector data of user's request shape, then By the vector data matrixing, the extraction of shape is completed, then the matrix data is translated and/or scaled processing generation and is painted Pallet, mode is finally drawn using three dimensions orthogonal projection component layer, realizes the auto-erasing effect in masking-out.Pass through Above-mentioned technical proposal, erasing the self-defined and erase process of shape is realized in erase process and is automatically processed, it is and existing Technology is compared, and expands the scope of application of masking-out method for deleting, and interactive mode is also no longer limited to the behaviour to screen or button Make.
Brief description of the drawings
Fig. 1 is the flow chart according to masking-out auto-erasing method one embodiment of the present invention based on template;
Fig. 2 is the schematic diagram according to the base figure of masking-out auto-erasing method another embodiment of the present invention based on template;
Fig. 3 is scanned according to the raster data of masking-out auto-erasing method another embodiment of the present invention based on template Schematic diagram;
Fig. 4 is to draw template according to the making of masking-out auto-erasing method another embodiment of the present invention based on template Schematic diagram;
Fig. 5 is the signal according to the auto-erasing of masking-out auto-erasing method another embodiment of the present invention based on template Figure;
Fig. 6 is the signal according to the drafting shape of masking-out auto-erasing method another embodiment of the present invention based on template Figure.
Embodiment
For the ease of understanding the present invention, below in conjunction with the accompanying drawings and specific embodiment, the present invention is carried out in more detail It is bright.The preferred embodiment of the present invention is given in accompanying drawing.But the present invention can realize in many different forms, and It is not limited to the embodiment described by this specification.On the contrary, the purpose for providing these embodiments is made in disclosure of the invention The understanding of appearance more thorough and comprehensive.
It should be noted that unless otherwise defined, all technologies and scientific terminology are with belonging to used in this specification The implication that the those skilled in the art of the present invention are generally understood that is identical.
Used term is intended merely to describe the purpose of specific embodiment in the description of the invention, is not to use In the limitation present invention.Term "and/or" used in this specification includes the arbitrary of one or more related Listed Items With all combinations.
Fig. 1 shows the flow chart of masking-out auto-erasing method one embodiment of the invention based on template.In Fig. 1, wrap Include:
Step S101:Shape is extracted, user's request shape is obtained from pre-selected images, and handle and obtain including the use Family demand shape and the base figure represented with raster data;
Step S102:Change data, the raster data of the user's request shape in the base figure is converted into vector number According to, and the vector data is further converted into vector matrix;
Step S103:Template is drawn in generation, and the vector matrix is translated and/or scaling is handled, obtains drawing mould Plate;
Step S104:Input picture, input need the bottom plate image shown and the masking-out for covering the bottom plate image Image;
Step S105:Drawing image, using drafting template auto-erasing on the masking-out image, so as to corresponding Show the bottom plate image.
Above-mentioned steps are further illustrated below.
First, step S101 be in order to obtain the user's request shape for erasing, and user's request shape mainly from Obtained in pre-selected images, such as user's request can be selected to be shaped as leaf of bamboo shape, and leaf of bamboo shape can is from the one of shooting Extracted in the pre-selected images of width bamboo.In addition, the base figure where the user's request shape is represented with raster data. Here raster data refers to represent base figure in a manner of pixel-matrix, such as base figure is the figure of 200 × 200 pixels Picture, raster data therein refers to the grid of one 200 × 200 come the corresponding pixel value for representing each pixel, and the picture Plain value then embodies the numerical value such as the color of the pixel, brightness.
Fig. 2 shows that the base diagram of masking-out auto-erasing method another embodiment of the invention based on template is intended to, the base Figure includes the user's request shape extracted by step S101, it can be seen that shape needed for the user similar to a kind of scratch shape, That is the shape that the foreground picture 11 of black is formed, the Background 12 of the base figure is grey.
It is further preferred that in step S101 extracts shape, input first has the pre-selection figure of user's request shape Picture, then user's request shape is taken out from the pre-selected images, base figure is used as using the inside of the shape border of user's request shape Foreground picture 11, the Background 12 using the outside of the shape border of user's request shape as base figure, Background 12 with first filling Color is filled, such as light grey, and foreground picture 11 is filled with the second fill color, such as black.Here, the first fill color is single color Pure color (such as pure blue, pure green), the second fill color are another pure colors different from the first fill color, such as the first filling When color is blue, the second fill color is free from the group of other multicolour of the first fill color for red, or the second fill color Close, such as the first fill color is blueness, and the second fill color is green and red combination, and not comprising blueness.In Fig. 2 institutes Show Ji Tuzhong,, can be by the data of its each internal grid (i.e. each pixel) for foreground picture 11 during Fill Color Value or pigment value are arranged to RGB (0,0,0), and the pigment value for representing three primary colours red, green, blue is 0, is shown as black;And for Background 12, the data value of its each internal grid (i.e. each pixel) or pigment value can be arranged to RGB (200, 200,200) the pigment value for, representing three primary colours red, green, blue is 200, is shown as light grey.As can be seen that the He of foreground picture 11 Background 12 not only shows significant difference, and pigment value also has significant difference.
For the step S102 in Fig. 1, data conversion is mainly completed, the raster data of user's request shape is changed For vector data, the method for the raster data vector quantization is:
The first step, determine intersection point, the raster data of base figure be scanned with behavior unit, it is determined that with user's request shape There is the grid line y of intersection point on each side of shapei, i ∈ [1, t], i are grid line yiSequence number, t is grid line yiTotal line number.
Here, when being scanned with row, it both can from top to bottom carry out scanning by row, can also carry out from bottom to top Scanned by row.
Second step, intersection point sorting, by the intersection point (x in each grid linei,j, yi) along grid line yiSort ascending is carried out, it is excellent Select sort ascending from left to right.
Fig. 3 shows the raster data scanning of masking-out auto-erasing method another embodiment of the invention based on template Schematic diagram, when entering line scans from bottom to top, it can be seen that first intersection point of scanning the first row 21 is p1,1, the second row 22 First intersection point p2,1
3rd step, matched by row, adjoining nodes are proceeded by from first intersection point in each grid line Pairing, i.e. (xi,2m-1, yi) and (xi,2m, yi) it is an intersection point pair, i ∈ [1, t], m ∈ [1, si], each Intersection point is to representing that grid line in the intersecting section in one, the sideline of user's request shape, obtainsj∈[1,2si], 2siRepresent grid line yiWith user The number of each side intersection point of demand shape, obtaining vector data collection is:
Wherein, p is worked asij=(xi,j,yi), i ∈ [1, t], j ∈ [1,2si],
By above-mentioned steps, the boundary vector data of user's request shape can be obtained, without user's request shape Internal data, required data volume reduces.Also, will be converted to by the shape raster data of a matrix representation be easy to carry out it is several The vector data of the boundary coordinate sequence of what conversion, so as to realize the vector quantization of raster data.
It is seen that P1In often capable coordinate pair number might not be equal, i.e. si≠sj(i ≠ j, i, j ∈ [1, t]). Because:For different user's request shapes, the coordinate pair number that scan line scanning does not go together to obtain might not phase Deng, as shown in figure 3, the coordinate pair number that the scanning of the first scan line 21 obtains is 1, the coordinate that the scanning of the second scan line 22 obtains It is 2 to number.
Follow-up for convenience to carry out data conversion and operation, next we are to P1Carry out matrixing processing.It is further excellent Choosing, in step s 102, vector data is converted to the method for vector matrix is:
Fill the vector data collection P1So that the number for the data that vector data collection is often gone is identical, obtains the vector Matrix is:
Wherein, n=max { 2si| i ∈ [1, t] }, fill method is for appointing The i ∈ [1, t] of meaning, if j ∈ (2si, n], then pij=(- 10000, -10000).
After obtaining the vector matrix, it is possible to carry out various conversion process to vector matrix.And pass through at various conversion After reason, it is possible to which generation obtains drawing template, that is, the content that step S103 is completed.
For the step S103 in Fig. 1, mainly complete to translate vector matrix and/or scaling is handled, thus To drafting template.
Preferably, for above-mentioned vector matrix P2The method for zooming in and out conversion is by vector matrix P2It is multiplied by a scaling Transformation matrix A, i.e. P2A, wherein, scale transformation matrix A is n × n square formations, i.e.,K represents scaling Coefficient.Wherein, the foundation that k chooses maximum is the vector matrix P2After amplification, the width of obtained drafting template is small In or equal to masking-out image width, and draw template length be less than or equal to masking-out image length.That is, Template is drawn when being amplified, corresponding erasing masking-out is not to be exceeded.
Preferably, for above-mentioned vector matrix P2The method for carrying out translation transformation is by the vector matrix P2Increase to the right After one row 1, multiplied by with a translation transformation matrix B, i.e. [P21] B, wherein, the translation transformation matrix B is (n+1) × n squares Battle array,Wherein, p0=(x0,y0), x0Represent the distance in the movement of x-axis direction, y0Represent in y-axis The distance of direction movement.
By step S103, a variety of conversion process can be carried out to the vector matrix of generation, so as to generate all size, The different drafting template in position, while all kinds of drafting templates are obtained, also by the pixel in the user's request shape Reason, is converted into the processing to its shape border, effectively reduces the workload of graphic plotting so that the efficiency of Image Rendering is more It is high.
Fig. 4 has further carried out patterned explanation to the step S102 and S103 shown in Fig. 1, it can be seen that in Fig. 4 , the base Figure 41 represented with raster data is first converted to vector data 42 by step S102 shown in Fig. 1, then enters one again Step is converted to vector matrix 43;Then, by step S103 shown in Fig. 1, vector matrix 43 can be zoomed in and out conversion respectively 44 (Fig. 4 is shown as amplification effect), translation transformation 45, and the combination 46 of both conversion.Said by Fig. 4 visualization It is bright, it is more beneficial for understanding the step S102 and S103 in Fig. 1.
Then, in step S104 in Fig. 1, input needs the bottom plate image shown and for covering bottom plate image Masking-out image.Here, bottom plate image is the content for needing to show, and masking-out image is to be covered on bottom plate image to be used to hide Bottom plate image is kept off, usual masking-out image is opaque, it is necessary to progressively wipe masking-out progressively to show bottom plate that masking-out is covered The true features of image, and shape used in wiping is exactly to draw the shape of template, erase process is exactly to draw the shape of template Shape in masking-out constantly change adjustment process, and in this process bottom plate image from draw template changes shape in by Step reveals.
Preferably, bottom plate image and masking-out image have the shape and structure of identical size, such as when being all rectangle, two The length and width of person corresponds to identical, if be all circle, the radius of the two is identical.
It is further preferred that bottom plate image has identical display resolution with masking-out image.
Below in conjunction with Fig. 5 and Fig. 6, for the step S105 in Fig. 1, wherein using draw template on masking-out image from Moving the method wiped is preferably:
First, in the three dimensions that orthogonal projection is formed, the guide along observer's direction of visual lines (z-axis direction in Fig. 5) Enter masking-out image 52;
Then, in the front of masking-out image 52, according to the content of bottom plate image 51, random utilize draws template generation Draw shape;
Finally, the pixel filling of the correspondence position of bottom plate image 51 is drawn into shape, obtains blank map as 53, fill out simultaneously Image 53 is filled to be superimposed with masking-out image 52 and obtain wiping image 54.
Here, it can be seen that drawing template can be changed with dynamic random, thus produce and draw shape, practical application In and draw template change once can be carried out an auto-erasing.Also, draw shape is drawn caused by template every time Shape, blank map picture will be obtained in the pixel of position filling bottom plate image corresponding to bottom plate image, while again blank map picture The effect wiped on masking-out image is produced with masking-out imaging importing, that is to say, that carries out the same of pixel filling to drawing shape When be also the blank map picture that progressively generates with masking-out image in the process being overlapped.Fig. 6 shows multiple by drawing template After conversion effect is wiped on masking-out image.
Preferably, when template is drawn in random utilization during producing drafting shape, with non-scratching area in masking-out image 52 Domain is basic point, a translation variation coefficient is obtained using random function, then by step shown in the translation variation coefficient and Fig. 1 P in translation matrix in S1030X0And/or y0It is multiplied, you can realize and draw template auto-translating, the erasing position to drawing template Put random automatic selection;Preferably, using the lower left corner of masking-out image 52 as starting point (0,0), line by line from top to bottom, from left to right time Go through and do not wipe region, the span for translating variation coefficient is [- 1,1].
As can be seen here, the embodiment of the present invention can draw mould in application process by being realized to the calling of random function The random change of plate position, and then drafting shape is randomly generated, therefore generate the scratching area that a position is chosen automatically Domain, you can realize the automatic progress of erase process, it is no longer necessary to which user specifies erasure location.
Preferably, an anglec of rotation can also be randomly generated using random function, produces and draws shape, when drafting mould When plate Random-Rotation changes, the diversity for drawing shape generation can be further enriched.
As can be seen here,, can be with by the way of the drafting of above-mentioned three dimensions orthogonal projection component layer in step S105 Masking-out image and drafting shape are intuitively and accurately subjected to matching primitives in the same direction, are easy to read from bottom plate image Capture element draw the pixel filling of shape, obtains blank map picture, and when STOCHASTIC CONTROL draws translation, the scaling of template With it is rotationally-varying when, the generation that can to draw shape has diversity, and these the random changes for drawing template can be with Automatically generated by random function, so that erase process is carried out in a manner of automating, being randomized.
By the above-mentioned means, the masking-out auto-erasing method of the invention based on template, base figure is reconstructed with pre-selected images, then The base figure is carried out to the vector data of grid scanning calculating user's request shape, then by the vector data matrixing, completes shape The extraction of shape, then matrix data is translated and/or scaled processing generation and draws template, finally just penetrated using three dimensions Projection component layer draws mode and realizes final auto-erasing effect.Compared with masking-out method for deleting of the prior art, this Invention realizes erasing the self-defined and erase process of shape in erase process and automatically processed, applied widely, interaction Mode is also no longer limited to the operation to screen or button.
Embodiments of the invention are the foregoing is only, are not intended to limit the scope of the invention, it is every to utilize this hair The equivalent transformation that bright specification and accompanying drawing content are made, or other related technical areas are directly or indirectly used in, similarly It is included within the scope of the present invention.

Claims (8)

  1. A kind of 1. masking-out auto-erasing method based on template, it is characterised in that comprise the following steps:
    Extract shape, from pre-selected images obtain user's request shape, and handle obtain comprising the user's request shape and with The base figure that raster data represents;
    Change data, the raster data of the user's request shape in the base figure is converted into vector data, and further by institute State vector data and be converted to vector matrix;
    Template is drawn in generation, and the vector matrix is translated and/or scaling is handled, obtains drawing template;
    Input picture, input need the bottom plate image shown and the masking-out image for covering the bottom plate image;
    Auto-erasing, using drafting template auto-erasing on the masking-out image, the bottom plate figure is shown so as to corresponding Picture.
  2. 2. the masking-out auto-erasing method according to claim 1 based on template, it is characterised in that in the extraction shape In, pre-selected images of the input with user's request shape, then the user's request shape is taken out from the pre-selected images first Shape, the foreground picture using the inside of the shape border of the user's request shape as the base figure, with the user's request shape Shape border the outside Background as the base figure, the Background filled with the first fill color, the foreground picture with Second fill color is filled, and first fill color is the pure color of single color, and second fill color is and the described first filling The combination of the different another pure color of color either other multicolour without first fill color.
  3. 3. the masking-out auto-erasing method according to claim 2 based on template, it is characterised in that by the base figure The method that the raster data of the user's request shape is converted to vector data is:
    Determine intersection point, the raster data of the base figure be scanned with behavior unit, it is determined that with the user's request shape There is the grid line y of intersection point on each sidei, i ∈ [1, t], i are the sequence number of the grid line, and t is total line number of the grid line;
    Intersection point sorting, by the intersection point (x in each grid linei,j, yi) along the grid line yiCarry out sort ascending;
    Matched by row, adjoining nodes pairing, i.e. (x are proceeded by from first intersection point in each grid linei,2m-1, yi) and (xi,2m, yi) it is an intersection point pair, i ∈ [1, t], m ∈ [1, si], each intersection point is to representing that the grid line needs in the user The intersecting section in one, sideline of shape is asked, is obtainedj∈ [1,2si], 2siRepresent grid line yiWith the number of each side intersection point of the user's request shape, obtaining vector data collection is:
    <mrow> <msup> <mi>P</mi> <mn>1</mn> </msup> <mo>=</mo> <mfenced open = "{" close = "}"> <mtable> <mtr> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mn>1</mn> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>)</mo> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mn>1</mn> <mo>,</mo> <mn>2</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>)</mo> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mn>...</mn> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mn>1</mn> <mo>,</mo> <mn>2</mn> <msub> <mi>s</mi> <mn>1</mn> </msub> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mn>1</mn> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mn>2</mn> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>)</mo> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mn>2</mn> <mo>,</mo> <mn>2</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>)</mo> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mn>...</mn> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mn>2</mn> <mo>,</mo> <mn>2</mn> <msub> <mi>s</mi> <mn>1</mn> </msub> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mn>2</mn> </msub> <mo>)</mo> </mrow> </mtd> </mtr> <mtr> <mtd> <mn>...</mn> </mtd> <mtd> <mrow></mrow> </mtd> <mtd> <mrow></mrow> </mtd> <mtd> <mrow></mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mi>t</mi> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mi>t</mi> </msub> <mo>)</mo> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mi>t</mi> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mi>t</mi> </msub> <mo>)</mo> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mn>...</mn> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mo>(</mo> <msub> <mi>x</mi> <mrow> <mi>t</mi> <mo>,</mo> <mn>2</mn> <msub> <mi>s</mi> <mi>t</mi> </msub> </mrow> </msub> <mo>,</mo> <msub> <mi>y</mi> <mi>t</mi> </msub> <mo>)</mo> </mrow> </mtd> </mtr> </mtable> </mfenced> </mrow>
    Wherein, p is worked asij=(xi,j,yi), i ∈ [1, t], j ∈ [1,2si],
    <mrow> <msup> <mi>P</mi> <mn>1</mn> </msup> <mo>=</mo> <mfenced open = "{" close = "}"> <mtable> <mtr> <mtd> <mrow> <msub> <mi>p</mi> <mrow> <mn>1</mn> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <msub> <mi>p</mi> <mrow> <mn>1</mn> <mo>,</mo> <mn>2</mn> </mrow> </msub> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mn>...</mn> <mo>,</mo> </mrow> </mtd> <mtd> <msub> <mi>p</mi> <mrow> <mn>1</mn> <mo>,</mo> <mn>2</mn> <msub> <mi>s</mi> <mn>1</mn> </msub> </mrow> </msub> </mtd> </mtr> <mtr> <mtd> <mrow> <msub> <mi>p</mi> <mrow> <mn>2</mn> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <msub> <mi>p</mi> <mrow> <mn>2</mn> <mo>,</mo> <mn>2</mn> </mrow> </msub> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mn>...</mn> <mo>,</mo> </mrow> </mtd> <mtd> <msub> <mi>p</mi> <mrow> <mn>2</mn> <mo>,</mo> <mn>2</mn> <msub> <mi>s</mi> <mn>2</mn> </msub> </mrow> </msub> </mtd> </mtr> <mtr> <mtd> <mn>...</mn> </mtd> <mtd> <mrow></mrow> </mtd> <mtd> <mrow></mrow> </mtd> <mtd> <mrow></mrow> </mtd> </mtr> <mtr> <mtd> <mrow> <msub> <mi>p</mi> <mrow> <mi>t</mi> <mo>,</mo> <mn>1</mn> </mrow> </msub> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <msub> <mi>p</mi> <mrow> <mi>t</mi> <mo>,</mo> <mn>2</mn> </mrow> </msub> <mo>,</mo> </mrow> </mtd> <mtd> <mrow> <mn>...</mn> <mo>,</mo> </mrow> </mtd> <mtd> <msub> <mi>p</mi> <mrow> <mi>t</mi> <mo>,</mo> <mn>2</mn> <msub> <mi>s</mi> <mi>t</mi> </msub> </mrow> </msub> </mtd> </mtr> </mtable> </mfenced> <mo>.</mo> </mrow>
  4. 4. the masking-out auto-erasing method according to claim 3 based on template, it is characterised in that by the vector data Being converted to the method for the vector matrix is:
    Fill the vector data collection so that the number of the vector data collection each row of data is identical, obtains the vector matrix For:
    Wherein, n=max { 2si| i ∈ [1, t] }, fill method be forIf j ∈ (2si, n], then pij=(- 10000, -10000).
  5. 5. the masking-out auto-erasing method according to claim 4 based on template, it is characterised in that to the vector matrix P2The method for zooming in and out processing is by the vector matrix P2It is multiplied by a scale transformation matrix A, i.e. P2A, wherein, the contracting It is n × n square formations to put transformation matrix A, i.e.,K represents the coefficient of scaling.
  6. 6. the masking-out auto-erasing method according to claim 5 based on template, it is characterised in that the k chooses maximum The foundation of value is the vector matrix P2After amplification, the width of the obtained drafting template is less than or equal to the masking-out The width of image, and the length for drawing template is less than or equal to the length of the masking-out image.
  7. 7. the masking-out auto-erasing method according to claim 4 based on template, it is characterised in that to the vector matrix P2The method for carrying out translating processing is by the vector matrix P2After increasing to the right a row 1, multiplied by with a translation transformation matrix B, That is [P21] B, wherein, the translation transformation matrix B is (n+1) × n matrix,Wherein, p0= (x0,y0), x0Represent the distance in the movement of x-axis direction, y0Represent the distance in the movement of y-axis direction.
  8. 8. the masking-out auto-erasing method based on template according to any one of claim 1 to 7, it is characterised in that utilize It is described drafting template method of auto-erasing in masking-out be:
    First, in the three dimensions that orthogonal projection is formed, masking-out image is first imported along observer's direction of visual lines;
    Then, in the front of the masking-out image, according to the content of the bottom plate image, random utilization is drawn template generation and painted Shape processed;
    Finally, shape will be drawn described in the pixel filling of the correspondence position of the bottom plate image, obtains blank map picture, while by institute State blank map picture and the masking-out imaging importing and obtain wiping image.
CN201711007651.3A 2017-10-25 2017-10-25 mask automatic erasing method based on template Active CN107844240B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711007651.3A CN107844240B (en) 2017-10-25 2017-10-25 mask automatic erasing method based on template

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711007651.3A CN107844240B (en) 2017-10-25 2017-10-25 mask automatic erasing method based on template

Publications (2)

Publication Number Publication Date
CN107844240A true CN107844240A (en) 2018-03-27
CN107844240B CN107844240B (en) 2019-12-17

Family

ID=61661795

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711007651.3A Active CN107844240B (en) 2017-10-25 2017-10-25 mask automatic erasing method based on template

Country Status (1)

Country Link
CN (1) CN107844240B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111221461A (en) * 2019-11-19 2020-06-02 北京字节跳动网络技术有限公司 Method, apparatus, device and storage medium for gradually presenting image presentation content
CN112672118A (en) * 2019-10-15 2021-04-16 中强光电股份有限公司 Projector, projection system, computer-readable storage medium, and display operation method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6233363B1 (en) * 1997-09-26 2001-05-15 Minolta Co., Ltd. Image reading apparatus for a document placed face up having a function of erasing finger area images
CN104078028A (en) * 2014-06-27 2014-10-01 联想(北京)有限公司 Screen brightness adjusting method and electronic equipment
CN106530309A (en) * 2016-10-24 2017-03-22 成都品果科技有限公司 Video matting method and system based on mobile platform
CN106599857A (en) * 2016-12-20 2017-04-26 广东欧珀移动通信有限公司 Image identification method, apparatus, computer-readable storage medium and terminal device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6233363B1 (en) * 1997-09-26 2001-05-15 Minolta Co., Ltd. Image reading apparatus for a document placed face up having a function of erasing finger area images
CN104078028A (en) * 2014-06-27 2014-10-01 联想(北京)有限公司 Screen brightness adjusting method and electronic equipment
CN106530309A (en) * 2016-10-24 2017-03-22 成都品果科技有限公司 Video matting method and system based on mobile platform
CN106599857A (en) * 2016-12-20 2017-04-26 广东欧珀移动通信有限公司 Image identification method, apparatus, computer-readable storage medium and terminal device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
朱婧: "图像矢量化方法研究", 《中国优秀硕士学位论文全文数据库信息科技辑(月刊)》 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112672118A (en) * 2019-10-15 2021-04-16 中强光电股份有限公司 Projector, projection system, computer-readable storage medium, and display operation method
CN111221461A (en) * 2019-11-19 2020-06-02 北京字节跳动网络技术有限公司 Method, apparatus, device and storage medium for gradually presenting image presentation content

Also Published As

Publication number Publication date
CN107844240B (en) 2019-12-17

Similar Documents

Publication Publication Date Title
CN108389257B (en) Generating a three-dimensional model from a scanned object
CN104750931A (en) Intelligent device control arrangement system applied to interior design
TW201101824A (en) Processing method of display setup and embedded system
CN106162140A (en) The compression method of a kind of panoramic video and device
CN103996167A (en) Thumbnail display method and user equipment
CN101739210B (en) Reminding method for image browsing and device thereof
CN109643462B (en) Real-time image processing method based on rendering engine and display device
CN102521820B (en) Object picture display method with dynamic fusion of background and display method thereof
CN103139478A (en) Photographing method with real-time rendering of main image and secondary image
CN101883218B (en) Image acquisition and artistic processing method based on camera
CN102110289A (en) Method for enhancing color image contrast ratio on basis of variation frame
CN107844240A (en) A kind of masking-out auto-erasing method based on template
CN107527377A (en) A kind of hanging Chinese character rendering intent of three-dimensional earth based on mobile platform
CN104281865B (en) A kind of method and apparatus for generating Quick Response Code
CN101673409B (en) Image rendering method applied to computer screen
CN102722902B (en) Anti-aliasing the improving one&#39;s methods of rasterization stage in a kind of graph rendering streamline
US11043019B2 (en) Method of displaying a wide-format augmented reality object
CN111179390B (en) Method and device for efficiently previewing CG (content distribution) assets
JPH05143711A (en) Image generating method
CN102073468B (en) Method for realizing image edge blending based on window system
CN103065343A (en) Vector map standard conversion method based on spatial data model
CN105205797B (en) A kind of acquiring method of image variant art distortion figure
CN109117542B (en) Parquet importing method based on convolution algorithm
JP3501479B2 (en) Image processing device
JP2009272665A (en) Image processing apparatus, image processing method, and program

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant