Citation: Premachandra, H.W.H.;
Yamada, M.; Premachandra, C.;
Kawanaka, H.
Low-Computational-Cost Algorithm
for Inclination Correction of
Independent Handwritten Digits on
Microcontrollers. Electronics 2022, 11,
1073. https://doi.org/10.3390/
electronics11071073
Academic Editors: Enrico Vezzetti,
Andrea Luigi Guerra, Gabriele
Baronio, Domenico Speranza
and Luca Ulrich
Received: 9 February 2022
Accepted: 28 March 2022
Published: 29 March 2022
Publisher’s Note: MDPI stays neutral
with regard to jurisdictional claims in
published maps and institutional affil-
iations.
Copyright: © 2022 by the authors.
Licensee MDPI, Basel, Switzerland.
This article is an open access article
distributed under the terms and
conditions of the Creative Commons
Attribution (CC BY) license (https://
creativecommons.org/licenses/by/
4.0/).
Article
Low-Computational-Cost Algorithm for Inclination Correction
of Independent Handwritten Digits on Microcontrollers
H. Waruna H. Premachandra
1
, Maika Yamada
2
, Chinthaka Premachandra
2,
* and Hiroharu Kawanaka
3
1
ICT Center (Information Communication Technology Center), Wayamba University of Sri Lanka,
Makandura, Gonawila (NWP) 60170, Sri Lanka; waruna@wyb.ac.lk
2
Department of Electronic Engineering, School of Engineering, Shibaura Institute of Technology,
Tokyo 135-8548, Japan; ag17111@shibaura-it.ac.jp
3
Department of Electrical and Electronic Engineering, Mie University, Mie 514-8507, Japan;
kawanaka@elec.mie-u.ac.jp
* Correspondence: chintaka@sic.shibaura-it.ac.jp
Abstract:
In recent years, the digitization of documents has progressed, and opportunities for
handwritten document creation have decreased. However, handwritten notes are still taken for
memorizing data, and automated digitalization is needed in some cases, such as making Excel sheets.
When digitizing handwritten notes, manual input is required. Therefore, the automatic recognition
and input of characters using a character recognition system is useful. However, if the characters are
inclined, the recognition rate will be low. Therefore, we focus on the inclination correction problem
of characters. The conventional method corrects the inclination and estimates the character line
inclination. However, these methods do not work when characters exist in independent positions.
Therefore, in this study, we propose a new method for estimating and correcting the tilt of independent
handwritten digits by analyzing a circumscribed rectangle and other digital features. The proposed
method is not based on an AI-based learning model or a complicated mathematical model. It is
developed following a comparatively simple mathematical calculation that can be implemented on a
microcontroller. Based on the results of the experiments using digits written in independent positions,
the proposed method can correct the inclination with high accuracy. Furthermore, the proposed
algorithm is low-computational cost and can be implemented in real-time on a microcontroller.
Keywords:
document image processing; character inclination estimation; circumscribed rectangle;
digit feature analysis
1. Introduction
Owing to document digitalization, handwritten document usage is decreasing. How-
ever, there are many situations in which handwriting is needed. For example, writing down
experimental data in notes during scientific experiments using apparatus is still common.
Sometimes, automatically converting memorized data to electronic documents, such as
Excel sheets, sheets by OCR platforms (ex: Nanonets-OCR platform), is important because
manual insertion is time-consuming. The automatic conversion of written documents to
electronic documents does not work well when written data are inclined. This inclination
correction problem is solved when the written data exists as character lines. However, they
do not work well when characters exist as independent characters.
Many studies have been conducted on document image analysis [
1
–
7
], including
mathematical expression recognition [
8
], character recognition, etc. Character tilt correc-
tion is related to document image analysis. In conventional research, some methods are
used to correct the inclination of character lines, such as the inclination correction of the
character string using a wavelet transform and statistical-based methods [
8
–
21
]. When it
is a character string (line) with two or more characters, the slope of the character string
is estimated, and the slope is corrected. However, these methods cannot be applied to
Electronics 2022, 11, 1073. https://doi.org/10.3390/electronics11071073 https://www.mdpi.com/journal/electronics