CN101894363A - Patched garbage mask border rendering method - Google Patents

Patched garbage mask border rendering method Download PDF

Info

Publication number
CN101894363A
CN101894363A CN2009100847356A CN200910084735A CN101894363A CN 101894363 A CN101894363 A CN 101894363A CN 2009100847356 A CN2009100847356 A CN 2009100847356A CN 200910084735 A CN200910084735 A CN 200910084735A CN 101894363 A CN101894363 A CN 101894363A
Authority
CN
China
Prior art keywords
border
point
boundary
sub
garbage mask
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
CN2009100847356A
Other languages
Chinese (zh)
Other versions
CN101894363B (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.)
China Digital Video Beijing Ltd
Original Assignee
China Digital Video Beijing Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by China Digital Video Beijing Ltd filed Critical China Digital Video Beijing Ltd
Priority to CN2009100847356A priority Critical patent/CN101894363B/en
Publication of CN101894363A publication Critical patent/CN101894363A/en
Application granted granted Critical
Publication of CN101894363B publication Critical patent/CN101894363B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Image Generation (AREA)

Abstract

The invention belongs to the image/video processing technology, and particularly relates to a patched garbage mask border rendering method. The method comprises the following steps of: dividing all Bezier curves in a garbage mask into a plurality of sub segments; determining an external direction of the garbage mask; then calculating external border distances and internal border distances of all segment points according to the information of border points; and finally, drawing an external/internal border and an external/internal angle border corresponding to an initial endpoint of each Bezier curve taken as a unit. The method divides the external/internal border and the external/internal angle border corresponding to the initial endpoint of each Bezier curve into a plurality of triangular patches so that the rendered border is smoother and clearer and the regulation and control of the operation are more flexible.

Description

