ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Loading TImageEnVect for OCR
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

Sidney Egnew

USA
51 Posts

Posted - Jun 07 2017 :  06:58:21  Show Profile  Reply
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.

xequte

38187 Posts

Posted - Jun 08 2017 :  18:56:13  Show Profile  Reply
Hi

TImageEnVect is just a TImageEnView with vectorial features, so you should still use the same loading procedure:

ImageVector := TImageEnVect.Create(nil);
try
  ImageVector.IO.LoadFromFile(SourceFileName);
  BarcodeDetection(ImageVector, myStringList);
finally
  ImageVector.Free;
end

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: