Reasons for Invalid image region specified

  • 1.2K Views
  • Last Post 20 February 2014
  • Topic Is Solved
Stefan posted this 19 February 2014

I am using the sample Node module to call the ABBYY Cloud API. Every thing works fine with the demo code on github when I call processImage.

I added a function processTextField according to the already provided method processImage.

I set the region query string to "?region=115,40,100,40" for an image that is about 400x200 pixel and I get "Invalid image region specified" with code 450 as response.

The call succeeds with "?region=-1,-1,-1,-1".

What could be the reason for this?

I am a bit puzzled. Thanks for any help!

Stefan

Order By: Standard | Newest | Votes
Stefan posted this 20 February 2014

My bad. Coordinates are top,left,right,bottom. All - including right and bottom - relative to the top left corner.

Anastasia Galimova posted this 20 February 2014

According to the processTextField method description, the coordinates of the region are measured in pixels relative to the left top corner of the image and are specified in the following order: left, top, right, bottom.

So,

  • the first coordinate should be less than the third coordinate,
  • the second coordinate should be less (not equal!) than the fourth coordinate.

Close