A handwriting collection method, device, equipment and storage medium

CN118429992BActive Publication Date: 2026-11-20GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202310075248.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-01-31
Publication Date
2026-11-20
Estimated Expiration
2043-01-31

AI Technical Summary

Technical Problem

Existing handwriting capture solutions cannot accurately capture users' real handwriting and require expensive smart hardware devices, which are inconvenient to use and easily damaged.

Method used

By collecting a set of images of the user's writing process through a smart terminal, obtaining the pen tip coordinates corresponding to each image, and using a prediction model to determine the handwriting, the purchase of additional hardware equipment can be avoided.

Benefits of technology

It achieves accurate collection of users' real handwriting, reduces costs, and improves ease of use. Users can write on real paper, making it suitable for various writing scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118429992B_ABST
    Figure CN118429992B_ABST
Patent Text Reader

Abstract

The application discloses a handwriting collection method, device and equipment and a storage medium. The method is executed by a smart terminal, and the method comprises the following steps: collecting an image set of a user's writing process; acquiring a pen tip coordinate corresponding to each image in the image set; and determining a writing handwriting according to the pen tip coordinate corresponding to each image in the image set. According to the technical scheme of the embodiment of the application, the image set of the user's writing process is collected, the pen tip coordinate corresponding to each image in the image set is acquired, and the writing handwriting is determined according to the pen tip coordinate corresponding to each image in the image set. Through the technical scheme of the embodiment of the application, the real handwriting of the user can be correctly collected, and the cost is reduced without the need of purchasing additional smart collection hardware equipment.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of image processing technology, and in particular to a handwriting acquisition method, apparatus, device and storage medium. Background Technology

[0002] Handwriting collection refers to the collection of a writer's handwriting. The collected handwriting can be extended to many application scenarios, such as text recognition or handwriting evaluation.

[0003] Currently, handwriting collection solutions mainly involve using smart pens or dot-matrix fonts and other smart hardware devices. However, when collecting handwriting, the writer needs to use a smart pen or dot-matrix font to write, which is very different from writing with a ballpoint pen, fountain pen, or on paper. This makes it impossible to accurately collect the user's actual handwriting.

[0004] Existing handwriting capture solutions not only fail to accurately capture users' real handwriting, but also require consumable hardware such as smart pens or dot matrix calligraphy templates, which are expensive. More importantly, the capture process requires users to use specialized hardware, which is inconvenient and prone to loss or damage. Summary of the Invention

[0005] This invention provides a handwriting acquisition method, apparatus, device, and storage medium to enable accurate acquisition of a user's real handwriting without the need to purchase additional intelligent acquisition hardware, thus reducing costs.

[0006] According to one aspect of the present invention, a handwriting acquisition method is provided, executed by a smart terminal, the method comprising:

[0007] Collect a set of images of the user's writing process;

[0008] Obtain the pen tip coordinates corresponding to each image in the image set;

[0009] The handwriting is determined based on the pen tip coordinates corresponding to each image in the image set.

[0010] According to another aspect of the present invention, a handwriting acquisition device is provided, the device comprising:

[0011] The acquisition module is used to acquire a set of images of the user's writing process;

[0012] The first acquisition module is used to acquire the pen tip coordinates corresponding to each image in the image set;

[0013] The first determining module is used to determine the handwriting based on the pen tip coordinates corresponding to each image in the image set.

[0014] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0015] At least one processor; and

[0016] A memory communicatively connected to the at least one processor; wherein,

[0017] The memory stores a computer program that can be executed by the at least one processor, which enables the at least one processor to perform the handwriting acquisition method according to any embodiment of the present invention.

[0018] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the handwriting acquisition method according to any embodiment of the present invention.

[0019] The technical solution of this invention collects a set of images of the user's writing process, obtains the pen tip coordinates corresponding to each image in the image set, and determines the handwriting based on the pen tip coordinates corresponding to each image in the image set. Through the technical solution of this invention, the user's real handwriting can be accurately collected without the need to purchase additional intelligent collection hardware equipment, thus reducing costs.

[0020] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0021] To more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0022] Figure 1 This is a flowchart of a handwriting acquisition method according to an embodiment of the present invention;

[0023] Figure 2 This is a schematic diagram of a method for obtaining a prediction model by iteratively training a neural network model using a target sample set, as described in an embodiment of the present invention.

[0024] Figure 3 This is a schematic diagram of the structure of a handwriting acquisition device according to an embodiment of the present invention;

