小编use*_*524的帖子

Tessnet2 使用 Tesseract 引擎 - 为什么它会给出非常糟糕的输出?

我正在尝试使用 Tessnet2 在 C# 中使用 Tesseract 引擎。对于我给 Tessnet2 的许多测试图像,输出非常糟糕,几乎没有什么是正确的。

这是我在 C# 控制台项目 Program.cs 类中的代码:

 static void Main(string[] args)
    {
        try
        {
        Bitmap image = new Bitmap(@"C:\Users\hp\Desktop\eurotext.tif");
        var ocr = new Tesseract();

        //when I tried to add the SetVariable(...), it didn't change the output much

        ocr.Init(@"C:\Program Files (x86)\Tesseract-OCR", "eng", true);

        var result = ocr.DoOCR(image, Rectangle.Empty);
        foreach (Word word in result)
            Console.WriteLine("{0} : {1}", word.Confidence, word.Text);

        Console.ReadLine();
    }
    catch (Exception exception)
    {
        Console.WriteLine("Error");
    }
}
Run Code Online (Sandbox Code Playgroud)

例如,这是一个样本(大二进制 300 dpi)测试图像“eurotext.tif”: 在此处输入图片说明

这是该图像的 Tessnet2 输出: 在此处输入图片说明

我一直在使用这个网站来学习使用 …

c# ocr tesseract tessnet2

5
推荐指数
1
解决办法
6093
查看次数

二叉搜索树?

我正在尝试使用C++创建二叉搜索树.我只使用函数来插入数据和查找数据.我似乎无法使程序工作,虽然我发现它是非常逻辑和正确的?

任何帮助将不胜感激.

#include<iostream>
using namespace std;

template <class T>
class BinarySearchTree
{
private:
    struct tree
    {
        tree *leftchild;
        tree *rightchild;
        T data;
    };
    tree *root;
public:
    BinarySearchTree()
    {
        root=NULL; 
    }
    void insert(T);
    void searchForItem(T);
};

template<class T>
void BinarySearchTree<T>::insert(T newNum)
{
    tree *newItem = new tree; 
    tree *parent; 

    newItem->data = newNum;
    newItem->leftchild = NULL;
    newItem->rightchild = NULL;

    if(root==NULL) 
        root=newItem;

    else
    {
        tree *current;
        current=root;
        while(current) 
        {
            parent = current;

            if(newItem->data > current->data)
                current = current->rightchild;
            else
                current = current->leftchild;
        } …
Run Code Online (Sandbox Code Playgroud)

c++ pointers class binary-search-tree

-3
推荐指数
1
解决办法
545
查看次数

标签 统计

binary-search-tree ×1

c# ×1

c++ ×1

class ×1

ocr ×1

pointers ×1

tesseract ×1

tessnet2 ×1