create account

You have a bad handwriting? Maybe I can’t read it but my program can by nikolanikola

View this thread on: hive.blogpeakd.comecency.com
· @nikolanikola ·
$107.83
You have a bad handwriting? Maybe I can’t read it but my program can
I remember, I learned to read and write way before entering my elementary school, so someone could maybe think that I had enough time so far to learn to write legibly and neatly.

Allow me to disappointingly answer you: LOL.

Maybe that’s somehow related with the fact that my mum works as a medical worker and we all know that all people in medicine have awful handwriting – something that you can see as a meaningless, curve line, a doctor can read as a ‘‘two weeks, three pills per day’’, so there’s nothing else left to do for you except to swallow those pills and pray to God that it was really written on that prescription. 

As you can see, an ability to read someone’s handwriting is pretty important and that was interesting challenge for machine learning in past years. There is bunch of software on the market and I’m sure that they made solid amount of money to their authors. Also there are numerous reasons to know to recognize written numbers and that’s all part of one big area called [pattern recognition.](https://en.wikipedia.org/wiki/Pattern_recognition)

On my [last article about AI](https://steemit.com/steemstem/@nikolanikola/artificial-intelligence-for-dummies-it-s-all-in-the-game-part-4), I’ve received one interesting comment by @alexander.alexis that made me laugh:

<center> ![](https://i.imgur.com/gSOBRsV.jpg)</center>


But, that also made me thinking and gave me an idea to maybe make some program that can mess around a little bit with pictures. Of course, I can’t make conscious images and program them to be self-made - if I would know that, I would probably be a millionaire so far. 

Instead of that, what if I could write a program that can recognize handwritten digits? Does it sound like a science fiction to you? 

## This is how it works ##
<br>
Pattern recognition is actually one big tool for making decisions – for example, based on symptoms, your doctor has to decide are you sick or not and just to show you how it’s important, imagine two types of error:

If you are healthy and doctor made mistake and considered you as a sick person – it’s still not a big deal, you’ll use your medications for some time to ‘‘cure yourself’’ and that’s it.

But take a look at a different side of a story – if you are sick and doctor made mistake and considered you as a healthy person, it can be much more serious case with catastrophic consequences.

So what is actually making one doctor good?

It’s an ability to notice right symptoms and based on that and his knowledge, to recognize your ‘‘state’’ and make the best possible decision.

Looking through eyes of patter recognition, those symptoms are actually **descriptors** or **features** – I talked about them in my [post about neural networks.](https://steemit.com/steemstem/@nikolanikola/would-you-love-to-see-how-i-trained-my-small-tiny-powerful-neural-network) They are the best possible characteristics for some class and it’s hugely important to choose right features. Basically, choosing right features is almost half job done. To accomplish that, it’s a good practice to talk with someone who is expert in area for which you want to make classifier.

Pattern recognition is widely useful, for example in fingerprint recognition (say hello to Apple servers which are collecting your data through iPhone), or face recognition (say hello to Facebook servers which are collecting your data from your pictures) or in analyzing sentiments in your text (say hello to Google servers which are collecting your data from your mail) and so on.

To show you how it works in practice, I’ve used one data base of handwritten digits, which my class on college made for machine learning exercises. Fun fact – computer has the most difficulties to make the difference between digits 6, 8 and 9. So I’ve used exactly those three digits to show you this principle.

This is how my data base looks like:

![](https://i.imgur.com/PiljPDh.jpg)

And here are some of the representatives:

<center>![](https://i.imgur.com/ZwXcDsY.jpg)</center>


To work easier we should do a little preparation of our data set. You can imagine every picture as a net of pixels and every pixel has some values of red, green and blue color, right? First of all, we will make binarization of pictures – simply said, we’ll turn them to be black and white (you’ll see later why). 

Again, I’m turning on Matlab and we can set one treshold and say that if every pixel value (between 0 and 255) is above that treshold then it’s white pixel and if it’s below then it’s black pixel. You can see the code below how it' done for one image:

![](https://i.imgur.com/Oz4sBG0.jpg)


The result is black and white image:


<center>![crnobela.jpg](https://cdn.steemitimages.com/400x400/https://cdn.steemitimages.com/DQmY69i8iSCX46e4GzZVrp4nQrEJ2jYkqnDCHC8qrCT1ECj/crnobela.jpg)</center>

Next step is to crop that extra white space around the digits, so we could easily extract features and the result should look like this:


<center>![](https://i.imgur.com/4fpemPB.jpg)</center>


When we finish this for all pictures in our data set, then the preparation is finished and we can search for features and further manipulations with this data.

What can we use as features?

 This is why we had to turn our pictures to be black and white – we will use number of black pixels in areas like upper right and lower left corner of the picture as a first and second feature! Basically – we are trying to see is something written in those areas, because it’s supposed for number 6 to have more white pixels in upper right corner and more black pixels in lower left corner. For nines it should be literally the opposite case and for eights it should have black pixels on both areas. 
 
Now, we are going to read all pictures that we will use as a training set:

![](https://i.imgur.com/aqQKaic.jpg)


Function ‘feature’ is a function which I wrote for preparation of the pictures and feature extraction, which I explained above.

Now I’m going to plot those classes.

![](https://i.imgur.com/3Bh0iKW.jpg)

And it looks like this:

<center>![](https://i.imgur.com/35CPZrs.jpg)</center>


As you can see, x1 and x2 are our features (number of black pixels in those two areas) and we can clearly see the difference between our numbers 6, 8 and 9 in this space.

After making the training set, we should build a classifier which we will train to recognize numbers on our test set.

First we will do the same procedure like on the training set – making the test set and extracting the features:

![](https://i.imgur.com/1e149l9.jpg)


Now, if you are not the type who is everyday surrounded with numbers and formulas , prepare yourself to see one of the ugliest things in your life:

<center>![](https://i.imgur.com/XDGmO5Z.jpg)</center>


This is the formula which we will use to make our classifier – It’s called probability density function for vectors with [normal distributed variables.](https://en.wikipedia.org/wiki/Multivariate_normal_distribution) The principle is to calculate density functions for every sample of our classes and to compare them. In order to calculate this, we must first determine covariance matrices and mean values of our training classes:

![](https://i.imgur.com/03IHpOR.jpg)


When it’s finished, we are building now ‘the thing’ which will recognize our numbers, using the formula from above and we will test it immediately:

![](https://i.imgur.com/F9x9DEx.jpg)


In order to see our results, we will use something about which I talked last time in my neural networks article – a confusion matrix! This is that mk variable from the part of the code above – it’s actually a matrix and if we display it’s values, it looks like this:

![](https://i.imgur.com/a8JFvWC.jpg)


This means that out of 60 samples of written sixes, eights and nines, our program wrongly classified only three samples!!!

It recognized one six as an eight and two eights as nines.

And that’s the small, nerdy peek into how those things work behind today’s “buzz technology”.

Impressive, isn’t it?

<br>
I hope that you enjoyed,

I have to thank my mentor @scienceangel for her strong support during writing this article and for staying curious and patient to read everything what I write for STEM community.

---
Sources:

Introduction to statistical pattern recognition, *Keinosuke Fukunaga*

Good part of this article is written relying on my experience.

All images are screenshots, taken from my computer and are free for further use.
👍  , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , and 346 others
properties (23)
authornikolanikola
permlinkyou-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can
categorysteemstem
json_metadata{"tags":["steemstem","science","technology","engineering","teamserbia"],"users":["alexander.alexis","scienceangel"],"image":["https://i.imgur.com/gSOBRsV.jpg","https://i.imgur.com/PiljPDh.jpg","https://i.imgur.com/ZwXcDsY.jpg","https://i.imgur.com/Oz4sBG0.jpg","https://cdn.steemitimages.com/400x400/https://cdn.steemitimages.com/DQmY69i8iSCX46e4GzZVrp4nQrEJ2jYkqnDCHC8qrCT1ECj/crnobela.jpg","https://i.imgur.com/4fpemPB.jpg","https://i.imgur.com/aqQKaic.jpg","https://i.imgur.com/3Bh0iKW.jpg","https://i.imgur.com/35CPZrs.jpg","https://i.imgur.com/1e149l9.jpg","https://i.imgur.com/XDGmO5Z.jpg","https://i.imgur.com/03IHpOR.jpg","https://i.imgur.com/F9x9DEx.jpg","https://i.imgur.com/a8JFvWC.jpg"],"links":["https://en.wikipedia.org/wiki/Pattern_recognition","https://steemit.com/steemstem/@nikolanikola/artificial-intelligence-for-dummies-it-s-all-in-the-game-part-4","https://steemit.com/steemstem/@nikolanikola/would-you-love-to-see-how-i-trained-my-small-tiny-powerful-neural-network","https://en.wikipedia.org/wiki/Multivariate_normal_distribution"],"app":"steemit/0.1","format":"markdown"}
created2018-10-14 14:08:36
last_update2018-10-14 14:08:36
depth0
children19
last_payout2018-10-21 14:08:36
cashout_time1969-12-31 23:59:59
total_payout_value81.288 HBD
curator_payout_value26.546 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length8,479
author_reputation50,408,814,127,998
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,277,089
net_rshares81,704,063,080,300
author_curate_reward""
vote details (410)
@alexander.alexis · (edited)
$0.02
My dad was a dermatologist, so I've inherited some of his ineligible-writing skills :D It would be useful to have a machine to translate my writing for people!

> a confusion matrix!

That's what I felt like reading some of the math!

---

Thanks for the mention. And always interesting to read a machine-learning post.
👍  ,
properties (23)
authoralexander.alexis
permlinkre-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181016t134833758z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-16 13:48:42
last_update2018-10-16 13:49:06
depth1
children1
last_payout2018-10-23 13:48:42
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length319
author_reputation21,140,508,991,402
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,413,301
net_rshares20,261,711,601
author_curate_reward""
vote details (2)
@nikolanikola ·
$0.02
I love to believe that I actually write really nice and that I'm just too lazy to do it properly 😏

>That's what I felt like reading some of the math!

Ohh I was right - I can bet that Gaussian formula scared you? :D

You're welcome, it's always interesting to write a machine learning post :)
👍  ,
properties (23)
authornikolanikola
permlinkre-alexanderalexis-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181017t003020272z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-17 00:30:24
last_update2018-10-17 00:30:24
depth2
children0
last_payout2018-10-24 00:30:24
cashout_time1969-12-31 23:59:59
total_payout_value0.017 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length293
author_reputation50,408,814,127,998
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,444,880
net_rshares19,544,754,267
author_curate_reward""
vote details (2)
@alexs1320 ·
$0.03
I really enjoyed reading this post!

I'm a bit curious... Have you noticed why those few examples were misinterpreted? Seriously bad writing, or something with the alignment or the line was broken...?
👍  , ,
properties (23)
authoralexs1320
permlinkre-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181014t143510204z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-14 14:35:12
last_update2018-10-14 14:35:12
depth1
children2
last_payout2018-10-21 14:35:12
cashout_time1969-12-31 23:59:59
total_payout_value0.024 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length200
author_reputation150,945,165,388,638
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,278,710
net_rshares25,416,159,293
author_curate_reward""
vote details (3)
@nikolanikola · (edited)
$0.03
I'm glad that you like it:)

Well some of them had really bad writing but sometimes some other things can be factors like at this sample below:

![greska.png](https://cdn.steemitimages.com/DQmfGD4ASVbuaD167ejKHmLHNSeZYRJyZb6gsHxXDzW1Y8j/greska.png)

Because it has this black spot in the lower left corner and I was cutting the edges until it comes to first black pixel, it's recognized as 9 😢
👍  ,
properties (23)
authornikolanikola
permlinkre-alexs1320-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181014t144559675z
categorysteemstem
json_metadata{"tags":["steemstem"],"image":["https://cdn.steemitimages.com/DQmfGD4ASVbuaD167ejKHmLHNSeZYRJyZb6gsHxXDzW1Y8j/greska.png"],"app":"steemit/0.1"}
created2018-10-14 14:46:03
last_update2018-10-14 14:46:51
depth2
children1
last_payout2018-10-21 14:46:03
cashout_time1969-12-31 23:59:59
total_payout_value0.024 HBD
curator_payout_value0.003 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length393
author_reputation50,408,814,127,998
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,279,286
net_rshares26,186,957,623
author_curate_reward""
vote details (2)
@alexs1320 ·
$0.02
It's nice to see that preprocessing was responsible and not the algorithm itself. With some more advanced method to replace the simplest thresholding, this becomes useful ;)
👍  , ,
properties (23)
authoralexs1320
permlinkre-nikolanikola-re-alexs1320-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181014t145250231z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-14 14:52:51
last_update2018-10-14 14:52:51
depth3
children0
last_payout2018-10-21 14:52:51
cashout_time1969-12-31 23:59:59
total_payout_value0.017 HBD
curator_payout_value0.001 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length173
author_reputation150,945,165,388,638
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,279,613
net_rshares18,795,152,290
author_curate_reward""
vote details (3)
@fredanderson ·
$0.02
You have a very interesting article! It strike me coz I myself have a bad writing, I will always tell my parents, I'd rather type my report than printing it on the paper. But I think, for myself at least the reason is that I don't hold my pen correctly, many times I've heard people told me " I am holding my pen wrong",  So I guess proper posture affect your handwriting.
👍  ,
properties (23)
authorfredanderson
permlinkre-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181017t132039558z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-17 13:24:42
last_update2018-10-17 13:24:42
depth1
children0
last_payout2018-10-24 13:24:42
cashout_time1969-12-31 23:59:59
total_payout_value0.017 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length372
author_reputation27,999,430,487
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,480,555
net_rshares19,624,262,660
author_curate_reward""
vote details (2)
@lemouth ·
$0.02
This is a very nice post, and the explanations are very clear. I am wondering how many people will try it at home. :)
👍  ,
properties (23)
authorlemouth
permlinkre-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181019t141816615z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-19 14:18:18
last_update2018-10-19 14:18:18
depth1
children2
last_payout2018-10-26 14:18:18
cashout_time1969-12-31 23:59:59
total_payout_value0.017 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length117
author_reputation338,011,164,701,274
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,622,452
net_rshares20,379,427,272
author_curate_reward""
vote details (2)
@nikolanikola · (edited)
Thank you @lemouth! :)

I would be very happy if someone would find himself in those things thanks to my blog, but I think that literally no one will try this at home :D
properties (22)
authornikolanikola
permlinkre-lemouth-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181020t012807954z
categorysteemstem
json_metadata{"tags":["steemstem"],"users":["lemouth"],"app":"steemit/0.1"}
created2018-10-20 01:28:15
last_update2018-10-20 01:32:12
depth2
children1
last_payout2018-10-27 01:28:15
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length169
author_reputation50,408,814,127,998
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,655,614
net_rshares0
@lemouth ·
$0.02
Maybe one day... who knows? :D
👍  ,
properties (23)
authorlemouth
permlinkre-nikolanikola-re-lemouth-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181024t182842603z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-24 18:28:30
last_update2018-10-24 18:28:30
depth3
children0
last_payout2018-10-31 18:28:30
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.005 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length30
author_reputation338,011,164,701,274
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,976,437
net_rshares22,326,335,001
author_curate_reward""
vote details (2)
@utopian-io ·
$0.02
#### Hi @nikolanikola!

Your post was upvoted by utopian.io in cooperation with @steemstem - supporting knowledge, innovation and technological advancement on the Steem Blockchain.

#### Contribute to Open Source with utopian.io
Learn how to contribute on <a href="https://join.utopian.io">our website</a> and join the new open source economy.

**Want to chat? Join the Utopian Community on Discord https://discord.gg/h52nFrV**
👍  ,
properties (23)
authorutopian-io
permlink20181015t022228581z
categorysteemstem
json_metadata{"tags":["utopian.tip"],"app":"utopian-io"}
created2018-10-15 02:22:30
last_update2018-10-15 02:22:30
depth1
children1
last_payout2018-10-22 02:22:30
cashout_time1969-12-31 23:59:59
total_payout_value0.017 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length427
author_reputation152,955,367,999,756
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,311,094
net_rshares19,187,192,920
author_curate_reward""
vote details (2)
@nikolanikola ·
❤️
properties (22)
authornikolanikola
permlinkre-utopian-io-20181015t022228581z-20181015t103005890z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-15 10:30:09
last_update2018-10-15 10:30:09
depth2
children0
last_payout2018-10-22 10:30:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length2
author_reputation50,408,814,127,998
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,332,546
net_rshares0
@zeeshanrai ·
i thought this post is best its increased my knowledge Good Job !
👍  
properties (23)
authorzeeshanrai
permlinkre-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181016t164332721z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-16 16:43:33
last_update2018-10-16 16:43:33
depth1
children1
last_payout2018-10-23 16:43:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length65
author_reputation-14,652,754,275
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,424,328
net_rshares7,908,985,695
author_curate_reward""
vote details (1)
@nikolanikola ·
I would upvote your comment with at least 50$, only if I could ❤️
properties (22)
authornikolanikola
permlinkre-zeeshanrai-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181017t002028470z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-17 00:20:33
last_update2018-10-17 00:20:33
depth2
children0
last_payout2018-10-24 00:20:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length65
author_reputation50,408,814,127,998
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,444,569
net_rshares0
@zen-art ·
$0.02
This is sooooo cool!!! This is the coolest thing I have seen in a while, wow! Oh and, that formula is not the ugliest thing in your life and I am so going to use it in my post tomorrow about math and send you some people over, hihihi, I will even scare them with you :D

P.S. Do you have any idea how to fix the code to be more precise and maybe lower the error probability from 5% to maybe 2% or smaller?
👍  ,
properties (23)
authorzen-art
permlinkre-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181016t204539006z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-16 20:45:39
last_update2018-10-16 20:45:39
depth1
children5
last_payout2018-10-23 20:45:39
cashout_time1969-12-31 23:59:59
total_payout_value0.018 HBD
curator_payout_value0.004 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length405
author_reputation70,614,391,684,372
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,435,950
net_rshares20,117,240,005
author_curate_reward""
vote details (2)
@nikolanikola ·
Thanks Petra! 😊

Have you seen some uglier formulas? Now I'm curious.

You have definitely found the right person for scaring people with math, send them over! :D

Well, like I said to Alex above in comments - those mistakes appeared because some samples were really bad written and the algorithm by itself works nicely, but I assume that there can be some improvement. 

Here's one idea - when cropping, we can after reaching first black pixels on image, to check few rows further to see do we have more black pixels - if not, we can consider it as a black spot and can continue cropping and preprocessing image. That way, we could eliminate that case of misinterpreted eight from above. I hope that I was clear :)
properties (22)
authornikolanikola
permlinkre-zen-art-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181017t005031237z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-17 00:50:36
last_update2018-10-17 00:50:36
depth2
children4
last_payout2018-10-24 00:50:36
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length715
author_reputation50,408,814,127,998
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,445,573
net_rshares0
@zen-art ·
I see beauty in math so to answer your question, nope, I have not seen one ugly thing in math :)
Yeah, you were clear, I think... Like a loop part in the code that would repeat the cropping process after first checking if the pixel is a part of the number or not.
properties (22)
authorzen-art
permlinkre-nikolanikola-re-zen-art-re-nikolanikola-you-have-a-bad-handwriting-maybe-i-can-t-read-it-but-my-program-can-20181017t074651796z
categorysteemstem
json_metadata{"tags":["steemstem"],"app":"steemit/0.1"}
created2018-10-17 07:46:54
last_update2018-10-17 07:46:54
depth3
children3
last_payout2018-10-24 07:46:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length263
author_reputation70,614,391,684,372
root_title"You have a bad handwriting? Maybe I can’t read it but my program can"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id73,463,719
net_rshares0