[0025] Figure 4This is a schematic diagram of the structure of an electronic device that implements the handwriting acquisition method of this invention. Detailed Implementation

[0026] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0027] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0028] It is understood that before using the technical solutions disclosed in the various embodiments of this disclosure, users should be informed of the types, scope of use, and usage scenarios of the personal information involved in this disclosure in an appropriate manner in accordance with relevant laws and regulations, and user authorization should be obtained.

[0029] Example 1

[0030] Figure 1 This is a flowchart of a handwriting acquisition method according to an embodiment of the present invention. This embodiment is applicable to handwriting acquisition situations. The method can be executed by the handwriting acquisition device in this embodiment of the present invention, which can be implemented in software and / or hardware, such as... Figure 1 As shown, the method specifically includes the following steps:

[0031] S101. Collect a set of images of the user's writing process.

[0032] In this embodiment, the handwriting capture method can be executed by a smart terminal. For example, the smart terminal can be an online learning device. Preferably, the smart terminal is equipped with a camera and has a shooting function.

[0033] The user writing process can be the process by which a user writes on paper using a pen such as a pencil, ballpoint pen, or fountain pen. For example, the user writing process can include writing activities such as practicing calligraphy, drawing, or answering questions.

[0034] It should be noted that the image set can be obtained by the smart terminal and consists of at least one set of images containing the paper and pen tip of the user during the writing process.

[0035] Specifically, users write on paper using pens such as pencils, ballpoint pens, or fountain pens. During the writing process, the smart terminal captures images of the paper and pen tip, obtaining each image corresponding to the user's writing process, and these images together form an image set.

[0036] For example, the smart terminal can acquire images continuously or at intervals of a first preset time. The first preset time can be a time set by the user according to actual conditions. This embodiment does not limit the specific value of the first preset time; for example, the first preset time could be 1 millisecond.

[0037] It is important to note that when capturing images of paper and pen tip using a smart terminal, the paper and pen tip must be within the camera's field of view, and the paper must not be moved or altered during writing or capturing; otherwise, the handwriting will be inaccurately identified.

[0038] It should be noted that, in this embodiment, the operation of collecting images of the user's writing process through the camera of the smart terminal is performed with the user's authorization.

[0039] S102. Obtain the pen tip coordinates corresponding to each image in the image set.

[0040] It should be explained that pen tip coordinates can be the position coordinates of the pen tip in each image.

[0041] Specifically, after the smart terminal collects a set of images of the user's writing process, it obtains the position coordinates of the pen tip in each image of the set of images collected by the smart terminal.

[0042] S103. Determine the writing style based on the pen tip coordinates corresponding to each image in the image set.

[0043] It should be noted that handwriting can be continuous handwriting from the user during the writing process.

[0044] Specifically, the pen tip coordinates of each image in the image set corresponding to the user's writing process can be connected in chronological order to form a continuous writing handwriting, thereby completing the collection of the user's writing handwriting.

[0045] The technical solution of this invention collects a set of images of the user's writing process, obtains the pen tip coordinates corresponding to each image in the image set, and determines the handwriting based on the pen tip coordinates corresponding to each image in the image set. Through the technical solution of this invention, the user's real handwriting can be accurately collected without the need to purchase additional intelligent collection hardware equipment, thus reducing costs.

[0046] Optionally, obtain the pen tip coordinates for each image in the image set, including:

[0047] Each image in the image set is input into the prediction model in turn to obtain the feature image corresponding to each image in the image set.

[0048] It should be explained that, in this embodiment, the prediction model can be a prediction network model used to extract features from each image in the image set to obtain the feature image corresponding to each image in the image set.

[0049] The prediction model is obtained by iteratively training a neural network model using a target sample set, which includes image samples and the pen tip coordinates corresponding to the image samples.

[0050] In this embodiment, the image sample may be an image sample containing the paper and pen tip of the user during the writing process.

[0051] The feature image can be the feature image containing the pen tip position corresponding to each image in the image set input by the prediction model.

[0052] Specifically, each image in the image set can be sequentially input into the prediction model at second preset time intervals. The prediction model extracts features from each image to obtain a feature image corresponding to each image in the image set. The second preset time can be a time preset by the user according to actual conditions. This embodiment does not limit the specific value of the second preset time; for example, the second preset time could be 1 millisecond.

[0053] The pen tip coordinates for each image are determined based on the feature image corresponding to each image.

[0054] Specifically, the pen tip coordinates for each image are predicted based on the feature image corresponding to each image.

[0055] Optionally, each image in the image set is sequentially input into the prediction model to obtain the feature image corresponding to each image in the image set, including:

