void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.HOGDescriptor)) { LogError("owner is not initialized. Add Action \"newHOGDescriptor\"."); return; } OpenCVForUnity.ObjdetectModule.HOGDescriptor wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.HOGDescriptor, OpenCVForUnity.ObjdetectModule.HOGDescriptor>(owner); if (!(img.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("img is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_img = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(img); if (!(foundLocations.Value is OpenCVForUnityPlayMakerActions.MatOfPoint)) { LogError("foundLocations is not initialized. Add Action \"newMatOfPoint\"."); return; } OpenCVForUnity.CoreModule.MatOfPoint wrapped_foundLocations = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfPoint, OpenCVForUnity.CoreModule.MatOfPoint>(foundLocations); if (!(weights.Value is OpenCVForUnityPlayMakerActions.MatOfDouble)) { LogError("weights is not initialized. Add Action \"newMatOfDouble\"."); return; } OpenCVForUnity.CoreModule.MatOfDouble wrapped_weights = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfDouble, OpenCVForUnity.CoreModule.MatOfDouble>(weights); wrapped_owner.detect(wrapped_img, wrapped_foundLocations, wrapped_weights); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.HOGDescriptor)) { LogError("owner is not initialized. Add Action \"newHOGDescriptor\"."); return; } OpenCVForUnity.ObjdetectModule.HOGDescriptor wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.HOGDescriptor, OpenCVForUnity.ObjdetectModule.HOGDescriptor>(owner); if (!(img.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("img is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_img = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(img); if (!(foundLocations.Value is OpenCVForUnityPlayMakerActions.MatOfPoint)) { LogError("foundLocations is not initialized. Add Action \"newMatOfPoint\"."); return; } OpenCVForUnity.CoreModule.MatOfPoint wrapped_foundLocations = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfPoint, OpenCVForUnity.CoreModule.MatOfPoint>(foundLocations); if (!(weights.Value is OpenCVForUnityPlayMakerActions.MatOfDouble)) { LogError("weights is not initialized. Add Action \"newMatOfDouble\"."); return; } OpenCVForUnity.CoreModule.MatOfDouble wrapped_weights = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfDouble, OpenCVForUnity.CoreModule.MatOfDouble>(weights); if (!(hitThreshold.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("hitThreshold is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_hitThreshold = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(hitThreshold); if (!(winStride.Value is OpenCVForUnityPlayMakerActions.Size)) { LogError("winStride is not initialized. Add Action \"newSize\"."); return; } OpenCVForUnity.CoreModule.Size wrapped_winStride = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Size, OpenCVForUnity.CoreModule.Size>(winStride); if (!(padding.Value is OpenCVForUnityPlayMakerActions.Size)) { LogError("padding is not initialized. Add Action \"newSize\"."); return; } OpenCVForUnity.CoreModule.Size wrapped_padding = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Size, OpenCVForUnity.CoreModule.Size>(padding); if (!(searchLocations.Value is OpenCVForUnityPlayMakerActions.MatOfPoint)) { LogError("searchLocations is not initialized. Add Action \"newMatOfPoint\"."); return; } OpenCVForUnity.CoreModule.MatOfPoint wrapped_searchLocations = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfPoint, OpenCVForUnity.CoreModule.MatOfPoint>(searchLocations); wrapped_owner.detect(wrapped_img, wrapped_foundLocations, wrapped_weights, wrapped_hitThreshold, wrapped_winStride, wrapped_padding, wrapped_searchLocations); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.HOGDescriptor)) { LogError("owner is not initialized. Add Action \"newHOGDescriptor\"."); return; } OpenCVForUnity.ObjdetectModule.HOGDescriptor wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.HOGDescriptor, OpenCVForUnity.ObjdetectModule.HOGDescriptor>(owner); if (!(img.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("img is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_img = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(img); if (!(foundLocations.Value is OpenCVForUnityPlayMakerActions.MatOfPoint)) { LogError("foundLocations is not initialized. Add Action \"newMatOfPoint\"."); return; } OpenCVForUnity.CoreModule.MatOfPoint wrapped_foundLocations = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfPoint, OpenCVForUnity.CoreModule.MatOfPoint>(foundLocations); if (!(weights.Value is OpenCVForUnityPlayMakerActions.MatOfDouble)) { LogError("weights is not initialized. Add Action \"newMatOfDouble\"."); return; } OpenCVForUnity.CoreModule.MatOfDouble wrapped_weights = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfDouble, OpenCVForUnity.CoreModule.MatOfDouble>(weights); if (!(searchLocations.Value is OpenCVForUnityPlayMakerActions.MatOfPoint)) { LogError("searchLocations is not initialized. Add Action \"newMatOfPoint\"."); return; } OpenCVForUnity.CoreModule.MatOfPoint wrapped_searchLocations = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfPoint, OpenCVForUnity.CoreModule.MatOfPoint>(searchLocations); wrapped_owner.detect(wrapped_img, wrapped_foundLocations, wrapped_weights, (float)hitThreshold.Value, new OpenCVForUnity.CoreModule.Size((double)winStride_width.Value, (double)winStride_height.Value), new OpenCVForUnity.CoreModule.Size((double)padding_width.Value, (double)padding_height.Value), wrapped_searchLocations); }