Hi
I want to use ocrengine2 to recognize numbers. How do I switch?
form.Add(new StringContent(“2”), “ocrengine”);
Hi
I want to use ocrengine2 to recognize numbers. How do I switch?
form.Add(new StringContent(“2”), “ocrengine”);
I updated the C# OCR example code in Github.
Your code snippet looks good. So I am not sure why it does not work. =>As a test, can you please download the example project and test it there?
try
{
HttpClient httpClient = new HttpClient();
httpClient.Timeout = new TimeSpan(1, 1, 1);
MultipartFormDataContent form = new MultipartFormDataContent();
form.Add(new StringContent("helloworld"), "apikey"); //Added api key in form data
form.Add(new StringContent(getSelectedLanguage()), "language");
form.Add(new StringContent("2"), "ocrengine");
form.Add(new StringContent("true"), "scale");
form.Add(new StringContent("true"), "istable");
if (string.IsNullOrEmpty(ImagePath) == false)
{
byte[] imageData = File.ReadAllBytes(ImagePath);
form.Add(new ByteArrayContent(imageData, 0, imageData.Length), "image", "image.jpg");
}