[0056] The images in the image set are downsampled to obtain the first feature image.

[0057] As we know, image subsampling can be simply understood as reducing the size of an image, also known as downsampling. Its purpose is twofold: 1) to make the image fit the size of the display area; 2) to generate a thumbnail of the corresponding image. Specifically, the principle of subsampling is: for an image of size M*N, it is downsampled by a factor of s, resulting in a resolution image of size (M / s)*(N / s). Of course, s should be a common divisor of M and N. If considering a matrix image, it means transforming the image within an s*s window of the original image into a single pixel, and the value of this pixel is the average value of all pixels within the window.

[0058] The first feature image can be a feature image obtained by downsampling the images in the image set.

[0059] In actual operation, the scaling ratio for upsampling and downsampling of images in the image set can be preset by the user according to the actual situation. This embodiment does not limit the scaling ratio for upsampling and downsampling. This embodiment describes the scaling ratio for upsampling and downsampling as 2.

[0060] Specifically, the video frames in the image set are downsampled to obtain a first feature image with a size of 1 / 2 of the image size in the image set.

[0061] The first feature image is downsampled to obtain the second feature image.

[0062] The second feature image can be a feature image obtained by downsampling the first feature image.

[0063] Specifically, the first feature image video frame with an image size of 1 / 2 in the image set is downsampled to obtain the second feature image with an image size of 1 / 4 in the image set.

[0064] The second feature image is downsampled to obtain the third feature image.

[0065] The third feature image can be a feature image obtained by downsampling the second feature image.

[0066] Specifically, the second feature image video frame with an image size of 1 / 4 in the image set is downsampled to obtain the third feature image with an image size of 1 / 8 in the image set.

[0067] The third feature image is upsampled to obtain the fourth feature image.

[0068] As we know, image upsampling is essentially image magnification, also known as image interpolation. Its main purpose is to enlarge the original image so that it can be displayed on a higher resolution display device. Specifically, the principle of upsampling is that image magnification almost always uses interpolation methods, that is, inserting new elements between pixels of the original image using a suitable interpolation algorithm. This embodiment does not limit the specific interpolation algorithm.

[0069] The fourth feature image can be a feature image obtained by upsampling the third feature image.

[0070] Specifically, the third feature image video frame with an image size of 1 / 8 in the image set is upsampled to obtain the fourth feature image with an image size of 1 / 4 in the image set.

[0071] The fourth feature image and the second feature image are stitched together to obtain the fifth feature image.

[0072] The fifth feature image can be obtained by stitching together the fourth and second feature images. This embodiment does not limit the method of stitching the fourth and second feature images.

[0073] Specifically, the fourth feature image, which is 1 / 4 the size of the image in the image set, and the second feature image, which is 1 / 4 the size of the image in the image set, are stitched together to obtain the fifth feature image.

[0074] The fifth feature image is upsampled to obtain the sixth feature image.

[0075] The sixth feature image can be a feature image obtained by upsampling the fifth feature image.

[0076] Specifically, the fifth feature image is upsampled to obtain a sixth feature image with a size of 1 / 2 in the image set.

[0077] The first feature image and the sixth feature image are concatenated to obtain the seventh feature image.

[0078] The seventh feature image can be obtained by stitching together the first feature image and the sixth feature image. This embodiment does not limit the method of stitching together the first feature image and the sixth feature image.

[0079] Specifically, the first feature image (1 / 2 the size of the first feature image in the image set) and the sixth feature image (1 / 2 the size of the sixth feature image in the image set) are stitched together to obtain the seventh feature image.

[0080] Convolve the seventh feature image to obtain the eighth feature image.

[0081] In this embodiment, the convolution operation can be a 1×1 convolution of the seventh feature image, and the number of channels of the seventh feature image can be controlled to obtain a single-channel output feature map, namely the eighth feature image.

[0082] The eighth feature image can be the feature image obtained by convolving the seventh feature image.

[0083] Specifically, the seventh feature image, which is half the size of the image in the image set, is convolved. The number of channels of the seventh feature image is controlled by 1×1 convolution to obtain a single-channel output feature map, which is the eighth feature image. At this time, the eighth feature image is half the size of the image in the image set.

[0084] Optionally, the pen tip coordinates for each image are determined based on the feature image corresponding to each image, including:

[0085] Obtain the target region in the eighth feature image whose pixel value is greater than the pixel threshold.

[0086] The pixel threshold can be a threshold preset by the user according to the actual situation. In this embodiment, the specific value of the pixel threshold is not limited. For example, the pixel threshold can be 0.5.

