我正在尝试使用opencv for android中的立体校准整流
我没有找到在java中从列表转换为Mat的方法,但在opencv c++中,我们可以从矢量创建Mat
这是我所做的步骤:
//find fundamental matrix
//srcmatchkey and dstmatchkey are List<Point> as required in findFundamentalMat function,
they have been calculated using FLANN Matcher
Cali3D.findFundamentalMat(srcMatchKey, dstMatchKey, Calib3d.FM_8POINT);
//this is the strange part
Calib3D.stereoRectifyUncalibrated(Mat points1,Mat,points1,Mat fundamentalMatrix,Mat H1,Mat H2)据我所知,Mat points1和Mat points2是由srcMatchKey和dstMatchKey组成的Mat (或者我错了吗??,如果是错误的,请改正它),并且没有接受列表或c++中的向量之类的Mat构造函数,而Mat c++有这一点。
所以问题是,有没有办法在android中从列表中创建Mat?谢谢你的帮助。
发布于 2012-04-13 21:04:36
如果您使用的是安卓版OpenCV 2.3.1,List到Mat的转换代码为:
List<Point> lp = null;
Mat mp = Converters.vector_Point_to_Mat(lp);或者说到stereoRectifyUncalibrated(),它可以是:
Mat mp = Converters.vector_Point2d_to_Mat(lp);在用于安卓的Java2.4.beta(最近发布)中,所有的List<T>类型都被MatOfT类型所取代,该类型阻止了在原生和OpenCV之间来回复制数据。
https://stackoverflow.com/questions/10137249
复制相似问题