Method and apparatus for drawing and erasing calligraphic ink objects on a display surface

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, the ink envelope comprising line segments joining pointer instances at the sampled contact coordinates; generating a smoothed ink envelope at least by fitting curves to points on the ink envelope; and drawing the smoothed ink envelope on a display thereby to generate the calligraphic ink object.

FIELD OF THE INVENTION

The present invention relates to a method and apparatus for drawing and erasing calligraphic ink objects on a display surface.

BACKGROUND OF THE INVENTION

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.

SUMMARY OF THE INVENTION

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.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

Turning now toFIG. 1, a block diagram of an interactive input system is shown and is generally identified by reference numeral10. Interactive input system10comprises a coordinate input device12such as for example a touch panel, interactive surface or interactive whiteboard on which pointer contacts can be made. The coordinate input device12communicates with processing structure14executing one or more application programs. Image data generated by the processing structure14is displayed on a display surface of the coordinate input device12allowing a user to interact with the displayed image via pointer contacts on the coordinate input device12. The processing structure14interprets pointer contacts as input to the running application program and updates the image data accordingly so that the image displayed on the display surface of the coordinate input device12reflects the pointer activity. In this manner, the coordinate input device12and processing structure14allow pointer interactions with the coordinate input device12to be recorded as handwriting or drawing or used to control execution of the running application program. The coordinate input device12of the interactive input system10may be separate from the processing structure14, or may be combined with the processing structure14to form an integral compact unit as in the case of personal computers (PCs), tablet PCs, laptop PCs, personal digital assistants (PDAs), cellular telephones or other suitable devices.

FIG. 2illustrates an exemplary coordinate input device12in the form of an interactive whiteboard (IWB)20. In this embodiment, the IWB20is a 600i series interactive whiteboard manufactured by SMART Technologies ULC, of Calgary, Alberta, Canada, assignee of the subject application. The IWB20comprises a large, analog resistive touch screen22having a touch surface24, which also acts as a display surface on which computer generated images are presented. The touch surface24is surrounded by a bezel26. A tool tray28is affixed to the bezel26adjacent the bottom edge of the touch surface24and accommodates one or more pen tools that are used to interact with the touch surface24. The touch screen22is mounted on a wall or other suitable support surface via a mounting bracket30. A boom assembly32is also mounted on the wall above the touch screen22via the mounting bracket30. The boom assembly32comprises a speaker housing34accommodating a plurality of speakers (not shown), a generally horizontal boom36extending outwardly from the speaker housing34and a projector38adjacent the distal end of the boom36. The projector38is aimed back towards the touch screen22so that the image projected by the projector38is presented on the touch surface24.

When the user uses a pen tool40or a finger to contact the touch surface24, the touch screen22detects the contact and transmits contact information to the processing structure14(seeFIG. 1). The processing structure14obtains or calculates the pointer coordinates at the contact location(s) on the touch surface24using the contact information transmitted from the touch screen22. Depending on the operating mode of the IWB20, the pen tool contact coordinates are interpreted as a digital ink drawing object, a digital ink erasing object, or a command (mouse) event.

The processing structure14in 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 structure14runs 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 surface24, 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 surface24.

FIGS. 3A to 3Cshow the graphical user interface50presented on the touch surface24as a SMART Notebook™ application window. As shown inFIG. 3A, when a user writes on the canvas page52inside the SMART Notebook™ application window50using the pen tool40, as the pen tool40is moved along the touch surface24, the touch screen22transmits contact information to the processing structure14. The processing structure14in turn uses the contact information to determine the pen tool contact coordinates and interprets the pen tool coordinates as input digital ink. The input digital ink is used by the processing structure14to create a calligraphic ink object54representing the user's writing on the touch surface24. The processing structure14also updates the image data conveyed to the projector38so that the calligraphic ink object54is presented on the touch surface24. The image data is updated substantially immediately in “real time” by the processing structure14so that the projected image includes the user's writing substantially as soon as it is input.

As shown inFIG. 3B, when an eraser tool60is dragged along a path or trace62across the calligraphic ink object54displayed on the canvas page52, the portion64of the ink calligraphic ink object54that intersects the trace62is erased. The calligraphic ink object54after the erasing operation is shown inFIG. 3C.

