c++ - Mat subtraction with OpenCV in Java -


i'm trying convert opencv code c++ java, i'm stuck @ code:

mat matxyz; // mat mat result; // other mat // ... set above mats values ... result = mat::ones(matxyz.size(), cv_32f) - result; 

first, don't understand last line does. second, don't know how transfer line java (opencv 2.4.6), there no overloaded operators in c++, , not find comparable method in java class (see opencv javadoc).

what best way transfer java?

there matrix operations in org.opencv.core.core class, including subtraction operators.

mat endresult; core.subtract(mat.ones(matxyz.size(),cvtype.cv_32f),result,endresult); 

the last line of code creates matrix filled ones, same size matxyz, data floating point numbers. described in docs linked.


Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -