void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.CascadeClassifier)) { LogError("owner is not initialized. Add Action \"newCascadeClassifier\"."); return; } OpenCVForUnity.ObjdetectModule.CascadeClassifier wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.CascadeClassifier, OpenCVForUnity.ObjdetectModule.CascadeClassifier>(owner); if (!(image.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("image is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_image = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(image); if (!(objects.Value is OpenCVForUnityPlayMakerActions.MatOfRect)) { LogError("objects is not initialized. Add Action \"newMatOfRect\"."); return; } OpenCVForUnity.CoreModule.MatOfRect wrapped_objects = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfRect, OpenCVForUnity.CoreModule.MatOfRect>(objects); if (!(numDetections.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("numDetections is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_numDetections = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(numDetections); wrapped_owner.detectMultiScale2(wrapped_image, wrapped_objects, wrapped_numDetections); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.CascadeClassifier)) { LogError("owner is not initialized. Add Action \"newCascadeClassifier\"."); return; } OpenCVForUnity.ObjdetectModule.CascadeClassifier wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.CascadeClassifier, OpenCVForUnity.ObjdetectModule.CascadeClassifier>(owner); if (!(image.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("image is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_image = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(image); if (!(objects.Value is OpenCVForUnityPlayMakerActions.MatOfRect)) { LogError("objects is not initialized. Add Action \"newMatOfRect\"."); return; } OpenCVForUnity.CoreModule.MatOfRect wrapped_objects = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfRect, OpenCVForUnity.CoreModule.MatOfRect>(objects); if (!(numDetections.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("numDetections is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_numDetections = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(numDetections); wrapped_owner.detectMultiScale2(wrapped_image, wrapped_objects, wrapped_numDetections, (float)scaleFactor.Value, minNeighbors.Value, flags.Value, new OpenCVForUnity.CoreModule.Size((double)minSize_width.Value, (double)minSize_height.Value), new OpenCVForUnity.CoreModule.Size((double)maxSize_width.Value, (double)maxSize_height.Value)); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.CascadeClassifier)) { LogError("owner is not initialized. Add Action \"newCascadeClassifier\"."); return; } OpenCVForUnity.ObjdetectModule.CascadeClassifier wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.CascadeClassifier, OpenCVForUnity.ObjdetectModule.CascadeClassifier>(owner); if (!(image.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("image is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_image = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(image); if (!(objects.Value is OpenCVForUnityPlayMakerActions.MatOfRect)) { LogError("objects is not initialized. Add Action \"newMatOfRect\"."); return; } OpenCVForUnity.CoreModule.MatOfRect wrapped_objects = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfRect, OpenCVForUnity.CoreModule.MatOfRect>(objects); if (!(numDetections.Value is OpenCVForUnityPlayMakerActions.MatOfInt)) { LogError("numDetections is not initialized. Add Action \"newMatOfInt\"."); return; } OpenCVForUnity.CoreModule.MatOfInt wrapped_numDetections = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfInt, OpenCVForUnity.CoreModule.MatOfInt>(numDetections); if (!(scaleFactor.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("scaleFactor is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_scaleFactor = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(scaleFactor); if (!(minSize.Value is OpenCVForUnityPlayMakerActions.Size)) { LogError("minSize is not initialized. Add Action \"newSize\"."); return; } OpenCVForUnity.CoreModule.Size wrapped_minSize = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Size, OpenCVForUnity.CoreModule.Size>(minSize); if (!(maxSize.Value is OpenCVForUnityPlayMakerActions.Size)) { LogError("maxSize is not initialized. Add Action \"newSize\"."); return; } OpenCVForUnity.CoreModule.Size wrapped_maxSize = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Size, OpenCVForUnity.CoreModule.Size>(maxSize); wrapped_owner.detectMultiScale2(wrapped_image, wrapped_objects, wrapped_numDetections, wrapped_scaleFactor, minNeighbors.Value, flags.Value, wrapped_minSize, wrapped_maxSize); }