[0087] The target region can be a region in the eighth feature image where the pixel value is greater than the pixel threshold.

[0088] Specifically, a pixel threshold, such as 0.5, can be set to obtain the target region in the eighth feature image whose pixel value is greater than the pixel threshold.

[0089] Determine the pen tip coordinates based on the center point coordinates of the target area.

[0090] It should be noted that the center point coordinates can be the coordinates of a point at the center of the target area. Preferably, the center point coordinates can be two-dimensional coordinates; for example, the center point coordinates can be represented as (x′, y′).

[0091] Specifically, the pen tip coordinates are determined based on the center point coordinates (x′, y′) of the target area.

[0092] Optionally, the pen tip coordinates can be determined based on the center point coordinates of the target area, including:

[0093] The first ratio is determined based on the dimensions of the images in the image set and the dimensions of the eighth feature image.

[0094] It should be explained that the first ratio can be the ratio of the size of the images in the image set to the size of the eighth feature image. For example, the first ratio of the size of the images in the image set to the size of the eighth feature image can be 2:1.

[0095] Specifically, the dimensions of the images in the image set are obtained, the dimensions of the eighth feature image are obtained, and the first ratio is determined based on the dimensions of the images in the image set and the dimensions of the eighth feature image.

[0096] The pen tip coordinates are determined based on the first scale and the coordinates of the center point of the target area.

[0097] Specifically, if the first ratio of the size of the image in the image set to the size of the eighth feature image is 2:1, and the center point coordinates of the target region are (x′, y′), then the pen tip coordinates (x, y) are determined as follows: x = 2*x′, y = 2*y′. That is, the horizontal and vertical coordinates of the center point coordinates of the target region are multiplied by 2 (the first ratio is 2:1) to obtain the pen tip coordinates corresponding to each image in the image set.

[0098] Optionally, the neural network model is iteratively trained using the target sample set, including:

[0099] The image samples in the target sample set are downsampled to obtain the first predicted feature image.

[0100] The first predicted feature image can be a predicted feature image obtained by downsampling image samples in the target sample set.

[0101] In actual operation, the scaling ratio of upsampling and downsampling of the images in the target sample set can be preset by the user according to the actual situation. This embodiment does not limit the scaling ratio of upsampling and downsampling. This embodiment describes the scaling ratio of upsampling and downsampling as 2.

[0102] Specifically, the video frames in the target sample set are downsampled to obtain a first predicted feature image with an image size of 1 / 2 of the target sample set.

[0103] The first predicted feature image is downsampled to obtain the second predicted feature image.

[0104] The second predicted feature image can be a predicted feature image obtained by downsampling the first predicted feature image.

[0105] Specifically, the first predicted feature image video frame with an image size of 1 / 2 in the target sample set is downsampled to obtain the second predicted feature image with an image size of 1 / 4 in the target sample set.

[0106] The second predicted feature image is downsampled to obtain the third predicted feature image.

[0107] The third predicted feature image can be a predicted feature image obtained by downsampling the second predicted feature image.

[0108] Specifically, the second predicted feature image video frame with an image size of 1 / 4 in the target sample set is downsampled to obtain the third predicted feature image with an image size of 1 / 8 in the target sample set.

[0109] The third predicted feature image is upsampled to obtain the fourth predicted feature image.

[0110] The fourth predicted feature image can be a predicted feature image obtained by upsampling the third predicted feature image.

[0111] Specifically, the third predicted feature image video frame with an image size of 1 / 8 in the target sample set is upsampled to obtain the fourth predicted feature image with an image size of 1 / 4 in the target sample set.

[0112] The fourth and second predicted feature images are concatenated to obtain the fifth predicted feature image.

[0113] The fifth predicted feature image can be a predicted feature image obtained by stitching together the fourth predicted feature image and the second predicted feature image. This embodiment does not limit the method of stitching together the fourth and second predicted feature images.

[0114] Specifically, the fourth predicted feature image (1 / 4 the size of the image in the target sample set) and the second predicted feature image (1 / 4 the size of the image in the target sample set) are stitched together to obtain the fifth predicted feature image.

[0115] The fifth predicted feature image is upsampled to obtain the sixth predicted feature image.

[0116] The sixth predicted feature image can be a predicted feature image obtained by upsampling the fifth predicted feature image.

[0117] Specifically, the fifth predicted feature image is upsampled to obtain a sixth predicted feature image with half the image size in the target sample set.

