C++ OpenCV缝合_detailed.cpp断言失败错误

C++ OpenCV缝合_detailed.cpp断言失败错误,c++,opencv,C++,Opencv,我在OpenCV答案网站上问过这个问题,但还没有收到回复,所以我想我应该试试这里 我刚刚成功地构建了opencv 3.2.0和opencv_contrib 3.2.0,现在我正在使用示例文件来尝试一些东西(使用--try_cuda=yes选项),但是我得到了以下错误: Finding features... Features in image #1: 217 Features in image #2: 224 Features in image #3: 281 Features in image

我在OpenCV答案网站上问过这个问题,但还没有收到回复,所以我想我应该试试这里

我刚刚成功地构建了opencv 3.2.0和opencv_contrib 3.2.0,现在我正在使用示例文件来尝试一些东西(使用
--try_cuda=yes
选项),但是我得到了以下错误:

Finding features...
Features in image #1: 217
Features in image #2: 224
Features in image #3: 281
Features in image #4: 235
Features in image #5: 172
Finding features, time: 3.58099 sec
Pairwise matchingPairwise matching, time: 2.84527 sec
Initial camera intrinsics #2:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[0.96701878, 0.020416204, 0.012416624;
 0.014757388, 0.97670352, 0.26495183;
 0.046871029, 0.11209502, 1]
Initial camera intrinsics #3:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[1, 0, 0;
 0, 1, 0;
 0, 0, 1]
Initial camera intrinsics #4:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[1.0235587, -0.024432728, -0.014125917;
 0.004413465, 1.0243349, -0.26835808;
 -0.010042391, -0.15711401, 1.0413489]
Initial camera intrinsics #5:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[1.045368, -0.054304995, -0.018363208;
 0.013821163, 1.0776026, -0.54379475;
 -0.044207353, -0.2462063, 1.1049906]
Camera #2:
K:
[8478.069673382501, 0, 447;
 0, 8478.069673382501, 335.5;
 0, 0, 1]
R:
[0.9999181, 0.01271866, 0.001412834;
 -0.012757109, 0.99941444, 0.031748302;
 -0.0010082112, -0.031763725, 0.99949491]
Camera #3:
K:
[8439.012955389799, 0, 447;
 0, 8439.012955389799, 335.5;
 0, 0, 1]
R:
[1, 8.6602086e-09, 4.6566129e-10;
 -6.2404979e-09, 1, 0;
 0, 0, 1]
Camera #4:
K:
[8518.394954182764, 0, 447;
 0, 8518.394954182764, 335.5;
 0, 0, 1]
R:
[0.99987215, -0.015882459, -0.0018503442;
 0.015817553, 0.99939477, -0.030980414;
 0.0023412704, 0.030947186, 0.99951828]
Camera #5:
K:
[8491.398203106019, 0, 447;
 0, 8491.398203106019, 335.5;
 0, 0, 1]
R:
[0.99940926, -0.034253821, -0.0027813595;
 0.034020044, 0.99755055, -0.061118517;
 0.0048680915, 0.060987789, 0.99812663]
Warping images (auxiliary)...
Warping images, time: 0.0660702 sec
Compositing...
Compositing image #2
Multi-band blender, number of bands: 10
OpenCV Error: Assertion failed (clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0, u->size, alignedPtr.getAlignedPtr(), 0, 0, 0) == CL_SUCCESS) in cv::ocl::OpenCLAllocator::map, file G:\Development\opencv\sources\opencv\modules\core\src\ocl.cpp, line 4773
Compositing...
Compositing image #2
Multi-band blender, number of bands: 10
Compositing image #3
OpenCV Error: Assertion failed (dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX) in cv::remap, file G:\Development\opencv\sources\opencv\modules\imgproc\src\imgwarp.cpp, line 4956
所有的建议都非常感谢,因为我对C++和OpenCV。 谢谢

更新

禁用OpenCL后,出现以下错误:

Finding features...
Features in image #1: 217
Features in image #2: 224
Features in image #3: 281
Features in image #4: 235
Features in image #5: 172
Finding features, time: 3.58099 sec
Pairwise matchingPairwise matching, time: 2.84527 sec
Initial camera intrinsics #2:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[0.96701878, 0.020416204, 0.012416624;
 0.014757388, 0.97670352, 0.26495183;
 0.046871029, 0.11209502, 1]
Initial camera intrinsics #3:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[1, 0, 0;
 0, 1, 0;
 0, 0, 1]
Initial camera intrinsics #4:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[1.0235587, -0.024432728, -0.014125917;
 0.004413465, 1.0243349, -0.26835808;
 -0.010042391, -0.15711401, 1.0413489]
Initial camera intrinsics #5:
K:
[1012.630229401095, 0, 447;
 0, 1012.630229401095, 335.5;
 0, 0, 1]
R:
[1.045368, -0.054304995, -0.018363208;
 0.013821163, 1.0776026, -0.54379475;
 -0.044207353, -0.2462063, 1.1049906]
