Handprint Character Recognization

  • 65 Views
  • Last Post 3 weeks ago
Tarun@HWare posted this 06 November 2017

Hello,

We are working on an application where we are required to recognize the hand written characters from a hard copy of document. The document contain text separated by box. Also document might contain some non-alphabet chracters like tick mark/check mark.

I came to know Abby cloud sdk has support for this kind of feature but did not find any sample code of tutorial. Any help is greatly appreciated.

 

Thanks

Tarun Sharma

 

Order By: Standard | Newest | Votes
Oksana Serdyuk posted this 08 November 2017

As we have already answered you by email, you can use the field-level recognition for your usage scenario for extracting any special region on the image. There are available the following methods:

Please refer to the linked pages for detailed information on the methods’ usage.

Our code samples in different programming languages are available at the Code Samples web page.

Tarun@HWare posted this 08 November 2017

Thanks for the response Oksana,

As suggested I have tried to use processFields method for my requirement to fetch more then one handprint data from a form.  However I am getting some error response from server without any detail of error. Please find the error response as below:

====================================

<?xml version="1.0" encoding="utf-8"?>

<response>

    <task id="f00a01f3-e935-4a7a-820b-6c1f4b79a58a" registrationTime="2017-11-08T16:05:27Z" statusChangeTime="2017-11-08T16:05:41Z" status="ProcessingFailed" filesCount="1" credits="8" error="Internal error" />

</response>

====================================

The steps I am following are as below:

  • First I am calling "submitImage" method with image in body.
    •    Got success response with status Submitted and received a task id.
  • Then I execute processFields method by passing this task id from above step. I also added xml to defined the interested fields layout (please check at the bottom of this message).
  • Then I checked the status of task with task id from previous steps. In return I got  status="ProcessingFailed" error="Internal error".

The xml file for proecssField method is as below:

======================

<document xmlns="http://ocrsdk.com/schema/taskDescription-1.0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ocrsdk.com/schema/taskDescription-1.0.xsd http://ocrsdk.com/schema/taskDescription-1.0.xsd">
<fieldTemplates></fieldTemplates>
<page applyTo="0">        <text id="field1" left="21" top="52" right="109" bottom="79">              <language>English</language>              <textType>handprinted</textType>              <markingType>partitionedFrame</markingType>              <regExp>[0-9a-zA-Z]</regExp>              <placeholdersCount>4</placeholdersCount>        </text>        <text id="field2" left="104" top="52" right="188" bottom="83">              <language>English</language>              <textType>handprinted</textType>              <markingType>partitionedFrame</markingType>              <regExp>[0-9a-zA-Z]</regExp>              <placeholdersCount>4</placeholdersCount>        </text> </page>

</document> 

 

Oksana Serdyuk posted this 09 November 2017

There is something wrong with your XML template. In our logs the error is "Invalid page number: 1". If you process a document consisting of one page, then use the

<page applyTo="0">

because the numbering starts from zero.

To know the exact reason of the issue you can use the getTaskStatus method. However, please pay your attention to one peculiarity of usage of this method. If you call the getTaskStatus method for the first time (for the first task with a problem file) you will get the response with the corresponding cause of the issue, i.e. the specific error message. And all other tasks with the same file are also failed to process, but the getTaskStatus method will return the response with the ProcessingFailed status and the Internal error description without more details.

Tarun@HWare posted this 09 November 2017

Initially I have set the applyTo attribute of page element to 0,1,2,3 (copied from sample xml file). Its only after couple of attempts I figured out applyTo should be 0. As I was just playing around with the same sample file it keeps on giving me "ProcessFailed" error. Could that be the reason of error?

What should I do to try again with same file ? Is there any way to delete it from server?

Also I am using an image and not pdf document, could there be any problem because of that?

 

Oksana Serdyuk posted this 09 November 2017

Please send your image and the XML template to CloudOCRSDK@abbyy.com.

Tarun@HWare posted this 09 November 2017

I just sent you the image and xml file content at above mentioned email address. Let me know in case you do not receive.

Oksana Serdyuk posted this 5 weeks ago

Your XML template is fine, but I would recommend you to limit the possible letter set and also to improve the quality of your origin image. The resolution of your image is only 96 dpi and it is quite low for OCR, especially for ICR.

I used the following template:

...
   <page applyTo="0">
      <text id="field1" left="21" top="52" right="109" bottom="79">
         <language>English</language>
         <textType>handprinted</textType>
         <markingType>partitionedFrame</markingType>
         <regExp>[A-Z]</regExp>
         <placeholdersCount>4</placeholdersCount>
      </text>
      <text id="field2" left="104" top="52" right="188" bottom="83">
         <language>Digits</language>
         <textType>handprinted</textType>
         <markingType>partitionedFrame</markingType>
         <regExp>[0-9]</regExp>
         <placeholdersCount>4</placeholdersCount>
      </text>
   </page>
...

and got the values for field1 as 'AKL' and field2 – as '460'. Inaccuracy in recognition is due to the fact that the form is not filled accurately enough:

  • Liked by
  • Tarun@HWare
Tarun@HWare posted this 4 weeks ago

Thanks for the detailed response Oksana,

I tried further on same image to extract more data but like above image it misread other text as well. In date field of same form, sdk read 280717 (28/07/17) to 680414. I understand it could consider 7 (with horizontal dash) as 4 but not sure why 2 is tread as 6.

I see there is a writingStyle parameters that can tell more about style of hand-print character, can that be a help in recognizing characters with more accuracy. Is so how we can use it, i don't see much documentation about it.

 

Thanks

Tarun Sharma

 

 

Oksana Serdyuk posted this 4 weeks ago

Kindly try this field description:

      <text id="field3" left="300" top="69" right="411" bottom="94">
         <language>Digits</language>
         <textType>handprinted</textType>
         <markingType>partitionedFrame</markingType>
         <regExp>(((|0)[1-9])|([12][0-9])|(30)|(31))(((|0)[1-9])|(10)|(11)|(12))([0-9][0-9])</regExp>
         <placeholdersCount>6</placeholdersCount>
      </text>

then the recognition result is "280414".

  • Liked by
  • Tarun@HWare
Tarun@HWare posted this 3 weeks ago

Hello Oksana,

 

Thanks a lot for the response and sorry for delayed reply, I was engaged in developing sample application as per your above suggestions. Solution works great when we try with static image embedded in our solution, however there is an issue , Abbyy cloud sdk require the exact pixel location for the fields to be extracted (in static xml file). But when capturing the image from camera the resolution of captured document can greatly vary depends on how the document is scanned. In this case putting a static xml file with fields location is very hard to match and thus the results are never predictable. 

Is there any other way we can provide the interested area in captured image so the abbyy cloud sdk can captured the data. 

 

Thanks

Tarun Sharma

Oksana Serdyuk posted this 3 weeks ago

I see the following ways:

1) You can add to user interface a frame showing the document position on the screen when the user is taking a picture. This should help you to get photos with the same document position on them.

2) Another possible solution is to use our offline product - ABBYY FlexiCapture Engine.

Close