void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Feature2D)) { LogError("owner is not initialized. Add Action \"newFeature2D\"."); return; } OpenCVForUnity.Features2dModule.Feature2D wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Feature2D, OpenCVForUnity.Features2dModule.Feature2D>(owner); List <OpenCVForUnity.CoreModule.Mat> wrapped_images = new List <OpenCVForUnity.CoreModule.Mat>(); OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(images, wrapped_images); List <OpenCVForUnity.CoreModule.MatOfKeyPoint> wrapped_keypoints = new List <OpenCVForUnity.CoreModule.MatOfKeyPoint>(); OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.MatOfKeyPoint, OpenCVForUnity.CoreModule.MatOfKeyPoint>(keypoints, wrapped_keypoints); List <OpenCVForUnity.CoreModule.Mat> wrapped_descriptors = new List <OpenCVForUnity.CoreModule.Mat>(); OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToList <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(descriptors, wrapped_descriptors); wrapped_owner.compute(wrapped_images, wrapped_keypoints, wrapped_descriptors); OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.Mat, OpenCVForUnityPlayMakerActions.Mat>(wrapped_images, images); OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.MatOfKeyPoint, OpenCVForUnityPlayMakerActions.MatOfKeyPoint>(wrapped_keypoints, keypoints); OpenCVForUnityPlayMakerActionsUtils.ConvertListToFsmArray <OpenCVForUnity.CoreModule.Mat, OpenCVForUnityPlayMakerActions.Mat>(wrapped_descriptors, descriptors); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Feature2D)) { LogError("owner is not initialized. Add Action \"newFeature2D\"."); return; } OpenCVForUnity.Features2dModule.Feature2D wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Feature2D, OpenCVForUnity.Features2dModule.Feature2D>(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 (!(keypoints.Value is OpenCVForUnityPlayMakerActions.MatOfKeyPoint)) { LogError("keypoints is not initialized. Add Action \"newMatOfKeyPoint\"."); return; } OpenCVForUnity.CoreModule.MatOfKeyPoint wrapped_keypoints = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfKeyPoint, OpenCVForUnity.CoreModule.MatOfKeyPoint>(keypoints); if (!(descriptors.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("descriptors is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_descriptors = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(descriptors); wrapped_owner.compute(wrapped_image, wrapped_keypoints, wrapped_descriptors); }