Handwriting erasing and segmenting method

By generating handwriting paths and storing them in a doubly linked list, and combining intersection and difference operations, the problem of inaccurate handwriting erasure in whiteboard software is solved, enabling fast segmentation and erasure, and supporting subsequent handwriting operations.

CN121599996APending Publication Date: 2026-03-03SICHUAN CHANGHONG EDUCATION TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202511790384.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-12-01
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing whiteboard software cannot quickly and accurately erase and segment handwriting, especially it cannot accurately erase and segment handwriting that simulates chalk or pen writing.

Method used

By generating handwriting paths and storing them in a doubly linked list, and combining intersection and difference operations, precise erasure and segmentation of handwriting can be achieved.

Benefits of technology

It enables rapid segmentation and erasure of handwriting, supports dragging and scaling of handwriting, and improves operational efficiency.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599996A_ABST
    Figure CN121599996A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of whiteboard software handwriting storage modeling, and provides a handwriting erasing and segmenting method for solving the problem that an existing handwriting erasing and segmenting method is not perfect and accurate enough, which comprises the following steps of: dividing handwriting drawing into a mode of connecting a plurality of path graphs and a method of erasing based on 2D (two-dimensional) graph intersection calculation and difference set taking; any position of the handwriting can be accurately erased; meanwhile, the position of the path of the rest part of the erased handwriting in the linked list can be quickly positioned by adopting an adjacent calculation mode, the handwriting can be quickly segmented while being erased through the double linked list, and the segmented handwriting can be immediately dragged, zoomed and the like after being erased, so that the operation efficiency after the handwriting is erased is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of handwriting storage and modeling technology in whiteboard software, specifically a handwriting erasure and segmentation method. Background Technology

[0002] On traditional smart interactive screens, whiteboard software collects coordinate information from touch and mouse inputs to generate various handwriting patterns and displays the written content. Traditional whiteboard software either cannot quickly drag or scale the divided graphics individually, or it simply connects the sampled points to create a segmentation, failing to achieve precise erasing and segmentation.

[0003] For example, Chinese invention patent CN113610946A discloses a method for segmenting drawing handwriting using the eraser function. This method stores the stroke sampling points of each stroke in several original stroke arrays and uses a comparison between the erase area and each stroke sampling point in the array to determine if it falls within the area. This method uses stroke sampling points for segmentation and erasure. However, because the stroke sampling points lack handwriting width data, the strokes cannot have soft brush effects, lack width variation, and cannot erase handwriting with brushstrokes or nib effects. Furthermore, this method cannot perform partial erasure segmentation, such as erasing a portion of the width of a handwriting area without affecting its length. In contrast, actual whiteboard software handwriting drawing, to simulate chalk or soft brush writing, uses variations in writing pressure and speed to create handwriting that includes brushstrokes and nib effects. The limitations of this patent's sampling point method prevent it from accurately segmenting and erasing surface-based handwriting. Summary of the Invention

[0004] To address the shortcomings and lack of precision in existing handwriting erasure segmentation methods, this invention provides a handwriting erasure segmentation method.

[0005] The technical solution adopted by the present invention to solve the above problems is:

[0006] Handwriting erasure segmentation methods include:

[0007] Step 1: Generate the handwriting path;

[0008] Step 2: Store the several stroke paths generated during the stroke drawing process in a doubly linked list according to their order;

[0009] Step 3: During erasure, compare the erasure path with each path in the handwriting list in turn: If there is an intersection, remove the path that intersects with the erasure path from the list, and then determine whether the erasure path truncates the path; if so, add the remaining path to the previous or next path of the original path according to the adjacency principle, generating two independent path lists; if the erasure path does not truncate the path, add the remaining path back to the original path position in the list.

[0010] Step 4: Recursively execute the operations in Step 3 during the erasure process until the erasure is complete; generate the erased handwriting based on one or more handwriting linked lists obtained at the end.

[0011] Furthermore, step 1 specifically includes:

[0012] Collect the sequence of input points during the stroke drawing process;

[0013] The strokes are segmented based on the angle of the line connecting adjacent input points relative to the horizontal X-axis.

[0014] Obtain the centerline based on input points in different segments;

[0015] Calculate the stroke width at each center point by combining pen pressure and speed parameters;

[0016] Generate path coordinates based on stroke width;

[0017] The corresponding stroke path is formed by filling and drawing based on the path coordinates using a graphics API.

[0018] Furthermore, based on the input point and the drawing algorithm, the center line is generated using Bézier curve interpolation.

[0019] Furthermore, brushes include soft brushes, hard brushes, and flat brushes.

