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
最满意答案
您的协同功能正常工作。 问题是你正在从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"); } } }
相关问答
更多-
在iMacros等待20秒(Waiting 20 seconds in iMacros)[2023-06-23]
在您的第一个代码中,以下列方式更改循环: 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 ...
-
为什么处理器不等待?(Why is the processor not waiting?)[2024-02-04]
清楚地说,看看你的代码流程, 在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 ... -
协程不等待秒(Coroutine not waiting for the seconds)[2022-01-27]
您的协同功能正常工作。 问题是你正在从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的连接。 实际上,如 ...
-
在Qt等了几秒钟(waiting a few seconds in Qt)[2022-09-17]
另一种等待而不创建额外功能的方法: void SerialIO::initialize() { // Code here QEventLoop loop; QTimer::singleShot(15000, &loop, SLOT(quit())); loop.exec(); // Code here, executed after 15s } 注意:如果某些内容删除了带有deleteLater (当处理等待期间收到的某些事件/信号时,可能来自您的串行输入),您将在循环退出后删除并使其 ...