opencv mat multiplication

edited July 2015 in Library Questions

Please show me the light on multiplying two MAT objects. I can't find anything on processing about it... I am trying to follow this example.

import gab.opencv.*;
import org.opencv.core.Mat;
import org.opencv.core.CvType;
import org.opencv.core.Core;

OpenCV opencv;

void setup(){
  size(300,300);
  opencv = new OpenCV(this, width, height);

  Mat r = new Mat(1, 3, CvType.CV_32F);
  r.put(0, 0, 0.707);
  r.put(0, 1, -0.707);
  r.put(1, 0, 0.707);
  r.put(1, 1, 0.707);

  Mat v = new Mat(1, 3, CvType.CV_32F);
  double d1 = 1.00;
  double d2 = 2.00;
  v.put(0, 0, d1);
  v.put(0, 1, d2);
  v.put(0, 2, d2);
  v.put(0, 3, d2);
  Mat final_mat = new Mat();

  Core.gemm(v,r,1,new Mat(),0,final_mat);

}

it returns a very weird error on someone's else user directory....

OpenCV Error: Assertion failed (a_size.width == len) in gemm, file /Users/matthewepler/opencv-2.4.5/modules/core/src/matmul.cpp, line 718

Tagged:
Sign In or Register to comment.