A method, apparatus, electronic device, and storage medium for displaying hand-drawn tables.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-02-12
- Publication Date
- 2026-08-14
AI Technical Summary
但是,用户在触控平板中绘制手写表格时,不管是通过软件插入固定表格的方法,还是自动识别表格结构再转换成固定表格的方法,得到的效果与用户真实手绘的效果都有比较大的差异,无法体现用户的手绘风格
Smart Images

Figure CN122569864A_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of computers, and more specifically, to a method, apparatus, electronic device, and storage medium for displaying hand-drawn tables in the field of computers. Background Technology
[0002] Currently, drawing handwritten tables on touch tablets is a common way to display content, whether in teaching or meeting settings. However, when users draw handwritten tables on touch tablets, whether by inserting a fixed table through software or by automatically recognizing the table structure and converting it into a fixed table, the resulting effect differs significantly from the user's actual hand-drawn style and fails to reflect the user's hand-drawn style. Summary of the Invention
[0003] This application provides a method, apparatus, electronic device, and storage medium for displaying hand-drawn tables, which can display tables that retain the user's hand-drawn style on an electronic device.
[0004] Firstly, a method for displaying a hand-drawn table is provided. This method includes: acquiring a user-drawn hand-drawn table and converting it into a table image; determining multiple table lines in the table image and identifying the corresponding table line for each cell; smoothing the corresponding table line to obtain an enhanced table line, and replacing the corresponding table line in the table image with the enhanced table line; determining the text trajectory within each text area of the table image and determining the current tilt angle of each text area; wherein the current tilt angle is the tilt angle of the text area relative to a baseline; determining a target tilt angle corresponding to each text area based on the cell to which each text area belongs, and adjusting the current tilt angle of each text area to the target tilt angle; identifying the text content in each text area of the table image, enhancing the text content, and obtaining an adjusted and enhanced hand-drawn table; and displaying the adjusted and enhanced hand-drawn table on an electronic device.
[0005] The above technical solution acquires a user-drawn hand-drawn table and converts it into a table image, preserving the personalized elements of the user-drawn table in the converted image. By identifying multiple table lines in the table image and clarifying the table lines to which each cell belongs, smoothing is applied to smooth out any irregular or rough lines that might exist in the original hand-drawn table, improving the overall visual presentation. Determining the current tilt angle of each text area and adjusting it to the target tilt angle solves problems such as text tilting and uneven placement that may occur during the hand-drawing process, making the text layout in the table more reasonable and standardized. Identifying the text content in the text areas allows for targeted beautification of the text content, making the text within the table more standardized. Finally, displaying the adjusted and beautified hand-drawn table on an electronic device presents a table that retains the user's hand-drawn style, enhancing the user experience.
[0006] In conjunction with the first aspect, in some implementations of the first aspect, after converting the hand-drawn table into a table image, the method further includes: performing content segmentation on the table image to obtain cell segmentation results and text segmentation results; wherein, the cell segmentation results contain coordinate data of each cell region in the table image; and the text segmentation results contain coordinate data of each text region in the table image.
[0007] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, determining multiple table lines in the table image includes: determining multiple table lines in the table image based on the cell segmentation result and the trajectory data corresponding to the hand-drawn table.
[0008] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, determining the text trajectory within each text region of the table image includes: mapping the text segmentation result and the trajectory data corresponding to the hand-drawn table to obtain the text trajectory within each text region.
[0009] The above technical solution segments the table image to obtain cell segmentation and text segmentation results, facilitating subsequent targeted processing of the content in cell and text regions. Based on the cell segmentation results, the specific location of each cell region within the table image can be determined. Furthermore, by combining this with the original trajectory data of the hand-drawn table, the trajectory portions belonging to table lines can be more accurately identified, improving the accuracy of table line recognition. Additionally, the text segmentation results can be mapped to the trajectory data corresponding to the hand-drawn table, allowing the extraction of text trajectories within each text region from the hand-drawn table's trajectory, improving the accuracy of text trajectory recognition and better preserving the stylistic characteristics of the user's handwritten text.
[0010] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, based on the cell segmentation result and the trajectory data corresponding to the hand-drawn table, multiple table lines in the table image are determined, including: mapping the cell segmentation result and the trajectory data corresponding to the hand-drawn table to obtain multiple trajectories corresponding to the cells in the table image; determining the trajectory category corresponding to each of the multiple trajectories; removing the trajectories whose trajectory category is text category and drawing category from the multiple trajectories to obtain the remaining trajectories, and determining the remaining trajectories as multiple table lines in the table image; wherein, the drawing category trajectory is the trajectory inside the cell that exists around the text category trajectory.
[0011] The above technical solution, by mapping the cell segmentation results to the trajectory data corresponding to the hand-drawn table, can more accurately determine which cell each trajectory belongs to, achieving refined trajectory attribution. By identifying the trajectory category corresponding to each of the multiple trajectories, the trajectories can be classified, facilitating subsequent processing. By removing trajectories categorized as text or drawing, trajectories belonging to table lines can be accurately filtered from the multiple trajectories corresponding to a cell, and the remaining trajectories are identified as multiple table lines in the table image. Since text trajectories and drawing trajectories usually have different functions and forms of expression than table lines, removing them can effectively eliminate interference, avoid misidentifying text strokes, random drawings, etc., as table lines, thereby improving the accuracy of table line recognition.
[0012] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, determining the trajectory category corresponding to each trajectory among the multiple trajectories includes: obtaining the trajectory time sequence information corresponding to each trajectory; splicing each trajectory according to the trajectory time sequence information to obtain the spliced trajectory; and inputting the spliced trajectory into the trajectory classification prediction model to obtain the trajectory category corresponding to each trajectory.
[0013] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, determining the classifying table line belonging to each cell among the multiple table lines includes: performing inflection point detection on each table line among the multiple table lines to obtain the inflection point corresponding to each table line; segmenting each table line according to the inflection point corresponding to each table line to obtain the segmented table lines; determining the classifying line segment belonging to each cell based on the cell segmentation result and the segmented table lines; and splicing the classifying line segments of each cell to obtain the classifying table line of each cell in the table image.
[0014] The above technical solution detects inflection points on each table line, accurately identifying the locations where the table line's direction significantly changes—the inflection points. By segmenting the table lines according to their corresponding inflection points, complex table lines that may have multiple directional changes are broken down into relatively simple, unidirectional line segments, facilitating subsequent determination of the table line's classification. Based on the cell segmentation results and the segmented table lines, the classification of each cell's line segment is determined, clearly identifying which line segments constitute the boundary of each cell. By splicing the classification line segments of each cell, the classifying table line for each cell in the table image can be obtained, thus completely reconstructing the boundary shape of each cell. Through this process, each cell in the table image has a clear and complete classifying table line, making the overall table structure more standardized and uniform.
[0015] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, the target tilt angle corresponding to each text region is determined based on the cell to which each text region belongs, including: determining the tilt angle corresponding to the cell to which each text region belongs based on the cell segmentation result and the text segmentation result; wherein, the tilt angle corresponding to the cell is the tilt angle of the cell relative to the baseline; and determining the target tilt angle corresponding to each text region based on the tilt angle corresponding to the cell to which each text region belongs.
[0016] The above technical solution, by combining cell segmentation results and text segmentation results, can accurately determine the specific cell to which each text region belongs. Based on the tilt angle corresponding to the cell to which each text region belongs, the target tilt angle for each text region is determined, ensuring that the tilt state of the text region is consistent with the tilt state of the cell region. Visually, this makes the text appear more harmonious within the cell, avoiding the abruptness caused by different tilt angles between text and cells, and improving the overall aesthetics of the table.
[0017] In combination with the first aspect and the above implementation methods, in some implementation methods of the first aspect, after adjusting the current tilt angle of each text region to the target tilt angle, the method further includes: extracting the trajectory of the text category and the trajectory of the drawing category in each cell; determining the attribution relationship between the trajectory of the text category and the trajectory of the drawing category; and based on the attribution relationship, marking the trajectory of the text category in each cell using the trajectory corresponding to the drawing category.
[0018] In the aforementioned technical solution, the trajectory of the drawing category typically supplements, emphasizes, or explains the text content corresponding to the trajectory of the text category. By clarifying the attribution relationship between the trajectory of the text category and the trajectory of the drawing category, it is possible to determine which specific text content the trajectory of the drawing category targets, which helps to fully understand the information carried by the text within the cell and the user's additional intentions. Based on the attribution relationship, using the trajectory corresponding to the drawing category to mark the trajectory of the text category can make the key content and crucial information in the text more prominent, thus improving the efficiency of reading table content.
[0019] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, text content is beautified, including: determining the target text attribute corresponding to the text content, and determining the target beautification method corresponding to the target text attribute; beautifying the text content based on the target beautification method.
[0020] The aforementioned technical solution, by determining the target text attributes corresponding to the text content, enables detailed classification of diverse texts. Identifying and classifying text attributes allows for clear differentiation between texts with different attributes, avoiding the application of the same processing method to all texts and laying the foundation for subsequent targeted beautification methods. Determining corresponding target beautification methods for different target text attributes achieves personalized text beautification. Applying uniform operations to text content with the same text attributes according to the determined target beautification methods makes the text content with the same text attributes appear more neat and aesthetically pleasing.
[0021] Combining the first aspect and the above implementation methods, in some implementation methods of the first aspect, the hand-drawn table is converted into a table image, including: obtaining trajectory data when the user draws the hand-drawn table; obtaining multiple drawing trajectories in the hand-drawn table based on the trajectory data; obtaining the temporal information of each of the multiple drawing trajectories; and rendering the multiple drawing trajectories according to the temporal information of each of the multiple drawing trajectories to obtain the table image.
[0022] The above technical solution obtains the trajectory of the user drawing a hand-drawn table. Based on this trajectory data, multiple drawing trajectories in the hand-drawn table are obtained. According to the time sequence information, each drawing trajectory is rendered one by one in the order in which the user drew the table. The time sequence information of the drawing trajectory can be reflected in the table image, which can provide an accurate reference for the subsequent segmentation of table elements and effectively improve the accuracy of table element segmentation.
[0023] Secondly, a display device for a hand-drawn table is provided. The device includes: an acquisition module for acquiring a hand-drawn table drawn by a user and converting the hand-drawn table into a table image; a first beautification module for determining multiple table lines in the table image and determining the belonging table line of each cell among the multiple table lines; smoothing the belonging table line to obtain beautified table lines, and replacing the belonging table lines in the table image with the beautified table lines; an adjustment module for determining the text trajectory in each text area of the table image and determining the current tilt angle of each text area; determining the target tilt angle corresponding to each text area based on the cell to which each text area belongs, and adjusting the current tilt angle of each text area to the target tilt angle; wherein the current tilt angle is the tilt angle of the text area relative to a baseline; a second beautification module for recognizing the text content in each text area of the table image, beautifying the text content, and obtaining the adjusted and beautified hand-drawn table; and a display module for displaying the adjusted and beautified hand-drawn table on an electronic device.
[0024] In conjunction with the second aspect, in some implementations of the second aspect, the device further includes a segmentation module, which is specifically used to: perform content segmentation on the table image to obtain cell segmentation results and text segmentation results; wherein, the cell segmentation results contain coordinate data of each cell region in the table image; and the text segmentation results contain coordinate data of each text region in the table image.
[0025] Combining the second aspect and the above implementation methods, in some implementation methods of the second aspect, the first beautification module includes a table line determination unit, which is specifically used to: determine multiple table lines in the table image based on the cell segmentation result and the trajectory data corresponding to the hand-drawn table.
[0026] Combining the second aspect and the above implementation methods, in some implementation methods of the second aspect, the adjustment module includes a text trajectory determination unit, which is specifically used to: map the text segmentation result and the trajectory data corresponding to the hand-drawn table to obtain the text trajectory within each text region.
[0027] Combining the second aspect and the above implementation methods, in some implementation methods of the second aspect, the table line determination unit is specifically used to: map the cell segmentation result and the trajectory data corresponding to the hand-drawn table to obtain multiple trajectories corresponding to the cells in the table image; determine the trajectory category corresponding to each of the multiple trajectories; remove the trajectories whose trajectory category is text category and drawing category from the multiple trajectories to obtain the remaining trajectories, and determine the remaining trajectories as multiple table lines in the table image; wherein, the drawing category trajectory is the trajectory inside the cell that exists around the text category trajectory.
[0028] Combining the second aspect and the above implementation methods, in some implementation methods of the second aspect, the table line determination unit includes a trajectory category determination subunit, which is specifically used to: obtain the trajectory time sequence information corresponding to each trajectory; splice each trajectory according to the trajectory time sequence information to obtain the spliced trajectory; and input the spliced trajectory into the trajectory classification prediction model to obtain the trajectory category corresponding to each trajectory.
[0029] In conjunction with the second aspect and the above implementation methods, in some implementation methods of the second aspect, the first beautification module includes a classifying table line determination unit. This classifying table line determination unit is specifically used for: detecting inflection points of each of the multiple table lines to obtain the inflection point corresponding to each table line; dividing each table line according to the inflection point corresponding to each table line to obtain the divided table line; determining the classifying line segment belonging to each cell based on the cell segmentation result and the divided table line; and splicing the classifying line segments of each cell to obtain the classifying table line of each cell in the table image.
[0030] In conjunction with the second aspect and the above implementation methods, in some implementation methods of the second aspect, the adjustment unit includes an angle determination unit, which is specifically used to: determine the tilt angle corresponding to the cell to which each text region belongs based on the cell segmentation result and the text segmentation result; wherein, the tilt angle corresponding to the cell is the tilt angle of the cell relative to the baseline; and determine the target tilt angle corresponding to each text region based on the tilt angle corresponding to the cell to which each text region belongs.
[0031] In conjunction with the second aspect and the above implementation methods, in some implementation methods of the second aspect, the device further includes a marking module, which is specifically used to: extract the trajectory of the text category and the trajectory of the drawing category in each cell; determine the attribution relationship between the trajectory of the text category and the trajectory of the drawing category; and, based on the attribution relationship, mark the trajectory of the text category in each cell using the trajectory corresponding to the drawing category.
[0032] In combination with the second aspect and the above implementation methods, in some implementation methods of the second aspect, the second beautification module is specifically used to: determine the target text attribute corresponding to the text content, and determine the target beautification method corresponding to the target text attribute; and beautify the text content based on the target beautification method.
[0033] Combining the second aspect and the above implementation methods, in some implementation methods of the second aspect, the acquisition module is specifically used to: acquire the trajectory data when the user draws the hand-drawn table; based on the trajectory data, obtain multiple drawing trajectories in the hand-drawn table; acquire the temporal information of each of the multiple drawing trajectories; and render the multiple drawing trajectories according to the temporal information of each of the multiple drawing trajectories to obtain the table image.
[0034] Thirdly, an electronic device is provided, including a memory and a processor. The memory is used to store executable program code, and the processor is used to call and run the executable program code from the memory, causing the electronic device to perform the hand-drawn table display method of the first aspect and any possible implementation thereof.
[0035] Fourthly, a computer program product is provided, comprising: computer program code, which, when run on a computer, causes the computer to execute the method for displaying a hand-drawn table as described in the first aspect and any possible implementation thereof.
[0036] Fifthly, a computer-readable storage medium is provided that stores computer program code, which, when executed on a computer, causes the computer to perform the method for displaying a hand-drawn table as described in the first aspect and any possible implementation thereof. Attached Figure Description
[0037] Figure 1 This is a schematic flowchart illustrating a method for displaying a hand-drawn table according to an embodiment of this application;
[0038] Figure 2 This is a schematic diagram of a rendered hand-drawn table image provided in an embodiment of this application;
[0039] Figure 3 This is a schematic diagram of a segmentation model containing two branches provided in an embodiment of this application;
[0040] Figure 4 This is a schematic diagram of a spliced trajectory provided in an embodiment of this application;
[0041] Figure 5 This is a schematic diagram of a segmented table line provided in an embodiment of this application;
[0042] Figure 6 This is a schematic diagram illustrating how to determine the tilt angle of a text region according to an embodiment of this application;
[0043] Figure 7 This is a schematic diagram of a hand-drawn table and a preliminary beautified table obtained based on the hand-drawn table, provided in an embodiment of this application;
[0044] Figure 8 This is a schematic diagram illustrating a text enhancement process provided in an embodiment of this application;
[0045] Figure 9 This is a schematic diagram of a hand-drawn table and a final beautified table obtained based on a preliminary beautified table, provided in an embodiment of this application.
[0046] Figure 10 This is a schematic diagram of the structure of a hand-drawn table display device provided in an embodiment of this application;
[0047] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application. Detailed Implementation
[0048] The technical solutions in this application will be clearly and thoroughly described below with reference to the accompanying drawings. In the description of the embodiments of this application, unless otherwise stated, " / " means "or," for example, A / B can mean A or B. "And / or" in the text is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, and B existing alone. Furthermore, in the description of the embodiments of this application, "multiple" refers to two or more than two.
[0049] Hereinafter, the terms "first" and "second" are used for descriptive purposes only and should not be construed as implying or suggesting relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
[0050] Currently, drawing handwritten tables on touch tablets is a common way to display content, whether in teaching or meeting settings. However, when users draw handwritten tables on touch tablets, whether by inserting a fixed table through software or by automatically recognizing the table structure and converting it into a fixed table, the resulting effect differs significantly from the user's actual hand-drawn style and fails to reflect the user's hand-drawn style.
[0051] Specifically, many touch tablet apps currently offer the ability to directly insert tables, allowing users to set parameters such as the number of rows and columns to quickly generate a standardized table. However, these tables are often standardized and rigid, generated according to software templates, lacking the unique strokes, line variations, and free-flowing style of hand-drawn tables. They are visually and stylistically distinct from tables hand-drawn by the user.
[0052] Some touchscreen tablet software intelligently recognizes user-drawn lines and outlines, converting them into fixed, regular tables. However, during this conversion, the original hand-drawn elements, which had personal characteristics, are basically standardized. The converted tables become very neat and mechanical, losing the unique style shown by the user when drawing. For example, the variations in stroke thickness and the not-so-straight but rhythmic lines that might have existed when drawing are no longer present.
[0053] To address the aforementioned technical problems, this application provides a method for displaying hand-drawn tables. The subject of this method can be an electronic device, specifically a mobile phone, tablet computer, laptop computer, ultra-mobile personal computer (UMPC), etc. This application does not limit the specific type of electronic device.
[0054] This application embodiment directly converts user-drawn hand-drawn tables into table images, preserving the personalized elements of the user-drawn tables in the converted images. Furthermore, after clearly defining the table lines belonging to each cell in the table image, smoothing is applied to improve the overall visual presentation of the table. The current tilt angle of each text area in the table image can also be adjusted to a target tilt angle, making the text layout within the table more reasonable and standardized. Identifying the text content within text areas allows for targeted beautification of the text, making the text within the table more standardized. Finally, displaying the adjusted and beautified hand-drawn table on an electronic device presents a table that retains the user's hand-drawn style, enhancing the user experience.
[0055] Figure 1 This is a schematic flowchart illustrating a method for displaying a hand-drawn table according to an embodiment of this application.
[0056] For example, such as Figure 1 As shown, the method 100 includes:
[0057] S101: Obtain the hand-drawn table created by the user and convert it into a table image.
[0058] S102, determine multiple table lines in the table image, and determine the table line belonging to each cell among the multiple table lines.
[0059] S103, smooth the assigned table lines to obtain beautified table lines, and replace the assigned table lines in the table image with beautified table lines.
[0060] S104, determine the text trajectory within each text region in the table image, and determine the current tilt angle of each text region.
[0061] The current tilt angle mentioned above is the tilt angle of the text area relative to the baseline.
[0062] S105, based on the cell to which each text region belongs, determine the target tilt angle corresponding to each text region, and adjust the current tilt angle of each text region to the target tilt angle.
[0063] S106, identify the text content in each text area of the table image, beautify the text content, and obtain the hand-drawn table after adjustment and beautification.
[0064] S107 displays an adjusted and beautified hand-drawn table on an electronic device.
[0065] In this embodiment, by acquiring a user-drawn hand-drawn table and converting it into a table image, the personalized elements of the user-drawn table can be preserved in the converted image. By identifying multiple table lines in the table image and clarifying the table lines to which each cell belongs, smoothing is applied to smooth out any irregular or rough lines that might exist in the original hand-drawn table, improving the overall visual presentation. Determining the current tilt angle of each text area and adjusting it to the target tilt angle solves problems such as text tilting and unevenness that may occur during the hand-drawing process, making the text layout in the table more reasonable and standardized. Identifying the text content in the text areas allows for targeted beautification of the text content, making the text within the table more standardized. Finally, displaying the adjusted and beautified hand-drawn table on an electronic device presents a table that retains the user's hand-drawn style, enhancing the user experience.
[0066] The following is about Figure 1 The implementation methods of each step in the illustrated embodiment are explained in detail below:
[0067] Regarding S101 above, it is understood that the hand-drawn table mentioned above refers to a hand-drawn table created by the user on an electronic device such as a touchscreen tablet or mobile phone. Specifically, a hand-drawn table typically contains several rows or columns forming cells, which may contain text, numbers, symbols, and other content.
[0068] In some embodiments, a user draws a handwritten table on the tablet screen using the stylus provided with the touch tablet. The touch tablet can capture the content displayed on the screen in real time during the user's handwriting process, and recognize the table structure and handwriting data of the handwritten table, and then synthesize a table image in a standard format.
[0069] For example, the coordinate sequence recorded in the trajectory data of a user-drawn table can be used to draw lines according to the order of the coordinate points, forming a table image consistent with the handwriting process. The trajectory data of the hand-drawn table is typically a continuous coordinate sequence recorded by a handwriting input device (such as a stylus or electronic whiteboard) when the user draws the table. Each coordinate point (x, y) represents the position of the pen tip at a certain moment, and the sequence of multiple coordinate points constitutes the complete path of the handwriting during the user's table drawing process. For example, {{x 00 y 00 , ...x 0N y 0N}, {x 10 y 10 ,........x 1N y 1N}, ...} represents multiple coordinate sequences that may belong to the trajectories of different lines or text, where each subsequence {x} 00 y 00 , ...x 0N y 0N} corresponds to a continuous stroke path.
[0070] In some embodiments, after obtaining the trajectory data of the user drawing a hand-drawn table, multiple drawing trajectories can be rendered directly based on the trajectory data of the hand-drawn table to obtain a rendered image of the hand-drawn table.
[0071] It is understandable that the above-mentioned rendering of multiple drawing trajectories refers to converting the trajectory data of the handwritten table into a visual image representation.
[0072] For example, the image of the rendered hand-drawn table is as follows: Figure 2 As shown.
[0073] To more accurately segment the table elements in the table image, the temporal information of each trajectory in the hand-drawn table can be embedded in the generated table image, so that the order of each trajectory can be intuitively distinguished in the table image.
[0074] One possible implementation involves converting a hand-drawn table into a table image, including: acquiring trajectory data of the user drawing the hand-drawn table; obtaining multiple drawing trajectories in the hand-drawn table based on the trajectory data; acquiring the temporal information of each of the multiple drawing trajectories; and rendering the multiple drawing trajectories according to their respective temporal information to obtain the table image.
[0075] As can be understood, as mentioned earlier, the trajectory data described above is a continuous sequence of coordinates recorded by a handwriting input device (such as a stylus, electronic whiteboard, etc.) when the user draws a table. Rendering multiple drawing trajectories refers to converting the trajectory data of the handwritten table into a visual image representation.
[0076] Specifically, after acquiring the trajectory data of the user drawing the hand-drawn table, adjacent coordinate points within the same trajectory can be connected to form line segments, creating multiple drawing trajectories in the hand-drawn table. While collecting the trajectory data, a timestamp for each coordinate point can be recorded. During the formation of the drawing trajectories, these timestamps can be used to construct complete temporal information for each drawing trajectory, including the drawing order of each coordinate point and the time interval between adjacent coordinate points. Based on this temporal information, multiple trajectories are rendered to obtain the aforementioned table image.
[0077] The above technical solution obtains the trajectory of the user drawing a hand-drawn table. Based on this trajectory data, multiple drawing trajectories in the hand-drawn table are obtained. According to the time sequence information, each drawing trajectory is rendered one by one in the order in which the user drew the table. The time sequence information of the drawing trajectory can be reflected in the table image, which can provide an accurate reference for subsequent segmentation of table content and attribution of table trajectories, effectively improving the accuracy of table content segmentation and determination of table trajectory attribution.
[0078] Furthermore, after obtaining the table image corresponding to the above hand-drawn table, the table content can be detected and segmented based on the table image.
[0079] In one possible implementation, after converting the hand-drawn table into a table image, the method further includes: performing content segmentation on the table image to obtain cell segmentation results and text segmentation results; wherein the cell segmentation results contain coordinate data of each cell region in the table image; and the text segmentation results contain coordinate data of each text region in the table image.
[0080] It is understood that the above content segmentation refers to identifying and separating different elements or regions in a table image. In the above embodiment, the content identified and separated can specifically be each cell and each text region in the table image.
[0081] In some embodiments, the table image can be segmented based on a preset segmentation model to obtain cell segmentation results and text segmentation results.
[0082] For example, the aforementioned preset segmentation model can be a multi-task learning model, which can be built based on common text detection algorithms (such as PAN++). This model can be based on two tasks: one is segmenting cells in a table image, and the other is segmenting text in the table image.
[0083] The preset segmentation model can be as follows: Figure 3 As shown, this includes a cell splitting branch and a text splitting branch. The cell splitting branch outputs the cell splitting results, and the text splitting branch outputs the text splitting results.
[0084] The specific process of content segmentation of the table image described above can be as follows: the table image corresponding to the hand-drawn table is used as the input of the preset segmentation model, and the table image is preprocessed to obtain the preprocessed table image; wherein, the above preprocessing process includes steps such as image enhancement and noise reduction; then, the convolutional layer in the preset segmentation model is used to extract the features in the preprocessed table image, and the obtained features are respectively input to the cell segmentation branch and the text segmentation branch; finally, the cell segmentation result output by the cell segmentation branch and the text segmentation result output by the text segmentation branch are obtained.
[0085] Furthermore, the cell segmentation result above includes coordinate data for each cell region, which can also be understood as the coordinate data of the bounding box of each cell; the text segmentation result above includes coordinate data for each text region, which can also be understood as the coordinate data of the bounding box of the text block.
[0086] The above method segments the content of the table image to obtain cell segmentation results and text segmentation results, which facilitates subsequent targeted processing of the content of the cell area and the text area.
[0087] Regarding S102 above, it can be understood that the table lines refer to the lines that constitute the table boundaries, including horizontal and vertical lines, which can divide the table into different cells.
[0088] For example, image processing techniques (such as edge detection algorithms) can be used to identify table lines in a table image; machine learning models can also be used to predict the position of table lines in a table image.
[0089] Furthermore, after obtaining the coordinate data of the bounding box of each cell in the above table image, multiple table lines in the table image can be determined based on the coordinate data of the bounding box of each cell.
[0090] In one possible implementation, determining multiple table lines in the table image includes: determining multiple table lines in the table image based on the cell segmentation result and the trajectory data corresponding to the hand-drawn table.
[0091] As mentioned earlier, the cell segmentation results above include the coordinates of the bounding box of each cell. Based on these cell segmentation results, the specific location of each cell can be determined; for example, a rectangular area can be defined using the coordinates of the top-left and bottom-right corners.
[0092] The trajectory data corresponding to the hand-drawn table mentioned above refers to the actual movement trajectory of the user when drawing the table, specifically a continuous coordinate sequence. Based on the trajectory data corresponding to the hand-drawn table, the original drawing process of the table can be reconstructed.
[0093] For example, the specific process of determining multiple table lines in a table image based on cell segmentation results and trajectory data corresponding to the hand-drawn table can be as follows: Based on the cell segmentation results, the positions of the horizontal and vertical lines of the cells in the table image are initially determined. For example, the common boundary between two adjacent cells is likely a table line, and a set of candidate table lines can be obtained through the above method. Then, a preliminary table is constructed based on the set of candidate table lines. Each trajectory in the trajectory data is projected onto the nearest candidate table line in the constructed preliminary table, and the distance between the trajectory and the nearest candidate table line is calculated. If the distance is less than a preset threshold, the candidate table line can be determined as a table line in the table image. Through the above method, multiple table lines in the table image are determined sequentially.
[0094] Furthermore, in order to more accurately and quickly determine multiple table lines in a table image, we can first obtain multiple trajectories corresponding to the cells in the table image based on the cell segmentation results and the trajectory data corresponding to the hand-drawn table, and then determine the multiple table lines in the table image from the obtained multiple trajectories.
[0095] In one possible implementation, multiple table lines in a table image are determined based on the cell segmentation result and the trajectory data corresponding to the hand-drawn table. This includes: mapping the cell segmentation result and the trajectory data corresponding to the hand-drawn table to obtain multiple trajectories corresponding to the cells in the table image; determining the trajectory category corresponding to each of the multiple trajectories; removing trajectories whose category is text or drawing from the multiple trajectories to obtain the remaining trajectories; and determining the remaining trajectories as multiple table lines in the table image. The drawing category trajectory is the trajectory inside the cell that exists around the text category trajectory.
[0096] As can be understood, as mentioned above, based on the cell segmentation results, a rectangular area can be defined for each cell, which is the position of that cell in the table image.
[0097] For example, the process of mapping the cell segmentation results and the trajectory data corresponding to the hand-drawn table to obtain multiple trajectories corresponding to the cells in the table image can be as follows: Align the coordinate space corresponding to the cell segmentation results with the coordinate space corresponding to the trajectory data of the hand-drawn table, that is, ensure that the coordinates in the cell segmentation results and the coordinates corresponding to the trajectory data are based on the same coordinate system and the units of the coordinate values are also consistent; then, for the trajectory data in the table image, based on the coordinates of the trajectory points, determine whether each trajectory point is within the coordinate range of the rectangular area defined by the cell. Once it is determined that the trajectory point belongs to a certain cell, a mapping relationship between the trajectory point and the cell can be established; then, in the above manner, determine the cell to which each trajectory point in the trajectory data belongs, and establish a mapping relationship between each trajectory point and the cell to obtain a mapping relationship table containing multiple sets of mapping relationships; finally, traversing the established mapping relationship table, the set of trajectory points corresponding to each cell can be obtained. This set of trajectory points is the trajectory data corresponding to the cell. Since the trajectory data contains time sequence information, the trajectory points corresponding to the cells can be connected according to the time sequence information to obtain multiple trajectories corresponding to the cells.
[0098] In some embodiments, a trajectory classification prediction model can be pre-trained to classify and predict the category of the trajectory. The input of the model is the spliced trajectory obtained by splicing the above multiple trajectories in chronological order, and the output is the category corresponding to each of the multiple trajectories.
[0099] Table line trajectories typically possess relatively simple and regular characteristics, such as straight line shapes, specific orientations (primarily horizontal or vertical), and positional distribution closely related to cell boundaries. However, text and drawing trajectories exhibit far more complex and diverse characteristics. Text trajectories encompass various stroke shapes, different writing styles, and font variations, while drawing trajectories may be entirely random scribbles, with significant uncertainty in their shape, size, and distribution.
[0100] Therefore, when directly identifying table line trajectories, the complex features of text and drawing trajectories may interfere with the identification process, leading to a higher likelihood of misclassification. Thus, a trajectory classification prediction model that can identify text and drawing trajectories can be trained.
[0101] Furthermore, after obtaining the multiple trajectories corresponding to the cells, the category of each trajectory can be determined based on the trajectory classification prediction model trained above. Then, trajectories classified as text or drawing categories can be removed from the multiple trajectories, and the remaining trajectories are the multiple table lines in the table image.
[0102] It is understood that the above-mentioned text category trajectory refers to the stroke trajectory in the text, which can form a complete text; the above-mentioned drawing category trajectory refers to the trajectory inside the cell that exists around the text category trajectory, including but not limited to the circle category trajectory, the underline category trajectory, and the wavy line category trajectory.
[0103] The above method, by mapping the cell segmentation results to the trajectory data corresponding to the hand-drawn table, can more accurately determine which cell each trajectory belongs to, achieving refined trajectory attribution. By identifying the trajectory category corresponding to each of the multiple trajectories, the trajectories can be classified, facilitating subsequent processing. By removing trajectories categorized as text or drawing, trajectories belonging to the table lines can be accurately filtered from the multiple trajectories corresponding to each cell, and the remaining trajectories are identified as the multiple table lines in the table image. Since text and drawing trajectories usually have different functions and forms of expression than table lines, removing them can effectively eliminate interference, avoiding misidentification of text strokes, random drawings, etc., as table lines, thereby improving the accuracy of table line recognition.
[0104] In some embodiments, the trajectory classification prediction model described above can be trained as follows: Collect a large number of tabular data samples containing trajectories of different categories; manually label each collected trajectory to determine its category, such as text, circle, underline, or wavy line; then concatenate multiple trajectories according to their temporal order to obtain the concatenated trajectory; extract features from the concatenated trajectory to obtain a trajectory feature sequence; then convert the extracted trajectory feature sequence and corresponding category labels into a format suitable for model training, and divide the data into a training set, a validation set, and a test set; wherein the training set is used to train the model, the validation set is used to adjust the model parameters, and the test set is used to evaluate the final performance of the model; then determine a suitable deep learning model and optimization learning algorithm, and use the training set and optimization learning algorithm to iteratively train the deep learning model, continuously adjusting the model parameters during training to enhance the model's recognition ability; the validation set can also be used to evaluate the model's performance, and the model parameters can be adjusted based on the performance evaluation results; finally, evaluate the final performance of the model based on the test set, and determine that the trajectory classification prediction model training is complete when the accuracy of the model output after inputting the test set reaches a pre-set threshold.
[0105] Furthermore, the aforementioned trajectory classification prediction model can be stored in an electronic device. When determining the trajectory category of multiple trajectories corresponding to a cell, the trajectory classification prediction model can be directly obtained, and the trajectory category of each trajectory can be predicted based on the trajectory classification prediction model.
[0106] One possible implementation involves determining the trajectory category of each trajectory among multiple trajectories, including: obtaining the trajectory time sequence information corresponding to each trajectory; concatenating each trajectory according to the trajectory time sequence information to obtain the concatenated trajectory; and inputting the concatenated trajectory into a trajectory classification prediction model to obtain the trajectory category corresponding to each trajectory.
[0107] It is understandable that, since each of the multiple trajectories contains corresponding trajectory time sequence information, that is, the order information of the trajectory points in the time series, each trajectory can be spliced together according to the trajectory time sequence information to obtain the spliced trajectory.
[0108] For example, such as Figure 4 As shown, Figure 4 The numbers ①, ②, ③... in the text This refers to the temporal sequence corresponding to each trajectory; among them, the trajectory corresponding to label ① has the earliest temporal sequence; label The corresponding trajectory has the latest time sequence, meaning that as the label value increases, the trajectory's time sequence becomes later.
[0109] Furthermore, Figure 4Numbered ①, ②, ③... By splicing the data in chronological order, the spliced trajectory can be obtained, i.e. Figure 4 The trajectory of the "table" text style and the trajectory of the "wavy line" style below the "table" text.
[0110] The spliced trajectory is input into a pre-trained trajectory classification and prediction model, and the output is: trajectory number ① to... The corresponding trajectory is a text category trajectory; trajectory label The corresponding trajectory is a wavy line type trajectory, i.e. a graffiti type trajectory.
[0111] Furthermore, as mentioned above, trajectories categorized as text or drawing are removed from the multiple trajectories, and the remaining trajectories are the multiple table lines in the table image.
[0112] After identifying the multiple table lines in the table image, it is possible to determine which table line belongs to each cell.
[0113] In some embodiments, the distance between each table line and the boundary of each cell can be calculated, and a distance threshold can be set. When the distance between the table line and the boundary of a cell is less than or equal to the set distance threshold, it is preliminarily determined that the table line belongs to that cell.
[0114] Understandably, table lines are usually close to the cell boundaries. For example, for horizontal table lines, you can calculate the distance between the table line and the top and bottom boundaries of the cell; for vertical table lines, you can calculate the distance between the table line and the left and right boundaries of the cell.
[0115] For example, if the distance threshold is set to 3 pixels, when a horizontal table line is 2 pixels away from the upper boundary of the area defined by cell A, it means that the horizontal table line is the upper boundary of cell A.
[0116] In other embodiments, the position of the endpoints of the table lines can also be checked, and if the endpoints of the table lines fall on the boundary of a cell, then the table lines belong to that cell.
[0117] For example, if the coordinates of the lower endpoint of a vertical table line are exactly the same as the coordinates of the lower left corner of a cell's bounding area, then the vertical table line is the left boundary line of the cell.
[0118] In one possible scenario, a user might draw the horizontal and vertical table lines in one stroke. To easily determine the ownership of each table line, inflection point detection can be performed on each table line, and the table lines can be segmented based on the results of the inflection point detection, and then the ownership of each cell can be determined.
[0119] In one possible implementation, determining the class line belonging to each cell among multiple table lines includes: performing inflection point detection on each of the multiple table lines to obtain the inflection point corresponding to each table line; segmenting each table line according to the inflection point corresponding to each table line to obtain segmented table lines; determining the class line segment belonging to each cell based on the cell segmentation result and the segmented table lines; and splicing the class line segments belonging to each cell to obtain the class line belonging to each cell in the table image.
[0120] As can be understood, the aforementioned inflection point refers to a point in the table line where the curvature changes significantly, typically marking the transition from one line to another. In a table, inflection points usually appear at the corners of cells or at the intersections of table lines.
[0121] For example, inflection point detection for each table line can be performed based on a method of cumulative curvature.
[0122] Suppose a line in a table has a trajectory consisting of a series of points P1, P2, P3, ..., P n Composition. For trajectory point P i (2≤i≤n-1) can be used to construct a vector from the points on its trajectory before and after it. For example, vector For P i-1 Point to P i vectors, vectors For P i Point to P i+1 The vector.
[0123] Calculate vectors using the dot product formula. sum vector The angle θ between them. Assume... but in,
[0124] The angle θ calculated above can be used to estimate the trajectory point P. i The curvature at a point. For example, when θ is close to 0 degrees or 180 degrees, the smaller the curvature, the smoother the trajectory at that point; when θ is close to 90 degrees, the curvature is larger.
[0125] Starting from the starting point P1 of the trajectory of the table line, for each trajectory point P i (i>1), calculate from P1 to P i The cumulative curvature. Assume k i Let P be the trajectory point i The curvature at that point (calculated using the angle mentioned above), and the cumulative curvature K. i It is calculated using the following formula (1):
[0126]
[0127] For example, if for a certain table line, there are trajectory points P1, P2, P3, P4, and the curvature at P2 is k2 = 0.1 and the curvature at P3 is k3 = 0.2, then the cumulative curvature at P3 is K3 = k2 + k3 = 0.3.
[0128] Furthermore, a curvature threshold can be set to distinguish between points where curvature changes are normal and points where curvature changes are significant, i.e., inflection points as mentioned earlier. Suppose that testing reveals that when the cumulative change in curvature is greater than or equal to 0.5, a significant change in the direction of the table lines is likely to occur, i.e., an inflection point has appeared. In this case, the curvature threshold can be set to 0.5.
[0129] For example, if for a certain table line, the cumulative curvature of each trajectory point is calculated as K1 = 0 (starting point), K2 = 0.1, K3 = 0.3, K4 = 0.4, and K5 = 0.9, and the curvature threshold is 0.5, then at trajectory point P5, the cumulative curvature changes from 0.4 to 0.9, and the change is equal to the curvature threshold. Therefore, trajectory point P5 can be determined as an inflection point.
[0130] Furthermore, after determining the inflection point of each table line, the table line can be divided at the inflection point to obtain the divided table line, i.e., the line segment.
[0131] The method described above detects inflection points on each table line, accurately identifying locations where the line's direction changes significantly. Segmenting the table lines according to these inflection points breaks down complex lines with multiple directional changes into simpler, more directional segments, facilitating subsequent line assignment. Determining the line segment belonging to each cell based on the segmented lines clearly identifies the line segments that define each cell's boundary. By concatenating these line segments, the corresponding table line for each cell in the image is obtained, thus fully reconstructing the boundary shape of each cell. This process ensures that each cell in the table image has a clear and complete corresponding table line, resulting in a more standardized and uniform overall table structure.
[0132] As mentioned earlier, the cell segmentation results reflect the approximate position and range of each cell in the table image. Based on the cell segmentation results, the segmented table lines can be matched with each cell.
[0133] For example, if a line segment obtained after segmentation coincides with the boundary height of a cell in space, it can be preliminarily determined that the line segment belongs to that cell.
[0134] like Figure 5 As shown, based on the cell segmentation results, the defined area 1-10 corresponding to each cell can be initially determined, and the table lines are divided according to the detected inflection points to obtain multiple segmented line segments.
[0135] Since cells are separated by table lines, the shared table lines between adjacent cells (vertically or horizontally) can be used as boundaries. For example, the line between cell 1 and cell 5 can be defined as the lower boundary of cell 1, and this line can also be used as the upper boundary of cell 5. This process can be repeated to quickly determine the line segment to which each cell belongs.
[0136] Furthermore, for each cell, after determining all the belonging line segments, these segments can be spliced together to form the complete belonging table lines for each cell. This is equivalent to reconstructing the boundary of each cell.
[0137] Regarding S103 above, it is understandable that after determining the table line belonging to each cell, the table line belonging to the cell can be smoothed to obtain a smoothed and aesthetically pleasing table line.
[0138] For example, beautifying the table lines in a table image can be done automatically after the user has drawn the table, or it can be triggered by a functional control, such as a virtual or physical button.
[0139] In some embodiments, after determining the class line of each cell, the trajectory data corresponding to the class line can be obtained, and Bezier fitting can be performed on the trajectory of each class line to regenerate a continuous curve. Then, a smoothing strategy can be used to further smooth and beautify the curve.
[0140] Understandably, the aforementioned Bézier fitting refers to finding a Bézier curve that closely resembles the original trajectory but is smoother. Bézier curves inherently possess excellent smoothing properties, generating very natural curve shapes. The Bézier curve obtained through Bézier fitting can transform a potentially jagged original trajectory into a smooth curve.
[0141] For example, taking quadratic Bézier curve fitting as an example, the starting and ending points of the trajectory data corresponding to the lines in the above-mentioned assignment table are taken as the two endpoint control points of the Bézier curve, and then the intermediate control points are determined by a certain method. For example, the position of the intermediate control points can be estimated based on the shape characteristics of the original trajectory (such as the direction of curvature, the magnitude of curvature, etc.).
[0142] Then, using the parametric equation of the Bézier curve, B(t) = (1-t) 2 P0+2t(1-t)P1+t 2 P2 (where t∈[0,1], P0 is the starting control point, P1 is the intermediate control point, and P2 is the ending control point) is used to calculate a series of coordinate points within the range of t (e.g., t = 0, 0.1, 0.2, ..., 1). These coordinate points constitute the fitted Bézier curve. This curve approximates the original trajectory in a smooth way, reducing noise and unevenness in the original trajectory.
[0143] Furthermore, smoothing strategies such as filtering-based smoothing methods and spline difference smoothing methods can be used to further smooth and beautify the curves obtained from the above fitting.
[0144] For example, taking a filter-based smoothing method, you can first choose an appropriate filter window size, such as setting a window containing n neighboring points (n is usually an odd number, such as 3, 5, 7, etc.). This window will slide along the fitted Bézier curve.
[0145] As the window slides to a certain position, the coordinates of the points within the window (x and y coordinates are processed separately) are averaged. For example, for the x coordinate, the average of the x coordinates of all points within the window is calculated as the smoothed x coordinate value for that position. A similar operation is performed for the y coordinate. By sliding the window sequentially through the entire curve, the curve smoothed by moving average filtering can be obtained, which is the beautified table line mentioned earlier.
[0146] Furthermore, after obtaining the beautified table lines, the corresponding table line for each cell in the table image can be replaced with the beautified table lines.
[0147] In addition to enhancing the table lines of a table image, you can also enhance the text within the table image.
[0148] For example, similar to the previous example, beautifying the text in a table image can be done automatically after the user has drawn the table, or it can be triggered by a functional control, such as a virtual or physical button.
[0149] Regarding S104 above, it is understood that before beautifying the text, the text trajectory data of each text area in the table image can be determined first.
[0150] The aforementioned text trajectory data refers to the text-related portion of the trajectory data in the hand-drawn table. This text trajectory data records the movement path of the pen tip or input device when writing text in the table.
[0151] In one possible implementation, determining the text trajectory within each text region of the table image includes: mapping the text segmentation result to the trajectory data corresponding to the hand-drawn table to obtain the text trajectory within each text region.
[0152] As can be understood, as mentioned above, the text segmentation results include the coordinate data of each text region, which can also be understood as the coordinate data of the bounding box of the text block.
[0153] Similarly, based on the text segmentation results, a rectangular region (usually a parallelogram) can be defined for each text region. This rectangular region is the position of the text region in the table image.
[0154] For example, the process of mapping the text region segmentation result and the trajectory data corresponding to the hand-drawn table to obtain the text trajectory corresponding to the text region in the table image can be as follows: Align the coordinate space corresponding to the text region segmentation result with the coordinate space corresponding to the trajectory data corresponding to the hand-drawn table, that is, ensure that the coordinates in the text region segmentation result and the coordinates corresponding to the trajectory data are based on the same coordinate system and the coordinate value units are also consistent; then, for the trajectory data in the table image, based on the coordinates of the trajectory points, determine whether each trajectory point is within the coordinate range of a rectangular area defined by the text region. Once it is determined that the trajectory point belongs to a certain text region, a mapping relationship between the trajectory point and the text region can be established; then, in the above manner, determine the text region to which each trajectory point in the trajectory data belongs, and establish a mapping relationship between each trajectory point and the text region to obtain a mapping relationship table containing multiple sets of mapping relationships; finally, traversing the established mapping relationship table, the set of trajectory points corresponding to each text region can be obtained. This set of trajectory points is the text trajectory data corresponding to the text region. Since the text trajectory data contains temporal information, the text trajectory points corresponding to the text region can be connected according to the temporal information to obtain multiple text trajectories corresponding to the text region.
[0155] Furthermore, when beautifying the text area in a table image, the tilt angle of the text area can usually be adjusted to make the text area look more aesthetically pleasing.
[0156] Typically, the current tilt angle of each text region can be determined. This current tilt angle is the tilt angle of the text region relative to the baseline.
[0157] For example, the baseline mentioned above can be the x-axis of a coordinate system established based on the table image. For instance, a coordinate system can be established with the trajectory point at the bottom left corner of the table image as the origin, the horizontal direction to the right as the positive x-axis, and the vertical direction upward as the positive y-axis.
[0158] Furthermore, the angle between the diagonal of the text region and the positive x-axis of the established coordinate system can be calculated, and this angle can be determined as the current tilt angle of the text region.
[0159] For example, such as Figure 6 As shown, the angle between the diagonal of text region B and the x-axis of the established coordinate system is 30 degrees, so the current tilt angle of text region B can be determined to be 30 degrees.
[0160] It is understood that the angle between the upper or lower boundary line of text region B and the x-axis of the established coordinate system can also be determined as the current tilt angle of text region B. The aforementioned diagonal, upper boundary line, and lower boundary line can all be referred to as "text tilt lines". This application does not limit the method of determining the text tilt line.
[0161] Furthermore, after determining the current tilt angle of the text region, the target tilt angle of the text region can also be determined, that is, the final tilt angle to which the text region needs to be adjusted.
[0162] Regarding S105 above, it is understood that in a table image, cells typically provide a "container"-like framework for text. To make the text and cells more visually harmonious, the target tilt angle corresponding to the text area can be determined based on the cell to which the text area belongs.
[0163] In one possible implementation, the target tilt angle corresponding to each text region is determined based on the cell to which each text region belongs, including: determining the tilt angle corresponding to the cell to which each text region belongs based on the cell segmentation result and the text segmentation result; wherein the tilt angle corresponding to the cell is the tilt angle of the cell relative to the baseline; and determining the target tilt angle corresponding to each text region based on the tilt angle corresponding to the cell to which each text region belongs.
[0164] As can be understood, as mentioned above, the position and boundary information of each cell in the table image can be determined based on the cell segmentation results; the position and boundary information of each text region in the table image can be determined based on the text segmentation results.
[0165] By comparing the text segmentation results with the cell segmentation results, the cell to which each text region belongs can be determined. For example, based on the coordinates of the center trajectory point of the text region, it can be determined which cell the center trajectory point belongs to, and the cell to which the center trajectory point belongs is the cell to which the text region belongs.
[0166] Furthermore, similar to the previous example, we can determine the tilt angle of the cell corresponding to each text region, that is, the tilt angle of the cell relative to the baseline. Then, based on the tilt angle of the cell to which the text region belongs, we can determine the target tilt angle of the text region.
[0167] It is understandable that the aforementioned baseline is the x-axis of the coordinate system established based on the table image mentioned earlier.
[0168] In some embodiments, it can be determined whether the tilt angle corresponding to the cell to which the text area belongs is less than or equal to a preset angle. If the tilt angle corresponding to the cell to which the text area belongs is less than or equal to the preset angle, the tilt angle corresponding to the cell to which the text area belongs can be determined as the target tilt angle of the text area; if the tilt angle corresponding to the cell to which the text area belongs is greater than the preset angle, the tilt angle corresponding to the cell can be adjusted to the target angle (which is less than or equal to the preset angle) first, and then the tilt angle corresponding to the adjusted cell can be determined as the target tilt angle of the text area.
[0169] The preset angle can be set according to actual needs, for example, it can be set to 10 degrees.
[0170] For example, suppose the preset angle is 10 degrees, such as Figure 6 As shown, if the tilt angle of the cell to which the text region B belongs relative to the x-axis is determined to be 10 degrees, it can be determined that the tilt angle of the cell to which the text region belongs is equal to the preset angle, and thus the target tilt angle of the text region B can be determined to be 10 degrees.
[0171] If it is determined that the tilt angle of the cell to which text region B belongs relative to the x-axis is 30 degrees, it can be determined that the tilt angle of the cell to which text region B belongs is greater than the preset angle. Therefore, before adjusting the tilt angle of text region B, the tilt angle of the cell to which text region B belongs should be adjusted first, and then the adjusted tilt angle of the cell to which text region B belongs should be determined as the target tilt angle of text region B.
[0172] Specifically, you can first obtain the target angle of the cell to which text region B belongs, and then rotate the cell according to the target angle to adjust the tilt angle of the cell.
[0173] For example, if the target angle of the cell to which text region B belongs is a tilt angle of 0 degrees relative to the x-axis, then the tilt angle of the cell to which text region B belongs can be adjusted to a tilt angle of 0 degrees relative to the x-axis, and then the target tilt angle of text region B can be determined to be a tilt angle of 0 degrees relative to the x-axis.
[0174] Furthermore, after determining the current tilt angle of the text region and the target tilt angle corresponding to the text region, the current tilt angle of the text region can be adjusted to the target tilt angle.
[0175] In some embodiments, the angle difference between the current tilt angle and the target tilt angle of the text region can be calculated, and then for each text trajectory point within the text region, the coordinates of the trajectory point can be rotated and adjusted according to the angle difference.
[0176] For example, for each text trajectory point (x, y) within a text area, it needs to be rotated by an angle difference Δθ. A rotation matrix can be used to achieve this coordinate transformation. In a two-dimensional plane, the rotation matrix for a counter-clockwise rotation of angle Δθ around the origin is:
[0177]
[0178] Furthermore, the coordinate vectors of the text trajectory points can be multiplied by the rotation matrix to obtain the adjusted coordinates. This method can be used to operate on all trajectory points within the text area, thereby adjusting the tilt angle of the entire text area to the target tilt angle.
[0179] The method described above, by combining cell segmentation results with text segmentation results, can accurately determine the specific cell to which each text region belongs. Setting the tilt angle of the cell to which the text region belongs as the target tilt angle of the text region ensures that the tilt state of the text region is consistent with that of the cell region. Visually, this makes the text appear more harmonious within the cell, avoiding the abruptness caused by different tilt angles between the text and the cell, and improving the overall aesthetics of the table.
[0180] Since each cell may contain not only text category trajectories but also some drawing category trajectories (i.e., the circled category trajectory, underline category trajectory, and wavy line category trajectory mentioned above), in order to preserve the style of the user's hand-drawn table as much as possible, drawing trajectories can be left around the text category trajectories.
[0181] In one possible implementation, after adjusting the current tilt angle of each text region to the target tilt angle, the method further includes: extracting the trajectory of the text category and the trajectory of the drawing category in each cell; determining the attribution relationship between the trajectory of the text category and the trajectory of the drawing category; and based on the attribution relationship, marking the trajectory of the text category in each cell using the trajectory corresponding to the drawing category.
[0182] Understandably, since multiple trajectories corresponding to each cell have already been determined, and the trajectories of the text category and the drawing category among the multiple trajectories can be identified, the text category trajectories and the drawing category trajectories in each cell can be extracted.
[0183] Furthermore, the attribution relationship between the trajectory of the text category and the trajectory of the drawing category can be determined based on the trajectory coordinate data.
[0184] For example, the distance between the trajectory of the text category and the trajectory of the drawing category can be calculated based on trajectory coordinate data. If the trajectory of the drawing category and the trajectory of the text category are very close in space, for example, if their average distance is less than a certain threshold, then they may have a relationship of attribution. In particular, when the endpoints or part of the line segments of the trajectory of the drawing category and the trajectory of the text category are very close, it indicates that the trajectory of the drawing category may be related to the trajectory of the text category.
[0185] Furthermore, based on trajectory coordinate data, it can be determined whether the trajectory of a drawing category encloses the trajectory of a text category. If the trajectory of a drawing category forms a closed or nearly closed region, and the trajectory of a text category exists inside this closed or nearly closed region, it can be inferred that the trajectory of the drawing category may be an emphasis or annotation of the trajectory of the text category.
[0186] Furthermore, after clarifying the attribution relationship, within each cell, the trajectory of the text category can be marked using the trajectory of the drawing category.
[0187] For example, such as Figure 7 As shown, Figure 7 The image on the left is a user-drawn table. Figure 7 The right image in the image shows the preliminary beautified table obtained after the above table line enhancement and text area adjustment. Furthermore, within the cells of this preliminary beautified table, the text category trajectory is marked using the trajectory corresponding to the painted category trajectory. That is... Figure 7 In the right figure, the trajectory of the text category corresponding to "Productivity" is marked using the trajectory of the "Selected Category".
[0188] In some embodiments, not only can the trajectory of the drawing category be used to mark the trajectory of the text category, but the color, line thickness, saturation and other attributes of the trajectory of the drawing category can also be changed to more prominently highlight the key content corresponding to the trajectory of the text category.
[0189] The above method uses drawing categories to supplement, emphasize, or explain the text content corresponding to the text category's trajectory. By clarifying the relationship between the text category's trajectory and the drawing category's trajectory, it's possible to determine which specific text content the drawing category's trajectory targets. This helps in fully understanding the information carried by the text within the cell and the user's additional intentions. Based on this relationship, marking the text category's trajectory with the drawing category's trajectory makes the key content and crucial information in the text more prominent, thus improving the efficiency of reading table content.
[0190] Furthermore, after beautifying the table lines and text areas of the hand-drawn table, you can also beautify the text content within the text areas.
[0191] Regarding S106 above, it is understandable that after the initial beautification of the hand-drawn table is completed, the text content in each text area can be identified in the table image, and then the text content can be labeled according to attributes, and a unified beautification method can be adopted for text content with the same attribute label.
[0192] For example, character recognition algorithms can be used to recognize characters in each text region to obtain the recognized text content.
[0193] Furthermore, after identifying the text content in each text region, the corresponding text attributes can be determined, and the text content can be beautified based on the text attributes.
[0194] One possible implementation involves beautifying the text content by: determining the target text attribute corresponding to the text content, and determining the target beautification method corresponding to the target text attribute; and beautifying the text content based on the target beautification method.
[0195] It is understood that the aforementioned target text attributes refer to the attributes of the text content, which include, but are not limited to: English, Chinese, numbers, personal names, place names, organizations, and dates.
[0196] In some embodiments, the text content in each text region can be identified based on a named entity recognition algorithm, and the text content can be labeled with attributes.
[0197] Understandably, named entity recognition algorithms are a type of natural language processing technology that aims to identify entities with specific meanings from text and classify and label them.
[0198] For example, based on the named entity recognition algorithm, the text content "multi-line handwriting recognition" in the text area can be identified, and the target text attribute corresponding to the text content can be labeled as "Chinese".
[0199] Furthermore, the text attributes of all text content can be identified, and the target text attributes corresponding to each text content can be labeled. Then, the target beautification method corresponding to the target text attributes can be determined.
[0200] For example, the target text attribute mentioned above can be any one of English, Chinese, numbers, personal names, place names, organizations, or dates.
[0201] The aforementioned beautification methods may include adjusting the thickness of the text trajectory, adjusting the text color, adjusting the text font size, adjusting the text layout, and adjusting the text strokes to the target strokes. This application does not specifically limit the beautification methods described in its embodiments.
[0202] Specifically, for text content with the same text attributes, the same beautification method is used, meaning that the target beautification method is also the same for text content with the same text attributes.
[0203] Specifically, adjusting the text trajectory thickness refers to adjusting the text trajectory of text content with the same text attributes to the same thickness; adjusting the text color refers to adjusting the text color of text content with the same text attributes to the same color; adjusting the text font size refers to adjusting the font of text content with the same text attributes to the same size; adjusting the text layout refers to adjusting the alignment, line spacing, and character spacing of text content with the same text attributes to the same type; and adjusting to the target stroke refers to using the same target stroke (stroke strokes are usually reflected in the stroke order, pressure, and speed of writing) for text content with the same text attributes.
[0204] In some embodiments, for text content with Chinese attributes, a "grid" beautification method can be used. Specifically, a "grid" can be initialized for each Chinese character, and the height, width, rotation angle, etc. of the Chinese text trajectory can be adjusted to fill the "grid". Multiple "grids" can be spliced together to make the size and spacing of the beautified Chinese characters approximately the same, resulting in a more aesthetically pleasing overall appearance.
[0205] For example, such as Figure 8 As shown, Figure 8 By applying "grid" formatting to Chinese text with the "handwriting enhancement" attribute, the following results can be obtained: Figure 8 The beautified text content shown on the right.
[0206] In other embodiments, for text content with English attributes, a "four-line, three-grid" beautification method can be used. Specifically, a word grid can be initialized for each word, and the height and width of each letter in each word can be adjusted according to writing standards and filled into the word grid. The word grids of all words are then spliced together at certain intervals, so that the size and spacing of the beautified English text are similar, resulting in a more aesthetically pleasing overall presentation.
[0207] For example, such as Figure 8 As shown, Figure 8 By applying a "four-line, three-space" formatting technique to the text containing the English attribute "hand beauty," the desired effect can be achieved. Figure 8 The beautified text content shown on the right.
[0208] Understandable, Figure 8 The "grid" and "four-line three-grid" in the table are drawn virtually during the beautification process. The "grid" and "four-line three-grid" are not actually displayed when the beautified table is shown.
[0209] Furthermore, based on the correspondence between beautification methods and text attributes, the target beautification method corresponding to the target text attribute can be determined. For example, the beautification methods corresponding to the "English" attribute are "change the text color to green" and "beautify using the four-line three-space beautification method".
[0210] If the target attribute of the text content in the text area is determined to be "English", then it can be determined that the text color of the text content needs to be changed to green, and the four-line three-grid beautification method is used to beautify the text.
[0211] For example, such as Figure 9 As shown, Figure 9 The left image in the table is a hand-drawn table created by the user. Figure 9 The right figure in the middle is based on Figure 7 The preliminary beautification table shown is the table obtained after beautifying the text content of each text area according to the target beautification method corresponding to the text attribute. That is, the table after beautifying the text content in the preliminary beautification table.
[0212] The method described above, by identifying the target text attributes corresponding to the text content, enables detailed classification of diverse texts. Identifying and classifying text attributes allows for clear differentiation between texts with different attributes, avoiding the application of the same processing method to all texts and laying the foundation for subsequent targeted beautification. Determining corresponding beautification methods for different target text attributes achieves personalized text beautification. Applying a uniform operation to text content with the same text attributes according to the determined target beautification method makes the text content with the same text attributes appear more neat and aesthetically pleasing.
[0213] Regarding S107 above, it is understood that after beautifying the table lines, text areas, and text content in the table image, the adjusted and beautified hand-drawn table can be displayed on an electronic device.
[0214] For example, the table ultimately displayed on the electronic device can be as follows: Figure 9 As shown in the right figure.
[0215] The above embodiments, by acquiring user-drawn hand-drawn tables and converting them into table images, retain the personalized elements of the user-drawn tables in the converted table images. Smoothing after clearly defining the table lines belonging to each cell smooths out any irregular or rough lines that might exist in the original hand-drawn tables, improving the overall visual presentation of the table. Adjusting the current tilt angle of each text area to the target tilt angle solves problems such as text tilt and unevenness that may occur during the hand-drawing process, making the text layout in the table more reasonable and standardized. Furthermore, based on the relationship between the trajectory of the drawing category and the trajectory of the text category, the trajectory of the text category can be marked using the trajectory corresponding to the drawing category, making the key content and information in the text more prominent and improving the efficiency of reading table content. Determining corresponding target beautification methods for different target text attributes achieves personalized text beautification. Applying uniform operations to text content with the same text attributes according to the determined target beautification methods makes the text content with the same text attributes appear more neat and aesthetically pleasing. Finally, displaying the adjusted and beautified hand-drawn tables on electronic devices can present tables that retain the user's hand-drawn style, thus improving the user experience.
[0216] Figure 10 This is a schematic diagram of the structure of a hand-drawn table display device provided in an embodiment of this application.
[0217] For example, such as Figure 10 As shown, the device 1000 includes:
[0218] The acquisition module 1001 is used to acquire a hand-drawn table created by the user and convert the hand-drawn table into a table image.
[0219] The first beautification module 1002 is used to determine multiple table lines in the table image and determine the belonging table line of each cell among the multiple table lines; to smooth the belonging table line to obtain the beautified table line, and to replace the belonging table line in the table image with the beautified table line.
[0220] The adjustment module 1003 is used to determine the text trajectory in each text area of the table image and determine the current tilt angle of each text area; based on the cell to which each text area belongs, it determines the target tilt angle corresponding to each text area and adjusts the current tilt angle of each text area to the target tilt angle.
[0221] The current tilt angle is the tilt angle of the text region relative to the baseline.
[0222] The second beautification module 1004 is used to identify the text content in each text area of the table image, beautify the text content, and obtain the hand-drawn table after adjustment and beautification.
[0223] Display module 1005 is used to display the adjusted and beautified hand-drawn table on an electronic device.
[0224] Optionally, the device further includes a segmentation module, which is specifically used to: perform content segmentation on the table image to obtain cell segmentation results and text segmentation results; wherein, the cell segmentation results contain coordinate data of each cell region in the table image; and the text segmentation results contain coordinate data of each text region in the table image.
[0225] In one possible implementation, the first beautification module includes a table line determination unit, which is specifically used to: determine multiple table lines in the table image based on the cell segmentation result and the trajectory data corresponding to the hand-drawn table.
[0226] In one possible implementation, the adjustment module includes a text trajectory determination unit, which is specifically used to: map the text segmentation result and the trajectory data corresponding to the hand-drawn table to obtain the text trajectory within each text region.
[0227] In one possible implementation, the table line determination unit is specifically used to: map the cell segmentation result and the trajectory data corresponding to the hand-drawn table to obtain multiple trajectories corresponding to the cells in the table image; determine the trajectory category corresponding to each of the multiple trajectories; remove the trajectories whose trajectory category is text category and drawing category from the multiple trajectories to obtain the remaining trajectories, and determine the remaining trajectories as multiple table lines in the table image; wherein, the trajectory of the drawing category is the trajectory inside the cell that exists around the trajectory of the text category.
[0228] In one possible implementation, the table line determination unit includes a trajectory category determination subunit, which is specifically used to: obtain the trajectory time sequence information corresponding to each trajectory; splice each trajectory according to the trajectory time sequence information to obtain the spliced trajectory; and input the spliced trajectory into the trajectory classification prediction model to obtain the trajectory category corresponding to each trajectory.
[0229] In one possible implementation, the first beautification module includes a classifying table line determination unit, which is specifically used to: detect inflection points for each of the multiple table lines to obtain the inflection point corresponding to each table line; segment each table line according to the inflection point corresponding to each table line to obtain the segmented table line; determine the classifying line segment belonging to each cell based on the cell segmentation result and the segmented table line; and splice the classifying line segments of each cell to obtain the classifying table line of each cell in the table image.
[0230] In one possible implementation, the adjustment unit includes an angle determination unit, which is specifically used to: determine the tilt angle corresponding to the cell to which each text region belongs based on the cell segmentation result and the text segmentation result; wherein the tilt angle corresponding to the cell is the tilt angle of the cell relative to the baseline; and determine the target tilt angle corresponding to each text region based on the tilt angle corresponding to the cell to which each text region belongs.
[0231] Optionally, the device further includes a marking module, which is specifically used to: extract the trajectory of the text category and the trajectory of the drawing category in each cell; determine the attribution relationship between the trajectory of the text category and the trajectory of the drawing category; and, based on the attribution relationship, mark the trajectory of the text category in each cell using the trajectory corresponding to the drawing category.
[0232] In one possible implementation, the second beautification module is specifically used to: determine the target text attribute corresponding to the text content, and determine the target beautification method corresponding to the target text attribute; and beautify the text content based on the target beautification method.
[0233] In one possible implementation, the acquisition module is specifically used to: acquire trajectory data when the user draws the hand-drawn table; obtain multiple drawing trajectories in the hand-drawn table based on the trajectory data; acquire the temporal information of each of the multiple drawing trajectories; and render the multiple drawing trajectories according to the temporal information of each of the multiple drawing trajectories to obtain the table image.
[0234] Figure 11 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this application.
[0235] For example, such as Figure 11 As shown, the electronic device 1100 includes a memory 1101 and a processor 1102, wherein the memory 1101 stores executable program code 1011, and the processor 1102 is used to call and execute the executable program code 1110 to perform a method for displaying a hand-drawn table.
[0236] Furthermore, this application also protects an apparatus that may include a memory and a processor, wherein the memory stores executable program code, and the processor is used to call and execute the executable program code to perform a hand-drawn table display method provided in this application.
[0237] This embodiment can divide the device into functional modules based on the above method example. For example, each module can correspond to a separate function, or two or more functions can be integrated into one processing module. The integrated module can be implemented in hardware. It should be noted that the module division in this embodiment is illustrative and only represents one logical functional division. In actual implementation, there may be other division methods.
[0238] When each functional module is divided according to its corresponding function, the device may further include an acquisition module, a first beautification module, an adjustment module, a second beautification module, and a display module. It should be noted that all relevant content regarding the steps involved in the above method embodiments can be referenced to the functional descriptions of the corresponding functional modules, and will not be repeated here.
[0239] It should be understood that the apparatus provided in this embodiment is used to execute the above-described method for displaying a hand-drawn table, and therefore can achieve the same effect as the above-described implementation method.
[0240] When using integrated units, the device may include a processing module and a storage module. When applied to an electronic device, the processing module can be used to control and manage the operation of the electronic device. The storage module can be used to support the execution of relevant program code and data by the electronic device.
[0241] The processing module may be a processor or a controller, which can implement or execute various exemplary logic blocks, modules, and circuits shown in conjunction with the disclosure of this application. The processor may also be a combination of functions that implement computing capabilities, such as a combination of one or more microprocessors, a combination of digital signal processing (DSP) and a microprocessor, etc., and the storage module may be a memory.
[0242] In addition, the device provided in the embodiments of this application may specifically be a chip, component or module. The chip may include a connected processor and a memory. The memory is used to store instructions. When the processor calls and executes the instructions, the chip can execute a hand-drawn table display method provided in the above embodiments.
[0243] This embodiment also provides a computer-readable storage medium storing computer program code. When the computer program code is run on a computer, the computer executes the above-described related method steps to implement the hand-drawn table display method provided in the above embodiment.
[0244] This embodiment also provides a computer program product that, when run on a computer, causes the computer to perform the aforementioned steps to implement a hand-drawn table display method provided in the above embodiment.
[0245] In this embodiment, the device, computer-readable storage medium, computer program product, or chip are all used to execute the corresponding methods provided above. Therefore, the beneficial effects they can achieve can be referred to the beneficial effects in the corresponding methods provided above, and will not be repeated here.
[0246] Through the above description of the embodiments, those skilled in the art will understand that, for the sake of convenience and brevity, only the division of the above functional modules is used as an example. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the device can be divided into different functional modules to complete all or part of the functions described above.
[0247] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative; for instance, the division of modules or units is only a logical functional division, and in actual implementation, there may be other division methods. For example, multiple units or components may be combined or integrated into another device, or some features may be ignored or not executed. Furthermore, the coupling or direct coupling or communication connection shown or discussed may be through some interfaces; the indirect coupling or communication connection between devices or units may be electrical, mechanical, or other forms.
[0248] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
Claims
1. A method for displaying hand-drawn tables, applied to electronic devices, characterized in that, The method includes: Obtain a hand-drawn table created by the user and convert the hand-drawn table into a table image; Identify multiple table lines in the table image, and determine the table line belonging to each cell among the multiple table lines; The belonging table lines are smoothed to obtain beautified table lines, and the belonging table lines in the table image are replaced with the beautified table lines; Determine the text trajectory within each text region in the table image, and determine the current tilt angle of each text region; wherein, the current tilt angle is the tilt angle of the text region relative to the baseline; Based on the cell to which each text region belongs, determine the target tilt angle corresponding to each text region, and adjust the current tilt angle of each text region to the target tilt angle; Identify the text content in each text area of the table image, beautify the text content, and obtain a hand-drawn table after adjustment and beautification; Display the adjusted and beautified hand-drawn table on an electronic device.
2. The method according to claim 1, characterized in that, After converting the hand-drawn table into a table image, the method further includes: The table image is segmented to obtain cell segmentation results and text segmentation results; wherein, the cell segmentation results contain the coordinate data of each cell region in the table image; and the text segmentation results contain the coordinate data of each text region in the table image.
3. The method according to claim 2, characterized in that, Determining multiple table lines in the table image includes: Based on the cell segmentation results and the trajectory data corresponding to the hand-drawn table, multiple table lines in the table image are determined.
4. The method according to claim 2, characterized in that, Determining the text trajectory within each text region of the table image includes: The text segmentation results are mapped to the trajectory data corresponding to the hand-drawn table to obtain the text trajectory within each text region.
5. The method according to claim 3, characterized in that, The step of determining multiple table lines in the table image based on the cell segmentation results and the trajectory data corresponding to the hand-drawn table includes: The cell segmentation results are mapped to the trajectory data corresponding to the hand-drawn table to obtain multiple trajectories corresponding to the cells in the table image; Determine the trajectory category corresponding to each of the multiple trajectories; Trajectories of the text and drawing categories are removed from the multiple trajectories to obtain the remaining trajectories. The remaining trajectories are then identified as multiple table lines in the table image. The drawing category trajectories are those existing within the cell and surrounding the text category trajectories.
6. The method according to claim 5, characterized in that, Determining the trajectory category corresponding to each of the multiple trajectories includes: Obtain the trajectory time sequence information corresponding to each trajectory; Each trajectory is spliced together according to the trajectory time sequence information to obtain the spliced trajectory; The spliced trajectory is input into the trajectory classification prediction model to obtain the trajectory category corresponding to each trajectory.
7. The method according to claim 2, characterized in that, Determining the classifying table line belonging to each cell among the multiple table lines includes: Inflection point detection is performed on each of the multiple table lines to obtain the inflection point corresponding to each table line; Each table line is divided according to its inflection point to obtain the divided table lines. Based on the cell segmentation results and the segmented table lines, determine the line segment belonging to each cell; By splicing together the line segments belonging to each cell, the table lines belonging to each cell in the table image are obtained.
8. The method according to claim 2, characterized in that, Determining the target tilt angle corresponding to each text region based on the cell to which each text region belongs includes: Based on the cell segmentation results and the text segmentation results, the tilt angle corresponding to the cell to which each text region belongs is determined; wherein, the tilt angle corresponding to the cell is the tilt angle of the cell relative to the baseline; Based on the tilt angle of the cell to which each text region belongs, the target tilt angle corresponding to each text region is determined.
9. The method according to claim 1, characterized in that, After adjusting the current tilt angle of each text region to the target tilt angle, the method further includes: Extract the trajectories of the text category and the drawing category from each cell; Determine the attribution relationship between the trajectory of the text category and the trajectory of the drawing category; Based on the attribution relationship, the trajectory of the text category is marked in each cell using the trajectory corresponding to the drawing category.
10. The method according to claim 1, characterized in that, The enhancement of the text content includes: Determine the target text attribute corresponding to the text content, and determine the target beautification method corresponding to the target text attribute; The text content is beautified based on the target beautification method.
11. The method according to claim 1, characterized in that, The step of converting the hand-drawn table into a table image includes: Obtain the trajectory data of the user when drawing the hand-drawn table; Based on the trajectory data, multiple drawing trajectories in the hand-drawn table are obtained; Obtain the temporal information of each of the multiple drawing trajectories; Based on the timing information of each of the multiple drawing trajectories, the multiple drawing trajectories are rendered to obtain the table image.
12. A display device for hand-drawn tables, characterized in that, The device includes: The acquisition module is used to acquire hand-drawn tables created by the user and convert the hand-drawn tables into table images; The first beautification module is used to determine multiple table lines in the table image, and determine the belonging table line of each cell among the multiple table lines; smooth the belonging table line to obtain beautified table lines, and replace the belonging table lines in the table image with the beautified table lines; An adjustment module is used to determine the text trajectory within each text region in the table image and determine the current tilt angle of each text region; based on the cell to which each text region belongs, determine the target tilt angle corresponding to each text region, and adjust the current tilt angle of each text region to the target tilt angle; wherein, the current tilt angle is the tilt angle of the text region relative to the baseline; The second beautification module is used to identify the text content in each text area of the table image, beautify the text content, and obtain the hand-drawn table after adjustment and beautification. The display module is used to display the adjusted and beautified hand-drawn table on an electronic device.
13. An electronic device, characterized in that, The electronic device includes: Memory, used to store executable program code; A processor for calling and running the executable program code from the memory, causing the electronic device to perform the method as described in any one of claims 1 to 11.
14. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed, implements the method as described in any one of claims 1 to 11.