Camera #2:
K:
[8478.069673382501, 0, 447;
 0, 8478.069673382501, 335.5;
 0, 0, 1]
R:
[0.9999181, 0.01271866, 0.001412834;
 -0.012757109, 0.99941444, 0.031748302;
 -0.0010082112, -0.031763725, 0.99949491]
Camera #3:
K:
[8439.012955389799, 0, 447;
 0, 8439.012955389799, 335.5;
 0, 0, 1]
R:
[1, 8.6602086e-09, 4.6566129e-10;
 -6.2404979e-09, 1, 0;
 0, 0, 1]
Camera #4:
K:
[8518.394954182764, 0, 447;
 0, 8518.394954182764, 335.5;
 0, 0, 1]
R:
[0.99987215, -0.015882459, -0.0018503442;
 0.015817553, 0.99939477, -0.030980414;
 0.0023412704, 0.030947186, 0.99951828]
Camera #5:
K:
[8491.398203106019, 0, 447;
 0, 8491.398203106019, 335.5;
 0, 0, 1]
R:
[0.99940926, -0.034253821, -0.0027813595;
 0.034020044, 0.99755055, -0.061118517;
 0.0048680915, 0.060987789, 0.99812663]
Warping images (auxiliary)...
Warping images, time: 0.0660702 sec
Compositing...
Compositing image #2
Multi-band blender, number of bands: 10
OpenCV Error: Assertion failed (clEnqueueReadBuffer(q, (cl_mem)u->handle, CL_TRUE, 0, u->size, alignedPtr.getAlignedPtr(), 0, 0, 0) == CL_SUCCESS) in cv::ocl::OpenCLAllocator::map, file G:\Development\opencv\sources\opencv\modules\core\src\ocl.cpp, line 4773
Compositing...
Compositing image #2
Multi-band blender, number of bands: 10
Compositing image #3
OpenCV Error: Assertion failed (dst.cols < SHRT_MAX && dst.rows < SHRT_MAX && src.cols < SHRT_MAX && src.rows < SHRT_MAX) in cv::remap, file G:\Development\opencv\sources\opencv\modules\imgproc\src\imgwarp.cpp, line 4956
合成。。。
合成图像#2
多波段混合器,波段数:10
合成图像#3
OpenCV错误:断言失败(dst.cols
opencv中某些图形卡(我猜您有某种intel卡)的GPU Mat分配存在问题,这使得缝合_detailed.cpp示例“有点”不稳定。您可以使用cv::ocl::setUseOpenCL(false)在运行时禁用GPU;命令,这将解决问题,但计算将需要更多的时间。您应该注意使用OpenCV进行缝合,因为当焦点未正确估计时,缝合非常不稳定。谢谢您的评论。我实际上使用的是Nvidia GTX 780 Ti,老实说,我怀疑这张卡是否存在这样的问题。在哪里使用
cv::ocl::setUseOpenCL(false)命令?我尝试将其包含在
main
方法的顶部,但名称空间
ocl
不存在。CUDA和OpenCV的集成正在进行中,因此我们可以期待一些改进。在main的顶部使用命令是可以的,您只需要包含该命令的标题;)我认为这是包含BTW的,你可以考虑使用类,它使用UsIsGPU选项并查看它是否工作正常。您还应该研究Stitcher类实现和stitching_detailed.cpp之间的区别,认为您可以在那里找到更好的参数设置,以及一些如何使事情更好地工作的提示。再次感谢Dmitri。我现在禁用了OpenCL,但又出现了另一个错误(请参阅我的OP)。你知道有其他好的缝合软件/库吗?opencv中某些图形卡(我猜你有某种intel卡)的GPU Mat分配存在问题,这使得缝合_detailed.cpp示例“有点”不稳定。您可以使用cv::ocl::setUseOpenCL(false)在运行时禁用GPU;命令,这将解决问题,但计算将需要更多的时间。您应该注意使用OpenCV进行缝合,因为当焦点未正确估计时,缝合非常不稳定。谢谢您的评论。我实际上使用的是Nvidia GTX 780 Ti,老实说,我怀疑这张卡是否存在这样的问题。在哪里使用
cv::ocl::setUseOpenCL(false)命令?我尝试将其包含在
main
方法的顶部,但名称空间
ocl
不存在。CUDA和OpenCV的集成正在进行中,因此我们可以期待一些改进。在main的顶部使用命令是可以的,您只需要包含该命令的标题;)我认为这是包含BTW的,你可以考虑使用类,它使用UsIsGPU选项并查看它是否工作正常。您还应该研究Stitcher类实现和stitching_detailed.cpp之间的区别,认为您可以在那里找到更好的参数设置,以及一些如何使事情更好地工作的提示。再次感谢Dmitri。我现在禁用了OpenCL,但又出现了另一个错误(请参阅我的OP)。你知道其他好的缝合软件/库吗?