我正在尝试使用 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++创建二叉搜索树.我只使用函数来插入数据和查找数据.我似乎无法使程序工作,虽然我发现它是非常逻辑和正确的?
任何帮助将不胜感激.
#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)