I wrote an application to test IEVision OCR capabilities.
ImageFolder: TImageEnFolderMView
ImageVector: TImageEnVect
I wrote functions using TImageEnVect to extract barcodes and OCR from the ImageFolder select image. Here is how I am loading ImageVector:
procedure TForm2.ImageFolderImageSelect(Sender: TObject; idx: Integer);
begin
ImageFolder.CopyToIEBitmap(idx,ImageVector.IEBtmap);
ImageVector.Update;
end;
The test program works correctly but I am having trouble getting it to work with my production application. Both the test and the production application are accessing images stored on disk in single page TIFF files. But the production program does not use any visual components. A queue is monitored that tells the program to process a particular image. I am using this code:
ImageVector := TImageEnVect.Create(nil);
try
// ImageVector.LoadFromFileIEV(SourceFileName); -- I tried this first
ImageVector.LoadObjectsFromTiff(SourceFileName,0);
BarcodeDetection(ImageVector,myStringList);
finally
ImageVector.Free;
end
My detection routine does not work with the new code. Here is my detection logic:
ImageVector.SelectionBase := iesbBitmap;
SelectionRectangle := IEVisionRect(0, 0, 0, 0);
if ImageVector.Selected then
with ImageVector do
SelectionRectangle := IEVisionRect(SelX1, SelY1, SelX2 - SelX1 + 1, SelY2 - SelY1 + 1);
BarcodeSymbols := IEVisionLib.createBarCodeScanner().scan(ImageVector.IEBitmap.GetIEVisionImage(), SelectionRectangle);
for i := 0 to BarcodeSymbols.size() - 1 do
begin
BarcodeSymbol := TIEVisionBarCodeSymbol(BarcodeSymbols.getObj(i));
StringList.Add(BarcodeSymbol.GetSymbolType().c_str()
+';'
+BarcodeSymbol.GetData().c_str());
end;
Please advise.