简单的问题。我找不到任何解决方案! 这是确定:矩阵乘矢量乘法
Mat dst = new Mat();
Mat a = Mat.ones(3,3,CvType.CV_32FC1);
Mat b = Mat.ones(3,3,CvType.CV_32FC1);
Core.multiply(a, b, dst);
System.out.println("DST\n" + dst.dump());
但是,这会导致错误:
Mat dst = new Mat();
Mat a = Mat.ones(3,3,CvType.CV_32FC1);
Mat b = Mat.ones(1,3,CvType.CV_32FC1);
//neither this
Core.multiply(a, b, dst); ///<<<< ERROR
//nor this works
Core.multiply(a, b.t(), dst); ///<<<< ERROR
System.out.println("DST\n" + dst.dump());
OpenCV Error: Sizes of input arguments do not match (The operation is neither 'array op array' (where arrays have the same size and the same number of channels), nor 'array op scalar', nor 'scalar op array') in cv::arithm_op, file C:\builds\master_PackSlaveAddon-win64-vc12-static\opencv\modules\core\src\arithm.cpp, line 1987
请帮助找到解决的办法。我怎样才能通过矢量来多元化矩阵?
你看过http://stackoverflow.com/questions/10168058/basic-matrix-mu ltiplication-in-opencv-for-android? – SergeyS
@SergeyS哦。谢谢!没有找到它。 – Vyacheslav