コミュニティ

Layout File 回答済み

Hello,

with Abbyy Corporate Edition you are able to load a image file and then define areas on it for the OCR.

You can save this layout into a layout file with the "blk" file extension.

 

It seems that there is no way to load this created layout file within the FineReader Engine API, is there?

この記事は役に立ちましたか?

0人中0人がこの記事が役に立ったと言っています

コメント

6件のコメント

  • Avatar
    Permanently deleted user

    Unfortunately, you cannot use .blk file in FRE.

    But you can create a layout using FRE API, save it into a file and use it in other FRE applications (please, see Developer’s Help → API Reference → Layout-Related Objects → Layout). Also ImageViewer Visual Component is a good way to create a layout file via gui (see Developer’s Help → Visual Components Reference → ImageViewer)

    0
  • Avatar
    Permanently deleted user

    Thank you for your answer.

    I have tried the following to create the layout file via API as mentioned in the Developer's Help.

    For example:

                Dim Region As FREngine.Region = Engine.CreateRegion()

                Region.AddRect(1974, 406, 2114, 442)

                Dim Block As FREngine.Block

                Block = abbLayout.AddBlock(FREngine.BlockTypeEnum.BT_Text, Region)

    The coordinates of the rectangle i got from the AnalyzePage method.

    It is from the first block of the analyzed Page.

    There is a text "Seite 1" in it.

    But nothing is recognized when calling the RecognizePage method.

     

     

     

     

     

     

    0
  • Avatar
    Permanently deleted user

    Is the ImageViewer component included in the FineReader 10 Engine SDK?

    0
  • Avatar
    Permanently deleted user

    But can you save the layout you created with ImageViewer?

    In the sample it doesn't seem to be possible.

    0
  • Avatar
    Permanently deleted user

    First things first:

    Did you defined type of block before recognition? I guess should use TextBlock.

     

    About ImageViewer:

    You should use Synchronizer object to sync document with ImageViewer. So your document layout will change according to changes in ImageViewer component. After that you can save the layout using the following code sample:

    Document.Pages.Item(page_num).Layout.SaveToFile(path);

    I would also recommend you to check our ImageComponents demo to better understand how to work with visual components.

    To load the layout please use the following code:

    Document.Pages.Item(page_num).Layout.LoadFromFile(path); 
    Document.Pages.Item(page_num).Synthesize(null);
    0
  • Avatar
    Permanently deleted user

    First things first:

    Did you defined type of block before recognition? I guess should use TextBlock.

     

    I did as you can see above.

      Block = abbLayout.AddBlock(FREngine.BlockTypeEnum.BT_Text, Region)

     

    Meanwhile I solved the problem: setting TextLanguage of RecognizerParams for the Textblock.

    Before I only passed the RecognizerParams to the FRDocument.Recognize() method.

     

                Dim RP As FREngine.RecognizerParams = Engine.CreateRecognizerParams

                RP.TextLanguage = Engine.PredefinedLanguages.FindLanguage("German").TextLanguage

     

                Dim Textblock As FREngine.ITextBlock = Block.GetAsTextBlock

                Textblock.RecognizerParams = RP

     

     

     

    0

サインインしてコメントを残してください。