CN113569842A - Method for positioning and acquiring handwriting based on pen point - Google Patents
Method for positioning and acquiring handwriting based on pen point Download PDFInfo
- Publication number
- CN113569842A CN113569842A CN202110791992.4A CN202110791992A CN113569842A CN 113569842 A CN113569842 A CN 113569842A CN 202110791992 A CN202110791992 A CN 202110791992A CN 113569842 A CN113569842 A CN 113569842A
- Authority
- CN
- China
- Prior art keywords
- point
- pen
- image
- taking
- boundary box
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000004590 computer program Methods 0.000 claims description 6
- 230000000007 visual effect Effects 0.000 abstract description 2
- 238000001514 detection method Methods 0.000 description 6
- 238000013527 convolutional neural network Methods 0.000 description 4
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/04—Architecture, e.g. interconnection topology
- G06N3/045—Combinations of networks
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/08—Learning methods
-
- Y—GENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
- Y02—TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
- Y02D—CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
- Y02D10/00—Energy efficient computing, e.g. low power processors, power management or thermal management
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Health & Medical Sciences (AREA)
- Biomedical Technology (AREA)
- Biophysics (AREA)
- Computational Linguistics (AREA)
- Life Sciences & Earth Sciences (AREA)
- Evolutionary Computation (AREA)
- Artificial Intelligence (AREA)
- Molecular Biology (AREA)
- Computing Systems (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Mathematical Physics (AREA)
- Software Systems (AREA)
- Health & Medical Sciences (AREA)
- Image Analysis (AREA)
Abstract
The invention discloses a method and a device for positioning and acquiring handwriting based on a pen point, which can process each frame of image in real time, and can detect key points and motion tracks of the pen point more accurately and more stably by increasing the amplified visual field, detecting angles and carrying out standardized processing on pen holder angles.
Description
Technical Field
The invention relates to the technical field of image processing, in particular to a method for positioning and acquiring handwriting based on a pen point.
Background
At present, writing tracks are often acquired by connecting a pen with a sensor with terminal equipment to transmit writing information, but the pen is often expensive and cannot be popularized. Currently, an effective method for real-time and accurate positioning of a pen point during writing and saving of a writing motion trajectory for real-time written character recognition is also lacking.
Disclosure of Invention
Aiming at the defects of the prior art, the invention aims to provide a method for positioning and acquiring handwriting based on a pen point.
In order to achieve the purpose, the invention adopts the following technical scheme:
a method for positioning and acquiring handwriting based on a pen point comprises the following specific processes:
s1, acquiring a frame of video image I1 by using a camera;
s2, detecting a hand boundary box B1 containing the pen-holding gesture from the image I1;
s3, expanding the hand boundary box B1 outwards by the set proportion f to obtain a boundary box B2, and cutting an image I2 along the boundary box B2;
s4, detecting the image I2 to obtain a rough key point P of a pen point and a pen holder inclination angle theta, wherein the pen holder inclination angle theta is an included angle between a central axis of a pen holder and a horizontal line;
s5, taking the rough key point P as a starting point, taking the pen point direction as the positive inclined direction of the pen holder, and taking the direction opposite to the pen point as the negative inclined direction of the pen holder; extending the pen holder in the positive oblique direction to intersect with the boundary box B2 at a point N, extending the pen holder in the negative oblique direction to intersect with the boundary box B2 at a point M, and taking a midpoint S of a line segment PM;
s6, taking the point P as a center, rotating the image to a standard angle beta, simultaneously recording the rotated point S as S ', and recording the rotated point N as N'; the standard angle beta is the average value of the inclination angles of all penholders in the sample data;
s7, taking the point S 'and the point N' as two vertexes of a rectangle to enclose a rectangular frame, and cutting out an image I3;
s8, detecting the image I3, acquiring a fine key point Q of a pen point, and storing the point Q to a track queue;
s9, acquiring the next frame of video image and repeating the steps S2-S8.
Further, in the method, the value of f is 10-20%.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the above-mentioned method.
An electronic device comprising a processor and a memory for storing a computer program; the processor is configured to implement the above method when executing the computer program.
The invention has the beneficial effects that: the pen point detection method carries out real-time processing on each frame of image, and can detect the key points and the motion tracks of the pen point more accurately and more stably by increasing the amplified visual field, detecting the angle and carrying out standardized processing on the pen holder angle.
Drawings
FIG. 1 is a schematic diagram of an example of a method in an embodiment of the invention.
Detailed Description
The present invention will be further described with reference to the accompanying drawings, and it should be noted that the present embodiment is based on the technical solution, and the detailed implementation and the specific operation process are provided, but the protection scope of the present invention is not limited to the present embodiment.
The embodiment provides a method for positioning and acquiring handwriting based on a pen point, which comprises the following specific processes:
s1, acquiring a frame of video image I1 by using the camera, as shown in figure 1.
S2, a hand bounding box B1 including the pen-holding posture is detected from the image I1. Wherein a general target detection model can be used for detection.
S3, expanding the hand boundary box B1 outwards by the set proportion f (10% -20%) to obtain a boundary box B2, and cutting out the image I2 along the boundary box B2.
S4, detecting the image I2, and obtaining a rough key point P of the pen point and a pen holder inclination angle theta, wherein the pen holder inclination angle theta refers to an included angle between a central axis of the pen holder and a horizontal line. The detection can be performed by adopting a key point detection model based on a CNN convolutional neural network, and the model is trained based on a regression method.
S5, taking the rough key point P as a starting point, taking the pen point direction as the positive inclined direction of the pen holder, and taking the direction opposite to the pen point as the negative inclined direction of the pen holder; the intersection point N with the boundary box B2 is extended in the positive penholder inclination direction, the intersection point M with the boundary box B2 is extended in the negative penholder inclination direction, and the midpoint S of the line segment PM is taken.
S6, taking the point P as a center, rotating the image to a standard angle beta, simultaneously recording the rotated point S as S ', and recording the rotated point N as N'; the standard angle beta is the average value of the inclination angles of all penholders in the sample data;
s7, using the point S 'and the point N' as two vertexes of the rectangle to enclose a rectangular frame, and cutting out the image I3.
S8, detecting the image I3, acquiring a fine key point Q of a pen point, and storing the point Q to a track queue; the detection can be specifically carried out by adopting a key point model based on a CNN convolutional neural network, and the model is trained based on a regression method.
S9, acquiring the next frame of video image and repeating the steps S2-S8.
The final trajectory queue is composed of pen point fine key points Q of a series of video images, and therefore handwriting is obtained.
Various corresponding changes and modifications can be made by those skilled in the art based on the above technical solutions and concepts, and all such changes and modifications should be included in the protection scope of the present invention.
Claims (4)
1. A method for positioning and acquiring handwriting based on a pen point is characterized by comprising the following specific processes:
s1, acquiring a frame of video image I1 by using a camera;
s2, detecting a hand boundary box B1 containing the pen-holding gesture from the image I1;
s3, expanding the hand boundary box B1 outwards by the set proportion f to obtain a boundary box B2, and cutting an image I2 along the boundary box B2;
s4, detecting the image I2 to obtain a rough key point P of a pen point and a pen holder inclination angle theta, wherein the pen holder inclination angle theta is an included angle between a central axis of a pen holder and a horizontal line;
s5, taking the rough key point P as a starting point, taking the pen point direction as the positive inclined direction of the pen holder, and taking the direction opposite to the pen point as the negative inclined direction of the pen holder; extending the pen holder in the positive oblique direction to intersect with the boundary box B2 at a point N, extending the pen holder in the negative oblique direction to intersect with the boundary box B2 at a point M, and taking a midpoint S of a line segment PM;
s6, taking the point P as a center, rotating the image to a standard angle beta, simultaneously recording the rotated point S as S ', and recording the rotated point N as N'; the standard angle beta is the average value of the inclination angles of all penholders in the sample data;
s7, taking the point S 'and the point N' as two vertexes of a rectangle to enclose a rectangular frame, and cutting out an image I3;
s8, detecting the image I3, acquiring a fine key point Q of a pen point, and storing the point Q to a track queue;
s9, acquiring the next frame of video image and repeating the steps S2-S8.
2. The method of claim 1, wherein f is 10% -20%.
3. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the method of any one of claims 1-2.
4. An electronic device comprising a processor and a memory, the memory for storing a computer program; the processor is adapted to carry out the method of any of claims 1-2 when executing the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110791992.4A CN113569842B (en) | 2021-07-13 | 2021-07-13 | Method for positioning and obtaining handwriting based on pen point |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110791992.4A CN113569842B (en) | 2021-07-13 | 2021-07-13 | Method for positioning and obtaining handwriting based on pen point |
Publications (2)
Publication Number | Publication Date |
---|---|
CN113569842A true CN113569842A (en) | 2021-10-29 |
CN113569842B CN113569842B (en) | 2023-09-26 |
Family
ID=78164654
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110791992.4A Active CN113569842B (en) | 2021-07-13 | 2021-07-13 | Method for positioning and obtaining handwriting based on pen point |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113569842B (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5902968A (en) * | 1996-02-20 | 1999-05-11 | Ricoh Company, Ltd. | Pen-shaped handwriting input apparatus using accelerometers and gyroscopes and an associated operational device for determining pen movement |
CN102520849A (en) * | 2011-11-28 | 2012-06-27 | 北京盛世宣合信息科技有限公司 | Electronic brush writing method and system |
US20130136377A1 (en) * | 2011-11-29 | 2013-05-30 | Samsung Electronics Co., Ltd. | Method and apparatus for beautifying handwritten input |
CN103744541A (en) * | 2014-01-26 | 2014-04-23 | 上海鼎为电子科技(集团)有限公司 | Writing pen, electronic terminal and writing system |
CN110647282A (en) * | 2019-09-18 | 2020-01-03 | 中北大学 | Handwritten track information acquisition method |
CN112132080A (en) * | 2020-09-29 | 2020-12-25 | 深圳棒棒帮科技有限公司 | Method and device for solving pen point image coordinates of intelligent pen, medium and intelligent pen |
-
2021
- 2021-07-13 CN CN202110791992.4A patent/CN113569842B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US5902968A (en) * | 1996-02-20 | 1999-05-11 | Ricoh Company, Ltd. | Pen-shaped handwriting input apparatus using accelerometers and gyroscopes and an associated operational device for determining pen movement |
CN102520849A (en) * | 2011-11-28 | 2012-06-27 | 北京盛世宣合信息科技有限公司 | Electronic brush writing method and system |
US20130136377A1 (en) * | 2011-11-29 | 2013-05-30 | Samsung Electronics Co., Ltd. | Method and apparatus for beautifying handwritten input |
CN103744541A (en) * | 2014-01-26 | 2014-04-23 | 上海鼎为电子科技(集团)有限公司 | Writing pen, electronic terminal and writing system |
CN110647282A (en) * | 2019-09-18 | 2020-01-03 | 中北大学 | Handwritten track information acquisition method |
CN112132080A (en) * | 2020-09-29 | 2020-12-25 | 深圳棒棒帮科技有限公司 | Method and device for solving pen point image coordinates of intelligent pen, medium and intelligent pen |
Non-Patent Citations (1)
Title |
---|
邢冲;吴仲城;: "基于三维力信息的笔交互毛笔书法效果表达", 计算机系统应用, no. 10 * |
Also Published As
Publication number | Publication date |
---|---|
CN113569842B (en) | 2023-09-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2021129528A1 (en) | Sorting method and apparatus, and device and storage medium | |
CN110163912B (en) | Two-dimensional code pose calibration method, device and system | |
CN112052852B (en) | Character recognition method of handwriting meteorological archive data based on deep learning | |
CN106325737A (en) | Method and equipment for erasing writing path | |
CN108009536A (en) | Scan method to go over files and system | |
CN115497108B (en) | Chinese character framework angular point detection method based on elliptical eccentricity | |
WO2022002262A1 (en) | Character sequence recognition method and apparatus based on computer vision, and device and medium | |
CN103617631B (en) | A kind of tracking based on Spot detection | |
CN114863571A (en) | Collaborative robot gesture recognition system based on computer vision | |
WO2022222096A1 (en) | Hand-drawn graph recognition method, apparatus and system, and computer readable storage medium | |
CN113705564B (en) | Pointer type instrument identification reading method | |
CN113569842B (en) | Method for positioning and obtaining handwriting based on pen point | |
CN114494751A (en) | License information identification method, device, equipment and medium | |
CN109241942B (en) | Image processing method and device, face recognition equipment and storage medium | |
US20180005066A1 (en) | Merging overlapping broken lines of a table | |
CN108436917B (en) | Calligraphy and carving robot writing control method considering tail end boundary | |
CN113222990B (en) | Chip counting method based on image data enhancement | |
CN115035032A (en) | Neural network training method, related method, device, terminal and storage medium | |
US9977979B2 (en) | Merging non-overlapping broken lines of a table | |
CN111291756B (en) | Method and device for detecting text region in image, computer equipment and computer storage medium | |
CN114359931A (en) | Express bill identification method and device, computer equipment and storage medium | |
CN115657925B (en) | Touch input recognition system, method, device and computer-readable storage medium | |
CN104731323B (en) | A kind of gesture tracking method of many direction of rotation SVM models based on HOG features | |
Borad et al. | Digitization of Handwritten Attendance Entries using Structural Similarity Measurement | |
CN113269742B (en) | System and method for identifying and detecting sub-regions in quasi-web crawler discrete region group |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |