Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Monday, March 11, 2013 6:56:16 AM(UTC)

rad1  
rad1

Groups: Registered
Posts: 23


Hello,

I'm working on an application that allows user to scan many documents. These documents are all of the same type, and my application must be able to get the same information from all document.

I'm using rectangle to define the zone of the information to get, but my problem is when some documents have not the same DPI.

How can I get the same rectangle/zone for different DPI?

In other words, how to update the coordinates of the rectangle when you change the DPI?

Thanks for help.
 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Tuesday, March 12, 2013 4:54:13 AM(UTC)

mohamed  
mohamed

Groups: Registered, Tech Support
Posts: 179


If changing the DPI is done to the scanner's settings (scanning resolution), this will change the size of the scanned image (dimensions in pixels).
This means that if you scan a document with 8.5x11 inches using 100 DPI the result image size will be 850x1100 pixels (inches x DPI).
Also, if you scanned the same document using 200 DPI the result image size will be 1700x2200 pixels. This will affect the position you need to set for the zones.

One way to do it is to store the zone locations based on some reference DPI such as 300. When the image is loaded or scanned by the user, check the image's DPI before you run OCR and if it's different from 300, change all zone coordinates by a ratio of:
newCoord = storedCoord * newDPI / 300.

This means if a zone's left top corner was at (200, 250) and the user scans at 400 DPI instead of 300, the new coordinates will be:
newCoordX = 200 * 400 / 300
newCoordY = 250 * 400 / 300

So the zone corner becomes (266, 333) instead of (200, 250).

The same ratio applies to the width and height.
Mohamed Abedallah
Developer Support Engineer
LEAD Technologies, Inc.

LEAD Logo
 
#3 Posted : Thursday, March 21, 2013 7:30:39 AM(UTC)

rad1  
rad1

Groups: Registered
Posts: 23


Hello Mohamed,

Thanks for help, it works well.

Regards.
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.052 seconds.