The present invention relates to a method and apparatus for drawing and erasing calligraphic ink objects on a display surface.
Interactive input systems that allow users to inject input (e.g. digital ink, mouse events etc.) into an application program using an active pointer (e.g., a pointer that emits light, sound or other signal), a passive pointer (e.g., a finger, cylinder or other suitable object) or other suitable input device such as for example, a mouse or trackball, are known. These interactive input systems include but are not limited to: touch systems comprising touch panels employing analog resistive or machine vision technology to register pointer input such as those disclosed in U.S. Pat. Nos. 5,448,263; 6,141,000; 6,337,681; 6,747,636; 6,803,906; 7,232,986; 7,236,162; and 7,274,356 assigned to SMART Technologies ULC of Calgary, Alberta, Canada, assignee of the subject application, the entire contents of which are incorporated by reference; touch systems comprising touch panels employing electromagnetic, capacitive, acoustic or other technologies to register pointer input; tablet personal computers (PCs); laptop PCs; personal digital assistants (PDAs); and other similar devices.
A number of applications that generate calligraphic ink from a user's handwritten input (i.e. ordinary ink) have been considered. For example, these applications include Microsoft Tablet PC applications, and the calligraphy tool implemented in the Inkscape Open Source vector graphics editor. Compared to ordinary ink, which is represented as a pixel-based image object, calligraphic ink is represented as a vectorized image. As a result, calligraphy ink has a smoother appearance than ordinary ink, and can be arbitrarily zoomed without showing jagged or zig-zag lines (i.e. stair-stepping) that are usually seen at the edges of a zoomed ordinary ink object. Unfortunately existing calligraphic ink generating applications still exhibit disadvantages. In particular, existing calligraphic ink generating applications are slow, do not present the outlines of calligraphic ink objects with the desired degree of smoothness and do not readily permit portions of calligraphic ink objects to be erased.
Methods of erasing ink objects have been considered. For example, U.S. Pat. No. 6,326,954 to Van leperen et al. entitled “Method For Erasing On An Electronic Writeboard”, assigned to SMART Technologies ULC of Calgary, Alberta, Canada, assignee of the subject application, teaches a method of erasing at least a portion of an ink object displayed on an electronic writeboard. However, when this method is applied to calligraphic ink objects, the degree of smoothness of the unerased portion of the calligraphic ink object typically does not meet the desired standard.
Therefore, there is a need to provide a novel method of generating and erasing calligraphic ink objects on a display surface.
Accordingly, in one aspect there is provided a method of generating a calligraphic ink object, comprising sampling contact coordinates generated by a coordinate input device during writing thereon using a pointer to generate an ink trajectory generally representing the writing; generating an ink envelope, said ink envelope comprising line segments joining pointer instances at said sampled contact coordinates; generating a smoothed ink envelope at least by fitting curves to points on said ink envelope; and drawing the smoothed ink envelope on a display thereby to generate the calligraphic ink object.
In one embodiment, the sampling contact coordinates further comprises processing the sampled contact coordinates to reduce the number of sampled contact coordinates used to generate the ink trajectory. In particular, selected sampled contact coordinates that are co-linear with other sampled contact coordinates are discarded.
In one embodiment, the ink envelope generating is performed upon completion of writing, such as for example when a pointer up event occurs. The ink envelope generally completely surrounds the ink trajectory. The ink envelope generating comprises surrounding each sampled contact coordinate along the generated ink trajectory with a pointer instance and for each consecutive pair of sampled coordinates, generating line segments on opposite sides of a line segment joining the sampled contact coordinates of the pair that extend between the pointer instances surrounding the sampled contact coordinates of the pair. The generated line segments extending between the pointer instances surrounding the sampled contact coordinates of each pair may be substantially tangential to the peripheries of the pointer instances.
In one embodiment, generating the smoothed ink envelope comprises fitting Bezier curves to points on the ink envelope.
In another embodiment, the ink trajectory comprises ink trajectory segments. An ink envelope segment is generated for each ink trajectory segment and the ink envelopes segments are combined to form the ink envelope.
In one embodiment, the drawing comprises drawing the smoothed ink envelope as a vectorized image. Prior to the drawing, the smoothed ink envelope may be colored or shaded.
According to another aspect there is provided a method of generating a calligraphic ink object comprising generating an ink trajectory representing writing input on a coordinate input device using an object, the ink trajectory comprising a subset of contact coordinates generated by the coordinate input device; generating an ink envelope surrounding the ink trajectory, the ink envelope being represented by curved and straight line segments; and drawing the ink envelope on a display thereby to generate the calligraphic ink object.
In one embodiment, the curved line segments are Bezier curves and the ink envelope resembles the boundary of the path of a geometric pointer tip following the ink trajectory.
According to yet another aspect there is provide an apparatus comprising at least one processor; and memory storing a calligraphic ink object generating routine, the calligraphic ink object generating routine, when executed by the at least one processor, causing the apparatus to: sample contact coordinates generated by a coordinate input device during writing thereon using a pointer to generate an ink trajectory generally representing the writing; generate an ink envelope, said ink envelope comprising line segments joining pointer instances at said sampled contact coordinates; generate a smoothed ink envelope at least by fitting curves to points on said ink envelope; and draw the smoothed ink envelope on a display thereby to generate the calligraphic ink object.
According to yet another aspect there is provided an apparatus comprising at least one processor; and memory storing a calligraphic ink object generating routine, the calligraphic ink object generating routine, when executed by the at least one processor, causing the apparatus to: generate an ink trajectory representing writing input on a coordinate input device using an object, the ink trajectory comprising a subset of contact coordinates generated by the coordinate input device; generate an ink envelope surrounding the ink trajectory, the ink envelope being represented by curved and straight line segments; and draw the ink envelope on a display thereby to generate the calligraphic ink object.
According to yet another aspect there is provided a computer readable medium embodying computer program code, which when executed by at least one processor, causes an apparatus to sample contact coordinates generated by a coordinate input device during writing thereon using a pointer to generate an ink trajectory generally representing the writing; generate an ink envelope, said ink envelope comprising line segments joining pointer instances at said sampled contact coordinates; generate a smoothed ink envelope at least by fitting curves to points on said ink envelope; and draw the smoothed ink envelope on a display thereby to generate the calligraphic ink object.
According to yet another aspect there is provided a computer readable medium embodying computer program code, which when executed by at least one processor, causes an apparatus to: generate an ink trajectory representing writing input on a coordinate input device using an object, the ink trajectory comprising a subset of contact coordinates generated by the coordinate input device; generate an ink envelope surrounding the ink trajectory, the ink envelope being represented by curved and straight line segments; and draw the ink envelope on a display thereby to generate the calligraphic ink object.
According to yet another aspect there is provided a method of erasing at least a portion of a calligraphic ink object delineated by an eraser trace intersecting said calligraphic ink object, said method comprising calculating intersection points between said calligraphic ink object and said eraser trace; generating additional points along line segments that extend between the intersection points on opposite sides of the eraser trace; fitting curves to the intersection points and the additional points; modifying the outline of said calligraphic ink object using said curves; and deleting the portion of said calligraphic ink object between said curves.
According to yet another aspect there is provided an apparatus comprising at least one processor; and memory storing a calligraphic ink object erasing routine, the calligraphic ink object erasing routine, when executed by the at least one processor, causing the apparatus to: calculate intersection points between said calligraphic ink object and said eraser trace; generate additional points along line segments that extend between the intersection points on opposite sides of the eraser trace; fit curves to the intersection points and the additional points; modify the outline of said calligraphic ink object using said curves; and delete the portion of said calligraphic ink object between said curves.
According to still yet another aspect there is provided a computer readable medium embodying computer program code, which when executed by at least one processor, causes an apparatus to calculate intersection points between said calligraphic ink object and said eraser trace; generate additional points along line segments that extend between the intersection points on opposite sides of the eraser trace; fit curves to the intersection points and the additional points; modify the outline of said calligraphic ink object using said curves; and delete the portion of said calligraphic ink object between said curves.
Embodiments will now be described more fully with reference to the accompany drawings in which:
Turning now to
When the user uses a pen tool 40 or a finger to contact the touch surface 24, the touch screen 22 detects the contact and transmits contact information to the processing structure 14 (see
The processing structure 14 in this embodiment is a general purpose computing device in the form of a personal computer or other suitable processing device. The computer comprises for example, a processing unit, system memory (volatile and/or non-volatile memory), other non-removable or removable memory (a hard disk drive, RAM, ROM, EEPROM, CDROM, DVD, flash memory etc.) and a system bus coupling the various computer components to the processing unit. It will be understood that the computer may also include a network connection to access shared or remote drives, one or more networked computers, or other networked devices over wired and/or wireless communication links using an appropriate communications format (e.g. Ethernet, WiFi, BlueTooth etc.)
The processing structure 14 runs a host software application such as SMART Notebook™ offered by SMART Technologies ULC of Calgary, Alberta, Canada. As is known, during execution, the SMART Notebook™ application provides a graphical user interface comprising a canvas page or palette, that is presented on the touch surface 24, and on which freeform or handwritten ink objects together with other computer generated objects can be input and manipulated via pointer interaction with the touch surface 24.
As shown in
The processing structure 14 generates the calligraphic ink object from the sampled contact points based on the brush type the user is using. In this embodiment, the brush type is a virtual pointer tip selected by the user from a set of predefined virtual pointer tip shapes, including circles, ellipses, polygons, etc., together with a user selected pointer tip size. In this case, the sampled contact points obtained at step 88 form the trajectory of the ink object, where each sampled contact point represents the centroid of the corresponding instance of the user selected brush type.
For ease of discussion, the calligraphic ink object generating method employed by the processing structure 14 will be described assuming that an elliptical brush has been selected by the user. At step 100, the processing structure 14 checks the sampled contact points of the ink trajectory, and removes co-linear contact points. For example, if P1, P2, . . . , Pn represent the sampled contact points of the ink trajectory, during the co-linear contact point removal process, the processing structure 14 calculates the slope of a line segment connecting the contact points Pi and Pi+1 according to:
Li=(yi+1−yi)/(xi+1−xi)
where i=1,2, . . . , i−2.
Then, the processing structure 14 calculates the slope of a line segment connecting the contact points Pi+1 and Pi+2 according to:
Li+1=(yi+2−yi+1)/(xi+2−xi+1)
If the calculated slopes are not equal i.e. Li≠Li+1, the processing structure 14 continues to compare the slope of a line segment connecting contact points Pi+1 and Pi+2 with that of a line segment connecting contact points Pi+2 and Pi+3. If the calculated slopes are equal i.e. Li=Li+1, the contact points Pi, Pi+1 and Pi+2 are co-linear points and the contact point Pi+1 is removed. In this case, the processing structure 14 compares the slope of the line segment connecting contact points Pi and Pi+2 with that of the line segment connecting contact points Pi+2 and Pi+3. The process continues in this manner until all sampled contact points are checked.
Turning back to
At step 104, each Bezier curve is sampled with respect to a predefined point distance. The obtained sampled contact points, which form a normalized ink trajectory, are indexed in accordance with a predefined order (e.g., the order of writing).
Turning back to
For any three successive sampled contact points of the ink trajectory, the corresponding outer envelope comprises a portion of the pointer tip instance centered at the middle sampled contact point. This portion of the pointer tip instance is then sampled with respect to a predefined point distance, and the obtained sampled contact points are also recorded as raw envelope points. For example, for the three successive contact points 140A, 140B and 140C, the raw outer envelope points comprise the tangent points 148A and 148B, the points 150A and 150B of the pointer tip instance 142B, the tangent point 148E, and the intersection point 152B of the tangential line segments 146C and 146D.
To determine the raw inner envelope points for any three successive sampled contact points of the normalized ink trajectory, two cases need to be considered. The first case is illustrated in
The second case is illustrated in
Turning back to
The generated raw envelope points are indexed. As shown in
Referring again to
As an example,
Each of the resulting fitting curves fits to a number of raw envelope points. The curve-fitting technique will return the range of raw envelope points to which each resulting fitting-curve fits. For example, in
Thereafter, the counter i is increased by 1 (step 184), and a check is made to determine whether all fitting curves have been processed (step 186). If not, the process reverts to step 182 to check the next fitting curve, in the case fitting curve E2. Otherwise, the generated index matrix is returned (step 188).
At step 182 for fitting curve E2, raw envelope points P39 and P38 fit to the fitting curve E2 and are associated with the sampled contact point C0. As a result, the sampled contact point C0 is also assigned the index 2 to indicate that the sampled contact point C0 is associated with the fitting curve E2 and the assigned index is added to the index matrix. As will be appreciated, after the raw envelope points to which each fitting curve fits have been checked, the resultant index matrix includes one or more indices for each sampled contact point identifying each fitting curve that is associated with each sampled contact point. For example with reference again to
Once the index matrix has been completed at step 188, the obtained fitting curve functions and the corresponding control points, as well as the sampled contact points of the normalized ink trajectory and the index matrix are stored. This information provides a mathematic description of the calligraphic object outline. With the mathematic description of the calligraphic ink object outline obtained, the outline of the calligraphic ink object may be filled in with a user-selected color or texture by the processing structure 14 using a rendering program. Then, the calligraphic ink object may be drawn on the touch surface 24 as a vectorized image so that it can be arbitrarily zoomed while maintaining the smoothness of its outline.
During this calligraphic ink object generating method, the sampled contact points of the user writing are segmented by time, i.e., starting from the first sampled contact point, the sampled contact points received by the processing structure 14 within every T milliseconds are grouped as a segment, where T is a predefined parameter. The value of the parameter T is selected from a range typically determined by the user based on writing experience and/or the processing structure performance. At step 200, the processing structure 14 receives the sampled contact points of a segment of the input ink object. At step 202, if the segment is not the first segment of the input ink object, the last sampled contact point of the previous segment is prefixed to the current segment and a storage pointer to these sampled contact points is placed into a segment heap. The ink object segment is then assigned to a background thread for generating the smoothed ink outline of the calligraphic ink object segment.
The background thread processes the ink object segment using a similar method as described with reference to
Referring again to
At step 204, if it is detected that the user has completed writing (e.g., when the pen tool-up event is received), the last ink object segment is then sent to a background thread for processing (step 206). In the processing of the last ink object segment, the pointer tip instance centered at the last sampled contact point of the normalized ink trajectory is also sampled at its outer part to obtain raw envelope points for closing the calligraphic ink object outline.
After all of the ink object segments have been processed, the calligraphic ink object segments are collected and smoothly connected together to form the final calligraphic ink object (step 208).
The method of erasing calligraphic ink objects employed by the processing structure 14 when a user moves an eraser across the touch surface 24 along a path or trace that intersects a calligraphic ink object will now be described. In the following, for ease of discussion, the erasing method will be described with specific reference to a circle-shaped eraser. However, those skilled in the art will appreciate that any other shape may be used as the eraser including, for example, an ellipse, triangle, rectangle, square, or other polygonal shape. The eraser may have a fixed size, or may be variable in size. When the eraser is variable size, the eraser size may be selected based on the magnitude of the pressure the user applies to the touch surface 24 using the eraser or on a user-selected size-varying scheme. Again for the ease of description, only the case where the trace of the eraser intersects the calligraphic ink object once will be discussed although those skilled in the art will appreciate that the method applies to cases where the trace of the eraser intersects the calligraphic ink object multiple times.
At step 222, the calligraphic ink object outline is split at intersection points A and B and at intersection points C and D. At step 224, additional outline points are generated between points A and C, and between points B and D, respectively. Then, an additional fitting curve is generated to fit the points A, C and the additional outline points therebetween (curve 264 in
At step 230, the portion of the calligraphic ink object outline that is outside of the newly generated outline, e.g. the portion of the calligraphic ink object outline outside of the curves 264 and 266, is deleted. The newly generated calligraphic ink object outline may be filled in with a user-selected color or texture by the rendering program. The resulting calligraphic ink object outline is shown in
Depending on the nature of the processing structure employed, this erasing method may be slow because step 220 typically requires a large amount of calculation to find the intersection points. In certain instances, a fast erasing methodology may be employed as will now be described.
The fast erasing methodology generally follows the same steps as shown in
The processing structure 14 first searches the sampled contact points of the normalized ink trajectory to find a sampled contact point within the eraser trace and nearest to the left edge of the eraser trace, which is, in the case shown in
After the intersection contact points C4 and C5 are found, their indices are checked to find the corresponding fitting curve on the calligraphic ink object outline. The indices of intersection contact point C4 are (3, 4), which correspond to fitting curve E3 above and fitting curve E4 below. Similarly, the indices of intersection contact point C5 are (5, 6), which correspond to fitting curve E5 above and fitting curve E6 below.
Then, for each identified fitting curve, a split point is calculated.
The processing structure 14 first calculates a line segment 302 between the two end control points P1 and P4. Then, the intersection point P5 of the line segments 300 and 302 is calculated. A split ratio t is calculated as:
t=|P1P5|/|P1P4|
where:
|P1P5| is the length of the line segment between control points P1 and P5; and
|P1P4| is the length of the line segment between control points P1 and P4.
The split point P6 on the fitting curve 304 is then calculated such that the ratio of the length of the curve P1P6 over that of the curve P1P6P4 is equal to t. In this embodiment, the BezierSplit function described in above-incorporated publication entitled “An Algorithm for Automatically Fitting Digitized Curves” authored by Philip J. Schneider, Graphics Gems, Academic Press Professional, Inc. (1990) is used as expressed by:
BezierSplit(OriginalControlPoints, ResultingLeftCurve, ResultingRightCurve, t)
where:
OriginalControlPoints are the coordinates of the original control points (input parameter);
ResultingLeftCurve is the resulting fitting curve on the left side of the split point (output parameter);
ResultingRightCurve is the resulting fitting curve on the right side of the split point (output parameter); and
t is the split ratio.
Thus, the BezierSplit function not only splits the fitting curve 304, but also generates a new fitting curve (Resulting LeftCurve) between control points P1 and P6, and another fitting curve (ResultingRightCurve) between control points P6 and P4.
For each fitting curve to be split, the BezierSplit function is called. For the fitting curve on the left side of the eraser trace, the ResultingLeftCurve is kept, and the ResultingRightCurve and the original fitting curve to be split are dropped. For the fitting curve on the right side of the eraser trace, the ResultingRightCurve is kept, and the ResultingLeftCurve and the original fitting curve to be split are dropped.
The next step of the fast erasing methodology is to generate additional outline points (corresponding to step 224 in
The above procedure generates two additional points so that these two points, together with the two end points L1 and L2 of the split outline, can be directly used as the four control points to obtain the additional fitting curve EL. However, those skilled in the art will appreciate that a different number of additional points may also be generated at different positions for generating the additional fitting curve. The actual number of additional points and the positions they are located may depend on the fitting curve used or may be arbitrary.
Two additional points R5 and R6 are also calculated for the right side of the calligraphic ink object outline in a similar manner. An additional fitting curve ER is then obtained by using the points R1, R5, R6 and R2 as the control points to close the right part of the calligraphic ink object outline.
The rest of the fast erasing methodology is similar to steps 230 and 232 in
Those skilled in the art will appreciate that the calligraphic ink generation and erasing methodologies described above that are performed by the processing structure are exemplary. Other variations and modifications are available. For example, although an elliptical shape is used as the pointer tip in the above embodiments, those skilled in the art will appreciate that other pointer tip shapes may be used, including, rectangular, square and other polygon shapes. The pointer tip may have a fixed size, or may be size-variable based on for example the pressure the user applies to the touch surface using the pointer or according to another user-selected size-varying scheme.
If a machine vision-based touch panel is employed rather than an analog resistive touch panel, the brush type may be determined from an image of the pointer tip contacting the touch surface 24 captured by the coordinate input device 12. In this case, each sampled contact point obtained at step 80 is derived from a captured pointer tip image. The centroids of the captured pointer tip images form the trajectory of the ink object.
Although embodiments have been described with reference to the drawings, those of skill in the art will appreciate that other variations and modifications from those described may be made without departing from the spirit and scope of the invention, as defined by the appended claims.
This application claims priority to U.S. Patent Appln. No. 61/252,064, filed Oct. 15, 2009, the contents of which are incorporated herein by reference.
Number | Name | Date | Kind |
---|---|---|---|
4620287 | Yam | Oct 1986 | A |
5434959 | Von Ehr et al. | Jul 1995 | A |
5448263 | Martin | Sep 1995 | A |
6055332 | Aitani et al. | Apr 2000 | A |
6141000 | Martin | Oct 2000 | A |
6157750 | Choi et al. | Dec 2000 | A |
6326954 | Van Ieperen | Dec 2001 | B1 |
6337681 | Martin | Jan 2002 | B1 |
6631200 | Savoray et al. | Oct 2003 | B1 |
6747636 | Martin | Jun 2004 | B2 |
6803906 | Morrison et al. | Oct 2004 | B1 |
6909430 | Dresevic et al. | Jun 2005 | B2 |
6952803 | Bloomberg et al. | Oct 2005 | B1 |
7039234 | Geidl et al. | May 2006 | B2 |
7224847 | Zhang et al. | May 2007 | B2 |
7232986 | Worthington et al. | Jun 2007 | B2 |
7236162 | Morrison et al. | Jun 2007 | B2 |
7274356 | Ung et al. | Sep 2007 | B2 |
7499055 | Lin et al. | Mar 2009 | B2 |
20030024748 | Dresevic et al. | Feb 2003 | A1 |
20030025681 | Hara | Feb 2003 | A1 |
20040028274 | Kawakami | Feb 2004 | A1 |
20040041811 | Lin et al. | Mar 2004 | A1 |
20040189666 | Frisken et al. | Sep 2004 | A1 |
20040196288 | Han | Oct 2004 | A1 |
20040233197 | Liu et al. | Nov 2004 | A1 |
20060274057 | Van Ness et al. | Dec 2006 | A1 |
20070040813 | Kushler et al. | Feb 2007 | A1 |
20090245654 | Xing et al. | Oct 2009 | A1 |
Entry |
---|
Richard J Kinch: MetaFog: Converting Metafont Shapes to Contours TUGboat, vol. 16, No. 3—Proceedings of the 1995 Annual Meeting, Jan. 1, 1995, pp. 233-243. |
Anonymous, “Metafont—Wikipedia, the free encyclopedia”, Sep. 5, 2009, XP055086186, Retrieved from the Internet: <URL:http://en.wikipedia.org/w/index.php?title=Metafont&oldid=312004506> [retrieved on Oct. 31, 2013]. |
Extended European Search Report for European Patent Application No. EP 10 82 2947, with a mailing date of Nov. 13, 2013. |
L. Belenkaia et al., “Creation, Presentation, Capture, and Replay of Freehand Writing in e-Lecture Scenarios” 2004 Paper presented at the ED-MEDIA World Conference on Educational Multimedia, Hypermedia & Telecommunications, accessed from the internet on Nov. 10, 2010 at: <http://citeseerx.ist.psu.edulviewdoc/summary?doi=l 0.1.1.93.5398>. |
Maria Teresa Infante Velazquez, “Metrics and Neatening of Handwritten Characters” Jun. 29, 2010 Master of Computer Science Thesis at the University of Western Ontario, accessed from the internet on Nov. 10, 2010 at: <http://www.csd.uwo.ca/-watt/home/students/theses/MTInfanteVelazquez2010-msc.pdf>. |
Paul Yao, “Add Support for Digital Ink to Your Windows Applications” MSDN Magazine 2004 accessed from the internet on Nov. 10, 2010 at: <httn: 1/l11sdn.microsoft.com/en-uslmagazinelcc 163 869. asnx>. |
Microsoft News Center, “Digital Ink, Breakthrough Technology in Tablet PC, Brings the Power of the Pen to the Desktop” (Microsofl News Center) Oct. 29, 2002 accesed from the internet on Nov. 15, 2010 at: <http://www.microsofi.com/presspass/features/2002/oct02/ I 0-29tabletinking.mspx>. |
Transmittal; International Search Report; and Written Opinion of the International Searching Authority for International Application No. PCT/CA2010001589. |
Number | Date | Country | |
---|---|---|---|
20110199297 A1 | Aug 2011 | US |
Number | Date | Country | |
---|---|---|---|
61252064 | Oct 2009 | US |