简体   繁体   English

OpenCV现有的Java Java代码

[英]OpenCV existing C++ code in Java

I am trying to create java code by using existing C++ code. 我试图通过使用现有的C ++代码创建Java代码。 Please see this link for C++ code. 请参阅此链接了解C ++代码。

Everything looks fine expect arithmetic operations on Mat objects. 一切看起来都很好,期望Mat对象上的算术运算。 I don't know what is java equivalent of those C++ code. 我不知道那些C ++代码的java等价物是什么。 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. 你是这些的java代码吗? Here, the variables are Mat objects 这里,变量是Mat对象

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 请参阅OpenCV Java文档中的更多选项

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM