Tif image CreateAnchorTemplate and FindAnchor issue with DPI

Discussions about machine vision support in GdPicture.
Post Reply
azeeth
Posts: 11
Joined: Tue Mar 19, 2019 7:54 am

Tif image CreateAnchorTemplate and FindAnchor issue with DPI

Post by azeeth » Mon May 27, 2019 3:11 am

Hi,
We have a product where we let users create Tif OCR template and then process Tif images to populate fields based on the template to match on OCR anchor.

It all works great if the template and processing images have same DPI. However it doesn't work if the DPI are not same. For example we found an issue where the template Tif has 300 DPI resolution. Whenever process images of 200 DPI resolution against the template, it doesn't return the correct coordinates for the anchor, which then results in wrong data field values.

We have tried to scale or manually set the resolution to same value, but still the anchor is not right.
We have also tried to do some math and calculate search coordinates in inches and then calculate pixels depending of the resolution but it doesn't seem to work right.

Please download the example Tif files in below link. 300 DPI tif is used to create template. The anchor coordinates are stored in inches in database. 200 DPI tif is then processed for data fields against the template. When processed the resulting anchor found is way bigger which is not right and results in incorrect OCR data.

https://drive.google.com/file/d/1DMXblT ... sp=sharing

Ajit

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: Tif image CreateAnchorTemplate and FindAnchor issue with DPI

Post by Gabriela » Mon May 27, 2019 3:16 pm

Hi,

The only possible solution here is that your template and all candidates need to have the same characteristics so the results are consistent. That means if the template is 300 DPI then the candidates should also be 300 DPI with the same kind of acquisition context. Of course, you can re-scale the 200 DPI candidate using appropriate methods (not only changing the DPI), but it is not recommended, as it produces bad results either.
Let us know if it helps.

azeeth
Posts: 11
Joined: Tue Mar 19, 2019 7:54 am

Re: Tif image CreateAnchorTemplate and FindAnchor issue with DPI

Post by azeeth » Wed May 29, 2019 5:41 am

Thanks.
But we think it getting right anchor should work regardless of the DPI as we supplying the coordinate pixels converted from inches when template was created.
I think two functions CreateAnchorTemplate() and FindAnchor() could be improved to get the right result.
We are a paying customer, can we please open up a technical support ticket? I have asked another question about OCR on Tif files that we are having trouble with. The whole mechanism of GDPicture creating Tif does something weird to the final file, that screws up the OCR and anchoring coordinates.

Ajit

Gabriela
Posts: 436
Joined: Wed Nov 22, 2017 9:52 am

Re: Tif image CreateAnchorTemplate and FindAnchor issue with DPI

Post by Gabriela » Wed May 29, 2019 7:56 am

Hello,

Of course, you can open a support ticket through the Helpdesk button here:
Helpdesk
Or directly here: Support platform
Thank you.

Post Reply

Who is online

Users browsing this forum: Amazon [Bot] and 1 guest