FIG. 4shows the general steps performed by the processing structure14during generation of a calligraphic ink object. At step88, the processing structure14receives contact information from the touch screen22in response to a user writing on the touch surface24using a pen tool40or finger. In this embodiment, the contact information is a series of sampled coordinates representing contact points on the touch surface24.

The processing structure14generates 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 step88form 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 structure14will be described assuming that an elliptical brush has been selected by the user. At step100, the processing structure14checks the sampled contact points of the ink trajectory, and removes co-linear contact points. For example, if P1, P2, . . . , Pnrepresent the sampled contact points of the ink trajectory, during the co-linear contact point removal process, the processing structure14calculates the slope of a line segment connecting the contact points Piand Pi+1according to:
Li=(yi+1−yi)/(xi+1−xi)
where i=1,2, . . . , i−2.
Then, the processing structure14calculates the slope of a line segment connecting the contact points Pi+1and Pi+2according 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 structure14continues to compare the slope of a line segment connecting contact points Pi+1and Pi+2with that of a line segment connecting contact points Pi+2and Pi+3. If the calculated slopes are equal i.e. Li=Li+1, the contact points Pi, Pi+1and Pi+2are co-linear points and the contact point Pi+1is removed. In this case, the processing structure14compares the slope of the line segment connecting contact points Piand Pi+2with that of the line segment connecting contact points Pi+2and Pi+3. The process continues in this manner until all sampled contact points are checked.FIG. 5shows an example of the ink trajectory after removing co-linear contact points.

Turning back toFIG. 4, at step102following removal of co-linear contact points, the ink trajectory is smoothed by piecewise curve-fitting. One of a number of known piecewise curve fitting techniques may be used. Generally, the resulting ink trajectory is a set of curve-fitting functions fk(A), where k=1, 2, . . . , and A is a set of parameters determined by the sampled contact points. In this embodiment, the processing structure14uses the piecewise curve-fitting technique described in the publication entitled “An Algorithm for Automatically Fitting Digitized Curves” authored by Philip J. Schneider, Graphics Gems, pages 612-626, Academic Press Professional, Inc. (1990), the entire content of which is incorporated herein by reference. The resulting ink trajectory is a set of connected Bezier curves, where each Bezier curve is a Bezier function determined by four control points calculated from the sampled contact points.

At step104, 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).FIG. 6shows the curve-fitted and normalized ink trajectory120(the curve without dots) overlaid on the ink trajectory before curve-fitting122(the curve with dots).

Turning back toFIG. 4, at step106following curve-fitting, the shape of the selected virtual pointer tip is applied to each sampled contact point of the normalized ink trajectory to form an ink envelope. For any three successive sampled contact points of the normalized ink trajectory, an outer envelope and an inner envelope are defined. Referring toFIG. 7, three successive sampled contact points T1, T2and T3are shown. The line segment128between contact points T1and T2, and the line segment130between contact points T2and T3form a first angle132greater than π, and a second angle134smaller than π. The envelope136that is within the range of the first angle132is defined as the outer envelope, and the envelope138that is within the range of the second angle134is defined as the inner envelope.

FIGS. 8A and 8Billustrate generation of the raw points of the ink envelope. As mentioned above, in this example the pointer tip has an elliptical shape. InFIG. 8A, reference numerals140,140A,140B and140C represent the sampled contact points of the normalized ink trajectory. A pointer tip instance142,142A and142B is applied to and centered at each sampled point contact140. Then, the processing structure14calculates two line segments146for each two adjacent sampled contact points140, which are tangential to the pointer tip instances at tangent points148. In the cases where a fixed-size pointer tip is used, the line segments146are also parallel to the line segment144between the two adjacent sampled contact points140. In other cases where the pointer tip may vary in size, shape, and/or angle, the line segments146may not be parallel to the line segment144. For the two adjacent sampled contact points140A and140B, the processing structure14calculates an upper line segment146A that is parallel to the line segment144A between the adjacent sampled contact points140A and140B, and is tangential to the pointer tip instances142A and142B, respectively, at tangent points148A and148B. The processing structure14also calculates a lower line segment146B that is parallel to the line segment144A between the adjacent sampled contact points140A and140B, and is tangential to the pointer tip instances142A and142B, respectively, at tangent points148C and148D. The tangent points, e.g., points148A,148B,148C and148D, are recorded as raw envelope points.

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 points140A,140B and140C, the raw outer envelope points comprise the tangent points148A and148B, the points150A and150B of the pointer tip instance142B, the tangent point148E, and the intersection point152B of the tangential line segments146C and146D.

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 inFIG. 8A, where the tangential line segment146B in the inner envelope area intersects with the tangential line segment146C in the inner envelope area. In this case, the intersection point152A, as well as the tangent points148D and148F are recorded as raw inner envelope points. Note that the tangent points148C and148G are dropped.