A kind of garbage mask border rendering method of tiled
Technical field
The invention belongs to the image/video treatment technology, be specifically related to a kind of garbage mask border rendering method of tiled.
Background technology
In the image/video process software, image/video is synthesized or carries out mask process during special effect processing is a kind of demand very widely.Common this mask can generate out or obtain out from the mask images of a special use by the key stunt, but so under many circumstances mask is not enough, also need to be used for to create out a mask by the method for manual drawing, this mask generally is referred to as garbage mask.
A garbage mask is made of some orderly end points (end point), per two continuous end points constitute a curve, along the working direction of end points order positive dirction, otherwise be contrary direction, each end points has two reference mark (control point), one is forward reference mark (forward control point), one is reverse reference mark (backward control point), the forward reference mark is used to control the shape of the forward curve of its place end points, and reverse reference mark is used to control the shape of the reverse curve of its place end points.Therefore, the shape of each bar curve is by two end points and two reference mark decisions, and they are actually three Beizer curves, and a garbage mask is described out by the closed curve that some three Beizer curves constitute.It is as follows to describe three Beizer curves with parametric equation:
x(t)=a x·t 3+b x·t 2+c x·t+d x
y(t)=a y·t 3+b y·t 2+c y·t+d y
T is the parameter of parametric equation in the following formula, and its scope is [0,1], a x, b xA series of coefficients are that the coordinate by the end points of this curve and reference mark determines out.
Except the fundamental element of describing a garbage mask is arranged: the Bezier extra curvature of end points and its defined, the element that control garbage mask boundary shape also will be arranged, this element is referred to as frontier point (edgepoint), frontier point has two attributes: position (position) and distance (distance), the parameter position of this frontier point of determining positions on garbage mask boundary curve, garbage mask boundary curve all is made up of the Bezier curve, and the parameter value (parameter value of parametric equation) of the position attribution of the frontier point Bezier curve that it was positioned at just adds the sequence number of this Bezier curve, such as a position is that 1.6 frontier point just means it between second and the 3rd curve that end points constituted of garbage mask (starting point is 0), and is on parametric t is that aspect of 0.6; Distance has determined the distance of the normal direction of the point of this frontier point above curve away from curve, and it is an outer boundary point that distance is represented this for positive number, is used for determining the outer boundary shape of garbage mask; Then representing this for negative is an inner boundary point, is used for determining the inner boundary shape of garbage mask.The border of whole garbage mask is decided by the shape that inner and outer boundary point institute envelope comes out.
So, the outside of a garbage mask and inner how the differentiation? here, still be that right side (counter clockwise direction or clockwise direction in other words conj.or perhaps) stipulates which side is the outside of garbage mask along the left side that positive dirction is seen generally, and it is called outside direction with Bezier curve among the garbage mask.Left side such as our regulation curve is an outside direction, that is to say that so the Bezier curve is the perimeter of garbage mask along the left side that positive dirction is seen, the right side is an interior zone.
Each frontier point has two coordinates, is respectively coordinate on coordinate and the border on the curve.Coordinate is meant the coordinate of that point of the correspondence of this frontier point on garbage mask on the curve, and this can directly obtain by its position attribution and the parametric equation of its place Bezier curve; Coordinate is meant that the normal direction of that point of the correspondence of this frontier point above garbage mask is away from the coordinate of its that point so far away apart from attribute of curve on the border, it can be by coordinate points on the curve tangent line side clockwise or be rotated counterclockwise 90 degree (for the outer boundary point, if the outside direction of garbage mask is the left side then is rotated counterclockwise, otherwise turn clockwise, so then just in time opposite to inner boundary point) be offset it again and so far calculate coordinate on its border apart from attribute.So coordinate is (x on the curve of a frontier point if calculated 0, y 0) and this unit tangent vector be (x t, y t), it is as follows to calculate on its border Coordinate Calculation method so:
x′=x 0+dist·(x t·cos(θ)-y t·sin(θ))
y′=y 0+dist·(x t·sin(θ)+y t·cos(θ))
In the following formula, dist represents the absolute value of this frontier point apart from attribute, and θ is-pi/2 or pi/2, and this depends on and turns clockwise or be rotated counterclockwise.Fig. 2 has shown a garbage mask and its frontier point.Garbage mask among Fig. 2 has 5 end points, three frontier points.Its outside direction is the left side, and frontier point A and frontier point C are outer boundary points and frontier point B is an inner boundary point as can be seen.
Creating this garbage mask generally is the curve of drawing a closure by the user, and filling the gray-scale map that this closed curve obtains then is exactly a garbage mask.It is too stiff to fill closed curve gray-scale map border afterwards, make it seem more level and smooth so need carry out certain modification to the border, general in addition also will control the length of border transition makes the border look certain thickness is arranged, in order to realize that these most of softwares tend to use morphologic contraction and expansion algorithm and Gaussian Blur Processing Algorithm, whole garbage mask seems too fuzzy when fog-level is bigger but such implementation method can cause, its border is also more fixing in addition, lacks ability of regulation and control flexibly.
Summary of the invention
The objective of the invention is to defective, a kind of garbage mask border rendering method of tiled is provided, make the garbage mask border after playing up more clear, control more flexible at prior art.
Technical scheme of the present invention is as follows: a kind of garbage mask border rendering method of tiled comprises the steps:
(1) all the Bezier curves among the garbage mask is divided into plurality of sub segments;
(2) determine the outside direction of garbage mask;
(3) go out the outer boundary distance and the inner boundary distance of all waypoints according to the information calculations of frontier point;
(4) be that outer/inner the border of its correspondence and outer/inner arm of angle circle of its initial end points correspondence are drawn by unit with every Bezier curve.
Further, the garbage mask border rendering method of aforesaid tiled, wherein, the method that in the step (1) the Bezier curve is divided into plurality of sub segments is as follows: for a Bezier curve, advance forward for step-length by 1/30, calculate the position tangent line vector of current this point, and carry out dot product with the unit tangent vector of this vector and previous fixed waypoint and calculate, if the value that draws is less than threshold value cos (2.5 π/180), then current point just is defined as a waypoint, not so this point is just ignored in the past, continues then by 1/30 step-length this process of repetition of advancing forward, up to the end of this Bezier curve.
Further, the garbage mask border rendering method of aforesaid tiled, wherein, the step of the outside direction of definite garbage mask is as follows in the step (2):
1. calculate the bounding box of garbage mask, obtain the maximum y value of bounding box and the intermediate value yc of minimum y value then;
2. find out this horizontal line of y=yc and the intersection point of all Bezier curves above the garbage mask, and find out leftmost that intersection point in these intersection points;
3. obtain the tangent line vector of leftmost that intersection point in its Bezier curve, carry out the cross product computing with the unit vector of x axle positive dirction then, if the z value of cross product operation result greater than 0 then outside direction is the right side, otherwise is the left side.
Further, the garbage mask border rendering method of aforesaid tiled, wherein, the fall into a trap outer boundary distance of calculating waypoint and the method for inner boundary distance of step (3) is: that outer/inner frontier point of position attribution numerical value minimum above garbage mask, find next outer/inner the frontier point adjacent with it, if the position attribution of these two frontier points is respectively p0 and p1, apart from attribute is respectively d 0 and d1, travel through all waypoints between these two frontier points, outer/inner frontier distance computing formula of each waypoint is d=d0+ (p-p0)/(p1-p0) (d1-d0), wherein, p is the position of the waypoint that calculated.
Further, the garbage mask border rendering method of aforesaid tiled, wherein, outer/inner arm of angle circle of the initial end points correspondence of Bezier curve described in the step (4) is meant the forward tangent line and the inconsistent fan-like pattern border of causing of reverse tangential direction of this end points, perpendicular to the forward tangent line and the reverse tangent line of this end points, the length of waist is outer/inner frontier distance of this end points to two waists on this fan-like pattern border respectively; The method of drawing outer/inner arm of angle circle is: with this fan-like pattern boundary demarcation is some tri patchs, calculate the gray-scale value on these tri patch summits then, gray-scale value for that summit of end points correspondence is 1, for outer/inner borderline summit gray-scale value is exactly 0, utilizes gouraud shading colorize method to play up these tri patchs then.
Further, the garbage mask border rendering method of aforesaid tiled, wherein, the method on outer/inner border of the drafting Bezier curve correspondence described in the step (4) is: at each sub-line segment, find position attribution all frontier points between the starting and ending waypoint of this sub-line segment; Obtain each frontier point outside/coordinate on the inner boundary; With frontier point on curve coordinate points and outer/inner borderline coordinate points as the summit of tri patch, calculate the gray-scale value on these tri patch summits; Utilize gouraud shading colorize method to play up these tri patchs then.
Further, the garbage mask border rendering method of aforesaid tiled, wherein, when drawing the outer boundary of Bezier curve correspondence in the step (4), for the outer boundary point between the starting and ending waypoint of each sub-line segment, always calculate coordinate on its outer boundary according to coordinate on its curve and its external parties apart from attribute and current garbage mask; For the inner boundary point between the starting and ending waypoint of each sub-line segment, outer boundary according to the broad sense outer boundary point of its front and the broad sense outer boundary point of back obtains its outer boundary distance apart from carrying out linear interpolation, and then calculating coordinate on its outer boundary, described broad sense outer boundary point comprises that outer boundary puts coordinate points on the outer boundary corresponding with waypoint of coordinate points on the pairing border.
Further, the garbage mask border rendering method of aforesaid tiled, wherein, when drawing the inner boundary of Bezier curve correspondence in the step (4), for the inner boundary point between the starting and ending waypoint of each sub-line segment, always calculate coordinate on its inner boundary according to coordinate on its curve and its internal side apart from attribute and current garbage mask; For the outer boundary point between the starting and ending waypoint of each sub-line segment, inner boundary according to the broad sense inner boundary point of its front and the broad sense inner boundary point of back obtains its inner boundary distance apart from carrying out linear interpolation, and then calculating coordinate on its inner boundary, described broad sense inner boundary point comprises that inner boundary puts coordinate points on the inner boundary corresponding with waypoint of coordinate points on the pairing border.
Further again, the garbage mask border rendering method of aforesaid tiled, wherein, in the step (4) in the process on outer/inner the border of drawing Bezier curve correspondence, each sub-line segment is divided into plurality of sections by all frontier points between its starting and ending waypoint, the outer boundary of each section constitutes a quadrilateral, each quadrilateral on average is divided into the experimental process quadrilateral along the trend of Bezier curve, the quantity computation method of dividing is as follows: establish the length that l0 represents this quadrilateral before waist, l1 represents the length of that waist of back, so sub-quadrilateral quantity Calculate this a little tetragonal apex coordinate and gray-scale value by linear interpolation after drawing sub-quadrilateral quantity, and then utilize identical method that each sub-quadrilateral is divided into the plurality of sub quadrilateral again along Bezier normal to curve direction, just whole quadrilateral can be divided into the plurality of sub quadrilateral at last; Each sub-quadrilateral is divided into two adjacent tri patchs, utilizes gouraud shading colorize method to play up these tri patchs.
Beneficial effect of the present invention is as follows: the garbage mask border rendering method of tiled provided by the present invention, realized the self-adaptation division of the sub-line segment of Bezier curve among the garbage mask, outer/inner the border of every Bezier curve correspondence and outer/inner arm of angle circle of its initial end points correspondence are divided into some tri patchs, utilize gouraud shading colorize method to play up these tri patchs, make the border of playing up more level and smooth, clear, more flexible to the regulation and control of operation.
Description of drawings
Fig. 1 is a method flow diagram of the present invention;
Fig. 2 is end points and the frontier point synoptic diagram of garbage mask;
Fig. 3 is divided into the synoptic diagram of tri patch for outside arm of angle circle of the end points correspondence of Bezier curve;
Fig. 4 is that frontier point and waypoint coordinate on outer boundary and inner boundary concern synoptic diagram;
Fig. 5 is rendering effect figure of the present invention.
Embodiment
Below in conjunction with the drawings and specific embodiments the present invention is described in detail.
As shown in Figure 1, the garbage mask border rendering method of a kind of tiled provided by the present invention comprises the steps:
(1) all the Bezier curves among the garbage mask is divided into plurality of sub segments;
(2) determine the outside direction of garbage mask;
(3) go out the outer boundary distance and the inner boundary distance of all waypoints according to the information calculations of frontier point;
(4) be that outer/inner the border of its correspondence and outer/inner arm of angle circle of its initial end points correspondence are drawn by unit with every Bezier curve.
In said method, at first to carry out the segmentation of Beizer curve among the garbage mask.Because for playing up of the processing border of tiled, the Bezier curve must be divided into some continuous sub-line segments, come this Beizer curve of approximate representation with this a little line segment, the tie point of these line segments is referred to as waypoint (segment point), a Beizer curve among the garbage mask has two waypoints at least, just its initial end points and end caps.The simplest method that a Bezier curve is divided into plurality of sub segments is exactly evenly to divide by the parametric t of this Bezier parametric equation, if can cause the very low curve of a lot of curvature to divide a lot of waypoints in vain too much but like this get, reduced the speed of the processing of some algorithms of back, if but get and under the very high situation of curvature, can cause curve level and smooth inadequately very little again.The present invention adopts the method for dynamic division, specific algorithm is as follows: for a Bezier curve, regulation is divided into 30 sub-line segments at most, that is to say that step-length minimum between the waypoint is 1/30, advance forward for step-length by 1/30, calculate the position tangent line vector of current this point, and carry out dot product with the unit tangent vector of this vector and previous fixed waypoint (t=0 must be a waypoint) and calculate, if the value that draws is less than threshold value cos (2.5 π/180), then current point just is defined as a waypoint, not so this point is just ignored in the past, then no matter be which kind of situation all continues by 1/30 step-length this process of repetition of marching forward, up to the end of going to this Bezier curve (t=1 also must be a waypoint).The benefit of dividing waypoint like this is if the sub-line segment that curvature of curve very low (or even straight line) is divided so will seldom even have only one section, and the sub-line segment of the high more division of curvature of curve is just many more, so this method is adaptive.
Next will distinguish outside and the inside of garbage mask.The present invention still is that right side (counter clockwise direction or clockwise direction in other words conj.or perhaps) stipulates which side is the outside of garbage mask along the left side that positive dirction is seen with Bezier curve among the garbage mask, and this is called outside direction.Left side such as the regulation curve is an outside direction, that is to say that so the Bezier curve is the perimeter of garbagemask along the left side that positive dirction is seen, the right side is an interior zone.In order to determine the outside direction of a garbage mask, following algorithm is arranged:
1. calculate the bounding box (bounding box) of garbage mask, obtain the maximum y value of bounding box and the intermediate value yc of minimum y value then.
In order to ask the bounding box of a garbage mask, at first to obtain the bounding box of each bar Bezier curve among the garbage mask.Concrete solution procedure is as follows: for the maximum/minimum value of horizontal direction, at first calculate x (0) and x (1), then x (t) asked the single order derived function, x ' (t)=3a xT 2+ 2b xT+c x, find the solution (t)=0 real root in t ∈ [0,1] of x ', and then the functional value of these real root correspondences and the value of x (0) and x (1) compared, just can obtain x (t) in t ∈ [0,1] interval maximal value and minimum value, the left margin and the right margin of Here it is this Bez i er curve bounding box.In like manner, calculate y (t), can obtain the coboundary and the lower boundary of bounding box in t ∈ [0,1] interval maximal value and minimum value.Solve so after the bounding box of left and right sides curve among the garbage mask, we just may obtain the bounding box boundary value of whole garbage mask according to the most left/the rightest/the go up most/boundary value under of these bounding boxs again.
2. find out this horizontal line of y=yc and the intersection point (in asking the process of friendship, being actually the intersection point of the sub-line segment of asking this horizontal line and this Bezier curve) of all Bezier curves above the garbage mask, and find out leftmost that intersection point in these intersection points.
3. obtain the tangent line vector of leftmost that intersection point in its Bezier curve, carry out the cross product computing with the unit vector of x axle positive dirction then, if the z value of cross product operation result greater than 0 then outside direction is the right side, otherwise is the left side.
Before carrying out specifically the playing up of garbage mask border, also need to calculate pairing outer boundary distance of waypoint and inner boundary distance on all Bezier curves, these two numerical value are used in order to constitute whole inside and outside boundary curve.Because frontier point has only determined the position of several discrete frontier points, but it can't determine the shape of inner boundary or the outer boundary of whole garbage mask, therefore also can't play up whole border.And the pairing outer boundary of waypoint distance and inner boundary distance are just for the inner boundary that can determine whole garbage mask or the needed data of shape of outer boundary, according to the pairing outer boundary of each waypoint distance and inner boundary distance just can with background technology on the computation bound point border introduced the similar method of coordinate calculate coordinate on the corresponding inner and outer boundary of each waypoint, thereby these coordinate points are coupled together the whole inside/outside of formation border.Below just introduce how to calculate pairing outer boundary distance of each waypoint and inner boundary distance, that outer/inner frontier point of position attribution numerical value minimum above garbage mask, find next outer/inner the frontier point adjacent with it, the position attribution of supposing these two frontier points is respectively p0 and p1, apart from attribute (frontier point is away from the distance on border) is respectively d0 and d1, travel through all waypoints between these two frontier points, outer/inner frontier distance of each segmentation can calculate like this: the position of supposing this waypoint is p, so its outer/inner frontier distance d=d0+ (p-p0)/(p1-p0) (d1-d0).Handle all frontier points successively by this method and to the last get back to outer/inner the frontier distance that first frontier point can calculate all waypoints.
Introduce the border of how playing up garbage mask with the method for tiled below, concrete method is: travel through in order that each end points E plays up its pairing border of pairing forward Bezier curve among the garbage mask.Be divided into following two steps:
1) plays up outer/inner arm of angle circle of this end points
Arm of angle circle is meant the forward tangent line and the inconsistent fan-like pattern border of causing of reverse tangential direction of this end points, two waists on this fan-like pattern border are respectively perpendicular to the forward tangent line and the reverse tangent line of this end points, the length of waist is exactly outer/inner frontier distance of this end points, and Fig. 3 is the synoptic diagram of outside arm of angle circle.With this fan-like pattern boundary demarcation is some tri patchs, in the present embodiment arm of angle circle is divided into 20 fixing tri patchs, calculate the gray-scale value on these tri patch summits then, gray-scale value for that summit of end points correspondence is 1, for the summit gray-scale value on the outer boundary is exactly 0, utilizes gouraud shading colorize method to play up these tri patchs then and gets final product.
2) play up outer/inner border of this end points forward curve
Play up outer/inner border of this end points forward curve and will carry out following processing: find position attribution all frontier points between the starting and ending waypoint of this sub-line segment each sub-line segment of this end points forward curve, these frontier points are the outer boundary point a bit, and some then is the inner boundary point.When playing up outer boundary, for the outer boundary point between the starting and ending waypoint of each sub-line segment, always calculate coordinate (referring to the description in the background technology) on its outer boundary according to coordinate on its curve and its external parties apart from attribute and current garbage mask, coordinate points in the back will be as the summit of tri patch on coordinate points and the border on its curve; For the inner boundary point between the starting and ending waypoint of each sub-line segment, can not directly use on its border coordinate points as the summit of tri patch, because its direction is anti-, need obtain its outer boundary distance apart from carrying out linear interpolation according to the outer boundary of the broad sense outer boundary point of its front (comprise outer boundary put coordinate points on the outer boundary corresponding of coordinate points on the pairing border) and the broad sense outer boundary point of back with waypoint, and then calculate coordinate on its outer boundary, position attribution such as certain inner boundary point is p, the position of that broad sense outer boundary point of its front is p0, distance is d0, the position of that broad sense outer boundary point of its back is p1, distance is d1, its outer boundary is apart from d=d0+ (p-p0)/(p1-p0) (d1-d0) so, just can calculate coordinate on its outer boundary so like this, thereby can use on its curve on the coordinate points and outer boundary coordinate points as the summit of tri patch.
When playing up the inner boundary of Bezier curve correspondence, for the inner boundary point between the starting and ending waypoint of each sub-line segment, always calculate coordinate (referring to the description in the background technology) on its inner boundary according to coordinate on its curve and its internal side apart from attribute and current garbagemask; For the outer boundary point between the starting and ending waypoint of each sub-line segment, inner boundary according to the broad sense inner boundary point of its front and the broad sense inner boundary point of back obtains its inner boundary distance apart from carrying out linear interpolation, and then calculating coordinate on its inner boundary, concrete grammar and above-mentioned situation when playing up outer boundary are similar.
Fig. 4 has shown an instantiation, as can be seen from Figure 4,3 frontier points is arranged between two continuous waypoints, and two outer boundary points are wherein arranged, and an inner boundary point is arranged.So just this line segment has been divided into 4 sections, the outer boundary of each section can constitute a quadrilateral, next will play up these quadrilaterals exactly.But before playing up, at first to determine the gray-scale value on these quadrilateral summits.For its gray-scale value of summit that is positioned on the outer boundary must be 0; Obtain for then need between 0 to 1, to carry out linear interpolation on the summit on the curve with the ratio of its outer boundary distance and inner boundary distance.Attention: the frontier distance that outer boundary point is put coordinate points on the border externally at the frontier distance of coordinate points on the inner boundary or inner boundary is that the frontier distance interpolation by its adjacent broad sense inside/outside frontier point obtains, and obtains apart from interpolation such as the outer boundary distance of the inner boundary point C outer boundary by outer boundary point A and outer boundary point B.
These quadrilaterals will have been played up exactly so, the present invention plays up it with the method that simply these quadrilaterals is divided into two tri patchs, because the situation of tangible ladder sense is arranged at the critical place that can occur two tri patchs in some cases, therefore these quadrilaterals further to be subdivided into the plurality of sub quadrilateral again, divided method is as follows: at first this quadrilateral on average is divided into the experimental process quadrilateral along the trend of Bezier curve, concrete quantity of dividing can be calculated like this: suppose that l0 represents the length of this quadrilateral before waist, l1 represents the length of that waist of back, so sub-quadrilateral quantity Just can calculate this a little tetragonal apex coordinate and gray-scale value after drawing sub-quadrilateral quantity by linear interpolation.And then utilize similar method that each sub-quadrilateral is divided into the plurality of sub quadrilateral along Bezier normal to curve direction, just whole quadrilateral can be divided into the plurality of sub quadrilateral at last.Afterwards each sub-quadrilateral being divided into two adjacent tri patchs utilizes gouraud shading colorize method to play up these tri patchs to get final product then.
Method of the present invention is not limited to the embodiment described in the embodiment, and those skilled in the art's technical scheme according to the present invention draws other embodiment, belongs to innovation scope of the present invention equally.

