首页 新闻 会员 周边 捐助

java调用opencv提取特征点报错

0
悬赏园豆:100 [待解决问题]

java类方法源码:
public void tezhengdian(String img1,String img2){
Mat src_base = Imgcodecs.imread(img1);
Mat src_test = Imgcodecs.imread(img2);
Mat gray_base = new Mat();
Mat gray_test = new Mat();
Imgproc.cvtColor(src_base, gray_base, Imgproc.COLOR_RGB2GRAY);
Imgproc.cvtColor(src_test, gray_test, Imgproc.COLOR_RGB2GRAY);
FeatureDetector featureDetector = FeatureDetector.create(FeatureDetector.ORB);
DescriptorExtractor descriptorExtractor = DescriptorExtractor.create(DescriptorExtractor.ORB);
MatOfKeyPoint keyPoint1 = new MatOfKeyPoint(), keyPoint2 = new MatOfKeyPoint();
Mat descriptorMat1 = new Mat(), descriptorMat2 = new Mat();
featureDetector.detect(gray_base, keyPoint1);//这里是报错位置
featureDetector.detect(gray_test, keyPoint2);
descriptorExtractor.compute(gray_base, keyPoint1, descriptorMat1);
descriptorExtractor.compute(gray_test, keyPoint2, descriptorMat2);
......
之后是数值计算
......
}

郁闷的是这个方法连续调用多次之后才会报错,差不多100次以内的调用不会报错。

报错信息:
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:\builds\master_PackSlaveAddon-win64-vc12-static\opencv\modules\core\src\ocl.cpp, line 5114

蔠点的主页 蔠点 | 初学一级 | 园豆:4
提问于:2018-12-10 16:16
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册