Basic-matrix-Multiplikation in OpenCV für Android

Ich bin wahrscheinlich dämlich hier, aber ich habe Probleme dabei einige etwar Matte Multiplikation mit OpenCV für Android.

Habe ich zwei Matte ist beides der gleiche Typ, CV_64F

mat1 hat Größe: 3 Zeilen, 3 Spalten

mat2 hat Größe: 3 Zeilen, 1 cols

Ich will, Sie zu vermehren zu geben, das Produkt mat3 der Größe 3 Zeilen, 1 cols.

Habe ich versucht mit:

Mat mat3 = new Mat(3, 1, CvType.CV_64F);
Core.multiply(mat1, mat2, mat3);


Aber ich bekomme eine Fehlermeldung:

CvException
[org.opencv.core.CvException:/home/andreyk/OpenCV2/trunk/opencv_2.3.1.b2/modules/core/src/arithm.cpp:1253:
error: (-209) Der Betrieb ist weder "array-op-array' (wo-arrays
haben die gleiche Größe und die gleiche Anzahl von Kanälen), noch " array-op
scalar', noch 'Skalare op array' in der Funktion void cv::arithm_op(const
cv::_InputArray& const cv::_InputArray& const cv::_OutputArray&,
const cv::_InputArray&, int, void (*)(const uchar, size_t, const
uchar*, size_t, uchar*, size_t, cv::Size, void*), bool, void*)

Was mache ich falsch?

Vielen Dank für jede Hilfe im Voraus.

EDIT:

Wenn es hilft, die 3x3-matrix mat2 ist das Ergebnis Imgproc.getPerspectiveTransform und der rest des Codes ist wie folgt:

Mat mat1 = new Mat(3, 1, CvType.CV_64F);
mat1.put(0, 0, 2.0);
mat1.put(1, 0, 0.5);
mat1.put(2, 0, 1.0);

Mat mat3 = new Mat(3, 1, CvType.CV_64F);
Core.multiply(mat2, mat1, mat3);
InformationsquelleAutor woodstock365 | 2012-04-16
Schreibe einen Kommentar