簡單的問題。我找不到任何解決方案! 這是確定:矩陣乘矢量乘法
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