1

有人使用fineReader abbyy sdk 10吗?我很好奇图像ocr处理后是否有可能获得数据挖掘的成功率。

对于我们有从图像中收集数据的工作流的场景,如果识别的结果小于 90%,那么我们将我们的批次进行视觉验证/校正。

对于 sdk 处理,我使用的是 .net - 知道它不是那么重要,但是......以防万一

我怎样才能达到这个数字?谢谢你的建议

4

3 回答 3

1

没有“全局识别置信度”属性。开发人员应使用自己的置信度标准自行计算。最简单的方法是遍历每个字符,检查 CharParams.IsSuspicious 属性。这是 FREngine 11 的代码示例 (C#)

    //Statistics counters 

    //Count of all suspicious symbols in layout
    private int suspiciousSymbolsCount;
    //Count of all unrecognized symbols in layout
    private int unrecognizedSymbolsCount;
    //Count of all nonspace symbols in layout
    private int allSymbolsCount;
    //Count of all words in layout
    private int allWordsCount;
    //Count of all not dictionary word in layout
    private int notDictionaryWordsCount;
    private void processImage()
    {
        // Create document
        FRDocument document = engineLoader.Engine.CreateFRDocument();

        try {
            // Add image file to document
            displayMessage( "Loading image..." );
            string imagePath = Path.Combine( FreConfig.GetSamplesFolder(), @"SampleImages\Demo.tif" );

            document.AddImageFile( imagePath, null, null );

            //Recognize document
            displayMessage( "Recognizing..." );
            document.Process( null );

            // Calculate text statistics
            displayMessage( "Calculating statistics..." );
            clearStatistics();
            for( int i = 0; i < document.Pages.Count; i++ ) {
                calculateStatisticsForLayout( document.Pages[i].Layout );
            }

            //show calculated statistics
            displayStatistics();

        } catch( Exception error ) {
            MessageBox.Show( this, error.Message, this.Text, MessageBoxButtons.OK, MessageBoxIcon.Error );
        }
        finally {
            // Close document
            document.Close();
        }
    }
    private void calculateStatisticsForLayout( Layout layout )
    {    
        LayoutBlocks blocks = layout.Blocks;
        for( int index = 0; index < blocks.Count; index++ ) {
            calculateStatisticsForBlock( blocks[index] );
        }
    }

    void calculateStatisticsForBlock( IBlock block )
    {           
        if( block.Type == BlockTypeEnum.BT_Text ) {
            calculateStatisticsForTextBlock( block.GetAsTextBlock() );
        } else if( block.Type == BlockTypeEnum.BT_Table ) {
            calculateStatisticsForTableBlock( block.GetAsTableBlock() );
        }
    }

    void calculateStatisticsForTextBlock( TextBlock textBlockProperties )
    {
        calculateStatisticsForText( textBlockProperties.Text );
    }

    void calculateStatisticsForTableBlock( TableBlock tableBlockProperties )
    {
        for( int index = 0; index < tableBlockProperties.Cells.Count; index++ ) {
            calculateStatisticsForBlock( tableBlockProperties.Cells[index].Block );
        }
    }

    void calculateStatisticsForText( Text text ) 
    {
        Paragraphs paragraphs = text.Paragraphs;
        for( int index = 0; index < paragraphs.Count; index++ ) {
            calculateStatisticsForParagraph( paragraphs[index] );
        }
    }

    void calculateStatisticsForParagraph( Paragraph paragraph )
    {
        calculateCharStatisticsForParagraph( paragraph );

        calculateWordStatisticsForParagraph( paragraph );
    }

    void calculateCharStatisticsForParagraph( Paragraph paragraph )
    {
        for( int index = 0; index < paragraph.Text.Length; index++ )
        {
            calculateStatisticsForChar( paragraph, index );
        }
    }

    void calculateStatisticsForChar( Paragraph paragraph, int charIndex )
    {
        CharParams charParams = engineLoader.Engine.CreateCharParams();
        paragraph.GetCharParams( charIndex, charParams );
        if( charParams.IsSuspicious ) 
        {
            suspiciousSymbolsCount++;
        }

        if( isUnrecognizedSymbol( paragraph.Text[charIndex] ) ) 
        {
            unrecognizedSymbolsCount++;
        }

        if( paragraph.Text[charIndex] != ' ' ) 
        {
            allSymbolsCount++;
        }
    }

    void calculateWordStatisticsForParagraph( Paragraph paragraph )
    {
        allWordsCount += paragraph.Words.Count;

        for( int index = 0; index < paragraph.Words.Count; index++ ) 
        {
            if( !paragraph.Words[index].IsWordFromDictionary ) 
            {
                notDictionaryWordsCount ++;
            }
        }
    }

    bool isUnrecognizedSymbol( char symbol )
    {
        //it is special constant used by FREngine recogniser
        return ( symbol == 0x005E );
    }

    void displayStatistics()
    {
        labelAllSymbols.Text = "All symbols: " + allSymbolsCount.ToString();
        labelSuspiciosSymbols.Text = "Suspicious symbols: " + suspiciousSymbolsCount.ToString();
        labelUnrecognizedSymbols.Text = "Unrecognized symbols: " + unrecognizedSymbolsCount.ToString();

        labelAllWords.Text = "All words: " + allWordsCount.ToString();
        labelNotDictionaryWords.Text = "Non-dictionary words: " + notDictionaryWordsCount.ToString();
    }
于 2016-02-15T10:56:27.300 回答
0

恕我直言,没有这样的“全局置信度”值 - 但您可以通过获取每个角色的置信度并对总数进行平均来轻松获得此值。但是,我认为您应该将您的请求发送到 ABBYY 的论坛或支持电子邮件地址,以了解他们的建议。

真的不可能告诉你如果我使用引擎我会得到什么程度的信心,因为这一切都取决于图像的质量、字体的大小等等:没有像'这样的东西行业用来作为数据基础的平均文档。

祝你好运!

于 2013-03-05T14:30:16.243 回答
0

FRE SDK 识别结果仅在文本或表格块中具有文本。我建议你有一个全局字数统计变量。

  1. 运行异步方法来遍历单词并获取单词中可疑字符的数量。(可疑)
  2. 查找每页中带有可疑字符的单词总数
  3. (带有可疑字符的单词)/(总单词数)并将结果乘以 100。

    2/4 等于 0.5。乘以 0.5 * 100 = 50%。那是您的准确性。上面在 abbyy 的另一个答案中给出了检查可疑字符和置信度的代码示例。

于 2019-11-12T13:49:25.223 回答