Claims (9)

1. the garbage mask border rendering method of a tiled comprises the steps:
(1) all the Bezier curves among the garbage mask is divided into plurality of sub segments;
(2) determine the outside direction of garbage mask;
(3) go out the outer boundary distance and the inner boundary distance of all waypoints according to the information calculations of frontier point;
(4) be that outer/inner the border of its correspondence and outer/inner arm of angle circle of its initial end points correspondence are drawn by unit with every Bezier curve.
2. the garbage mask border rendering method of tiled as claimed in claim 1, it is characterized in that: the method that in the step (1) the Bezier curve is divided into plurality of sub segments is as follows: for a Bezier curve, advance forward for step-length by 1/30, calculate the position tangent line vector of current this point, and carry out dot product with the unit tangent vector of this vector and previous fixed waypoint and calculate, if the value that draws is less than threshold value cos (2.5 π/180), then current point just is defined as a waypoint, not so this point is just ignored in the past, continue then by 1/30 step-length this process of repetition of advancing forward, up to the end of this Bezier curve.
3. the garbage mask border rendering method of tiled as claimed in claim 1 or 2 is characterized in that: the step of outside direction of determining garbage mask in the step (2) is as follows:
1. calculate the bounding box of garbage mask, obtain the maximum y value of bounding box and the intermediate value yc of minimum y value then;
2. find out this horizontal line of y=yc and the intersection point of all Bezier curves above the garbage mask, and find out leftmost that intersection point in these intersection points;
3. obtain the tangent line vector of leftmost that intersection point in its Bezier curve, carry out the cross product computing with the unit vector of x axle positive dirction then, if the z value of cross product operation result greater than 0 then outside direction is the right side, otherwise is the left side.
4. the garbage mask border rendering method of tiled as claimed in claim 1 or 2, it is characterized in that: the fall into a trap outer boundary distance of calculating waypoint and the method for inner boundary distance of step (3) is: that outer/inner frontier point of position attribution numerical value minimum above garbage mask, find next outer/inner the frontier point adjacent with it, if the position attribution of these two frontier points is respectively p0 and p1, apart from attribute is respectively d0 and d1, travel through all waypoints between these two frontier points, outer/inner frontier distance computing formula of each waypoint is d=d0+ (p-p0)/(p1-p0) (d1-d0), wherein, p is the position of the waypoint that calculated.
5. the garbage mask border rendering method of tiled as claimed in claim 1 or 2, it is characterized in that: outer/inner arm of angle circle of the initial end points correspondence of Bezier curve described in the step (4) is meant the forward tangent line and the inconsistent fan-like pattern border of causing of reverse tangential direction of this end points, perpendicular to the forward tangent line and the reverse tangent line of this end points, the length of waist is outer/inner frontier distance of this end points to two waists on this fan-like pattern border respectively; The method of drawing outer/inner arm of angle circle is: with this fan-like pattern boundary demarcation is some tri patchs, calculate the gray-scale value on these tri patch summits then, gray-scale value for that summit of end points correspondence is 1, for outer/inner borderline summit gray-scale value is exactly 0, utilizes the gouraudshading colorize method to play up these tri patchs then.
6. the garbage mask border rendering method of tiled as claimed in claim 1 or 2, it is characterized in that: the method on outer/inner border of the drafting Bezier curve correspondence described in the step (4) is: at each sub-line segment, find position attribution all frontier points between the starting and ending waypoint of this sub-line segment; Obtain each frontier point outside/coordinate on the inner boundary; With frontier point on curve coordinate points and outer/inner borderline coordinate points as the summit of tri patch, calculate the gray-scale value on these tri patch summits; Utilize gouraud shading colorize method to play up these tri patchs then.
7. the garbage mask border rendering method of tiled as claimed in claim 6, it is characterized in that: when drawing the outer boundary of Bezier curve correspondence in the step (4), for the outer boundary point between the starting and ending waypoint of each sub-line segment, always calculate coordinate on its outer boundary according to coordinate on its curve and its external parties apart from attribute and current garbage mask; For the inner boundary point between the starting and ending waypoint of each sub-line segment, outer boundary according to the broad sense outer boundary point of its front and the broad sense outer boundary point of back obtains its outer boundary distance apart from carrying out linear interpolation, and then calculating coordinate on its outer boundary, described broad sense outer boundary point comprises that outer boundary puts coordinate points on the outer boundary corresponding with waypoint of coordinate points on the pairing border.
8. the garbage mask border rendering method of tiled as claimed in claim 6, it is characterized in that: when drawing the inner boundary of Bezier curve correspondence in the step (4), for the inner boundary point between the starting and ending waypoint of each sub-line segment, always calculate coordinate on its inner boundary according to coordinate on its curve and its internal side apart from attribute and current garbage mask; For the outer boundary point between the starting and ending waypoint of each sub-line segment, inner boundary according to the broad sense inner boundary point of its front and the broad sense inner boundary point of back obtains its inner boundary distance apart from carrying out linear interpolation, and then calculating coordinate on its inner boundary, described broad sense inner boundary point comprises that inner boundary puts coordinate points on the inner boundary corresponding with waypoint of coordinate points on the pairing border.
9. the garbage mask border rendering method of tiled as claimed in claim 6, it is characterized in that: in the step (4) in the process on outer/inner the border of drawing Bezier curve correspondence, each sub-line segment is divided into plurality of sections by all frontier points between its starting and ending waypoint, the outer boundary of each section constitutes a quadrilateral, each quadrilateral on average is divided into the experimental process quadrilateral along the trend of Bezier curve, the quantity computation method of dividing is as follows: establish the length that l0 represents this quadrilateral before waist, l1 represents the length of that waist of back, so sub-quadrilateral quantity
Figure F2009100847356C0000031
Calculate this a little tetragonal apex coordinate and gray-scale value by linear interpolation after drawing sub-quadrilateral quantity, and then utilize identical method that each sub-quadrilateral is divided into the plurality of sub quadrilateral again along Bezier normal to curve direction, just whole quadrilateral can be divided into the plurality of sub quadrilateral at last; Each sub-quadrilateral is divided into two adjacent tri patchs, utilizes gouraud shading colorize method to play up these tri patchs.
CN2009100847356A 2009-05-20 2009-05-20 Patched garbage mask border rendering method Expired - Fee Related CN101894363B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2009100847356A CN101894363B (en) 2009-05-20 2009-05-20 Patched garbage mask border rendering method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2009100847356A CN101894363B (en) 2009-05-20 2009-05-20 Patched garbage mask border rendering method