[0020] Furthermore, the method for determining truncation is as follows: calculate the intersection of the graphic formed by the path in the handwriting chain list and the graphic formed by the trajectory after the eraser is moved, and take the difference set. If the remaining graphic is no longer connected to the graphic of the previous or next path of the original path, then the path is truncated.

[0021] Furthermore, if the minimum distance between the graphs is less than a threshold, then the graphs are considered connected.

[0022] Furthermore, intersection calculations are performed based on the built-in 2D graphics libraries of GDI+, Skia, or Qt.

[0023] The advantages of this invention compared to existing technologies are as follows: by dividing the handwriting drawing into multiple connected path graphics, and erasing based on 2D graphic intersection calculation and difference set method, it can accurately erase any position of the handwriting; at the same time, by using the adjacency calculation method for the remaining path of the erased handwriting, its position in the linked list can be quickly located. Through the doubly linked list, the handwriting can be quickly segmented during erasure. After erasure, the segmented handwriting can be dragged, scaled and other operations can be performed immediately, which improves the efficiency of the operation after handwriting erasure. Attached Figure Description

[0024] Figure 1 Flowchart of the handwriting erasure segmentation method;

[0025] Figure 2 This is a schematic diagram of the handwriting path;

[0026] Figure 3 This is a diagram illustrating the continuous erasing process.

[0027] Figure 4 This is a diagram illustrating the connection of handwriting paths;

[0028] Figure 5 This is a diagram illustrating the truncation and erasure process.

[0029] Figure 6 This is a diagram illustrating the truncation of the handwriting path. Detailed Implementation

[0030] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the invention.

[0031] like Figure 1 As shown, the handwriting erasure segmentation method includes:

[0032] Step 1: Generate the handwriting path.

[0033] The user writes a continuous stroke on the whiteboard interface using a pen (from the start of the stroke to the end of the stroke). The whiteboard software collects the input point sequence P0, P1, P3, ..., Pn in real time, such as... Figure 2As shown, the white dots in the handwriting path are the coordinate points collected in real time by the whiteboard software. Then, the angle of the line connecting adjacent coordinate points relative to the horizontal X-axis is measured, and the angle difference of each line is calculated. Based on the angle difference, the coordinate points are divided into different sets (corresponding to different paths). In this embodiment, the division is based on whether the difference is greater than a threshold (such as 5°). The coordinate points in different sets are combined with the current pen (such as soft pen, hard pen, flat pen, etc.) algorithm, and a smooth center line is obtained by using Bézier curve interpolation. Then, the handwriting width at each center point is calculated by combining parameters such as pen pressure and speed. The path coordinate points are generated based on the handwriting width. The path coordinate points are filled and drawn using a graphics API (such as Canvas or OpenGL) to form the corresponding path graphics.

[0034] like Figure 2 As shown, a piece of handwriting is divided into 6 connected closed paths: Path A, Path B, Path C, Path D, Path E, and Path F. Each path consists of a series of path coordinate points. Figure 2 The black dots on each path are the path coordinates. The path coordinates are filled and drawn using graphics APIs (such as Canvas or OpenGL) to form the corresponding path graphics.

[0035] Step 2: Store the several stroke paths generated during the stroke drawing process in a doubly linked list according to their order.

[0036] All handwriting paths are organized into a doubly linked list in chronological order. Each path node contains: path geometry data, a pointer to the previous path (prev), and a pointer to the next path (next); the first path's prev = null, and the last path's next = null.

[0037] All adjacent paths remain spatially connected (i.e., the graphic boundaries meet, and the minimum distance is 0). For example... Figure 2 As shown, the complete handwriting is represented by a linked list. This means that during drawing, it is only necessary to traverse the linked list sequentially and render each path.

[0038] Step 3: During erasure, the erasure path is compared with each path in the handwriting list in turn: if there is an intersection, the path that intersects with the erasure path is removed from the list, and then it is determined whether the erasure path truncates the path. If so, the remaining path is added to the previous or next path of the original path according to the adjacency principle, generating two independent path lists; if the erasure path does not truncate the path, the remaining path is added back to the atomic path position of the list.

[0039] When a user drags the eraser across the screen, the system records the path and generates an erasure path graphic (usually a circular or rectangular sweep area). Then, iterate through each path in the doubly linked list of handwriting and perform the following operations:

