# aircalc
This is under review.
aircalc has been downloaded by 20,387 downloads worldwide as of Feb.24, 2023.
aircalc is a Python program based on two state-of-the-art libraries including hand gesture recognition library
using mediapipe and optical character recognition library using tesseract.
aircalc can be easilly installed by pip command (PyPi).
This short program is made for education by showing how to use two state-of-the-art libraries.
aircalc has an error correction function for correcting hand-drawn images in order to achieve perfect image recognition by tesseract.
The paper on aircalc is under submission. If the paper is accepted, the source code will be disclosed with detailed explanations.
The hand gesture recognition allows you to draw a math expression and it will be automatically calculated. The answer will be posted on the screen.
Writing letters with a pen on paper is very different from drawing letters in the air.
Drawing "-" minus operator and "+" operator in the air are extremely difficult so that these operators in the current system are replaced by "W" and "P" respectively.
When drawing letters with fingers in the air, letters that are difficult
to recognize or write in the air need to be replaced with letters
that can be accurately recognized by artificial intelligence.
For example, replace the number "1" with "L" in the air.
# How to install necessary libraries
$ pip install pytesseract
For Windows users, you should also install the latest tesseract
https://github.com/UB-Mannheim/tesseract/wiki
And add tesseract.exe of Tesseract-OCR directory PATH in .profile or .bashrc.
$ pip install mediapipe
Finally install aircalc
$ pip install aircalc
$ pip install aircalc --force-reinstall --no-cache-dir --no-binary :all:
# How to run aircalc
aircalc is a program for drawing a math expression
in the air for possible calculation.
aircalc is based on two open source libraries including mediapipe and tesseract.
There are six states of five fingers recognized by mediapipe library:
0-finger, 1-finger, 2-finger, 3-finger, 4-finger, and 5-finger respectively.
<pre>
A pen of index finger tip is used for drawing an expression
by fingers.
0-finger can move the pen without drawing.
1-finger can draw lines in the air.
2-finger can move the pen without drawing.
3-finger can delete the last touches of drawn letters for correction.
4-finger can call tesseract for transforming the hand-writing
images to the digital text for possible calculation.
For several seconds, 4-finger can terminate the program
for showing the answer of the hand-drawn expression.
5-finger can move the pen without drawing.
</pre>
Continuous 4-finger state can terminate and exit this program.
0-finger or 5-finger is equivalent to 2-finger.
The saved picture is tranformed into digital text using the state-of-the-art
optical character recognition.
Writing letters with a pen on paper is very different from drawing letters in the air.
Of the 0 to 9 digits, 1 is the least recognizable number.
Drawing "L" in the air represents "1".
"S" or "5" in the air represents "5".
"P" in the air represents "+" plus operator.
"W" or "-" represents "-" minus operator.
"V" in the air represents "/" division operator.
"M" in the air represents "*" multiplication operator.
"&" in the air represents "\**" exponential operator.
Drawing two letters "a" and "A" in the air represents the sqrt() function.
Therefore, the string "a13A" or "aL3A" represents sqrt(13).
$ aircalc
https://youtu.be/med_jrFTMPA
<pre> sqrt(6)*2=? </pre>
<img src='https://github.com/y-takefuji/air_calculator/raw/main/a6AM2.png' width=320 height=240>
<pre> 1-3=? 10+2=? </pre>
[![Lw3.gif](https://github.com/y-takefuji/air_calculator/raw/main/Lw3.gif)](https://github.com/y-takefuji/air_calculator) [![10plus2.gif](https://github.com/y-takefuji/air_calculator/raw/main/10plus2.gif)](https://github.com/y-takefuji/air_calculator)
<pre> 4-5-3=? </pre>
[![4-5-3.gif](https://github.com/y-takefuji/air_calculator/raw/main/4-5-3.gif) <img src='https://github.com/y-takefuji/air_calculator/raw/main/4-5-3.png' width=160 height=120> <img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_4-5-3.png' width=120 height=90>
<pre> 2-3/5=? </pre>
[![2-3div5.gif](https://github.com/y-takefuji/air_calculator/raw/main/2-3div5.gif)
<img src='https://github.com/y-takefuji/air_calculator/raw/main/2-3div5.png' width=160 height=120> <img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_2-3div5.png' width=120 height=90>
<pre> 34*5=? </pre>
[![34M5.gif](https://github.com/y-takefuji/air_calculator/raw/main/34M5.gif)
<img src='https://github.com/y-takefuji/air_calculator/raw/main/34M5.png' width=160 height=120>
<img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_34M5.png' width=120 height=90>
<pre> 2**8=?</pre>
[![2^8.gif](https://github.com/y-takefuji/air_calculator/raw/main/2^8.gif)
<pre> 2&9V3 --> 2**9/3 </pre>
[![2^9div3.gif](https://github.com/y-takefuji/air_calculator/raw/main/2^9div3.gif)
<img src='https://github.com/y-takefuji/air_calculator/raw/main/2^9div3.png' width=160 height=120>
<img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_2^9div3.png' width=120 height=90>
<pre> aLLAV3=? -> sqrt(11)/3 </pre>
[![aLLAV3.gif](https://github.com/y-takefuji/air_calculator/raw/main/aLLAV3.gif)
<img src='https://github.com/y-takefuji/air_calculator/raw/main/aLLAV3.png' width=160 height=120>
<img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_aLLAV3.png' width=120 height=90>
Raw data
{
"_id": null,
"home_page": "https://github.com/y-takefuji/air_calculator",
"name": "aircalc",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.8",
"maintainer_email": null,
"keywords": null,
"author": "yoshiyasu takefuji",
"author_email": "takefuji@keio.jp",
"download_url": "https://files.pythonhosted.org/packages/a4/9a/8862c89acdcfc5424cda51806c2f4064daa8298fcccc052232ed0988ddab/aircalc-0.0.7.tar.gz",
"platform": null,
"description": "# aircalc\nThis is under review.\n\naircalc has been downloaded by 20,387 downloads worldwide as of Feb.24, 2023.\n\naircalc is a Python program based on two state-of-the-art libraries including hand gesture recognition library \nusing mediapipe and optical character recognition library using tesseract. \naircalc can be easilly installed by pip command (PyPi).\nThis short program is made for education by showing how to use two state-of-the-art libraries.\naircalc has an error correction function for correcting hand-drawn images in order to achieve perfect image recognition by tesseract.\n\nThe paper on aircalc is under submission. If the paper is accepted, the source code will be disclosed with detailed explanations.\n\nThe hand gesture recognition allows you to draw a math expression and it will be automatically calculated. The answer will be posted on the screen.\n\nWriting letters with a pen on paper is very different from drawing letters in the air.\n\nDrawing \"-\" minus operator and \"+\" operator in the air are extremely difficult so that these operators in the current system are replaced by \"W\" and \"P\" respectively.\n\nWhen drawing letters with fingers in the air, letters that are difficult \nto recognize or write in the air need to be replaced with letters \nthat can be accurately recognized by artificial intelligence.\nFor example, replace the number \"1\" with \"L\" in the air.\n\n# How to install necessary libraries\n\n$ pip install pytesseract\n\nFor Windows users, you should also install the latest tesseract\n\nhttps://github.com/UB-Mannheim/tesseract/wiki\n\nAnd add tesseract.exe of Tesseract-OCR directory PATH in .profile or .bashrc.\n\n$ pip install mediapipe\n\nFinally install aircalc\n\n$ pip install aircalc\n\n$ pip install aircalc --force-reinstall --no-cache-dir --no-binary :all:\n\n# How to run aircalc\n\naircalc is a program for drawing a math expression \nin the air for possible calculation.\n\naircalc is based on two open source libraries including mediapipe and tesseract.\n\nThere are six states of five fingers recognized by mediapipe library: \n0-finger, 1-finger, 2-finger, 3-finger, 4-finger, and 5-finger respectively.\n<pre>\nA pen of index finger tip is used for drawing an expression \nby fingers. \n\n0-finger can move the pen without drawing. \n1-finger can draw lines in the air. \n2-finger can move the pen without drawing. \n3-finger can delete the last touches of drawn letters for correction.\n4-finger can call tesseract for transforming the hand-writing \nimages to the digital text for possible calculation. \nFor several seconds, 4-finger can terminate the program \nfor showing the answer of the hand-drawn expression.\n5-finger can move the pen without drawing. \n</pre>\n\nContinuous 4-finger state can terminate and exit this program.\n\n0-finger or 5-finger is equivalent to 2-finger.\n\nThe saved picture is tranformed into digital text using the state-of-the-art \noptical character recognition.\n\nWriting letters with a pen on paper is very different from drawing letters in the air.\n\nOf the 0 to 9 digits, 1 is the least recognizable number.\n\nDrawing \"L\" in the air represents \"1\".\n\n\"S\" or \"5\" in the air represents \"5\".\n\n\"P\" in the air represents \"+\" plus operator.\n\n\"W\" or \"-\" represents \"-\" minus operator.\n\n\"V\" in the air represents \"/\" division operator.\n\n\"M\" in the air represents \"*\" multiplication operator.\n\n\"&\" in the air represents \"\\**\" exponential operator.\n\nDrawing two letters \"a\" and \"A\" in the air represents the sqrt() function.\nTherefore, the string \"a13A\" or \"aL3A\" represents sqrt(13).\n\n$ aircalc\n\nhttps://youtu.be/med_jrFTMPA\n<pre> sqrt(6)*2=? </pre>\n<img src='https://github.com/y-takefuji/air_calculator/raw/main/a6AM2.png' width=320 height=240>\n\n<pre> 1-3=? 10+2=? </pre>\n[![Lw3.gif](https://github.com/y-takefuji/air_calculator/raw/main/Lw3.gif)](https://github.com/y-takefuji/air_calculator) [![10plus2.gif](https://github.com/y-takefuji/air_calculator/raw/main/10plus2.gif)](https://github.com/y-takefuji/air_calculator)\n\n<pre> 4-5-3=? </pre>\n[![4-5-3.gif](https://github.com/y-takefuji/air_calculator/raw/main/4-5-3.gif) <img src='https://github.com/y-takefuji/air_calculator/raw/main/4-5-3.png' width=160 height=120> <img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_4-5-3.png' width=120 height=90>\n\n<pre> 2-3/5=? </pre>\n[![2-3div5.gif](https://github.com/y-takefuji/air_calculator/raw/main/2-3div5.gif)\n<img src='https://github.com/y-takefuji/air_calculator/raw/main/2-3div5.png' width=160 height=120> <img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_2-3div5.png' width=120 height=90>\n\n\n<pre> 34*5=? </pre>\n[![34M5.gif](https://github.com/y-takefuji/air_calculator/raw/main/34M5.gif)\n<img src='https://github.com/y-takefuji/air_calculator/raw/main/34M5.png' width=160 height=120> \n<img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_34M5.png' width=120 height=90>\n\n<pre> 2**8=?</pre>\n[![2^8.gif](https://github.com/y-takefuji/air_calculator/raw/main/2^8.gif)\n\n\n<pre> 2&9V3 --> 2**9/3 </pre>\n[![2^9div3.gif](https://github.com/y-takefuji/air_calculator/raw/main/2^9div3.gif)\n<img src='https://github.com/y-takefuji/air_calculator/raw/main/2^9div3.png' width=160 height=120> \n<img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_2^9div3.png' width=120 height=90>\n\n<pre> aLLAV3=? -> sqrt(11)/3 </pre> \n[![aLLAV3.gif](https://github.com/y-takefuji/air_calculator/raw/main/aLLAV3.gif)\n<img src='https://github.com/y-takefuji/air_calculator/raw/main/aLLAV3.png' width=160 height=120> \n<img src='https://github.com/y-takefuji/air_calculator/raw/main/resize_aLLAV3.png' width=120 height=90>\n\n\n",
"bugtrack_url": null,
"license": null,
"summary": "aircalc: calculate a math expression by five fingers in air.",
"version": "0.0.7",
"project_urls": {
"Bug Tracker": "https://github.com/y-takefuji/air_calculator",
"Homepage": "https://github.com/y-takefuji/air_calculator"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6db54acc93ed90667c7d524b3ef99bf2f74ba73dcdafd5043655b6b93a4c2ea9",
"md5": "48e4d1121830ae264527cd70ac5abcb4",
"sha256": "ef1335f84f93a60fca30068672cca343a2a0ec1ba91f46c2d9d9c1094557de3f"
},
"downloads": -1,
"filename": "aircalc-0.0.7-py3-none-any.whl",
"has_sig": false,
"md5_digest": "48e4d1121830ae264527cd70ac5abcb4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8",
"size": 5526,
"upload_time": "2024-04-22T08:41:51",
"upload_time_iso_8601": "2024-04-22T08:41:51.599461Z",
"url": "https://files.pythonhosted.org/packages/6d/b5/4acc93ed90667c7d524b3ef99bf2f74ba73dcdafd5043655b6b93a4c2ea9/aircalc-0.0.7-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "a49a8862c89acdcfc5424cda51806c2f4064daa8298fcccc052232ed0988ddab",
"md5": "63e28793a6e1193344fe9d288a78464d",
"sha256": "70e71094f0c1e64775416c09d55d8faa8481a99194fdda355f49907733aa8224"
},
"downloads": -1,
"filename": "aircalc-0.0.7.tar.gz",
"has_sig": false,
"md5_digest": "63e28793a6e1193344fe9d288a78464d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8",
"size": 5394,
"upload_time": "2024-04-22T08:41:53",
"upload_time_iso_8601": "2024-04-22T08:41:53.237611Z",
"url": "https://files.pythonhosted.org/packages/a4/9a/8862c89acdcfc5424cda51806c2f4064daa8298fcccc052232ed0988ddab/aircalc-0.0.7.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-22 08:41:53",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "y-takefuji",
"github_project": "air_calculator",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "aircalc"
}