[0118] The first and sixth predicted feature images are concatenated to obtain the seventh predicted feature image.

[0119] The seventh predicted feature image can be a feature image obtained by stitching together the first predicted feature image and the sixth predicted feature image. This embodiment does not limit the method of stitching together the first and sixth predicted feature images.

[0120] Specifically, the first predicted feature image (1 / 2 the size of the image in the target sample set) and the sixth predicted feature image (1 / 2 the size of the image in the target sample set) are stitched together to obtain the seventh predicted feature image.

[0121] Convolve the seventh predicted feature image to obtain the eighth predicted feature image.

[0122] In this embodiment, the convolution operation can be a 1×1 convolution on the seventh predicted feature image, and the number of channels of the seventh predicted feature image can be controlled to obtain a single-channel output predicted feature image, namely the eighth predicted feature image.

[0123] The eighth predicted feature image can be the predicted feature image obtained by convolving the seventh predicted feature image.

[0124] Specifically, the seventh predicted feature image, which is half the size of the image in the target sample set, is convolved. The number of channels in the seventh predicted feature image is controlled by 1×1 convolution to obtain a single-channel output predicted feature image, which is the eighth predicted feature image. At this time, the eighth predicted feature image is half the size of the image in the target sample set.

[0125] The parameters of the neural network model are trained using the objective function generated from the first and eighth predicted feature images until the prediction model is obtained.

[0126] As an exemplary description of an embodiment of the present invention Figure 2 This is a schematic diagram illustrating a method for obtaining a prediction model by iteratively training a neural network model using a target sample set, as described in an embodiment of the present invention. Figure 2 As shown, obtaining the prediction model by iteratively training the neural network model using the target sample set includes the following operations:

[0127] The image samples in the target sample set are downsampled to obtain the first predicted feature image; the first predicted feature image is downsampled to obtain the second predicted feature image; the second predicted feature image is downsampled to obtain the third predicted feature image; the third predicted feature image is upsampled to obtain the fourth predicted feature image; the fourth predicted feature image and the second predicted feature image are concatenated to obtain the fifth predicted feature image; the fifth predicted feature image is upsampled to obtain the sixth predicted feature image; the first predicted feature image and the sixth predicted feature image are concatenated to obtain the seventh predicted feature image; the seventh predicted feature image is convolved to obtain the eighth predicted feature image (which can be denoted as ptmask).

[0128] The image samples in the target sample set (which can be denoted as masks) are scaled down by a first ratio to obtain the scaled image of the target sample set (which can be denoted as gt mask). The loss value between the pt mask (eighth predicted feature image) and the gt mask (scaled image of the image samples in the target sample set) is calculated using a loss function (such as Dice loss). Post-processing (gradient backpropagation) is performed based on the loss value to optimize the parameters of the neural network model until the prediction model is obtained.

[0129] Optionally, the smart terminal includes a camera.

[0130] A collection of images capturing the user's handwriting process, including:

[0131] A collection of images of the user's writing process is captured through a camera.

[0132] Specifically, before writing, the user places the paper within the camera's field of view on the smart terminal. Then, the user writes on the paper using a pencil, ballpoint pen, or fountain pen. During the writing process, the smart terminal's camera captures images of the paper and pen tip, obtaining each image corresponding to the user's writing process. These images together form an image set.

[0133] In actual operation, the camera of the smart terminal can be fixed, and the user can place the paper directly in front of the camera's field of view; or the camera of the smart terminal can be rotated at different angles, and the user can place the paper at any position within the camera's field of view, and the camera can capture images of the paper and pen tip by rotating at different angles.

[0134] It should be noted that, in this embodiment, the operation of collecting images of the user's writing process through the camera of the smart terminal is performed with the user's authorization.

[0135] Optionally, after determining the writing trajectory according to the pen tip coordinate corresponding to each image in the image set, the method further comprises:

[0136] At least one character is determined according to the writing trajectory.

[0137] Herein, the character may be a character written by the user during the writing process.

[0138] Specifically, the writing trajectory in the user writing process is processed to determine at least one character written by the user.

[0139] Optionally, the trajectory collection method further comprises:

[0140] First stroke order information corresponding to each character is determined according to the writing trajectory.

[0141] It should be noted that the first stroke order information may be the stroke order information when the user writes the character during the writing process.

[0142] Specifically, the first stroke order information corresponding to each character when the user writes each character during the writing process is determined according to the writing trajectory.

[0143] Target stroke order information corresponding to each character is acquired.

[0144] Herein, the target stroke order information may be the standard stroke order information corresponding to the character.

[0145] For example, the target stroke order information corresponding to each character may be acquired by querying the provisions in the General Chinese Character Stroke Order Specification for Modern Chinese published in August 1997, 1st Edition, wherein the General Chinese Character Stroke Order Specification for Modern Chinese may be pre-stored in the intelligent terminal. For example, the target stroke order information of the character "禾" may include five strokes, the order of which is respectively撇 (pie), 横 (heng), 竖 (shu), 撇 (pie), 捺 (na).

[0146] Stroke order detection is performed according to the first stroke order information and the target stroke order information corresponding to each character, so as to obtain a detection result.

[0147] In this embodiment, the stroke order detection may be understood as comparing whether the first stroke order information and the target stroke order information corresponding to each character are the same, that is, detecting whether the stroke order when the user writes the character during the writing process is correct.

[0148] Herein, the detection result may include that the first stroke order information and the target stroke order information corresponding to each character are the same, or the first stroke order information and the target stroke order information corresponding to each character are different; when the first stroke order information and the target stroke order information corresponding to each character are different, the specific content of the difference between the first stroke order information and the target stroke order information corresponding to each character.

[0149] Specifically, stroke order detection is performed based on the first stroke order information and the target stroke order information for each character to obtain the detection results. Based on these results, it can be determined whether the user's stroke order is correct during the writing process. If the user's stroke order is incorrect, the user can correct it by referring to the specific discrepancies between the first stroke order information and the target stroke order information for each character in the detection results, thus helping the user write characters in the correct stroke order.

[0150] In practical operation, multi-dimensional evaluation can be performed on information such as the number of strokes, writing direction, and structural position of the characters written by the user. Specifically, based on the handwriting, the number of the first stroke, the writing direction, and the first structural position of each character are determined. The target number of strokes, the writing direction, and the structural position of each character are obtained from pre-stored information in the smart terminal. Based on these information, detection is performed to obtain the results.

[0151] In practice, at least one pattern, number, or letter written by the user can also be identified based on handwriting. For example, if a user answers questions on paper, such as multiple-choice questions with options A, B, C, and D, at least one letter can be identified through handwriting. The answer information for each multiple-choice question can be obtained, and the user's handwritten letter can be used for detection to determine whether the user's answers are correct.

[0152] The technical solution of this invention utilizes the camera of a smart terminal to capture the user's writing process. A predictive model determines the trajectory of the pen tip during writing, thereby collecting the user's handwriting. Compared with existing handwriting collection solutions, the advantages of this invention are: it eliminates the need for additional smart collection hardware, reducing costs; it is convenient for users as no smart collection device is required, and the collection process is virtually imperceptible; users can write on real paper, ensuring consistency between the collected handwriting and the user's actual handwriting; and it has no limitations on usage scenarios, suitable for tasks such as calligraphy practice, problem-solving, and drawing.

[0153] Example 2

[0154] Figure 3This is a schematic diagram of a handwriting acquisition device according to an embodiment of the present invention. This embodiment is applicable to handwriting acquisition applications. The device can be implemented using software and / or hardware, and can be integrated into any device that provides handwriting acquisition functionality, such as... Figure 3 As shown, the handwriting acquisition device specifically includes: an acquisition module 201, a first acquisition module 202, and a first determination module 203.

[0155] The acquisition module 201 is used to acquire a set of images of the user's writing process;

[0156] The first acquisition module 202 is used to acquire the pen tip coordinates corresponding to each image in the image set;

[0157] The first determining module 203 is used to determine the handwriting based on the pen tip coordinates corresponding to each image in the image set.

[0158] Optionally, the first acquisition module 202 includes:

[0159] An input unit is used to sequentially input each image in the image set into a prediction model to obtain a feature image corresponding to each image in the image set. The prediction model is obtained by iteratively training a neural network model using a target sample set, which includes: image samples and pen tip coordinates corresponding to the image samples.

[0160] The determination unit is used to determine the pen tip coordinates corresponding to each image based on the feature image corresponding to each image.

[0161] Optionally, the input unit is specifically used for:

[0162] The images in the image set are downsampled to obtain the first feature image;

[0163] The first feature image is downsampled to obtain the second feature image;

[0164] The second feature image is downsampled to obtain the third feature image;

[0165] The third feature image is upsampled to obtain the fourth feature image;

[0166] The fourth feature image and the second feature image are stitched together to obtain the fifth feature image;

[0167] The fifth feature image is upsampled to obtain the sixth feature image;

[0168] The first feature image and the sixth feature image are stitched together to obtain the seventh feature image;

[0169] The seventh feature image is convolved to obtain the eighth feature image.

[0170] Optionally, the determining unit includes:

[0171] A sub-unit is used to acquire target regions in the eighth feature image whose pixel values ​​are greater than a pixel threshold.

[0172] A sub-unit is defined to determine the pen tip coordinates based on the center point coordinates of the target area.

[0173] Optionally, the determining subunit is specifically used for:

[0174] The first ratio is determined based on the size of the images in the image set and the size of the eighth feature image;

[0175] The pen tip coordinates are determined based on the first ratio and the center point coordinates of the target area.

[0176] Optionally, the input unit is specifically used for:

[0177] The image samples in the target sample set are downsampled to obtain the first predicted feature image;

[0178] The first predicted feature image is downsampled to obtain the second predicted feature image;

[0179] The second predicted feature image is downsampled to obtain the third predicted feature image;

[0180] The third predicted feature image is upsampled to obtain the fourth predicted feature image;

[0181] The fourth predicted feature image and the second predicted feature image are concatenated to obtain the fifth predicted feature image;

[0182] The fifth predicted feature image is upsampled to obtain the sixth predicted feature image;

[0183] The first predicted feature image and the sixth predicted feature image are concatenated to obtain the seventh predicted feature image;

[0184] The seventh predicted feature image is convolved to obtain the eighth predicted feature image;

[0185] The parameters of the neural network model are trained based on the objective function generated from the first predicted feature image and the eighth predicted feature image until the prediction model is obtained.

[0186] Optionally, the smart terminal includes a camera;

[0187] The acquisition module is specifically used for:

[0188] A collection of images of the user's writing process is captured through a camera.

[0189] Optionally, the handwriting acquisition device further includes:

[0190] The second determining module is used to determine at least one character based on the writing handwriting after determining the writing handwriting based on the pen tip coordinates corresponding to each image in the image set.

[0191] Optionally, the handwriting acquisition device further includes:

[0192] The third determining module is used to determine the first stroke order information corresponding to each character based on the handwriting.

[0193] The second acquisition module is used to acquire the target stroke order information corresponding to each character;

[0194] The stroke order detection module is used to perform stroke order detection based on the first stroke order information and the target stroke order information corresponding to each character, and obtain the detection result.

[0195] The above-mentioned products can perform the handwriting acquisition method provided in any embodiment of the present invention, and have the corresponding functional modules and beneficial effects of performing the handwriting acquisition method.

[0196] Example 3

[0197] Figure 4 A schematic diagram of an electronic device 30 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0198] like Figure 4As shown, the electronic device 30 includes at least one processor 31 and a memory, such as a read-only memory (ROM) 32 or a random access memory (RAM) 33, communicatively connected to the at least one processor 31. The memory stores computer programs executable by the at least one processor. The processor 31 can perform various appropriate actions and processes based on the computer program stored in the ROM 32 or loaded from storage unit 38 into the RAM 33. The RAM 33 can also store various programs and data required for the operation of the electronic device 30. The processor 31, ROM 32, and RAM 33 are interconnected via a bus 34. An input / output (I / O) interface 35 is also connected to the bus 34.

[0199] Multiple components in electronic device 30 are connected to I / O interface 35, including: input unit 36, such as keyboard, mouse, etc.; output unit 37, such as various types of monitors, speakers, etc.; storage unit 38, such as disk, optical disk, etc.; and communication unit 39, such as network card, modem, wireless transceiver, etc. Communication unit 39 allows electronic device 30 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0200] Processor 31 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 31 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. Processor 31 performs the various methods and processes described above, such as handwriting acquisition methods:

[0201] Collect a set of images of the user's writing process;

[0202] Obtain the pen tip coordinates corresponding to each image in the image set;

[0203] The handwriting is determined based on the pen tip coordinates corresponding to each image in the image set.

[0204] In some embodiments, the handwriting acquisition method may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 38. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 30 via ROM 32 and / or communication unit 39. When the computer program is loaded into RAM 33 and executed by processor 31, one or more steps of the handwriting acquisition method described above may be performed. Alternatively, in other embodiments, processor 31 may be configured to perform the handwriting acquisition method by any other suitable means (e.g., by means of firmware).

[0205] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0206] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0207] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0208] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0209] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0210] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0211] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and this is not limited herein.

[0212] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A handwriting acquisition method, characterized in that, The method, executed by a smart terminal, includes: Collect a set of images of the user's writing process; Each image in the image set is sequentially input into the prediction model to obtain the feature image corresponding to each image in the image set. The prediction model is obtained by iteratively training a neural network model using a target sample set, which includes: image samples and the pen tip coordinates corresponding to the image samples. Determine the pen tip coordinates for each image based on the feature image corresponding to each image; The handwriting is determined based on the pen tip coordinates corresponding to each image in the image set; Specifically, each image in the image set is sequentially input into the prediction model to obtain a feature image corresponding to each image in the image set, including: The images in the image set are downsampled to obtain the first feature image; The first feature image is downsampled to obtain the second feature image; The second feature image is downsampled to obtain the third feature image; The third feature image is upsampled to obtain the fourth feature image; The fourth feature image and the second feature image are stitched together to obtain the fifth feature image; The fifth feature image is upsampled to obtain the sixth feature image; The first feature image and the sixth feature image are stitched together to obtain the seventh feature image; The seventh feature image is convolved, and the number of channels in the seventh feature image is controlled to obtain a single-channel output feature map, which is used as the eighth feature image.

2. The method according to claim 1, characterized in that, The pen tip coordinates for each image are determined based on the feature image corresponding to each image, including: Obtain the target region in the eighth feature image whose pixel value is greater than the pixel threshold; The pen tip coordinates are determined based on the center point coordinates of the target area.

3. The method according to claim 2, characterized in that, Determining the pen tip coordinates based on the center point coordinates of the target area includes: The first ratio is determined based on the size of the images in the image set and the size of the eighth feature image; The pen tip coordinates are determined based on the first ratio and the center point coordinates of the target area.

4. The method according to claim 1, characterized in that, The neural network model is trained iteratively using a target sample set, including: The image samples in the target sample set are downsampled to obtain the first predicted feature image; The first predicted feature image is downsampled to obtain the second predicted feature image; The second predicted feature image is downsampled to obtain the third predicted feature image; The third predicted feature image is upsampled to obtain the fourth predicted feature image; The fourth predicted feature image and the second predicted feature image are concatenated to obtain the fifth predicted feature image; The fifth predicted feature image is upsampled to obtain the sixth predicted feature image; The first predicted feature image and the sixth predicted feature image are concatenated to obtain the seventh predicted feature image; The seventh predicted feature image is convolved to obtain the eighth predicted feature image; The parameters of the neural network model are trained based on the objective function generated from the first predicted feature image and the eighth predicted feature image until the prediction model is obtained.

5. The method according to claim 1, characterized in that, The smart terminal includes a camera; A collection of images capturing the user's handwriting process, including: A collection of images of the user's writing process is captured through a camera.

6. The method according to claim 1, characterized in that, After determining the handwriting based on the pen tip coordinates corresponding to each image in the image set, the process further includes: At least one character can be identified based on the handwriting.

7. The method according to claim 6, characterized in that, Also includes: Determine the first stroke order information for each character based on the handwriting; Obtain the target stroke order information for each character; Stroke order detection is performed based on the first stroke order information and the target stroke order information corresponding to each character to obtain the detection result.

8. A handwriting capture device, characterized in that, include: The acquisition module is used to acquire a set of images of the user's writing process; The first acquisition module is used to acquire the pen tip coordinates corresponding to each image in the image set; The first determining module is used to determine the handwriting based on the pen tip coordinates corresponding to each image in the image set; The first acquisition module includes: An input unit is used to sequentially input each image in the image set into a prediction model to obtain a feature image corresponding to each image in the image set. The prediction model is obtained by iteratively training a neural network model using a target sample set, which includes: image samples and pen tip coordinates corresponding to the image samples. The determining unit is used to determine the pen tip coordinates corresponding to each image based on the feature image corresponding to each image; The input unit is specifically used for: The images in the image set are downsampled to obtain the first feature image; The first feature image is downsampled to obtain the second feature image; The second feature image is downsampled to obtain the third feature image; The third feature image is upsampled to obtain the fourth feature image; The fourth feature image and the second feature image are stitched together to obtain the fifth feature image; The fifth feature image is upsampled to obtain the sixth feature image; The first feature image and the sixth feature image are stitched together to obtain the seventh feature image; The seventh feature image is convolved, and the number of channels in the seventh feature image is controlled to obtain a single-channel output feature map, which is used as the eighth feature image.

9. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the handwriting acquisition method according to any one of claims 1-7.

10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that cause a processor to execute the handwriting acquisition method according to any one of claims 1-7.

Citation Information

Patent Citations

  • Writing evaluation method and device, equipment and storage medium

    CN113420983A