{"id":15717,"date":"2020-10-28T14:00:00","date_gmt":"2020-10-28T21:00:00","guid":{"rendered":"https:\/\/devwww.3cloudsolutions.com\/post\/handwriting-ocr-with-azure-3\/"},"modified":"2024-01-04T10:35:13","modified_gmt":"2024-01-04T18:35:13","slug":"handwriting-ocr-with-azure","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/handwriting-ocr-with-azure\/","title":{"rendered":"Handwriting OCR with Azure"},"content":{"rendered":"<p>Computer vision is one area where AI has really shone in recent years. In this post we&#8217;ll be taking a look at the handwriting recognition available in <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/computer-vision\/concept-recognizing-text\" target=\"_blank\" rel=\"noopener\">Read within Microsoft Azure&#8217;s Cognitive Services<\/a>.<\/p>\n<p><!--more--><\/p>\n<p>I&#8217;ve found that in the work-from-home environment I make excessive use of my whiteboards. Yes, plural, whiteboards. I really enjoy them. What I don&#8217;t enjoy is wishing I hadn&#8217;t erased something after I have. It doesn&#8217;t happen t<span style=\"background-color: transparent;\">erribly often but because it has I end up cramming notes into every nook and <\/span><span style=\"background-color: transparent;\">cranny of it before I start erasing the oldest stuff.<\/span><\/p>\n<p><img decoding=\"async\" style=\"width: 1200px;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/12\/Blog_Handwriting-OCR-with-Azure.png\" alt=\"Blog_Handwriting OCR with Azure\" width=\"1200\" \/><\/p>\n<p>The simplest solution would be to snap a picture with my cell phone and call it good. Even better would be mounting a security camera pointed at my whiteboard so there&#8217;s a nice consistent angle to the shots. If I&#8217;m going this far with it I might as well throw some AI based handwriting OCR at it so I can generate a searchable database, right? It&#8217;s the natural thing to do.<\/p>\n<p>Having recently had some excellent experience using text analytics within Cognitive Services I was eager to see what Read would give recognizing my whiteboard writing. I was expecting it be bamboozled by my sometimes-horrible handwriting or requiring some level of pre-processing to sharpen and clarify the input but the results from sending in the very first image were fantastic!<\/p>\n<p>This blog post won&#8217;t be a code-level review. For that I recommend <a href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/computer-vision\/quickstarts-sdk\/client-library?pivots=programming-language-pyth\" rel=\"noopener\">Microsoft&#8217;s Read&#8217;s <\/a><a id=\"__hsNewLink\" href=\"https:\/\/docs.microsoft.com\/en-us\/azure\/cognitive-services\/computer-vision\/quickstarts-sdk\/client-library?pivots=programming-language-pyth\" rel=\"noopener\">QuickStart guide.<\/a><\/p>\n<p>(I&#8217;ve linked to the Python version of the QuickStart for a reason. While we will not go into the code behind this I will mention I used OpenCV for the input, image manipulation, and output elements. OpenCV is a handy tool to have in your back pocket for computer vision projects and Python is a popular language to work with it. I doubt you will regret giving the combination a shot.)<\/p>\n<p>What you will get back from Read is a JSON document giving you the coordinates around each block of text and the text within. With that I can (crudely) draw a white box over the original text and draw the text back on in a variable font size that is roughly the right size.<\/p>\n<p>Here you can see a before and after of what the original board looked like and a visual representation of what Read told us about it.<\/p>\n<p><img decoding=\"async\" style=\"width: 706px;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/demo1-orig.png\" alt=\"demo1-orig\" width=\"706\" \/><img decoding=\"async\" style=\"width: 709px;\" src=\"https:\/\/3cloudsolutions.com\/wp-content\/uploads\/2022\/11\/demo1-ai.png\" alt=\"demo1-ai\" width=\"709\" \/><\/p>\n<p>There is also some additional metadata about confidence levels regarding the text predictions returned from Read but I was not concerned with that for this experiment.<\/p>\n<p>At this point I have all the data I need for a simple logging of what I&#8217;ve had on my whiteboard any given day. Future enhancements will likely include logging it all into OneNote for me, or maybe a method to publish to a Teams channel to share with a group. Perhaps some better color matching to the original whiteboard background and marker color is in order too.<\/p>\n<p><span data-contrast=\"auto\">If you&#8217;re interested in learning more we&#8217;d welcome a discussion with you and your team. Please <a href=\"\/get-started\/\">contact us<\/a> today!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Computer vision is one area where AI has really shone in recent years. In this post we\\&#8217;ll be taking a look at the handwriting recognition available in Read within Microsoft Azure\\&#8217;s Cognitive Services.<\/p>\n","protected":false},"author":21,"featured_media":12840,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[260],"tags":[319],"class_list":["post-15717","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai","tag-machine-learning-ai","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/15717","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=15717"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/15717\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/12840"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=15717"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=15717"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=15717"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}