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 : Wednesday, September 9, 2009 11:42:46 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 769


A common approach in today's market is to scan large batches of images, dump them into a folder and have another application that takes care of whatever processing you want to do on them such as OCR, forms processing, etc.  This sample VB.NET 2005 project shows how to do the first step in this kind of application.  The documents are going to be multipage, so the scanning application needs to know when to stop appending pages and start a new file.  For this purpose, a separator page with a barcode is inserted between each document's pages to indicate that a new file needs to be started.
 
This example also shows how to use SetCapability to set the AutoScan, AutoFeed, and TransferCount capabilities.
 
To run this demo, you need to at least print the first page from the word document which has the barcode separator page.  You'll likely need a few copies so you can insert them between your documents.  This demo assumes that the first page scanned is a separator.
File Attachment(s):
NET - v16 - Twain Barcode Separator.zip (21kb) downloaded 69 time(s).
 

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 : Thursday, September 10, 2009 11:45:01 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 769


This is a modification of the demo above to tackle a more specific task.  Rather than saving all pages to one format and bpp, some customers have wanted to scan different images at different bit depths and save them accordingly.  For example, a customer may want the first page to be 1bpp, 2nd page 8bpp, 3rd page 24bpp, and the remaining 1bpp.  Another example would be to scan pages 1-3 as 1bpp, page 4 as 8bpp, and the remaining pages at 1bpp.

There's two ways to go about this:

1. Set the necessary capabilities such as CAP_XFERCOUNT, ICAP_PIXELTYPE, etc. and then call Acquire.  Once those pages are done, set the capabilities for the next couple of pages and Acquire again.  Finally, once you've reached the point where the rest of the pages in the batch are to be the same, set CAP_XFERCOUNT to -1.  Some people may prefer this method because the scanner hardware is returning the image at the desired color resolution.  However, this can be difficult to program and causes a lot of overhead with the amount of capabilities you have to set.  When you hit a separator, you would need to cancel the scanning operation by setting e.Cancel to true.

2. Scan all pages at 24bpp color and process the images as needed in the AcquirePage event before saving.  This may or may not be faster depending on the kind of processing you intend on doing and the bpps you want to save.  However, this is easier to code and requires a lot less communication to and from the scanner.

I have attached two sample projects showing how to do each.
File Attachment(s):
 
#3 Posted : Thursday, September 10, 2009 12:23:45 PM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 769


Some scanners (many Kodak and Fujitsus for example) also have the ability to scan multiple bit depths at the same time which could enhance the image quality when using the second approach.  For more information, please visit http://support.leadtools...rums/24809/ShowPost.aspx
 
#4 Posted : Monday, February 8, 2010 5:14:25 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 769


For a VB6 COM Interop version of this example, check out http://support.leadtools.com/SupportPortal/CS/forums/32830/ShowPost.aspx.
 
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-2017, Yet Another Forum.NET
This page was generated in 0.212 seconds.