OpenCV输入阵列/输出阵列
我刚刚编译了OpenCV 2.3的最新版本。他们将所有矩阵输入/输出更改为输入阵列/输出阵列的决定把一切都搞砸了。在OpenCV 2.2下运行良好的同一段代码现在一文不值 我可以接受两种解决方案:OpenCV输入阵列/输出阵列,opencv,Opencv,我刚刚编译了OpenCV 2.3的最新版本。他们将所有矩阵输入/输出更改为输入阵列/输出阵列的决定把一切都搞砸了。在OpenCV 2.2下运行良好的同一段代码现在一文不值 我可以接受两种解决方案: 告诉我在哪里可以下载OpenCV 2.2 for Linux以及所有模块,缝合不丢失很重要(我试图找到一个合适的,但缝合总是丢失!) 帮我解决我下面描述的问题 OpenCV 2.4,即使仍然是beta版,已经修复了这个问题,我应该改为使用这个版本 我有一条例外信息: OpenCV Error: Ass
OpenCV Error: Assertion failed (k == STD_VECTOR_MAT) in getMat, file /home/widgg/opencv/trunk/modules/core/src/matrix.cpp, line 928
terminate called after throwing an instance of 'cv::Exception'
what(): /home/widgg/opencv/trunk/modules/core/src/matrix.cpp:928: error: (-215) k == STD_VECTOR_MAT in function getMat
在gdb中,这是堆栈:
#0 0x00007ffff5df3445 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007ffff5df6bab in __GI_abort () at abort.c:91
#2 0x00007ffff674169d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3 0x00007ffff673f846 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4 0x00007ffff673f873 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5 0x00007ffff673f96e in __cxa_throw () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6 0x00007ffff77fca51 in cv::error(cv::Exception const&) () from /usr/local/lib/libopencv_core.so.2.3
#7 0x00007ffff791306d in cv::_InputArray::getMat(int) const () from /usr/local/lib/libopencv_core.so.2.3
#8 0x00007ffff796064c in cv::perspectiveTransform(cv::_InputArray const&, cv::_OutputArray const&, cv::_InputArray const&) () from /usr/local/lib/libopencv_core.so.2.3
#0 0x00007ffff5df3445 in_uugi_raise(sig=)位于../nptl/sysdeps/unix/sysv/linux/raise.c:64
#1 0x00007FF5DF6BAB位于中止处的中止()中。c:91
#2 0x00007ffff674169d,位于/usr/lib/x86\u 64-linux-gnu/libstdc++.so.6中的
#3 0x00007FF673F846英寸??()来自/usr/lib/x86_64-linux-gnu/libstdc++.so.6
#来自/usr/lib/x86_64-linux-gnu/libstdc++.so.6的std::terminate()中的4 0x00007FF673F873
#5 0x00007FF673F96E,位于/usr/lib/x86\u 64-linux-gnu/libstdc++.so.6中的
#来自/usr/local/lib/libopencv_core.so.2.3的cv::error(cv::Exception const&)()中的6 0x00007ffff77fca51
#cv中的7 0x00007FF791306D::_InputArray::getMat(int)const(),来自/usr/local/lib/libopencv_core.so.2.3
#8 0x00007FF796064C,位于/usr/local/lib/libopencv\u core.so.2.3中的cv::perspectiveTransform(cv:_inputarrayconst&,cv:_outputarrayconst&,cv:_outputarrayconst&),cv:_inputarrayconst&)
最后,这是我调用cv::perspectiveTransform时的代码:
std::vector<cv::Point2f> corners(4);
cv::Mat cur_image = imread("my_image.jpg");
std::vector<cv::Point2f> img_corners(4);
img_corners[0] = cv::Point2f(0, 0);
img_corners[1] = cv::Point2f(cur_image.cols, 0);
img_corners[2] = cv::Point2f(cur_image.cols, cur_image.rows);
img_corners[3] = cv::Point2f(0, cur_image.rows);
cur_image.release();
cv::perspectiveTransform(img_corners, corners, m_transf);
std::向量角点(4);
cv::Mat cur_image=imread(“my_image.jpg”);
std::向量img_角(4);
img_角点[0]=cv::Point2f(0,0);
img_corners[1]=cv::Point2f(cur_image.cols,0);
img_corners[2]=cv::Point2f(cur_image.cols,cur_image.rows);
img_corners[3]=cv::Point2f(0,cur_image.rows);
cur_image.release();
透视变换(img_角点、角点、m_变换);
和cv::Mat m_transf=(Mat_u
或者,检查所有设置路径、链接器标志和include文件夹,确保通过include/complile/link步骤使用相同的版本谢谢,它解决了库问题!我删除了我拥有的所有OpenCV实例,只是进行了make安装,以将我想要的版本放入其中!这不是完整答案,我会的再次提出这个问题!但同时你有什么想法来解决这个问题吗?