コード例 #1
0
        /// <summary>
        /// Sets a image.
        /// </summary>
        /// <param name="faceLandmarkDetector">Face landmark detector.</param>
        /// <param name="imgMat">Image mat.</param>
        public static void SetImage(FaceLandmarkDetector faceLandmarkDetector, Mat imgMat)
        {
            if (faceLandmarkDetector == null)
            {
                throw new ArgumentNullException("faceLandmarkDetector");
            }
            if (faceLandmarkDetector != null)
            {
                faceLandmarkDetector.ThrowIfDisposed();
            }

            if (imgMat == null)
            {
                throw new ArgumentNullException("imgMat");
            }
            if (imgMat != null)
            {
                imgMat.ThrowIfDisposed();
            }
            if (!imgMat.isContinuous())
            {
                throw new ArgumentException("imgMat.isContinuous() must be true.");
            }

            faceLandmarkDetector.SetImage((IntPtr)imgMat.dataAddr(), imgMat.width(), imgMat.height(), (int)imgMat.elemSize());
        }
コード例 #2
0
 /// <summary>
 /// Sets a image.
 /// </summary>
 /// <param name="faceLandmarkDetector">Face landmark detector.</param>
 /// <param name="imgMat">Image mat.</param>
 public static void SetImage(FaceLandmarkDetector faceLandmarkDetector, Mat imgMat)
 {
     if (!imgMat.isContinuous())
     {
         throw new ArgumentException("imgMat.isContinuous() must be true.");
     }
     faceLandmarkDetector.SetImage((IntPtr)imgMat.dataAddr(), imgMat.width(), imgMat.height(), (int)imgMat.elemSize());
 }
        void DoProcess()
        {
            if (!(owner.Value is DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector))
            {
                LogError("owner is not initialized. Add Action \"newFaceLandmarkDetector\".");
                return;
            }
            DlibFaceLandmarkDetector.FaceLandmarkDetector wrapped_owner = DlibFaceLandmarkDetectorPlayMakerActionsUtils.GetWrappedObject <DlibFaceLandmarkDetectorPlayMakerActions.FaceLandmarkDetector, DlibFaceLandmarkDetector.FaceLandmarkDetector> (owner);

            wrapped_owner.SetImage(texture2D.Value as Texture2D);
        }