The second case is illustrated inFIG. 8B, where at least a portion of the tangential line segments160and162, respectively, is within the range of the first angle164, which is smaller than π. In this case, although the line segments160and162form the raw inner envelope, as illustrated inFIG. 8B, the line segments160and162do not intersect. In this case, the tangent point166A, which is the end point of the tangential line segment160that is closest to the tangent line segment162, and the tangential point166B, which is the end point of the tangent line segment162that is closest to the tangent line segment160, are defined as break-points.

Turning back toFIG. 8A, for each end point of the normalized ink trajectory (e.g., the end point140A), the outer part of the corresponding pointer tip (e.g.,142A) is also sampled to obtain the raw envelope points for closing the end of the ink trajectory (e.g., points150C,150D and150E).

The generated raw envelope points are indexed. As shown inFIG. 8C, each raw envelope point is associated with two index numbers: a natural index number, denoted as Pn, where n=0, 1, 2, . . . , and the index number of the nearest sampled contact point of the normalized ink trajectory. For example, inFIG. 8C, there are five raw envelope points P3, P4, P5, P6and P37near the sampled contact point C1of the ink trajectory. Therefore, these raw envelope points are also associated with the index of the sampled contact point C1, and are denoted as P3/1, P4/1, P5/1, P6/1and P37/1, where the number before “/” represents the natural index and the number after “/” represents the index of the nearest sampled contact point of the normalized ink trajectory. Note that the natural index of the raw envelope points may be in any convenient order, and the order shown inFIG. 8Cis for illustrative purposes only.

Referring again toFIG. 4, following raw envelope point generation at step106, the obtained raw envelope points are curve-fitted at step108to generate a smoothed ink envelope and hence a resultant smooth outline of the calligraphic ink object. Each set of successive raw outer envelope points are piecewise curve-fitted. Each set of successive raw inner envelope points between two break-points are also piecewise curve-fitted. Each pair of successive break-points are connected by a straight line. Thus, the smoothed outline of the calligraphic ink object is described by a set of curve functions, each determined by a set of calculated parameters, as well as the straight line functions connecting successive break-points. In this embodiment, the smoothed outline of the calligraphic ink object is described by a set of Bezier functions, each determined by four control points, as well as the straight line functions connecting successive break-points.

As an example,FIG. 8Cshows the control points of seven resulting fitting curves E1, E2, . . . , E7. In this figure, the control points of the resulting curves are moved outward for the purpose of clear illustration. The actual resulting curves would be at the proximity of the raw envelope points. Also for the purpose of clear illustration, the fitting curves are not drawn inFIG. 8C, but, instead, the control points are connected by dashed lines.

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, inFIG. 8C, the fitting curve E1fits to the raw envelope points P0to P6, and the fitting curve E3fits to the raw envelope points P6to P12. With this information, the sampled contact points of the normalized ink trajectory returned by the curve-fitting technique are indexed.

FIG. 8Dshows the steps performed during indexing of the sampled contact points of the normalized ink trajectory. First, a counter i is initialized to one (1) (step180) and the first fitting curve E1is selected. At step182, each raw envelope point to which the fitting curve E1fits, is checked to obtain the index of the associated sampled contact point of the normalized ink trajectory. For example, inFIG. 8C, raw envelope points P0to P6to which the fitting curve E1fits are checked. Seen from the second part of their denotation (i.e., the number after the slash “/”), raw envelope points P0, P1and P2are associated with sampled contact point C0. The sampled contact point C0is assigned an index 1 to indicate that the sampled contact point C0is associated with fitting curve E1and the assigned index is added to an index matrix.

Thereafter, the counter i is increased by 1 (step184), and a check is made to determine whether all fitting curves have been processed (step186). If not, the process reverts to step182to check the next fitting curve, in the case fitting curve E2. Otherwise, the generated index matrix is returned (step188).

At step182for fitting curve E2, raw envelope points P39and P38fit to the fitting curve E2and are associated with the sampled contact point C0. As a result, the sampled contact point C0is also assigned the index 2 to indicate that the sampled contact point C0is associated with the fitting curve E2and 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 toFIG. 8C, sampled contact point C1is assigned indices 1 and 2 and optionally index 3 (because raw envelope point P6fits to both fitting curve E1and fitting curve E3). Sampled contact point C2is assigned indices 3 and 2 and optionally index 4. When a raw envelope point fits to multiple fitting curves, the raw envelope point can be assigned to a selected fitting curve or to both fitting curves.

Once the index matrix has been completed at step188, 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 structure14using a rendering program. Then, the calligraphic ink object may be drawn on the touch surface24as a vectorized image so that it can be arbitrarily zoomed while maintaining the smoothness of its outline.FIG. 8Eshows an exemplary calligraphic ink object generated by the processing structure14using the above described method.

FIG. 9Ashows the steps performed by the processing structure14during an alternative calligraphic ink object generating technique. This technique is suitable for generating calligraphic ink objects substantially in real-time and employs multi-thread/multi-core technology to calculate the smoothed ink outline segments of the calligraphic ink objects in parallel.

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 structure14within 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 step200, the processing structure14receives the sampled contact points of a segment of the input ink object. At step202, 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 toFIG. 4but with a slight modification. In particular, during this method if the ink object segment is the first segment of the input ink object, the outer part of the pointer tip instance centered at the first sampled contact point of the normalized ink trajectory is sampled to obtain raw envelope points for closing the first end of the calligraphic ink object. The envelope around the last sampled contact point of the calligraphic ink object segment is left open. If the ink object segment is not the first segment of the input ink object, then both ends of the envelope are left open.

FIG. 9Bshows two exemplary segments S1and S2of an input ink object. The raw envelope points are also marked inFIG. 9Bas dots. Because calligraphic ink object segment S1is the first segment of the input calligraphic ink object, the outer part of the first pointer tip instance220is sampled to obtain the raw envelope points222for closing the calligraphic ink object segment outline. On the other hand, because calligraphic ink object segment S2is not the first segment of the input calligraphic ink object, both ends are left open.

Referring again toFIG. 9A, after sending the ink object segment to a background thread, the process checks at step204whether the user's writing is complete (e.g., by detecting whether a pen tool-up event occurs). If not, the process goes back to step200to collect another calligraphic ink object segment and send it to another background thread for processing. In this manner, calligraphic ink object outlines for different ink object segments are generated by different threads in parallel reducing the lag between the user writing the ink and written ink being displayed on the touch surface24.

At step204, 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 (step206). 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 (step208).FIG. 9Cshows such an exemplary calligraphic ink object, where each calligraphic ink object segment is contained within a respective rectangular box.

The method of erasing calligraphic ink objects employed by the processing structure14when a user moves an eraser across the touch surface24along 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 surface24using 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.

FIG. 10shows the steps performed by the processing structure14during erasing of a calligraphic ink object. At step220, the processing structure14initially finds the four points on the calligraphic ink object outline where the trace of the eraser intersects the calligraphic ink object. For example, inFIG. 11A, the trace of the eraser260intersects the outline of the calligraphic ink object262at points A, B, C and D.

At step222, the calligraphic ink object outline is split at intersection points A and B and at intersection points C and D. At step224, 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 (curve264inFIG. 11B). An additional fitting curve is also generated to fit the points B, D and the additional outline points therebetween (curve266inFIG. 11B). Then, the processing structure14closes the calligraphic ink object outline by connecting the outline to the additional fitting curves. For example, inFIG. 11C, the outline of the left part268of the calligraphic ink object is closed by connecting it to the curve264, and the outline of the right part270of the calligraphic ink object is closed by connecting it to the curve266.

At step230, 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 curves264and266, 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 inFIG. 11D. Optionally, at step232, the newly generated calligraphic ink object outline may be checked to see if all calligraphic ink object outline components of the calligraphic ink object are connected. If not, the calligraphic ink object can be split into separate calligraphic ink objects. The separate calligraphic ink objects may be automatically grouped together or may be separate. The decision to make them separate or automatically grouped may be based on the distance between the ends of the separate calligraphic ink objects. If the separate calligraphic ink objects are spaced by a distance greater than a threshold amount, then the calligraphic ink objects will be treated as separate ink objects; otherwise, they are automatically grouped.

