Dlib FaceLandmark Detector ver1.0.5 Release!
Version 1.0.5[Common]Fixed WebCamTextureToMatHelper class.[Common]Added Utils.getVersion().[Common]Fixed Utils.getFilePathAsync().
Dlib FaceLandmark Detector ver1.0.4 Release!
Version 1.0.4[Common]Updated shape_predictor_68_face_landmarks_for_mobile.dat.
OpenCV for Unity ver2.1.0 Release!
Version 2.1.0[Common]Fixed WebCamTextureToMatHelper class.[Common]Added Utils.getVersion().[Common]Fixed Utils.getFilePathAsync().
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 […]
Add WebGL platform Supports!
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.
Add WebGL platform Supports!
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.
OpenCV for Unity ver2.0.9 Release!
Version 2.0.9[WebGL]Added WebGL(beta) support.(Unity5.3 or later)
Dlib FaceLandmark Detector ver1.0.3 Release!
Version 1.0.3[WebGL]Added WebGL(beta) support.(Unity5.3 or later)[Common]Fixed missing script error.(WebCamTextureToMatHelper.cs)[Common]Added shape_predictor_68_face_landmarks_for_mobile.dat.
Dlib FaceLandmark Detector ver1.0.2 Release!
Veersion 1.0.2[Common]Improved WebCamTextureHelper class.
How to extract the shape predictor from “mmod_dog_hipsterizer.dat”
First of all, please look at this article. Hipsterize Your Dog With Deep Learning (dlib.net)The “mmod_dog_hipsterizer.dat” cannot be used as a shape predictor data because it is distributed in a state in which combines multiple files. I will introduce here because I wrote the code for the use of the dog face shape predictor data in “DlibFaceLandmarkDetector”.This example scene was created based on the “DlibFaceLandmarkDetector/Examples/CatDetectionExample”.Replace the “CatDetectionExample.cs” that is attached to Quad to this script code.Set to the dog image to the texture2D inspector.The file that you downloaded and unzipped from here must be put to the “streamingAssets” folder.using UnityEngine; using System.Collections; using System.Collections.Generic; using System.IO; #if UNITY_5_3 || UNITY_5_3_OR_NEWER using UnityEngine.SceneManagement; #endif using DlibFaceLandmarkDetector; namespace DlibFaceLandmarkDetectorSample { /// <summary> /// Dog detection example. /// </summary> public class DogDetectionExample : MonoBehaviour { /// <summary> /// The texture2 d. /// </summary> public Texture2D texture2D; //https://github.com/davisking/dlib/raw/master/examples/faces/dogs.jpg private Texture2D m_tex; private int m_width, m_height; private Color[] m_linesColor = null; // Use this for initialization void Start () { gameObject.transform.localScale = new Vector3 (texture2D.width, texture2D.height, 1); Debug.Log (“Screen.width ” + Screen.width + ” Screen.height ” + Screen.height + ” Screen.orientation ” + Screen.orientation); float width = gameObject.transform.localScale.x; float height = gameObject.transform.localScale.y; float widthScale = (float)Screen.width / width; float heightScale = (float)Screen.height / height; if (widthScale < heightScale) { Camera.main.orthographicSize = (width * (float)Screen.height / (float)Screen.width) / […]