Publications (2)

Publication Number Publication Date
CN101894363A true CN101894363A (en) 2010-11-24
CN101894363B CN101894363B (en) 2012-06-06

Family

ID=43103546

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2009100847356A Expired - Fee Related CN101894363B (en) 2009-05-20 2009-05-20 Patched garbage mask border rendering method

Country Status (1)

Country Link
CN (1) CN101894363B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090943A (en) * 2016-11-21 2018-05-29 三星电子株式会社 Render the methods, devices and systems of curve
CN108717354A (en) * 2018-05-17 2018-10-30 广州多益网络股份有限公司 Acquisition method, device and the storage device of mobile phone games rendering data
CN111292422A (en) * 2020-03-02 2020-06-16 上海索辰信息科技有限公司 Method for improving grid generation quality based on surface normal
CN113888566A (en) * 2021-09-29 2022-01-04 推想医疗科技股份有限公司 Target contour curve determining method and device, electronic equipment and storage medium
WO2022105737A1 (en) * 2020-11-20 2022-05-27 上海莉莉丝网络科技有限公司 Rendering method and system for map area boundary in game map, and computer readable storage medium
CN117726722A (en) * 2023-04-20 2024-03-19 书行科技(北京)有限公司 Special effect generation method, device and equipment for video image and readable storage medium

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108090943A (en) * 2016-11-21 2018-05-29 三星电子株式会社 Render the methods, devices and systems of curve
CN108090943B (en) * 2016-11-21 2022-02-01 三星电子株式会社 Method for rendering curve
CN108717354A (en) * 2018-05-17 2018-10-30 广州多益网络股份有限公司 Acquisition method, device and the storage device of mobile phone games rendering data
CN111292422A (en) * 2020-03-02 2020-06-16 上海索辰信息科技有限公司 Method for improving grid generation quality based on surface normal
WO2022105737A1 (en) * 2020-11-20 2022-05-27 上海莉莉丝网络科技有限公司 Rendering method and system for map area boundary in game map, and computer readable storage medium
US11887255B2 (en) 2020-11-20 2024-01-30 Shanghai Lilith Network Technology Company Limited Method and system for rendering boundary of map area within game map, and computer-readable storage medium
CN113888566A (en) * 2021-09-29 2022-01-04 推想医疗科技股份有限公司 Target contour curve determining method and device, electronic equipment and storage medium
CN113888566B (en) * 2021-09-29 2022-05-10 推想医疗科技股份有限公司 Target contour curve determination method and device, electronic equipment and storage medium
CN117726722A (en) * 2023-04-20 2024-03-19 书行科技(北京)有限公司 Special effect generation method, device and equipment for video image and readable storage medium

