Here is the problem I'm trying to solve.
--->We would like to speed up scanning by feeding the scanner multiple documents at a time (as opposed to feeding the scanner on document at a time).
-->To respect the document boundaries, we insert separator sheets between consecutive documents. The separator sheet will be recognizable through visual patterns.
Does anybody know how I can recognize specific pattern on a scanned image in order to identify the separator sheets on the fly and recognize them as document delimiters?
This (hard) feature will be included withih the next GdPicture V5 release.
I come back ASAP into this topic to give the best way to do that.
You can use the folowing code to acquire multiple image from a document feeder using a separator sheets.
- This code assumes that the first page in the feeder is a separator sheet.
- This code creates multipage PDF files. You can modify it easily in order to acquire into multipage TIFF files.
- This code is working from the GdPicture [PRO] V 5.0.5 http://www.gdpicture.com/download.php
Code: Select all
Dim nPDFNo As Long Dim nImageID As Long Dim nTemplateSeparator As Long Dim nCloserTemplate As Long Dim nCpt As Long Dim Imaging1 As Object Set Imaging1 = CreateObject("gdpicturepro5.imaging") 'GdPicture Pro. For GdPicture Light must be "gdpicture4.imaging" Imaging1.SetLicenseNumber ("YourLicenseKEY") Imaging1.TwainOpenDefaultSource Imaging1.TwainSetHideUI (True) Imaging1.TwainSetAutoFeed (True) 'Set AutoFeed Enabled Imaging1.TwainSetAutoScan (True) 'To achieve the maximum scanning rate 'First STEP: We create a new document identifier template from a scan of the paper separator nImageID = Imaging1.CreateImageFromTwain(Me.hWnd) nTemplateSeparator = Imaging1.ADRCreateTemplateFromGdPictureImage(nImageID) Imaging1.CloseImage (nImageID) 'Step 2, Now we will scan all the document feeder into several PDF files (a new PDF is created if a paper separator is detected) nPDFNo = 1 Imaging1.TwainPdfStart ("output" & Str(nPDFNo) & ".pdf") While Imaging1.CreateImageFromTwain(Me.hWnd) <> 0 nCpt = nCpt + 1 nImageID = Imaging1.GetNativeImage nCloserTemplate = Imaging1.ADRGetCloserTemplateForGdPictureImage(nImageID) If nCloserTemplate = nTemplateSeparator And Imaging1.ADRGetLastRelevance >= 92 Then 'A paper separator seems to be detected, we start on a new output PDF Imaging1.TwainPdfStop nPDFNo = nPDFNo + 1 Imaging1.TwainPdfStart ("output" & Str(nPDFNo) & ".pdf") Else Imaging1.TwainAddGdPictureImageToPdf (nImageID) End If Imaging1.CloseImage (nImageID) Wend Imaging1.TwainPdfStop Call Imaging1.TwainCloseSource
Let me know if you have any question regarding this method.
Who is online
Users browsing this forum: No registered users and 2 guests