Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

doing simple Matrix Multiply with the following matrix dimensions : [3x3]*[3x1] = [3x1]

you're confusing matrix and per-element multiplication, you need gemm(), not multiply(), like:

Mat res = new Mat();
Core.gemm(LmVSM_k_RotInv, LmVSM_k_TransVectNeg, 1, new Mat(), 0, res);
cout(res);

Mat [3*1*CV_64FC1, isCont=true, isSubmat=false, nativeObj=0x7f137014ee90, dataAddr=0x7f137014efc0]

also: please do not preallocate result Mat's (you're only confusing yourself about result sizes / types), just use new Mat() or similar, like in the lines above.

doing simple Matrix Multiply with the following matrix dimensions : [3x3]*[3x1] = [3x1]

you're confusing matrix and per-element multiplication, you need gemm(), not multiply(), like:

Mat res = new Mat();
Core.gemm(LmVSM_k_RotInv, LmVSM_k_TransVectNeg, 1, new Mat(), 0, res);
cout(res);
System.out.println(res);

Mat [3*1*CV_64FC1, isCont=true, isSubmat=false, nativeObj=0x7f137014ee90, dataAddr=0x7f137014efc0]

also: please do not preallocate result Mat's (you're only confusing yourself about result sizes / types), just use new Mat() or similar, like in the lines above.

doing simple Matrix Multiply with the following matrix dimensions : [3x3]*[3x1] = [3x1]

you're confusing matrix matrix and per-element per-element multiplication, you need gemm(), not multiply(), like:

Mat res = new Mat();
Core.gemm(LmVSM_k_RotInv, LmVSM_k_TransVectNeg, 1, new Mat(), 0, res);
System.out.println(res);

Mat [3*1*CV_64FC1, isCont=true, isSubmat=false, nativeObj=0x7f137014ee90, dataAddr=0x7f137014efc0]

also: please do not preallocate result Mat's (you're only confusing yourself about result sizes / types), just use new Mat() or similar, like in the lines above.

doing simple Matrix Multiply with the following matrix dimensions : [3x3]*[3x1] = [3x1]

you're confusing matrix and per-element multiplication, you need gemm(), not multiply(), like:

Mat res = new Mat();
Core.gemm(LmVSM_k_RotInv, LmVSM_k_TransVectNeg, 1, new Mat(), 0, res);
System.out.println(res);

Mat [3*1*CV_64FC1, isCont=true, isSubmat=false, nativeObj=0x7f137014ee90, dataAddr=0x7f137014efc0]
dataAddr=...]

also: please do not preallocate result Mat's (you're only confusing yourself about result sizes / types), just use new Mat() or similar, like in the lines above.