I have tested with OCR ABBY using sample code C# with sucess , but with the command :

ConsoleTest.exe --asMRZ C:\image.jpg C:\ (the result is file image.xml)

I want to integrate in my code C#, with function ProcessMRZ.

I do these steps:

1)I added two references: AbbyyOnlineSdk and NDesk.Options 2) I add namespace: using Abbyy.CloudOcrSdk;

3)I declare RESTClient: private Rest serviceclient RESTClient;

4)I called to the Test () function, with my infos details: name of my application and password

5)Now I want to apply asMRZ: Process Mrz, I call restClient.Process Mrz (@ "C: \ temp \ image.jpg"); Unfortunately, I have not the result ... I always ERROR!

Is Step 5) to call MRZ Process correct ? or how I should change it?

I also tried with: Process Mrz (@ "C: \ temp \ image.jpg" @ "C: \ temp \"); I have always not the result !!

Thanks

asked 27 Jun '16, 15:05

thabet%20idris's gravatar image

thabet idris
174

edited 10 Mar, 13:30

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦
1.5k16

We need some additional information from you to investigate the issue:

1) Kindly send us your project and step-by-step instruction how to run your application and reproduce the issue.

2) Please send us the logs from any HTTP debugger (such as Fiddler). We need to know what requests do you send to the server).

(27 Jun '16, 16:09) Oksana Serdyuk ♦♦

Thanks,

This is my TRY project ABBYY C#:

link text

link

answered 27 Jun '16, 16:25

thabet%20idris's gravatar image

thabet idris
174

I do not see in your code that you create and send any request to the service. In your case it should be:

[POST] http(s)://cloud.ocrsdk.com/processMRZ

and the input image file should be transmitted in the request body.

I would recommend you to re-read

link

answered 28 Jun '16, 12:42

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦
1.5k16

Very thanks,

I make the code for C#:

String url = "http://cloud.ocrsdk.com/processImage?Language=English,Russian"; WebRequest request = WebRequest.Create(url);

        String toEncode = ApplicationID + ":" + ApplicationPassword;
        Encoding isoEncoding = Encoding.GetEncoding("iso-8859-1");
        String isoEncoded = Encoding.GetBytes(toEncode);

        String baseEncoded = Convert.ToBase64String(isoEncoded);

        request.Headers.Add("Authorization", "Basic " + baseEncoded);

I have ERROR with Encoding.GetBytes(toEncode); Exist any using to add?

And please for i decise my input file : "http://cloud.ocrsdk.com/processImage?imageSource=...? How i precise my source, if it is in my PC or photo with scanner? Can you give mme a exemple please,

My photo is locate in C:\temp\

link

answered 28 Jun '16, 13:13

thabet%20idris's gravatar image

thabet idris
174

edited 30 Jun '16, 12:11

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦
1.5k16

There are some misprints in the code snippet in the Authentication section. Please do the following:

Encoding encoding = Encoding.GetEncoding("iso-8859-1");
string toEncode = ApplicationID + ":" + ApplicationPassword;
string baseEncoded = Convert.ToBase64String(encoding.GetBytes(toEncode));
request.Headers.Add( "Authorization", "Basic " + baseEncoded );

We have already corrected the documentation and we apologize for all possible inconvenience.

As for your question about the imageSource parameter, it is optional parameter and you can miss it. By default the value is auto and it means that the program will detect the image source automatically. But if you need to choose the source image you can allow the users of your application to make the choice themselves by implementing this possibility in the interface of your application.

link

answered 30 Jun '16, 12:17

Oksana%20Serdyuk's gravatar image

Oksana Serdyuk ♦♦
1.5k16

edited 30 Jun '16, 12:48

It is good Now it is correct Very thanks..

(30 Jun '16, 13:14) thabet idris
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×195
×37
×7

Asked: 27 Jun '16, 15:05

Seen: 713 times

Last updated: 10 Mar, 13:30

© 2016 ABBYY. All rights Reserved. www.ABBYY.com | Privacy Policy | Legal