首页 \ 问答 \ C#中的良好开源OCR [关闭](Good opensource OCR in C# [closed])

C#中的良好开源OCR [关闭](Good opensource OCR in C# [closed])

C#中有一个很好的开源OCR实现吗? 我正在尝试解决以下问题。 我有一个包含框的文件,人们在框中输入他们的身份证号码。 现在我想弄清楚程序中的id号。

谢谢你,巴拉


Is there a good open source OCR implementation in C#? I am trying to solve the following problem. I have a document which contains boxes and people enter their id number in the box. Now I want to figure out the id number in program.

Thank you, Bala


原文:https://stackoverflow.com/questions/1798077
更新时间:2024-04-04 10:04

最满意答案

您的协同功能正常工作。 问题是你正在从Update函数中调用它,并且它在一秒钟内被多次调用。 您可以使用boolean变量来检查协程函数是否正在运行。 如果它正在运行,则不要攻击或启动新的协程。 如果不是,那么你可以启动协程。

在协程函数结束时,将该变量设置为false 。 还有其他方法可以做到这一点,但这似乎是最简单的方法。

bool isAttackingPlayer = false;
IEnumerator HarmPlayer()
{
    Debug.Log("Inside Harm Player");
    yield return new WaitForSeconds(5);
    Debug.Log("Player Health is the issue");
    isAttackingPlayer = false; //Done attacking. Set to false
}

void Update()
{

    transform.LookAt(target);
    float step = speed * Time.deltaTime;
    distance = (transform.position - target.position).magnitude;
    if (distance < 3.5)
    {
        if (isAttackingPlayer == false)
        {
            isAttackingPlayer = true; //Is attacking to true
            animator.SetFloat("Attack", 0.2f);
            StartCoroutine("HarmPlayer");
        }
    }
}

Your coroutine functions is working properly. The problem is that you are calling it from the Update function and it's being called many times in a second. You can use a boolean variable to check if the coroutine function is running. If it is running, don't attack or start new coroutine. If it is not, then you can start coroutine.

At the end of the coroutine function set that variable to false. There other ways to do this but this seems to be the easiest way.

bool isAttackingPlayer = false;
IEnumerator HarmPlayer()
{
    Debug.Log("Inside Harm Player");
    yield return new WaitForSeconds(5);
    Debug.Log("Player Health is the issue");
    isAttackingPlayer = false; //Done attacking. Set to false
}

void Update()
{

    transform.LookAt(target);
    float step = speed * Time.deltaTime;
    distance = (transform.position - target.position).magnitude;
    if (distance < 3.5)
    {
        if (isAttackingPlayer == false)
        {
            isAttackingPlayer = true; //Is attacking to true
            animator.SetFloat("Attack", 0.2f);
            StartCoroutine("HarmPlayer");
        }
    }
}

相关问答

更多
  • 在您的第一个代码中,以下列方式更改循环: for (i = 1; i < 300; i++){ if (i == 20) iimPlayCode("WAIT SECONDS=60"); iimSet("i", i); iimPlay(macro); } In your first code change the loop in the following way: for (i = 1; i < 300; i++){ if (i == 20) ...
  • 该方法立即返回是正常的行为。 [UIView commitAnimations]不等待动画完成(或您使用的任何其他方法)。 Kristopher Johnson是对的,你不应该在这种情况下使用UIGraphicsGetCurrentContext 。 它用于drawRect:或者只要有有效的图形上下文。 动画上下文与图形上下文无关。 如果您在某个动画委托中不需要任何上下文,则只传递NULL。 Instead of waiting for the selector to finish, I used slee ...
  • 试试这个,它完全适合我。我可以点击“Micromax” Actions action = new Actions(driver); action.moveToElement(driver.findElement(By.linkText("Digital"))).build().perform(); WebDriverWait wait = new WebDriverWait(driver,30); wait.until(ExpectedConditions.visibilityOfElementLoc ...
  • 尝试这个 function aboutHide() { $("#aboutPopOut").animate({ left: "-60%" }, 500); setTimeout(function() { $("#fadeScreen").delay(2000).hide(); }, 500); }; try this function aboutHide() { $("#aboutPopOut").animate({ left: "-60%" }, 500) ...
  • 如果你想等一个协程完成...那么该方法也必须是一个协程。 您有3个选项,具体取决于您的具体情况: 将需要等待的代码移动到现有的协同方法中(在最后一个当前yield 。 您还可以将委托传递给当前协程并将其用作回调,然后每次使用现有协程都可以提供自己的回调委托。 然后,“等待完成”代码进入此委托。 将当前的非协同方法转换为协程。 创建一个新的协同程序,将需要等待其他协同程序的代码推入其中,包括调用现有的协程,在另一个协同程序上产生。 If you want to wait for a coroutine to ...
  • 您可以使用asyncio.wrap_future从并发的未来获得asyncio的未来: async def send_threadsafe(self, message, destination, *, loop=loop): concurrent = asyncio.run_coroutine_threadsafe( send(message), loop=destination) return await asyncio.wrap_future(concurrent, lo ...
  • 清楚地说,看看你的代码流程, 在Update它执行StartCoroutine(UseCoin()); ,然后立即执行指针跳转到UseCoin方法,从第一行找到该行的其余部分将在3秒后执行,因此它将在3秒后返回,同时执行其余代码。 希望你能理解。 In clear words, look at the flow of your code, In Update it executes StartCoroutine(UseCoin());, then immediately executing pointer ...
  • 您的协同功能正常工作。 问题是你正在从Update函数中调用它,并且它在一秒钟内被多次调用。 您可以使用boolean变量来检查协程函数是否正在运行。 如果它正在运行,则不要攻击或启动新的协程。 如果不是,那么你可以启动协程。 在协程函数结束时,将该变量设置为false 。 还有其他方法可以做到这一点,但这似乎是最简单的方法。 bool isAttackingPlayer = false; IEnumerator HarmPlayer() { Debug.Log("Inside Harm Playe ...
  • Tornado为每个新请求创建RequestHandler的新实例。 所以你的代码确实表现得像你期望的那样。 我运行它并打开两个终端窗口,每个窗口都运行wget localhost:8888/1 。 您的代码打印: Setting up executor ... Yielding ... Setting up executor ... Yielding ... ## ## ## Finished! Finished! 如你所料。 您可能看到的是,您的浏览器不愿意一次打开两个到同一URL的连接。 实际上,如 ...
  • 另一种等待而不创建额外功能的方法: void SerialIO::initialize() { // Code here QEventLoop loop; QTimer::singleShot(15000, &loop, SLOT(quit())); loop.exec(); // Code here, executed after 15s } 注意:如果某些内容删除了带有deleteLater (当处理等待期间收到的某些事件/信号时,可能来自您的串行输入),您将在循环退出后删除并使其 ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)