Also Published As

Publication number Publication date
CN101894363B (en) 2012-06-06

Similar Documents

Publication Publication Date Title
CN101894363B (en) Patched garbage mask border rendering method
CN104318600B (en) A kind of method that role's run trace animation is realized using Bézier curve
CN103559374B (en) A kind of method carrying out face disintegrated type surface subdivision on plurality of subnets lattice model
CN109976262B (en) Global curvature continuous fairing method for micro-line segment processing
CN113199479B (en) Track generation method and device, electronic equipment, storage medium and 3D camera
CN107230255A (en) A kind of method of dental restoration based on common template
CN102768764B (en) It is a kind of that the smooth method of figure is made based on Bezier
CN101923726A (en) Voice animation generating method and system
CN103914862A (en) Pencil sketch simulating method based on edge tangent stream
CN102298787A (en) Control method and control system for animation object motion
US8085270B2 (en) Apparatus for proccessing drawn-by-human-hand effect using style lines
CN104183008A (en) Shader classification method and device based on surface signal fitting and tessellation and graphics rendering method
CN104616327A (en) Tessellation based tinter simplifying method and device and graphic rendering method
KR100809522B1 (en) A efficient view-dependent lodlevel of detail lendering method of terrain
CN102306388B (en) Method and device for preventing stroke shape from deforming
CN103559721B (en) A kind of triangulation rapid image fusion method based on image gradient
CN114488941A (en) Trace fairing method and medium for micro line segments and machine tool numerical control equipment
CN106981095B (en) A kind of improved smooth free-form deformation
CN101894360B (en) Multi-CPU garbage mask rendering method
CN106408627A (en) Linear symbol drawing method
von Funck et al. Explicit control of vector field based shape deformations
CN115272146A (en) Stylized image generation method, system, device and medium
CN107578821A (en) A kind of real-time efficiently GPU rendering intents being used in system of virtual operation
CN114611359A (en) Grid-parameter hybrid model modeling method and system
Brainerd Catmull-clark subdivision surfaces

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: BEIJING CULTURAL AND SCIENTIFIC FINANCING LEASE CO

Free format text: FORMER OWNER: XIN'AOTE(BEIJING) VIDEO TECHNOLOGY CO., LTD.

Effective date: 20150326

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 100080 HAIDIAN, BEIJING TO: 100044 SHUNYI, BEIJING

TR01 Transfer of patent right

Effective date of registration: 20150326

Address after: 100044, room 2, building 1, No. 401, Golden Sail Road, Beijing, Shunyi District

Patentee after: Beijing culture science and technology finance leasing Limited by Share Ltd

Address before: 100080 Beijing city Haidian District xicaochang No. 1 Beijing Silicon Valley computer city 15 1501-1506 room

Patentee before: China Digital Video (Beijing) Limited

TR01 Transfer of patent right

Effective date of registration: 20170930

Address after: 100143 Beijing city Haidian District xicaochang No. 1 Silicon Valley computer city 15 1501-1506 room

Patentee after: China Digital Video (Beijing) Limited

Address before: 100044, room 2, building 1, No. 401, Golden Sail Road, Beijing, Shunyi District

Patentee before: Beijing culture science and technology finance leasing Limited by Share Ltd

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

Granted publication date: 20120606

Termination date: 20170520

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