OpenCV错误:断言失败(clEnqueueWriteBuffer)

时间:2018-05-17 19:41:12

标签: c# windows opencv image-recognition openalpr

我使用方法调用alpr识别器。在100,120牌照识别后,我从OpenCV收到以下错误,我不能再识别板块..

OpenCV Error: Assertion failed (clEnqueueWriteBuffer(q, (cl_mem)u->handle, 
CL_TRUE, dstrawofs, total, alignedPtr.getAlignedPtr(), 0, 0, 0) >= 0) in 
cv::ocl::OpenCLAllocator::upload,

file C:\projects\openalpr-win\windows\opencv\modules\core\src\ocl.cpp, line 5118

Caught exception in OpenALPR recognize: 
C:\projects\openalprwin\windows\opencv\modules\core\src\ocl.cpp:5118:
error: (-215) clEnqueueWriteBuffer(q, (cl_mem)u->handle, CL_TRUE, dstrawofs, 
total, alignedPtr.getAlignedPtr(), 0, 0, 0) >= 0 in function 
cv::ocl::OpenCLAllocator::upload

看起来像分配错误。 任何人都有一个想法如何解决它?

1 个答案:

答案 0 :(得分:-1)

我的代码中存在线程同步问题。我使用Tasks解决了这个问题,这篇文章对我有帮助:

https://pt.stackoverflow.com/a/203758/93121