0

I am trying to create java code by using existing C++ code. Please see this link for C++ code.

Everything looks fine expect arithmetic operations on Mat objects. I don't know what is java equivalent of those C++ code. I tried with google. I could not get anything regarding this.

 t1 = 2 * mu1_mu2 + C1;
 t2 = 2 * sigma12 + C2;
 t3 = t1.mul(t2);              // t3 = ((2*mu1_mu2 + C1).*(2*sigma12 + C2))

 t1 = mu1_2 + mu2_2 + C1;
 t2 = sigma1_2 + sigma2_2 + C2;
 t1 = t1.mul(t2);     

Do you what is the java code for these. Here, the variables are Mat objects

1 Answer 1

2

For addition you can use

add(Mat src1, Mat src2, Mat dst)

And for multiplication use

multiply(Mat src1, Scalar src2, Mat dst)

See more option on OpenCV Java Documentation

Sign up to request clarification or add additional context in comments.

1 Comment

thanks for the response, could you give me examples using sample code. that would be helpful.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.