WO2011007769A1 - 描画装置および描画プログラム - Google Patents
描画装置および描画プログラム Download PDFInfo
- Publication number
- WO2011007769A1 WO2011007769A1 PCT/JP2010/061809 JP2010061809W WO2011007769A1 WO 2011007769 A1 WO2011007769 A1 WO 2011007769A1 JP 2010061809 W JP2010061809 W JP 2010061809W WO 2011007769 A1 WO2011007769 A1 WO 2011007769A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- point
- interpolated
- coordinate value
- interpolation
- value
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/20—Drawing from basic elements, e.g. lines or circles
- G06T11/203—Drawing of straight lines or curves
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06T—IMAGE DATA PROCESSING OR GENERATION, IN GENERAL
- G06T11/00—2D [Two Dimensional] image generation
- G06T11/60—Editing figures and text; Combining figures or text
Definitions
- the present invention relates to a drawing apparatus and a drawing program for creating a drawing based on an input with a tablet pen or the like.
- Patent Document 1 discloses a technique for correcting and displaying a line width desired by the user
- Patent Document 2 discloses a technique for displaying a natural brushstroke
- Patent Document 3 corresponds to a writing pressure value.
- a technique for realizing drawing is disclosed.
- the position information on the tablet is given as a coordinate value of points constituting the point sequence, that is, as a discrete value. Therefore, an interpolation technique for smoothly connecting discrete values is required.
- Splines are well known as such an interpolation technique (for example, Non-Patent Document 1).
- a (K-1) -order spline function S is applied by applying a (K-1) -order B-spline B i, K (x) to connect between discrete point sequences.
- (X) ⁇ i B i, K (x) Is used.
- ⁇ i is determined.
- the input point sequence needs to be fixed. Therefore, in the interpolation using splines, there is a problem that followability is poor, that is, it takes time to draw.
- the interpolated points obtained using splines or the like are connected by straight lines. That is, since the interpolated points are also discrete points on the display screen, they are further connected by a straight line. Therefore, there is a problem that it is difficult to reproduce a smooth curve.
- An object of the present invention is to provide a drawing apparatus and a drawing program that quickly follow a user's input. It is another object of the present invention to provide a drawing apparatus and a drawing program that can draw a smooth curve.
- An object of the present invention is a drawing device that generates an interpolated point based on a plurality of inputted point sequences and draws it on a screen of a display device, Coordinate value acquisition means for acquiring the coordinate value of each sample point constituting the input point sequence; The predetermined number in the interpolation / smoothing function that can calculate the value interpolated based on the predetermined number of sample points when the number of sample points acquired by the coordinate value acquisition means is present.
- An interpolation / smoothing means for generating an interpolated coordinate value by applying the interpolation / smoothing function to the coordinate values of the predetermined number of sample points, This is achieved by a drawing device comprising drawing means for drawing a point at a position in response to the interpolated coordinate value on the screen of the display device.
- the drawing means superimposes the point at the position responding to the interpolated coordinate value generated by the interpolation / smoothing means on the point sequence already drawn on the screen of the display device. It is configured to draw by matching.
- the position points that respond to the interpolated coordinate values are partially overlapped.
- the point of the position responding to the interpolated coordinate value is superimposed with transparency.
- the coordinate value acquisition means acquires a value indicating a writing pressure at a sample point constituting the input point sequence
- the interpolation / smoothing means applies the interpolation / smoothing function to a value indicating the writing pressure at the sample point, and calculates a value indicating the interpolated writing pressure
- the drawing means is configured to draw a point having a size corresponding to the value indicating the interpolated writing pressure at the position indicated by the interpolated coordinate value.
- the interpolation / smoothing means performs a product-sum operation of a B-spline function based on the acquired coordinate value
- the interpolation / smoothing means performs a product-sum operation of a B-spline function based on the acquired coordinate value
- the coordinate value acquisition means excludes the input sample point from the sample points to be acquired when other sample points exist within a predetermined range of the input sample points. It is configured.
- the interpolated coordinate value when the drawing means has a point indicated by another interpolated coordinate value within a predetermined range of the point indicated by the interpolated coordinate value, the interpolated coordinate value is The point to be shown is configured to be excluded from the drawing target.
- Another object of the present invention is to provide a drawing program for generating an interpolated point based on a plurality of inputted point sequences and drawing it on the screen of the display device in a computer including an input device and a display device.
- the computer Coordinate value acquisition means for acquiring the coordinate value of each sample point constituting the input point sequence;
- the predetermined number in the interpolation / smoothing function that can calculate the value interpolated based on the predetermined number of sample points when the number of sample points acquired by the coordinate value acquisition means is present.
- An interpolation / smoothing means for generating an interpolated coordinate value by applying the interpolation / smoothing function to the coordinate values of the predetermined number of sample points, and This is achieved by a drawing program that functions as drawing means for drawing a point at a position in response to the interpolated coordinate value on the screen of the display device.
- the drawing means superimposes the point at the position responding to the interpolated coordinate value generated by the interpolation / smoothing means on the point sequence already drawn on the screen of the display device. It is configured to draw by matching.
- the position points that respond to the interpolated coordinate values are partially overlapped.
- the point of the position responding to the interpolated coordinate value is superimposed with transparency.
- the coordinate value acquisition means acquires a value indicating a writing pressure at a sample point constituting the input point sequence
- the interpolation / smoothing means applies the interpolation / smoothing function to a value indicating the writing pressure at the sample point, and calculates a value indicating the interpolated writing pressure
- the drawing means is configured to draw a point having a size corresponding to the value indicating the interpolated writing pressure at the position indicated by the interpolated coordinate value.
- FIG. 1 is a block diagram showing a configuration of a drawing apparatus according to the present embodiment.
- the drawing apparatus 10 includes a CPU 11, a ROM 12, a RAM 13, an input unit 14, an auxiliary storage device 15, a display device 16, and a tablet 17.
- the CPU 11 controls the drawing apparatus 10 as a whole, acquires a coordinate value of points constituting a point sequence input to the tablet using the tablet pen (stylus pen) 18, and coordinates of points to be drawn based on the acquired coordinate values Various processes such as a value calculation process and a drawing process on the screen of the display device 16 are executed.
- the ROM 12 performs various processes to be executed by the CPU 11, for example, a process for acquiring coordinate values of points constituting the point sequence input to the tablet 17 using the tablet pen 18, and points to be drawn (drawing based on the acquired coordinate values)
- a program such as a calculation process of the coordinate value of the target point and a drawing process on the screen of the display device 16 is stored.
- the program may be stored in the auxiliary storage device 15.
- the RAM 13 stores a program read from the ROM 12 and data generated in the course of processing. As will be described later, in the present embodiment, the coordinate values of the points constituting the point sequence input to the tablet 17 using the tablet pen 18, the coordinate values of the points generated during the interpolation process, and the points to be drawn Are stored in the RAM 13.
- the input unit 14 includes a keyboard and a mouse.
- the auxiliary storage device 15 includes, for example, a hard disk device or an SSD (Solid State Drive).
- the CPU 11 also has a GPU (Graphics Processing Unit) function such as a calculation process of a coordinate value of a point to be drawn based on the acquired coordinate value and a drawing process on the screen of the display device 16.
- a GPU Graphics Processing Unit
- a GPU may be provided as a separate body from the CPU 11.
- the tablet 17 is disposed so as to overlap the display device 16.
- the present invention is not limited to this, and the tablet 17 may be disposed apart from the display device 16.
- the tablet 17 can obtain plane coordinates (X coordinate and Y coordinate) where the tablet pen 18 is located by electromagnetic induction with the tablet pen (stylus pen) 18.
- the coordinate acquisition method is not limited to electromagnetic induction, and may be a resistive film method, an ultrasonic method, a method of reading coordinates by combining an optical sensor and image processing, or the like.
- the value which shows the pen pressure on the tablet 17 by the tablet pen 18 can also be acquired.
- the value of the pressure-sensitive element built in the pen may be acquired by an electromagnetic transmission / reception action, or a film for detecting pressure disposed on the tablet 17 may be used. Therefore, in this embodiment, when the tablet pen 18 is moved on the tablet 17 (on the display device 16) so as to draw characters or figures, the display device is based on the input of the movement locus of the tablet pen 18. Smooth characters and figures are displayed on the 16 screens. Further, the movement of the tablet pen 18 can be replaced by a mouse operation or the like.
- FIG. 3 is a functional block diagram of the drawing apparatus according to the present embodiment
- FIG. 4 is a flowchart illustrating an example of a main flow executed in the drawing apparatus according to the present embodiment.
- the drawing apparatus 10 includes a point sequence data acquisition unit 31, an interpolation processing unit 32, a drawing preprocessing unit 34, and a drawing processing unit 35.
- Various data generated in the point sequence data acquisition unit 31, the interpolation processing unit 32, and the drawing preprocessing unit 34 are stored in the storage unit 36.
- the point sequence data acquisition unit 31 accepts three-dimensional data including values indicating the position (X coordinate, Y coordinate) of the tablet pen 18 and the writing pressure from the tablet 17, generates point sequence data, and stores the storage unit 36.
- the interpolation processing unit 32 includes an interpolation / smoothing processing unit 33, executes interpolation processing based on the coordinate values of the points indicated by the point sequence data, generates a series of interpolated coordinate value groups, and stores the storage unit 36.
- the drawing preprocessing unit 34 calculates the coordinate value of the point to be drawn based on the coordinate value group stored in the storage unit 36.
- the drawing processing unit 35 displays a plurality of points (point sequence) on the screen of the display device 16 based on the calculated coordinate values. In addition, the coordinate value calculated in each component is stored in the storage unit 36 and used in subsequent processing.
- the functions of the point sequence data acquisition unit 31, the interpolation processing unit 32, the drawing preprocessing unit 34, and the drawing processing unit 35 are mainly realized by the CPU 11.
- the storage unit 36 corresponds to, for example, the RAM 13 and the auxiliary storage device 15.
- a GPU separate from the CPU 11 is provided, some of the functions of the point sequence data acquisition unit 31, the interpolation processing unit 32, the drawing preprocessing unit 34, and the drawing processing unit 35 can be replaced by the GPU. .
- FIG. 4 is a flowchart showing an example of point sequence data acquisition processing according to the present embodiment.
- the point sequence data acquisition unit 31 receives, from the tablet 17, the position of the tablet pen 18 on the tablet 17 at the current time Ti (the position of the sample point) and the three-dimensional coordinate value indicating the writing pressure ( XTi , YTi , PTi ) are acquired (step 501).
- (X Ti , Y Ti ) indicates the position of the tablet pen 18, and P Ti indicates the magnitude of the writing pressure applied to the tablet 17 by the tablet pen 18.
- the coordinate values (X Ti-1 , Y Ti-1 , P Ti-1 ) of the previously acquired coordinate values (time Ti-1) and the acquired coordinate values (X Ti , Y Ti , P Ti ) are the same.
- Step 503 a distance between adjacent points is calculated (step 503).
- the coordinate values (X Ti , Y Ti , P Ti ) obtained in step 501 are used as the k-th coordinate values (X k , Y k , P k ), and the position (X k , Y k ) and the position (X k ⁇ 1 , Y k ⁇ ) at the (k ⁇ 1) th coordinate value (X k ⁇ 1 , Y k ⁇ 1 , P k ⁇ 1 ) stored in the storage unit 36. 1 )) is calculated.
- the acquired distance can be considered as a speed having the sampling period ⁇ t as a unit time.
- the distance d (speed V) is calculated as follows.
- the distance is not limited to the Euclidean distance, and other distances such as a metropolitan distance may be employed.
- the point sequence data acquisition unit 31 stores the coordinate values (X k , Y k , P k ) in the storage unit 36 as part of the point sequence data (point data constituting the point sequence) (step 504).
- the point sequence data acquisition unit 31 determines that a point adjacent to (X k , Y k , P k ), that is, a point with coordinate values (X k ⁇ 1 , Y k ⁇ 1 , P k ⁇ 1 ) is predetermined. It is judged whether it is located within the distance (step 505).
- it may be determined whether the distance d is equal to or less than a predetermined threshold value d th .
- step 505 the CPU 11 removes the coordinate values (X k , Y k , P k ) obtained this time from the point sequence data (step 506). That is, the point sequence thinning process is executed.
- step 506 the point sequence data acquisition process ends.
- FIG. 6 is a flowchart illustrating an example of interpolation processing according to the present embodiment.
- the CPU 11 refers to the point sequence data and performs a moving average process on the point sequence data.
- the interpolation processing unit 32 uses the coordinate values (X k ⁇ 3 , X k ⁇ 3 ) of the (k ⁇ 3) th point as the coordinate values (X k , Y k , P k ) of the kth point.
- the average value of the coordinate values (X k , Y k , P k ) of the k-th point is calculated from Y k-3 , P k-3 ), and this is newly calculated as the coordinate value of the k-th point ( Xk , Yk , Pk ).
- the coordinate values of the new kth point take the following values.
- the interpolation processing unit 32 determines whether or not the number of acquired points is equal to or greater than a predetermined value (step 602), and if it is equal to or greater than the predetermined value (Yes in step 602), performs interpolation / smoothing processing (step 602). Step 603).
- the number of points may be four or more, and in this case, Yes is determined in step 602.
- interpolation / smoothing processing is executed (step 603).
- FIG. 7 is a flowchart showing an example of interpolation / smoothing processing according to the present embodiment.
- the interpolation / smoothing processing unit 33 initializes an array or a variable used for the calculation (step 701), calculates and adds a node (step 702), A function value is calculated using the added node (step 703).
- a function value is acquired by performing a product-sum operation on a value obtained by subdividing and parameterizing the acquired coordinate value according to the distance d and a B-spline function. The product-sum operation of the B-spline function according to this embodiment will be described later.
- the B-spline is a well-known technique described in Non-Patent Document 1, for example, and will be briefly described below.
- q i, q i + 1 , ⁇ are those that took the K floor of the difference quotient on q at the node of q i + K (q i ⁇ q i + 1 ⁇ ⁇ ⁇ q i + K).
- the (K-1) th-order spline function S (x) can be expressed as follows as a linear combination based on B-splines B i, K (x).
- a ⁇ y
- A, ⁇ , and y are as shown below.
- the coefficient ⁇ i can be obtained by determining the inputted point sequence.
- a B-spline is used as a basis function of a so-called Bezier curve that uses given N data points as control points for determining the shape of the curve. This technique is disclosed in Non-Patent Document 2, for example.
- the following data values can be obtained for the three-dimensional coordinate values (X i , Y i , P i ) acquired in the point sequence data acquisition process of the present case.
- X i , Y i , and P i are values indicating the X coordinate, Y coordinate, and writing pressure of the i-th point in the point sequence input by the user, respectively, and B i, K (t) is K
- the coordinate values (X (t), Y (t), P (t)) obtained by X (t), Y (t), and P (t) are interpolated coordinate values.
- a function is represented by a parameter by a parameter t, and a new interpolated coordinate value is obtained by a data value (coordinate value) and a B-spline.
- the number of points may be four or more.
- the interpolation / smoothing process is executed (FIG. 6). See steps 602, 603).
- spline processing is executed using four points (coordinate values ((X i ⁇ 3 , Y i ⁇ 3 , P i ⁇ 3 ) to (X i , Y i , P i )), and interpolation is performed.
- the interpolated coordinate values are stored in the storage unit 36.
- the interpolated points obtained from the four points are represented by (x j , Y j , p j ).
- FIG. 8 is a flowchart showing an example of the drawing preprocessing according to the present embodiment. As shown in FIG.
- the drawing preprocessing unit 34 stores four points (coordinate values ((X i ⁇ 3 , Y i ⁇ 3 , P i ⁇ 3 ) to (X i , Y i , P i )), the coordinates of the interpolated point (x j , y j , p j ) are read out and the start point and end point are specified (step 801). since the end point always draw, the two points are identified in step 801.
- the drawing preprocessing unit 34 determines whether or not the distance d is equal to or less than a predetermined threshold value d th determined according to the latest writing pressure value, the resolution of the display device, or the like (step 803). If YES is determined in step 803, the coordinate values ( xj , yj , pj ) are removed from the drawing target points (step 804). That is, the thinning process of the point sequence is executed. Steps 803 and 804 are the same as steps 505 and 506 in FIG. If YES is determined in step 803 or after step 804 is completed, the drawing preprocessing unit 34 associates the pen pressure value p j with the dot size of the point to be drawn (step 805). ).
- FIG. 9 is a diagram illustrating an example of a writing pressure / dot correspondence table according to the present embodiment.
- a table 900 in which the range is associated with a value D indicating the dot size of a point to be drawn is, for example, The table is copied to the RAM 13 in the pre-drawing process 34.
- the writing pressure (range) and the value indicating the dot size change linearly. For example, if the writing pressure value is in 256 steps (1 to 256) and 1 to 8, the value indicating the dot size is “1” (see reference numeral 901), and the writing pressure value is 9 to 16. For example, the value indicating the size of the dot is “2” (see reference numeral 902).
- the pen pressure and the dot size are not limited to the correspondence shown in FIG. Further, since the drawing element subjected to anti-aliasing is used for the dot, the writing pressure and the dot size (pixel cluster) do not always correspond clearly.
- Rendering preprocessing unit 34 refers to the table in the RAM 13, to determine the value D indicating the size of dots corresponding to the pen pressure value of P j. Thereby, it is possible to obtain data (x j , y j , D) of the drawing target point including the values x j and y j indicating the position and the value D indicating the size of the dot.
- the obtained drawing target point data (x j , y j , D) is stored in the storage unit 36.
- the drawing preprocessing unit 34 repeats the processing of steps 802 to 805 until the end point is reached. As a result, it is possible to obtain data of point sequences that are moderately separated from each other by a distance d th determined according to the latest writing pressure value, the resolution of the display device, and the like.
- the drawing process reads the data of the drawing target point and draws a point having a size indicated by D at the position (x j , y j ) indicated by the drawing target point. That is, in the present embodiment, instead of connecting the drawing target points with a line of a certain thickness, a large number of drawing target points are drawn on the screen at optimal intervals to represent curves and straight lines. . This is a big difference from the conventional method. In the present embodiment, the drawing pre-processing is repeatedly executed.
- the data of the drawing target points generated in each pre-drawing process are sequentially superimposed as a point having a predetermined transparency so as to have a predetermined color density and displayed on the screen.
- the color density (transparency) drawn at the drawing target point is determined in advance.
- each drawing target point is associated with the dot size D as described above, each drawing target point is drawn with a size corresponding to the writing pressure.
- FIG. 10 is a diagram schematically showing a drawing process according to the present embodiment.
- a point sequence 1001 of drawing target points is obtained from four point sequences P i-3 to P i input to the tablet 17.
- point sequences 1102, 1103, and 1104 of drawing target points are obtained by four point sequences P i ⁇ 2 to P i + 1 , P i ⁇ 1 to P i + 2 , and P i to P i + 3 (not shown), respectively.
- a curve 1010 displayed on the screen of the display device 16 is obtained by superimposing the point sequences 1001 to 1004.
- the area 1013 of the curve 1010 is an overlap of the point sequences 1001 to 1003, and the area 1014 is an overlap of the point sequences 1002 to 1004. It will also be understood that other regions (eg, regions 1011, 1012, 01015) are similarly superposed of the illustrated point sequence and other point sequences.
- the point sequence of the drawing target points is sequentially created from the four input point sequences. Therefore, it is possible to reproduce the curve formed by the drawing target points with a thickness corresponding to the writing pressure in almost real time according to the input of the point sequence (that is, the operation of the tablet pen).
- FIG. 11 is a diagram illustrating an example of the point sequence data acquired by the point sequence data acquisition unit 31 as a result of the user moving the tablet pen 18 on the tablet 17.
- FIG. 12 is a figure which shows the example of the curve displayed on the screen of the display apparatus 16 by the process concerning this Embodiment.
- the interpolation processing unit 32 interpolates and smoothes
- the drawing preprocessing unit 34 thins out the point sequence appropriately
- the drawing processing unit 35 finally draws the drawing target point to a predetermined color.
- the movement of the tablet pen 18 is reproduced by a curve.
- the interpolation / smoothing function that can calculate a value interpolated by the necessary number is used.
- the coordinate values of the points constituting the interpolated point sequence are calculated. As a result, it is possible to execute the calculation at the stage where the number of sample points required for interpolation is obtained without waiting for the start of processing until all the point sequences are obtained.
- the point sequence based on the interpolated coordinate value obtained by the calculation executed when the number of sample points necessary for the interpolation is obtained is already displayed on the screen of the display device. Draw and draw on the point sequence displayed in. This makes it possible to reproduce a smooth curve without having to connect adjacent points with a straight line.
- the tablet pen is in contact with the tablet and the position is acquired as a point sequence.
- the present invention is not limited to this, but the tablet pen is close to the tablet. Even in a non-contact state, the position of the tablet pen can be acquired as a point sequence. This can be realized by detecting the position by the electromagnetic induction transfer function between the tablet 17 and the tablet pen (stylus pen) 18.
- the tablet pen inclination A k may be detected to obtain coordinate values (X k , Y k , P k , A k ).
- the interpolated inclination value may be obtained as follows, similarly to the mathematical expression shown in Equation 8.
- a (t) ⁇ A i B i, K (t)
- an element for drawing for example, it may be the size of the dot as well as the pen pressure, or may be another element such as the color or the density of the dot. Drawing according to the inclination of the tablet pen is realized.
- the coordinate values (X k , Y k , A k ) may be acquired using the inclination of the tablet pen instead of the writing pressure.
- the shape of the drawn dot may be circular or elliptical. Of course, other shapes may be used as long as the size is determined according to the writing pressure.
- the product coordinate calculation is performed with the B-spline function obtained by subdividing the obtained coordinate value according to the distance d and parameterized, and the interpolated coordinate value is calculated. And smoothing is realized.
- the interpolation / smoothing functions that can be used are not limited to the functions described above, and for example, a Gaussian function may be applied.
- the Gaussian function G When the Gaussian function G is used, it can be expressed as follows when expressed in the same way as the mathematical formula of Equation 8. Note that it is desirable that the writing pressure P, the distance d, and the like are sequentially taken into consideration as parameters for determining the shape of the Gaussian function.
- X (t) ⁇ X i G (t)
- Y (t) ⁇ Y i G (t)
- P (t) ⁇ P i G (t)
- a function other than a Gaussian function can be used as long as it is a bell-shaped function.
- the interpolated coordinate value is calculated using the following mathematical formula.
- X (t) ⁇ X i B i, K (t)
- Y (t) ⁇ Y i B i, K (t)
- P (t) ⁇ P i B i, K (t)
- w (d) is a weight as a function value of speed (distance).
- the point sequence thinning process is executed (steps 504 and 505), but this is omitted. You may do it.
- FIG. 1 is a block diagram showing a configuration of a drawing apparatus according to the present embodiment.
- FIG. 2 is a perspective view showing an appearance of the drawing apparatus according to the embodiment of the present invention.
- FIG. 3 is a functional block diagram of the drawing apparatus according to the present embodiment.
- FIG. 4 is a flowchart showing an example of a main flow executed in the drawing apparatus according to the present embodiment.
- FIG. 5 is a flowchart showing an example of point sequence data acquisition processing according to the present embodiment.
- FIG. 6 is a flowchart illustrating an example of interpolation processing according to the present embodiment.
- FIG. 7 is a flowchart showing an example of interpolation / smoothing processing according to the present embodiment.
- FIG. 8 is a flowchart showing an example of the drawing preprocessing according to the present embodiment.
- FIG. 9 is a diagram illustrating an example of a writing pressure / dot correspondence table according to the present embodiment.
- FIG. 10 is a diagram schematically showing a drawing process according to the present embodiment.
- FIG. 11 is a diagram illustrating an example of point sequence data according to the present embodiment.
- FIG. 12 is a diagram illustrating an example of a curve displayed on the screen of the display device by the processing according to the present embodiment.
- Drawing device 10
- CPU 12 ROM 13 RAM
- Input part 15
- Auxiliary storage device 16
- Display apparatus 17
- Tablet 18 Tablet pen
- Point sequence data acquisition part 32
- Interpolation processing part 33
- Interpolation / smoothing process part 34
- Pre-drawing processing part 35
- Drawing processing part 36 Storage part
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Image Generation (AREA)
- Processing Or Creating Images (AREA)
- Position Input By Displaying (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
ユーザの入力に対して迅速に追従し、かつ、滑らかな曲線が描画することができる。装置は、入力された複数の点列に基づいて、補間された点を生成して表示装置16の画面上に描画する描画装置10は、入力された点列を構成する各サンプル点の座標値を取得する点列データ取得部31と、取得されたサンプル点の数が、所定数のサンプル点が存在する場合に当該所定数のサンプル点に基づき補間された値を算出可能な補間・平滑化関数における前記所定数に達したときに、当該所定数のサンプル点の座標値に、前記補間・平滑化関数を適用して、補間された座標値を生成する補間・平滑化処理部33と、表示装置16の画面上において補間された座標値に応答する位置に点を描画する描画処理部35手段と、を備える。
Description
本発明は、タブレットペンなどによる入力に基づく描画を作成する描画装置および描画プログラムに関する。
現在、タブレットペンとタブレットとの間の電磁誘導などにより、タブレットペンのタブレット上の位置情報(座標値)などを取得する技術が知られている。これを応用して、タブレットペンの動きに応じて、表示装置の画面上に描画する描画装置が提案されている。たとえば、特許文献1には、ユーザが望むような線幅を修正して表示する技術、特許文献2には、自然な毛筆画を表示する技術、特許文献3には、筆圧値に応じた描画を実現する技術が開示されている。
「Cによるスプライン関数 データ解析 CG 微分方程式」桜井明監修、菅野敬祐、吉村和美、高山文雄著、東京電機大学出版局、1993年発行
「Bernstein-Bezier Methods for Computer-Aided Design for Free-Form Curves and Surface」 William J. Gordon,Richard F.RiesenFeld著、Journal of the Association for Computing Machinery, Vol. 21, No.2, April 1974、1974年4月発行
また、上記タブレット上の位置情報は、点列を構成する点の座標値、つまり、離散値として与えられる。したがって、離散値の間を滑らかにつなぐ補間技術が必要となる。このような補間技術して、スプラインが良く知られている(たとえば、非特許文献1)。たとえば、B-スプラインにおいては、離散的な点列の間をつなぐために(K-1)次のB-スプラインBi,K(x)を適用した、(K-1)次のスプライン関数
S(x)=ΣαiBi,K(x)
が利用される。より具体的には、与えられたデータ点(xi,yi)(i=0,1,・・・,N-1)に対して、 yi=S(xi)を満足するようなαiを決定する。αiを決定するには、入力された点列が確定している必要がある。したがって、スプラインを用いた補間においては、追従性が悪い、つまり、描画までに時間を要するという問題点があった。
S(x)=ΣαiBi,K(x)
が利用される。より具体的には、与えられたデータ点(xi,yi)(i=0,1,・・・,N-1)に対して、 yi=S(xi)を満足するようなαiを決定する。αiを決定するには、入力された点列が確定している必要がある。したがって、スプラインを用いた補間においては、追従性が悪い、つまり、描画までに時間を要するという問題点があった。
さらに、従来の描画においては、スプラインなどを用いて得られた補間された点の間を直線でつないでいる。つまり、補間された点も表示画面上においては離散された点であるため、その間をさらに直線で結んでいる。したがって、滑らかな曲線を再現することが難しいという問題点もあった。
本発明は、ユーザの入力に対して迅速に追従する描画装置および描画プログラムを提供することを目的とする。また、本発明は、滑らかな曲線を描画することができる描画装置および描画プログラムを提供することを目的とする。
本発明の目的は、入力された複数の点列に基づいて、補間された点を生成して表示装置の画面上に描画する描画装置であって、
入力された点列を構成する各サンプル点の座標値を取得する座標値取得手段と、
前記座標値取得手段により取得されたサンプル点の数が、所定数のサンプル点が存在する場合に当該所定数のサンプル点に基づき補間された値を算出可能な補間・平滑化関数における前記所定数に達したときに、当該所定数のサンプル点の座標値に、前記補間・平滑化関数を適用して、補間された座標値を生成する補間・平滑化手段と、
表示装置の画面上において、前記補間された座標値に応答する位置に点を描画する描画手段と、を備えたことを特徴とする描画装置により達成される。
入力された点列を構成する各サンプル点の座標値を取得する座標値取得手段と、
前記座標値取得手段により取得されたサンプル点の数が、所定数のサンプル点が存在する場合に当該所定数のサンプル点に基づき補間された値を算出可能な補間・平滑化関数における前記所定数に達したときに、当該所定数のサンプル点の座標値に、前記補間・平滑化関数を適用して、補間された座標値を生成する補間・平滑化手段と、
表示装置の画面上において、前記補間された座標値に応答する位置に点を描画する描画手段と、を備えたことを特徴とする描画装置により達成される。
好ましい実施態様においては、前記描画手段が、前記表示装置の画面上に既に描画された点列に、前記補間・平滑化手段により生成された、補間された座標値に応答する位置の点を重ね合わせることにより描画するように構成されている。
より好ましい実施態様においては、前記補間された座標値に応答する位置の点を部分的に重ね合わせる。
また、別の好ましい実施態様においては、前記補間された座標値に応答する位置の点を透明度を持って重畳する。
別の好ましい実施態様においては、前記座標値取得手段が、前記入力された点列を構成するサンプル点における筆圧を示す値を取得し、
前記補間・平滑化手段が、前記サンプル点における筆圧を示す値に、前記補間・平滑化関数を適用して、補間された筆圧を示す値を算出し、
前記描画手段が、前記補間された座標値が示す位置において、前記補間された筆圧を示す値に応じた大きさの点を描画するように構成されている。
前記補間・平滑化手段が、前記サンプル点における筆圧を示す値に、前記補間・平滑化関数を適用して、補間された筆圧を示す値を算出し、
前記描画手段が、前記補間された座標値が示す位置において、前記補間された筆圧を示す値に応じた大きさの点を描画するように構成されている。
より好ましい実施態様においては、前記補間・平滑化手段が、前記取得された座標値に基づき、B-スプライン関数の積和演算として、
さらに別の好ましい実施態様においては、前記補間・平滑化手段が、前記取得された座標値に基づき、B-スプライン関数の積和演算として、
また、好ましい実施態様においては、前記座標値取得手段が、前記入力したサンプル点の所定範囲に他のサンプル点が存在する場合には、上記入力したサンプル点を、取得するサンプル点から除外するように構成されている。
また、好ましい実施態様においては、前記描画手段が、補間された座標値が示す点の所定範囲に、他の補間された座標値が示す点が存在する場合には、当該補間された座標値が示す点を描画対象から除外するように構成されている。
また、本発明の目的は、入力装置および表示装置を備えたコンピュータにおいて、入力された複数の点列に基づいて、補間された点を生成して表示装置の画面上に描画するための描画プログラムであって、前記コンピュータを、
入力された点列を構成する各サンプル点の座標値を取得する座標値取得手段、
前記座標値取得手段により取得されたサンプル点の数が、所定数のサンプル点が存在する場合に当該所定数のサンプル点に基づき補間された値を算出可能な補間・平滑化関数における前記所定数に達したときに、当該所定数のサンプル点の座標値に、前記補間・平滑化関数を適用して、補間された座標値を生成する補間・平滑化手段、並びに、
表示装置の画面上において、前記補間された座標値に応答する位置に点を描画する描画手段、として機能させることを特徴とする描画プログラムにより達成される。
入力された点列を構成する各サンプル点の座標値を取得する座標値取得手段、
前記座標値取得手段により取得されたサンプル点の数が、所定数のサンプル点が存在する場合に当該所定数のサンプル点に基づき補間された値を算出可能な補間・平滑化関数における前記所定数に達したときに、当該所定数のサンプル点の座標値に、前記補間・平滑化関数を適用して、補間された座標値を生成する補間・平滑化手段、並びに、
表示装置の画面上において、前記補間された座標値に応答する位置に点を描画する描画手段、として機能させることを特徴とする描画プログラムにより達成される。
好ましい実施態様においては、前記描画手段が、前記表示装置の画面上に既に描画された点列に、前記補間・平滑化手段により生成された、補間された座標値に応答する位置の点を重ね合わせることにより描画するように構成されている。
より好ましい実施態様においては、前記補間された座標値に応答する位置の点を部分的に重ね合わせる。
また、別の好ましい実施態様においては、前記補間された座標値に応答する位置の点を透明度を持って重畳する。別の好ましい実施態様においては、前記座標値取得手段が、前記入力された点列を構成するサンプル点における筆圧を示す値を取得し、
前記補間・平滑化手段が、前記サンプル点における筆圧を示す値に、前記補間・平滑化関数を適用して、補間された筆圧を示す値を算出し、
前記描画手段が、前記補間された座標値が示す位置において、前記補間された筆圧を示す値に応じた大きさの点を描画するように構成されている。
前記補間・平滑化手段が、前記サンプル点における筆圧を示す値に、前記補間・平滑化関数を適用して、補間された筆圧を示す値を算出し、
前記描画手段が、前記補間された座標値が示す位置において、前記補間された筆圧を示す値に応じた大きさの点を描画するように構成されている。
本発明によれば、ユーザの入力に対して迅速に追従する描画装置および描画プログラムを提供することが可能となる。また、本発明によれば、滑らかな曲線を描画することができる描画装置および描画プログラムを提供することが可能となる。
[全体構成]
以下、添付図面を参照して本発明の実施の形態について説明する。図1は、本実施の形態にかかる描画装置の構成を示すブロックダイヤグラムである。図1に示すように、本実施の形態にかかる描画装置10は、CPU11、ROM12、RAM13、入力部14、補助記憶装置15、表示装置16、タブレット17を有する。
以下、添付図面を参照して本発明の実施の形態について説明する。図1は、本実施の形態にかかる描画装置の構成を示すブロックダイヤグラムである。図1に示すように、本実施の形態にかかる描画装置10は、CPU11、ROM12、RAM13、入力部14、補助記憶装置15、表示装置16、タブレット17を有する。
CPU11は、描画装置10全体の制御、タブレットペン(スタイラスペン)18を用いてタブレットに入力された点列を構成する点の座標値の取得処理、取得した座標値に基づく描画すべき点の座標値の算出処理、表示装置16の画面上への描画処理など、種々の処理を実行する。
ROM12は、CPU11に実行させる種々の処理、たとえば、タブレットペン18を用いてタブレット17に入力された点列を構成する点の座標値の取得処理、取得した座標値に基づく描画すべき点(描画対象点)の座標値の算出処理、表示装置16の画面上への描画処理などのプログラムを格納する。或いは、上記プログラムは、補助記憶装置15に格納されていても良い。
RAM13は、ROM12から読み出されたプログラムや、処理の過程で生成されたデータを記憶する。後述するように、本実施の形態においては、タブレットペン18を用いてタブレット17に入力された点列を構成する点の座標値、補間処理の過程で生じた点の座標値、描画すべき点の座標値などがRAM13に記憶される。入力部14は、キーボードやマウスなどを含む。補助記憶装置15は、たとえば、ハードディスク装置やSSD(Solid State Drive)から構成される。
なお、本実施の形態において、CPU11は、取得した座標値に基づく描画すべき点の座標値の算出処理、表示装置16の画面上への描画処理など、GPU(Graphics Processing Unit)の機能も備える。無論、CPU11と別体として、GPUを備えても良い。
図2に示すように、タブレット17は、表示装置16と重ねあわされて配置されている。しかしながら、これに限定されず、タブレット17は表示装置16と離間して配置されても良い。タブレット17は、タブレットペン(スタイラスペン)18との間の電磁誘導により、タブレットペン18が位置している平面座標(X座標およびY座標)などを得ることができる。なお、座標取得の方法は、電磁誘導に限らず、抵抗膜方法や、超音波方式、光学センサと画像処理を組み合わせて座標を読み取る方式などでもよい。また、本実施の形態においては、タブレットペン18によるタブレット17上の筆圧を示す値を取得することもできる。これは、ペンに内蔵された感圧素子の値を電磁授受作用によって取得しても良いし、タブレット17に配置された圧力を感知する膜などを利用しても良い。したがって、本実施の形態において、タブレットペン18を、タブレット17上(表示装置16上)で文字や図形などを描くように移動させると、当該タブレットペン18の移動軌跡の入力に基づいて、表示装置16の画面上に、滑らかな文字や図形などが表示される。また、タブレットペン18の移動は、マウス操作などでも代替することができる。
[処理の概略]
図3は、本実施の形態にかかる描画装置の機能ブロックダイヤグラム、図4は、本実施の形態にかかる描画装置において実行されるメインフローの例を示すフローチャートである。図3に示すように、描画装置10は、点列データ取得部31、補間処理部32、描画前処理部34および描画処理部35を有する。点列データ取得部31、補間処理部32、描画前処理部34において生成された種々のデータは、記憶部36に記憶される。
図3は、本実施の形態にかかる描画装置の機能ブロックダイヤグラム、図4は、本実施の形態にかかる描画装置において実行されるメインフローの例を示すフローチャートである。図3に示すように、描画装置10は、点列データ取得部31、補間処理部32、描画前処理部34および描画処理部35を有する。点列データ取得部31、補間処理部32、描画前処理部34において生成された種々のデータは、記憶部36に記憶される。
点列データ取得部31は、タブレット17から、タブレットペン18の位置(X座標、Y座標)および筆圧を示す値を含む3次元のデータを受け入れて、点列データを生成して記憶部36に記憶する。補間処理部32は、補間・平滑化処理部33を含み、点列データが示す点の座標値に基づき、補間処理を実行して、一連の補間された座標値群を生成して、記憶部36に記憶する。描画前処理部34は、記憶部36に記憶された座標値群に基づいて、描画すべき点の座標値を算出する。描画処理部35は、算出された座標値に基づいて、表示装置16の画面上に複数の点(点列)を表示する。なお、各構成部分において算出された座標値などは記憶部36に格納されて後続する処理において利用される。
本実施の形態において、点列データ取得部31、補間処理部32、描画前処理部34、描画処理部35の機能は、主としてCPU11により実現される。また、記憶部36は、たとえば、RAM13および補助記憶装置15に相当する。なお、CPU11とは別体のGPUを設けた場合には、点列データ取得部31、補間処理部32、描画前処理部34、描画処理部35の機能の一部が、GPUにより代替され得る。
図4に示すように、本実施の形態にかかる描画装置10において、電源が投入され、或いは、描画の開始を示す指示が入力部14から与えられると、メインフローは起動し、後述するステップ402~405の処理が繰り返し実行される。CPU11は、RAM13中のデータや、表示装置16の画面のクリアを含むイニシャライズ処理(初期化処理)を実行する(ステップ401)。イニシャライズ処理(ステップ401)が終了すると、CPU11(特に、点列データ取得部31)は、点列データ取得処理を実行する(ステップ402)。図5は、本実施の形態にかかる点列データ取得処理の例を示すフローチャートである。
[点列データ取得処理]
図5に示すように、点列データ取得部31は、タブレット17から、現在の時刻Tiにおけるタブレット17上のタブレットペン18の位置(サンプル点の位置)および筆圧を示す3次元の座標値(XTi,YTi,PTi)を取得する(ステップ501)。ここに、(XTi,YTi)はタブレットペン18の位置を示し、PTiは、タブレットペン18がタブレット17に与えている筆圧の大きさを示している。前回に取得した座標値(時刻Ti-1)の座標値(XTi-1,YTi-1,PTi-1)と、取得した座標値(XTi,YTi,PTi)が同一であれば(ステップ502でYes)、ステップ501に戻る。ステップ502でNoと判断された場合には、隣接する点との間の距離を算出する(ステップ503)。本実施の形態においては、ステップ501で得られた座標値(XTi,YTi,PTi)を、第k番の座標値(Xk,Yk,Pk)として、その位置(Xk,Yk)と、記憶部36に記憶された第(k-1)番の座標値(Xk-1,Yk-1,Pk-1)における位置(Xk-1,Yk-1)との間の距離を算出している。なお、サンプル点の位置は、ほぼ一定のサンプリング周期Δtごとに距離が取得されるため、取得された距離は、サンプリング周期Δtを単位時間とする速度と考えることもできる。たとえば、距離としてユークリッド距離を採用すれば、距離d(速度V)は、以下のように算出される。
図5に示すように、点列データ取得部31は、タブレット17から、現在の時刻Tiにおけるタブレット17上のタブレットペン18の位置(サンプル点の位置)および筆圧を示す3次元の座標値(XTi,YTi,PTi)を取得する(ステップ501)。ここに、(XTi,YTi)はタブレットペン18の位置を示し、PTiは、タブレットペン18がタブレット17に与えている筆圧の大きさを示している。前回に取得した座標値(時刻Ti-1)の座標値(XTi-1,YTi-1,PTi-1)と、取得した座標値(XTi,YTi,PTi)が同一であれば(ステップ502でYes)、ステップ501に戻る。ステップ502でNoと判断された場合には、隣接する点との間の距離を算出する(ステップ503)。本実施の形態においては、ステップ501で得られた座標値(XTi,YTi,PTi)を、第k番の座標値(Xk,Yk,Pk)として、その位置(Xk,Yk)と、記憶部36に記憶された第(k-1)番の座標値(Xk-1,Yk-1,Pk-1)における位置(Xk-1,Yk-1)との間の距離を算出している。なお、サンプル点の位置は、ほぼ一定のサンプリング周期Δtごとに距離が取得されるため、取得された距離は、サンプリング周期Δtを単位時間とする速度と考えることもできる。たとえば、距離としてユークリッド距離を採用すれば、距離d(速度V)は、以下のように算出される。
d=((Xk-Xk-1)2+(Yk-Yk-1)2)1/2
なお、ユークリッド距離に限定されるものではなく、他の距離、たとえば、メトロポリタン距離などが採用されても良い。
なお、ユークリッド距離に限定されるものではなく、他の距離、たとえば、メトロポリタン距離などが採用されても良い。
点列データ取得部31は、座標値(Xk,Yk,Pk)を点列データの一部(点列を構成する点のデータ)として記憶部36に記憶する(ステップ504)。次いで、点列データ取得部31は、(Xk,Yk,Pk)に隣接する点、つまり、座標値(Xk-1,Yk-1,Pk-1)の点が、所定の距離内に位置しているか否かを判断する(ステップ505)。ここでは、上記距離dが、所定の閾値dth以下であるか否かを判断すれば良い。ステップ505でYesと判断された場合には、CPU11は、今回得られた座標値(Xk,Yk,Pk)を点列データから除去する(ステップ506)。つまり、点列の間引き処理を実行する。ステップ505でNoと判断された場合、或いは、ステップ506が実行された後に、点列データ取得処理は終了する。
[補間処理]
点列データ取得処理(ステップ402)が終了すると、CPU11は、補間処理を実行する(ステップ403)。図6は、本実施の形態にかかる補間処理の例を示すフローチャートである。CPU11(補間処理部32)は、点列データを参照して、点列データに対して移動平均処理を施す。本実施の形態において、補間処理部32は、第k番の点の座標値(Xk,Yk,Pk)として、第(k-3)番の点の座標値(Xk-3,Yk-3,Pk-3)から第k番の点の座標値(Xk,Yk,Pk)の平均値を算出して、これを新たに第k番の点の座標値(Xk,Yk,Pk)とする。
点列データ取得処理(ステップ402)が終了すると、CPU11は、補間処理を実行する(ステップ403)。図6は、本実施の形態にかかる補間処理の例を示すフローチャートである。CPU11(補間処理部32)は、点列データを参照して、点列データに対して移動平均処理を施す。本実施の形態において、補間処理部32は、第k番の点の座標値(Xk,Yk,Pk)として、第(k-3)番の点の座標値(Xk-3,Yk-3,Pk-3)から第k番の点の座標値(Xk,Yk,Pk)の平均値を算出して、これを新たに第k番の点の座標値(Xk,Yk,Pk)とする。
すなわち、新たな第k番の点の座標値はそれぞれ以下のような値をとる。
Xk=(Xk-3+Xk-2+Xk-1+Xk)/4
Yk=(Yk-3+Yk-2+Yk-1+Yk)/4
Pk=(Pk-3+Pk-2+Pk-1+Pk)/4
なお、移動平均フィルタ処理は、点列の変化の度合いを小さくする、つまり、平滑化するために行なっているが、これは省略しても良い。
Yk=(Yk-3+Yk-2+Yk-1+Yk)/4
Pk=(Pk-3+Pk-2+Pk-1+Pk)/4
なお、移動平均フィルタ処理は、点列の変化の度合いを小さくする、つまり、平滑化するために行なっているが、これは省略しても良い。
次いで、補間処理部32は、取得された点の個数が所定値以上であるかを判断し(ステップ602)、所定値以上(ステップ602でYes)であれば補間・平滑化処理を実行する(ステップ603)。本実施の形態においては、3次のスプライン処理が実行されるため、点の個数は4以上であれば良く、この場合に、ステップ602でYesと判断される。ステップ602でYesと判断された場合には、補間・平滑化処理が実行される(ステップ603)。図7は本実施の形態にかかる補間・平滑化処理の例を示すフローチャートである。
図7に示すように、補間・平滑化処理において、補間・平滑化処理部33は、演算に利用する配列や変数を初期化し(ステップ701)、節点を算出して追加し(ステップ702)、追加された節点を用いて関数値を演算する(ステップ703)。特に、本実施の形態においては、取得座標値を距離dに応じて細分化しパラメータ化した値と、B-スプライン関数の積和演算を行って関数値を取得する。本実施の形態にかかるB-スプライン関数の積和演算については後述する。
B-スプラインについては、たとえば、非特許文献1などに記載された周知の技術であるが、以下に簡単に説明する。
[B-スプライン]
(K-1)次のB-スプラインを、Bi,K(x)とすると、以下のように定義される。
(K-1)次のB-スプラインを、Bi,K(x)とすると、以下のように定義される。
Bi,K(x)=(qi+K-qi)MK(x:qi,qi+1,・・・,qi+K)
ここで、MK(x:qi,qi+1,・・・,qi+K)は、
ここで、MK(x:qi,qi+1,・・・,qi+K)は、
yi=S(xi) (i=0,1,・・・,N-1)
を満足するような係数αiを算出することにより得ることができる。
つまり、
Aα=y ただし、A、α、yは以下に示すものである。
Aα=y ただし、A、α、yは以下に示すものである。
[本実施の形態にかかるB-スプライン関数の補間演算]
本実施の形態においては、与えられたN個のデータ点を、曲線の形状を決める制御点として利用するいわゆるベジェ曲線の基底関数に、B-スプラインを利用する。この手法は、たとえば非特許文献2に開示されている。
本実施の形態においては、与えられたN個のデータ点を、曲線の形状を決める制御点として利用するいわゆるベジェ曲線の基底関数に、B-スプラインを利用する。この手法は、たとえば非特許文献2に開示されている。
たとえば、本件の点列データ取得処理にて取得された3次元の座標値(Xi,Yi,Pi)について、本実施の形態においては、以下のようなデータ値を得ることができる。
得られたX(t)、Y(t)、P(t)による座標値(X(t),Y(t),P(t))が補間された座標値となる。本実施の形態においては、パラメータtによる媒介変数により関数が表され、また、データ値(座標値)と、B-スプラインとにより、新たな補間された座標値が得られるため、B-スプラインBi,K(t)が算出できるだけのデータ点(点列)が得られた段階で、補間演算が実行されて、補間されたデータ値を得ることが可能となる。
本実施の形態においては、3次のスプライン処理が実行されるため、点の個数は4以上であれば良い。たとえば、初期的には、座標値(X0,Y0,P0)~(X3,Y3,P3)が取得された時点で、補間・平滑化処理が実行される(図6のステップ602、603)参照。以後の処理でも、4つの点(座標値((Xi-3,Yi-3,Pi-3)~(Xi,Yi,Pi)を用いてスプライン処理が実行されて、補間された座標値が得られる。補間された座標値は、記憶部36に格納される。
以下、4つの点(座標値((Xi-3,Yi-3,Pi-3)~(Xi,Yi,Pi))から得られた補間された点を、(xj,yj,pj)と表す。
[描画前処理]
補間処理(ステップ403)が終了すると、CPU11(描画前処理部34)は、描画前処理を実行する(ステップ404)。ステップ404においては、表示装置の画面上に表示すべき最終的な点列(描画対象点からなる点列)の座標値を算出する。図8は、本実施の形態にかかる描画前処理の例を示すフローチャートである。図8に示すように、描画前処理部34は、記憶部36に記憶された、4つの点(座標値((Xi-3,Yi-3,Pi-3)~(Xi,Yi,Pi))から得られた補間された点の座標(xj,yj,pj)を読み出し、始点と終点とを特定する(ステップ801)。補間された点の座標において始点と終点はかならず描画するため、ステップ801において上記2点が特定される。次いで、描画前処理部34は、第j番の座標(xj,yj,pj)における位置(xj,yj)を参照し、第j-1番の座標(xj-1,yj-1,pj-1)における位置(xj-1,yj-1)との距離を算出する。ここでは、たとえば、ユークリッド距離
d=((xj-xj-1)2+(yj-yj-1)2)1/2
を算出すれば良い。
補間処理(ステップ403)が終了すると、CPU11(描画前処理部34)は、描画前処理を実行する(ステップ404)。ステップ404においては、表示装置の画面上に表示すべき最終的な点列(描画対象点からなる点列)の座標値を算出する。図8は、本実施の形態にかかる描画前処理の例を示すフローチャートである。図8に示すように、描画前処理部34は、記憶部36に記憶された、4つの点(座標値((Xi-3,Yi-3,Pi-3)~(Xi,Yi,Pi))から得られた補間された点の座標(xj,yj,pj)を読み出し、始点と終点とを特定する(ステップ801)。補間された点の座標において始点と終点はかならず描画するため、ステップ801において上記2点が特定される。次いで、描画前処理部34は、第j番の座標(xj,yj,pj)における位置(xj,yj)を参照し、第j-1番の座標(xj-1,yj-1,pj-1)における位置(xj-1,yj-1)との距離を算出する。ここでは、たとえば、ユークリッド距離
d=((xj-xj-1)2+(yj-yj-1)2)1/2
を算出すれば良い。
次いで、描画前処理部34は、距離dが、最新の筆圧値や表示装置の分解能などに応じて決まる所定の閾値dth以下であるか否かを判断する(ステップ803)。ステップ803でYesと判断された場合には、座標値(xj,yj,pj)を描画対象点から除去する(ステップ804)。すなわち、点列の間引き処理を実行する。上記ステップ803、804は、図5のステップ505、506と同様である。ステップ803でYesと判断された場合、或いは、ステップ804が終了した後に、描画前処理部34は、筆圧値pjと、描画すべき点のドットの大きさとの対応付けを行なう(ステップ805)。図9は、本実施の形態にかかる筆圧・ドット対応テーブルの例を示す図である。
図9に示すように、本実施の形態においては、所定の筆圧値の範囲ごとに、当該範囲と描画すべき点のドットの大きさを示す値Dとが関連付けられたテーブル900が、たとえば、補助記憶装置15に格納され、描画前処理34において、当該テーブルがRAM13にコピーされている。本実施の形態にかかるテーブル900では、筆圧(の範囲)とドットの大きさを示す値とがリニアに変化するようになっている。たとえば、筆圧値が256段階中(1~256)、1~8であれば、ドットの大きさを示す値が「1」であり(符号901参照)、筆圧値が9~16であれば、ドットの大きさを示す値が「2」となる(符号902参照)。無論、このようにリニアであることに限定されず、非線形に、ドットの大きさを示す値が変化しても良い。また、筆圧とドットの大きさも、図9に示すような対応に限定されないことは言うまでも無い。さらに前記ドットには、アンチエイリアス処理が施された描画要素が用いられるため、筆圧とドットの大きさ(ピクセルクラスタ)は、必ずしも明確に対応しない。
描画前処理部34は、RAM13中のテーブルを参照して、筆圧値Pjに対応するドットの大きさを示す値Dを特定する。これにより、位置を示す値xj、yjおよびドットの大きさを示す値Dからなる描画対象点のデータ(xj,yj,D)を得ることができる。得られた描画対象点のデータ(xj,yj,D)は、記憶部36に格納される。描画前処理部34は、終点になるまで、ステップ802~805の処理を繰り返す。これにより、最新の筆圧値や表示装置の分解能などに応じて決まる距離dthだけ相互にほどよく離間した点列のデータを得ることが可能となる。
[描画処理]
次に、描画処理(図4のステップ405)について説明する。本実施の形態において、描画処理は、上記描画対象点のデータを読み出して、描画対象点が示す位置(xj,yj)に、Dで示される大きさの点を描画する。すなわち、本実施の形態においては、描画対象点の間を、ある太さの線で結ぶのではなく、多数の描画対象点を、画面上に最適な間隔で描画することで曲線や直線を表す。これが従来の手法との大きな違いである。また、本実施の形態においては描画前処理が繰り返し実行される。したがって、それぞれの描画前処理において生成された描画対象点のデータが、順次、所定の透明度を持った点として、所定の色の濃さになるように重畳され、画面に表示される。たとえば、描画対象点に描画される色の濃さ(透明度)は予め定められる。また、この描画対象点は、それぞれ、前述したように、ドットの大きさDが対応付けられているため、描画対象点はそれぞれ筆圧に応じた大きさで描画される。
次に、描画処理(図4のステップ405)について説明する。本実施の形態において、描画処理は、上記描画対象点のデータを読み出して、描画対象点が示す位置(xj,yj)に、Dで示される大きさの点を描画する。すなわち、本実施の形態においては、描画対象点の間を、ある太さの線で結ぶのではなく、多数の描画対象点を、画面上に最適な間隔で描画することで曲線や直線を表す。これが従来の手法との大きな違いである。また、本実施の形態においては描画前処理が繰り返し実行される。したがって、それぞれの描画前処理において生成された描画対象点のデータが、順次、所定の透明度を持った点として、所定の色の濃さになるように重畳され、画面に表示される。たとえば、描画対象点に描画される色の濃さ(透明度)は予め定められる。また、この描画対象点は、それぞれ、前述したように、ドットの大きさDが対応付けられているため、描画対象点はそれぞれ筆圧に応じた大きさで描画される。
なお、取得された描画対象点全てを重ね合わせるのではなく、描画対象点のうち選択された所定の一部を重ね合わせるように構成しても良い。
図10は、本実施の形態にかかる描画処理を概略的に示す図である。たとえば、タブレット17に入力された4つの点列Pi-3~Piにより、描画対象点の点列1001が得られている。同様に、4つの点列Pi-2~Pi+1、Pi-1~Pi+2、Pi~Pi+3(図示せず)により、描画対象点の点列1102、1103、1104がそれぞれ得られている。本実施の形態においては、表示装置16の画面上に表示される曲線1010は、上記点列1001~1004が重ね合わせられたものである。たとえば、曲線1010の領域1013は、点列1001~1003の重ね合わせであり、領域1014は、点列1002~1004の重ね合わせである。また、他の領域(たとえば、領域1011、1012,01015)も、同様に、図示した点列および他の点列の重ね合わせであることが理解できるであろう。
さらに、本実施の形態においては、ステップ402~404の処理が繰り返されることにより、入力された4つの点列により、順次、描画対象点の点列が作られていく。したがって、ほぼ点列の入力(つまり、タブレットペンの動作)に応じてほぼリアルタイムで、描画対象点により構成された曲線を、その筆圧に応じた太さで再現することが可能となる。
図11は、ユーザがタブレット17上でタブレットペン18を動かして、その結果、点列データ取得部31により取得された点列データの例を示す図である。また、図12は、本実施の形態にかかる処理により表示装置16の画面上に表示された曲線の例を示す図である。図12の例においては、補間処理部32によって補間・平滑化され、描画前処理部34において、点列が適度に間引かれ、描画処理部35により、描画対象点が最終的に所定の色の濃さになるよう重ねあわされて表示された結果、タブレットペン18の動きが曲線により再現されている。
本実施の形態によれば、入力された点(サンプル点)が、補間に必要な数だけ存在する場合に、当該必要数により補間された値を算出することが可能な補間・平滑化関数を通して、補間された点列を構成する点の座標値を算出する。これにより、全ての点列が得られるまで処理の開始を待つことなく、補間に必要な数だけサンプル点が得られた段階で、演算を実行することが可能となる。
また、本実施の形態によれば、上記補間に必要な数だけサンプル点が得られた段階で実行された演算により得られた補間された座標値に基づく点列を、既に表示装置の画面上に表示されている点列に重ね合わせて描画していく。これにより、隣接する点の間を直線で結ぶ必要なく、滑らかな曲線を再現することが可能となる。
[他の例]
本発明は、以上の実施の形態に限定されることなく、特許請求の範囲に記載された発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。
本発明は、以上の実施の形態に限定されることなく、特許請求の範囲に記載された発明の範囲内で、種々の変更が可能であり、それらも本発明の範囲内に包含されるものであることは言うまでもない。
たとえば、前記実施の形態においては、タブレットペンがタブレット上で接触した状態で、その位置を点列として取得しているがこれに限定されるものではなく、タブレットペンがタブレットに接近しているが接触しない状態であっても、タブレットペンの位置を点列として取得することができる。これは、タブレット17と、タブレットペン(スタイラスペン)18との間の電磁誘導授受作用により位置検出することから実現できる。
また、前記実施の形態においては、タブレットペンの位置している平面座標(X座標、Y座標)および筆圧により、座標値(Xk,Yk,Pk)を取得しているが、筆圧に加えて、タブレットペンの傾斜Akを検出して、座標値(Xk,Yk,Pk,Ak)を取得しても良い。この場合には、タブレットペン18の傾斜についても、数8に示す数式と同様に、以下のように補間された傾斜値が求められても良い。
A(t)=ΣAiBi,K(t)
さらに、傾斜値と、描画のための要素(たとえば、筆圧と同様にドットの大きさであっても良いし、色やドットの濃度など他の要素であっても良い)とを対応付けることで、タブレットペンの傾斜に応じた描画が実現される。
さらに、傾斜値と、描画のための要素(たとえば、筆圧と同様にドットの大きさであっても良いし、色やドットの濃度など他の要素であっても良い)とを対応付けることで、タブレットペンの傾斜に応じた描画が実現される。
或いは、筆圧の代わりに、タブレットペンの傾斜を利用して、座標値(Xk,Yk,Ak)を取得しても良い。
さらに、前記実施の形態においては、描画されるドットの形状は円形であっても楕円形であっても良い。無論、筆圧に応じてその大きさが決定されるものであれば他の形状であっても良い。
また、前記実施の形態においては、取得座標値を距離dに応じて細分化してパラメータ化した値と、B-スプライン関数との積和演算を行い、補間された座標値を算出して、補間および平滑化を実現している。しかしながら、使用できる補間・平滑化関数は上述した関数に限定されるものでなく、たとえば、ガウス関数を適用しても良い。ガウス関数Gを利用した場合には、数8の数式と同様の表現をすると、以下のように表すことができる。なお、ガウス関数の形状を決めるパラメータには、筆圧Pや距離dなどが、逐次、考慮されることが望ましい。
X(t)=ΣXiG(t)
Y(t)=ΣYiG(t)
P(t)=ΣPiG(t)
釣鐘型の関数であればガウス関数以外の関数も利用され得る。
Y(t)=ΣYiG(t)
P(t)=ΣPiG(t)
釣鐘型の関数であればガウス関数以外の関数も利用され得る。
さらに、前記実施の形態においては、数8に示すように、以下の数式を用いて補間された座標値を算出した。
X(t)=ΣXiBi,K(t)
Y(t)=ΣYiBi,K(t)
P(t)=ΣPiBi,K(t)
これによると、入力された点(サンプル点)を制御点として用いるため、補間された座標値からなる点列は、サンプル点を通らない。そこで、より好ましい実施の形態として、筆記速度が速く、点列がまばらになった際(点列を構成する点の間の距離dが大きくなった場合)にも、サンプル点に、より接近した位置に補間点列が計算されるように、以下のような数式を用いて補間・平滑化される座標値を算出しても良い。
Y(t)=ΣYiBi,K(t)
P(t)=ΣPiBi,K(t)
これによると、入力された点(サンプル点)を制御点として用いるため、補間された座標値からなる点列は、サンプル点を通らない。そこで、より好ましい実施の形態として、筆記速度が速く、点列がまばらになった際(点列を構成する点の間の距離dが大きくなった場合)にも、サンプル点に、より接近した位置に補間点列が計算されるように、以下のような数式を用いて補間・平滑化される座標値を算出しても良い。
X(t)=w(d)ΣXiBi,K(t)
Y(t)=w(d)ΣYiBi,K(t)
P(t)=w(d)ΣPiBi,K(t)
ここに、w(d)は、速度(距離)の関数値としての重みである。
Y(t)=w(d)ΣYiBi,K(t)
P(t)=w(d)ΣPiBi,K(t)
ここに、w(d)は、速度(距離)の関数値としての重みである。
また、前記実施の形態にいては、描画前処理においても、隣接する点の間が所定の距離内であれば点列の間引き処理を実行している(ステップ504、505)が、これは省略しても良い。
10 描画装置
11 CPU
12 ROM
13 RAM
14 入力部
15 補助記憶装置
16 表示装置
17 タブレット
18 タブレットペン
31 点列データ取得部
32 補間処理部
33 補間・平滑化処理部
34 描画前処理部
35 描画処理部
36 記憶部
11 CPU
12 ROM
13 RAM
14 入力部
15 補助記憶装置
16 表示装置
17 タブレット
18 タブレットペン
31 点列データ取得部
32 補間処理部
33 補間・平滑化処理部
34 描画前処理部
35 描画処理部
36 記憶部
Claims (14)
- 入力された複数の点列に基づいて、補間された点を生成して表示装置の画面上に描画する描画装置であって、
入力された点列を構成する各サンプル点の座標値を取得する座標値取得手段と、
前記座標値取得手段により取得されたサンプル点の数が、所定数のサンプル点が存在する場合に当該所定数のサンプル点に基づき補間された値を算出可能な補間・平滑化関数における前記所定数に達したときに、当該所定数のサンプル点の座標値に、前記補間・平滑化関数を適用して、補間された座標値を生成する補間・平滑化手段と、
表示装置の画面上において、前記補間された座標値に応答する位置に点を描画する描画手段と、を備えたことを特徴とする描画装置。 - 前記描画手段が、前記表示装置の画面上に既に描画された点列に、前記補間・平滑化手段により生成された、補間された座標値に応答する位置の点を重ね合わせることにより描画するように構成されたことを特徴とする請求項1に記載の描画装置。
- 前記描画手段が、前記補間された座標値に応答する位置の点の所定の一部を重ね合わせるように構成されたことを特徴とする請求項2に記載の描画装置。
- 前記描画手段が、前記補間された座標値に応答する位置の点を所定の透明度にて重ねあわせるように構成されたことを特徴とする請求項2または3に記載の描画装置。
- 前記座標値取得手段が、前記入力された点列を構成するサンプル点における筆圧を示す値を取得し、
前記補間・平滑化手段が、前記サンプル点における筆圧を示す値に、前記補間・平滑化関数を適用して、補間された筆圧を示す値を算出し、
前記描画手段が、前記補間された座標値が示す位置において、前記補間された筆圧を示す値に応じた大きさの点を描画するように構成されたことを特徴とする請求項1ないし4の何れか一項に記載の描画装置。 - 前記座標値取得手段が、前記入力したサンプル点の所定範囲に他のサンプル点が存在する場合には、上記入力したサンプル点を、取得するサンプル点から除外するように構成されたことを特徴とする請求項1ないし6の何れか一項に記載の描画装置。
- 前記描画手段が、補間された座標値が示す点の所定範囲に、他の補間された座標値が示す点が存在する場合には、当該補間された座標値が示す点を描画対象から除外するように構成されたことを特徴とする請求項1ないし8の何れか一項に記載の描画装置。
- 入力装置および表示装置を備えたコンピュータにおいて、入力された複数の点列に基づいて、補間された点を生成して表示装置の画面上に描画するための描画プログラムであって、前記コンピュータを、
入力された点列を構成する各サンプル点の座標値を取得する座標値取得手段、
前記座標値取得手段により取得されたサンプル点の数が、所定数のサンプル点が存在する場合に当該所定数のサンプル点に基づき補間された値を算出可能な補間・平滑化関数における前記所定数に達したときに、当該所定数のサンプル点の座標値に、前記補間・平滑化関数を適用して、補間された座標値を生成する補間・平滑化手段、並びに、
表示装置の画面上において、前記補間された座標値に応答する位置に点を描画する描画手段、として機能させることを特徴とする描画プログラム。 - 前記描画手段が、前記表示装置の画面上に既に描画された点列に、前記補間・平滑化手段により生成された、補間された座標値に応答する位置の点を重ね合わせることにより描画するように構成されたことを特徴とする請求項10に記載の描画プログラム。
- 前記描画手段が、前記補間された座標値に応答する位置の点の所定の一部を重ね合わせるように構成されたことを特徴とする請求項11に記載の描画プログラム。
- 前記描画手段が、前記補間された座標値に応答する位置の点を所定の透明度にて重ねあわせるように構成されたことを特徴とする請求項11または12に記載の描画プログラム。
- 前記座標値取得手段が、前記入力された点列を構成するサンプル点における筆圧を示す値を取得し、
前記補間・平滑化手段が、前記サンプル点における筆圧を示す値に、前記補間・平滑化関数を適用して、補間された筆圧を示す値を算出し、
前記描画手段が、前記補間された座標値が示す位置において、前記補間された筆圧を示す値に応じた大きさの点を描画するように構成されたことを特徴とする請求項10ないし13の何れか一項に記載の描画プログラム。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009-165401 | 2009-07-14 | ||
JP2009165401A JP2011022685A (ja) | 2009-07-14 | 2009-07-14 | 描画装置および描画プログラム |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2011007769A1 true WO2011007769A1 (ja) | 2011-01-20 |
Family
ID=43449376
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/JP2010/061809 WO2011007769A1 (ja) | 2009-07-14 | 2010-07-13 | 描画装置および描画プログラム |
Country Status (3)
Country | Link |
---|---|
JP (1) | JP2011022685A (ja) |
TW (1) | TW201112062A (ja) |
WO (1) | WO2011007769A1 (ja) |
Families Citing this family (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5172889B2 (ja) * | 2010-04-15 | 2013-03-27 | パナソニック株式会社 | 手書き入力装置、手書き入力方法、及び手書き入力プログラム |
WO2015075933A1 (en) * | 2013-11-19 | 2015-05-28 | Wacom Co., Ltd. | Method and system for ink data generation, ink data rendering, ink data manipulation and ink data communication |
US9507407B2 (en) * | 2014-02-21 | 2016-11-29 | Qualcomm Incorporated | Method and apparatus for improving power consumption on a touch device |
CN109964251B (zh) * | 2017-01-11 | 2023-07-21 | 株式会社和冠 | 描绘装置及描绘方法 |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05324921A (ja) * | 1992-05-25 | 1993-12-10 | Mutoh Ind Ltd | 曲線形成方法および装置 |
JPH08101922A (ja) * | 1991-01-07 | 1996-04-16 | Shima Seiki Mfg Ltd | 画像編集作成装置および画像編集作成方法 |
JPH08179874A (ja) * | 1994-12-20 | 1996-07-12 | Ricoh Co Ltd | 手書き入力表示装置 |
JP2003346171A (ja) * | 2002-05-24 | 2003-12-05 | Wacom-It Co Ltd | 描画装置および描画プログラム |
-
2009
- 2009-07-14 JP JP2009165401A patent/JP2011022685A/ja active Pending
-
2010
- 2010-07-13 WO PCT/JP2010/061809 patent/WO2011007769A1/ja active Application Filing
- 2010-07-13 TW TW99123005A patent/TW201112062A/zh unknown
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH08101922A (ja) * | 1991-01-07 | 1996-04-16 | Shima Seiki Mfg Ltd | 画像編集作成装置および画像編集作成方法 |
JPH05324921A (ja) * | 1992-05-25 | 1993-12-10 | Mutoh Ind Ltd | 曲線形成方法および装置 |
JPH08179874A (ja) * | 1994-12-20 | 1996-07-12 | Ricoh Co Ltd | 手書き入力表示装置 |
JP2003346171A (ja) * | 2002-05-24 | 2003-12-05 | Wacom-It Co Ltd | 描画装置および描画プログラム |
Also Published As
Publication number | Publication date |
---|---|
TW201112062A (en) | 2011-04-01 |
JP2011022685A (ja) | 2011-02-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Qian et al. | PUGeo-Net: A geometry-centric network for 3D point cloud upsampling | |
CN107067473B (zh) | 用于对3d建模对象进行重构的方法、装置及系统 | |
US8259101B2 (en) | Sketch-based design system, apparatus, and method for the construction and modification of three-dimensional geometry | |
Harary et al. | 3D Euler spirals for 3D curve completion | |
JP4545140B2 (ja) | 画像データ処理方法、医療用観察システム、医療用検査装置及びコンピュータプログラム | |
KR100707841B1 (ko) | 3차원 목표곡선을 이용한 곡면 변형 장치 및 그 방법 | |
Iarussi et al. | Bendfields: Regularized curvature fields from rough concept sketches | |
WO2006106686A1 (ja) | 3次元モデル変形システム、方法、及びコンピュータ読み取り可能プログラム、並びに、該プログラムを記憶したコンピュータ読み取り可能記憶媒体 | |
US11880913B2 (en) | Generation of stylized drawing of three-dimensional shapes using neural networks | |
WO2011007769A1 (ja) | 描画装置および描画プログラム | |
CN113205609A (zh) | 变形基础学习 | |
JP2007511267A (ja) | 変形可能表面を使った三次元セグメント化 | |
CN106716500B (zh) | 一种信息处理装置及深度定义方法 | |
Kara et al. | An evaluation of user experience with a sketch-based 3D modeling system | |
JP2009122998A (ja) | ソリッド/サーフェースモデルから外形線を抽出する方法及びコンピュータソフトウエアプログラム | |
Eyiyurekli et al. | Interactive free-form level-set surface-editing operators | |
JP4272226B2 (ja) | 画像流体系の相互作用表現装置、方法、及びそのプログラム | |
JP2013246578A (ja) | 画像変換装置および画像変換方法、画像変換プログラム | |
JP2016189117A (ja) | 形状変形装置および形状変形用プログラム | |
Eyiyurekli et al. | Localized editing of Catmull-Rom splines | |
Liu et al. | Animating characters in Chinese painting using two-dimensional skeleton-based deformation | |
Mohamed et al. | Cubic Bézier interpolation algorithm for rendering smoothly curves on virtual paper | |
JP3147391B2 (ja) | 3次元境界適合メッシュ分割における曲面の設定方法及びその装置 | |
CN104637091A (zh) | 一种通过稀疏表示创建流型的方法 | |
Ilic | Implicit meshes: unifying implicit and explicit surface representations for 3D reconstruction and tracking |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 10799827 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 10799827 Country of ref document: EP Kind code of ref document: A1 |