OpenCV for Unity ver2.0.4 Release!
- Author: Enox Software
- Category: Update
- Tags: OpenCV for Unity
Version 2.0.4
[Android]Added Support for Split Application Binary (.OBB) [Android]Removed opencvforunity.jar.Related posts
Way to translation of Mat class operators defined in C++
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 )): Note: In C++, the left-hand operand of compound assignment operators like “A += B” is reused, and operations such as “Core.add(A, B, A)” are performed internally. However, in C#, it is not possible to explicitly overload compound assignment operators. Instead, binary operator overloading is used implicitly, which results in a new Mat object being created and assigned to A each time an operator is used. This behavior leads to different memory management between C++ and C#. c++OpenCVForUnity(C#)Addition, subtraction, negation: A+B, A-B, A+s, A-s, s+A, s-A, -AA + BM1 + M2Core.add (M1, M2, M_dst)A – BM1 – M2Core.subtract (M1, M2, M_dst)A + sM1 + sCore.add (M1, s, M_dst)A – sM1 – sCore.subtract (M1, s, M_dst)-A-M1Core.multiply (M1, Scalar.all (-1), M_dst)Scaling: A*alpha A/alphaA * αM1 * 3Core.multiply (M1, Scalar.all (3), M_dst)A / αM1 / 3Core.divide (M1, Scalar.all (3), M_dst)Per-element multiplication and division: A.mul(B), A/B, alpha/AA.mul(B)M1.mul(M2)M1.mul (M2)A / BM1 / M2Core.divide (M1, M2, M_dst)α / A3 / M1Core.divide (new Mat (M1.size (), M1.type (), Scalar.all (3)), M1, M_dst)Matrix multiplication: A*BA * BM1 * M2Core.gemm (M1, M2, 1, new Mat (), 0, M_dst)Comparison: A cmpop B, A cmpop alpha, alpha cmpop A, where […]
- Author: Enox Software
- Category: Tips
- Tags: OpenCV for Unity
Mat Basic Processing1
These codes are included in the OpenCVForUnity Example Unity scenes. (MatBasicProcessingExample) Initialization Example Code: Execution Result: mat1=[1, 2, 3; 4, 5, 6; 7, 8, 9] mat2=[0.8660254037844387, -0.4999999999999999; 0.4999999999999999, 0.8660254037844387] mat3=[1, 1, 1, 1, 1; 1, 1, 1, 1, 1; 1, 1, 1, 1, 1; 1, 1, 1, 1, 1; 1, 1, 1, 1, 1] mat4=[0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0; 0, 0, 0, 0, 0] mat5=[1, 0, 0, 0, 0; 0, 1, 0, 0, 0; 0, 0, 1, 0, 0; 0, 0, 0, 1, 0; 0, 0, 0, 0, 1] mat6=[5, 5, 5; 5, 5, 5; 5, 5, 5] mat7=[246, 156; 192, 7; 165, 231] mat8=[124, 140; 125, 122; 131, 133] mat9.dims=4 mat9.rows=-1 //When the matrix is more than 2-dimensional, the returned size is (-1, -1). mat9.cols=-1 Multi Channel Example Code: Execution Result: mat1 dim:2 elemSize1:8 channels:1 mat2 dim:2 elemSize1:8 channels:10 mat3 dim:4 elemSize1:8 channels:1 Dump Example Code: Execution Result: mat1=Mat [ 3*3*CV_8UC1, isCont=True, isSubmat=False, nativeObj=0x793787296, dataAddr=0x794435328 ] mat1.dump()=[ 1, 1, 1; 1, 1, 1; 1, 1, 1] mat2=Mat [ 3*3*CV_8UC4, isCont=True, isSubmat=False, nativeObj=0x793789648, dataAddr=0x799875584 ] mat2.dump()=[ 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4; 1, 2, 3, 4, 1, 2, 3, 4, 1, 2, 3, 4; 1, 2, 3, 4, 1, […]
- Author: Enox Software
- Category: Tips
- Tags: OpenCV for Unity
Dlib FaceLandmark Detector ver1.1.0 Release!
Version 1.1.0 [Win][Mac][Linux][UWP]Added the native plugin file enabled SSE4 or AVX compiler option.
- Author: Enox Software
- Category: Update
- Tags: Dlib FaceLandmark Detector