This is a list of implemented matrix operations that can be combined in arbitrary complex expressions (here A, B stand for matrices ( Mat ), s for a scalar ( Scalar ), alpha for a real-valued scalar ( double )): c++ OpenCVForUnity(C#) Addition, subtraction, negation: A+B, A-B, A+s, A-s, s+A, s-A, -A A + B M1 + M2 Core.add (M1, M2, M_dst) A – B M1 – M2 Core.subtract (M1, M2, M_dst) A + s M1 + s Core.add (M1, s, M_dst) A – s M1 – s Core.subtract (M1, s, M_dst) -A -M1 Core.multiply (M1, Scalar.all (-1), M_dst) Scaling: A*alpha A/alpha A * α M1 * 3 Core.multiply (M1, Scalar.all (3), M_dst) A / α M1 / 3 Core.divide (M1, Scalar.all (3), M_dst) Per-element multiplication and division: A.mul(B), A/B, alpha/A A.mul(B) M1.mul(M2) M1.mul (M2) A / B M1 / M2 Core.divide (M1, M2, M_dst) α / A 3 / M1 Core.divide (new Mat (M1.size (), M1.type (), Scalar.all (3)), M1, M_dst) Matrix multiplication: A*B A * B M1 * M2 Core.gemm (M1, M2, 1, new Mat (), 0, M_dst) Comparison: A cmpop B, A cmpop alpha, alpha cmpop A, where cmpop is one of : >, >=, ==, !=, <=, <. The result of comparison is an 8-bit single channel mask whose elements are set to 255 (if the particular element or pair of elements satisfy […]
A new target platform has been added to our Unity Asset “OpenCVForUnity” and “DlibFaceLandmarkDetector“. With this update, it is now possible to develop WebGL applications that users can easily play with web browsers. Although it is currently in beta version, it seems that the main functions are working without problems. It works with Unity 5.3 or later. Demo Application Click To Start Development Tips Put a file that you want to use for the Utils.getFilePathAsync() in the “Aseets/StreamingAssets/” folder. In Case of WebGL platform, you need to use the Utils.getFilePathAsync() instead of the Utils.getFilePath(). (The haarcascade_frontalface_alt.xml is for OpenCVForUnityExample’s scenes. Please copy only when necessary) On the WebGL platform (asm.js), the calculation result of Float type may be significantly different from other platforms. When using the OpenCV’s method that use the Mat class (CvType is CV_32F) as an argument, you need to pay attention to the calculation precision. Please try experiencing WebGL development.