Depending on the nature of the processing structure employed, this erasing method may be slow because step220typically 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 inFIG. 10. However, at step220, the fast erasing methodology does not directly determine the intersection points of the calligraphy ink object outline and the eraser trace. Instead, the fast erasing methodology first finds the intersection points of the normalized ink trajectory and the eraser trace. Referring toFIG. 12A, each sampled contact point of the normalized ink trajectory is associated with an index matrix, which is a pair of indices (x,y) in this figure, where x refers to the index of the fitting curve above the normalized ink trajectory, and y refers the index of the fitting curve below the normalized ink trajectory. These indices are obtained when the calligraphic ink object is generated as previously described.

The processing structure14first 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 inFIG. 12A, contact point C4. The processing structure14also searches the sampled contact points of the normalized ink trajectory to find a sampled contact point within the eraser trace and nearest to the right edge of the eraser trace, which is, in the case shown inFIG. 12A, contact point C5. In an alternative implementation, the actual intersection points of the normalized ink trajectory and the calligraphic ink object outline may be found (which are interpolated points between contact points C3and C4, and contact points C5and C6, respectively). The index of each actual intersection point may be copied from its nearest sampled contact point of the normalized ink trajectory.

After the intersection contact points C4and C5are found, their indices are checked to find the corresponding fitting curve on the calligraphic ink object outline. The indices of intersection contact point C4are (3,4), which correspond to fitting curve E3above and fitting curve E4below. Similarly, the indices of intersection contact point C5are (5,6), which correspond to fitting curve E5above and fitting curve E6below.

Then, for each identified fitting curve, a split point is calculated.FIG. 12Billustrates how the split point is calculated for the fitting curve E3(numeral304). InFIG. 12B, the four control points of the Bezier fitting curve304are marked as P1, P2, P3and P4, where P1and P4are the two end points. Line300represents the left edge of the eraser trace.

The processing structure14first calculates a line segment302between the two end control points P1and P4. Then, the intersection point P5of the line segments300and302is calculated. A split ratio t is calculated as:
t=|P1P5|/|P1P4|
where:

|P1P5| is the length of the line segment between control points P1and P5; and

|P1P4| is the length of the line segment between control points P1and P4.

The split point P6on the fitting curve304is then calculated such that the ratio of the length of the curve P1P6over that of the curve P1P6P4is 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:

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 curve304, but also generates a new fitting curve (Resulting LeftCurve) between control points P1and P6, and another fitting curve (ResultingRightCurve) between control points P6and 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.FIG. 12Cshows the new calligraphic ink object outline after splitting, where E3′, E4′, E5′ and E6′ are the new fitting curves generated by the BezierSplit function, which are kept for using as the modified outline fitting curves.

The next step of the fast erasing methodology is to generate additional outline points (corresponding to step224inFIG. 10). Referring toFIG. 12C, for the left part of the calligraphic ink object outline, a line segment between the two split points L1and L2is calculated. Along this line segment, a point L3is calculated such that |L1L3|=|L1L2|/4. Similarly, a point L4on the line segment L1L2is also calculated such that |L4L2|=|L1L2|/4. Then, a point L5is calculated such that the line segment L3L5generally perpendicularly extends from point L3towards the center of the eraser trace and has a length of |L1L3|. Similarly, a point L6is calculated such that the line segment L4L6generally perpendicularly extends from point L4towards the center of the eraser trace and has a length of |L4L2|. An additional fitting curve ELis obtained by using the points L1, L5, L6and L2as the control points to close the left part of the calligraphic ink object outline.

The above procedure generates two additional points so that these two points, together with the two end points L1and L2of 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 R5and R6are also calculated for the right side of the calligraphic ink object outline in a similar manner. An additional fitting curve ERis then obtained by using the points R1, R5, R6and R2as the control points to close the right part of the calligraphic ink object outline.

The rest of the fast erasing methodology is similar to steps230and232inFIG. 10. In this embodiment, each unconnected portion of the calligraphic ink object after erasing is copied to a new calligraphic ink object. In the example shown inFIGS. 12A to 12D, the calligraphic ink object becomes two unconnected parts after erasing. Therefore, each part is copied to a separate calligraphic ink object. The original calligraphic ink object is deleted after copying each unconnected portion of the calligraphic ink object to a new calligraphic ink object.FIG. 12Dshows the calligraphic ink object outlines (two ink objects) after erasing.

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 surface24captured by the coordinate input device12. In this case, each sampled contact point obtained at step80is 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.