2.4.2 ошибка OPenCV

artarik

Active member
1638798900884.png
кусок лога
Код:
2021-12-06 16:52:18.5765 Fatal System.Exception: OpenCV: Failed to allocate 31581496 bytes
 ---> Emgu.CV.Util.CvException: OpenCV: Failed to allocate 31581496 bytes
   at Emgu.CV.CvInvoke.cveMatchTemplate(IntPtr image, IntPtr templ, IntPtr result, TemplateMatchingType method, IntPtr mask)
   at Emgu.CV.CvInvoke.MatchTemplate(IInputArray image, IInputArray templ, IOutputArray result, TemplateMatchingType method, IInputArray mask)
   at Emgu.CV.Image`2.MatchTemplate(Image`2 template, TemplateMatchingType method)
   at Images.Core.Helpers.PictureHelper.FindAll(Bitmap target, Double accuracy, Int32 maxMatches, Boolean fastSearch, Boolean scaledSearch, Boolean fragmentedSearch)
   at Images.Core.Helpers.PictureHelper.Find(Bitmap target, Double accuracy, Boolean fastSearch, Boolean fragmentedSearch)
   at Images.Core.Picture.Find(Picture target, Double accuracy, Boolean fragmentedSearch)
   --- End of inner exception stack trace ---
   at Images.Core.Picture.Find(Picture target, Double accuracy, Boolean fragmentedSearch)
   at Images.Core.Picture.FindFirstOnActualScreen(Picture target, Double accuracy, Boolean fragmentedSearch)
   at Activities.Image.FindImageOnScreen.Execute(Nullable`1 optionID)
   at BR.Engine.Runtimer.<>c__DisplayClass42_0.<ExecuteActivityFromStepAsync>b__3()
   at System.Threading.Tasks.Task.InnerInvoke()
   at System.Threading.Tasks.Task.<>c.<.cctor>b__274_0(Object obj)
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location where exception was thrown ---
   at System.Threading.ExecutionContext.RunFromThreadPoolDispatchLoop(Thread threadPoolThread, ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
--- End of stack trace from previous location where exception was thrown ---
   at BR.Engine.Runtimer.ExecuteActivityFromStepAsync(ExecutableStep step)
 
Попробуйте включить фрагментацию изображения в свойствах активности. Если ошибка продолжает возникать, то надо увеличить искомую картинку, так как она слишком маленькая.
 
Верх