[0040] Determine if the erase path graphic intersects with the current handwriting path graphic (this can be calculated using GDI+, Skia, or Qt's built-in 2D graphics library); if there is no intersection, skip it; if there is an intersection, perform a difference operation on the handwriting path to obtain the remaining graphic after erasing. For example... Figure 3 , Figure 5 If Path B intersects with the erasure path, then Path B is removed from the linked list, and the original linked list becomes two independent linked lists. , .

[0041] For paths that intersect, calculate whether the erased path is connected to the adjacent (prev and next) paths. The connection criterion is: if the minimum Euclidean distance between the boundaries of the two graphic paths is less than or equal to the tolerance threshold (e.g., 0.1 pixels), it is considered connected.

[0042] If the erased path remains connected to adjacent paths of the original path, it means the path was not truncated. In this case, the remaining path (the erased path) replaces the original path's position in the linked list. (See reference) Figure 4 Path G is the path after Path B is erased. Path G remains connected to the prev path Path A and the next path Path C of the original path Path B. At this point, we only need to add Path G back to the original position of Path B in the linked list to reconnect the broken linked list. .

[0043] If the erased path is no longer connected to any adjacent path of the original path, it means the path has been truncated. The remaining path is then added to the linked list containing either the original path's `prev` or `next` path, according to the adjacency principle. Specifically, if the erased path is connected to the original path's `prev` path, it is added to the end of the linked list containing the original path's `prev` path; if the erased path is connected to the original path's `next` path, it is added to the head of the linked list containing the original path's `next` path. (See reference) Figure 6 Path H and Path I are the remaining paths after erasure. Path H is connected to Path A, the prev path of the original path Path B. Path H is no longer connected to Path C, the next path of Path B, because the minimum distance between Path H and Path B is greater than a threshold. Path H is then added to the end of the linked list Path A to form a new linked list. Similarly, Path I is added to the head of linked list Path C, forming a new linked list. The erasure and segmentation were completed.

[0044] Step 4: Recursively execute the operations in Step 3 during the erasure process until the erasure is complete; generate the erased handwriting based on one or more handwriting linked lists obtained at the end.

[0045] During the erasure process, step 3 is executed recursively until the erasure path is compared with all handwriting paths. This results in one or more complete doubly linked lists, each representing a segmented, independent handwriting object. The whiteboard software can immediately perform independent operations on these objects (such as dragging, scaling, and deleting), significantly improving interaction efficiency in teaching scenarios.

Claims

1. A method for segmenting handwriting erasure, characterized in that, include: Step 1: Generate the handwriting path; Step 2: Store the several stroke paths generated during the stroke drawing process in a doubly linked list according to their order; Step 3: During erasure, compare the erasure path with each path in the handwriting list in turn: if there is an intersection, remove the path in the list that intersects with the erasure path from the list, and then determine whether the erasure path truncates the path. If so, the remaining paths are added to the previous or next path of the original path according to the adjacency principle, generating two independent path linked lists. If the erase path is not truncated, the remaining path is added back to the original path position in the linked list. Step 4: Recursively execute the operations in Step 3 during the erasure process until the erasure is complete; generate the erased handwriting based on one or more handwriting linked lists obtained at the end.

2. The handwriting erasure and segmentation method according to claim 1, characterized in that, Step 1 is as follows: Collect the sequence of input points during the stroke drawing process; The strokes are segmented based on the angle of the line connecting adjacent input points relative to the horizontal X-axis. Obtain the centerline based on input points in different segments; Calculate the stroke width at each center point by combining pen pressure and speed parameters; Generate path coordinates based on stroke width; The corresponding handwriting path is formed by filling and drawing based on the path coordinates using a graphics API.

3. The handwriting erasure and segmentation method according to claim 2, characterized in that, The center line is generated by combining input points with a drawing algorithm and using Bézier curve interpolation.

4. The handwriting erasure and segmentation method according to claim 3, characterized in that, Paintbrushes include soft brushes, hard brushes, and flat brushes.

5. The handwriting erasure and segmentation method according to claim 1, characterized in that, The method for determining truncation is as follows: calculate the intersection of the graphic formed by the path in the handwriting chain list and the graphic formed by the trajectory after the eraser is moved, and take the difference. If the remaining graphic is no longer connected to the graphic of the previous or next path of the original path, then the path is truncated.

6. The handwriting erasure and segmentation method according to claim 5, characterized in that, If the minimum distance between the graphs is less than the threshold, then the graphs are connected.

7. The handwriting erasure and segmentation method according to claim 5, characterized in that, Intersection calculations are performed using the built-in 2D graphics libraries of GDI+, Skia, or Qt.

Citation Information

Patent Citations

  • Method for segmenting drawing handwriting by utilizing eraser function

    CN113610946A