void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); if (!(width.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("width is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_width = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(width); if (!(height.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("height is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_height = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(height); wrapped_owner.inflate(wrapped_width, wrapped_height); }
void DoProcess() { if (!(rect.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("rect is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_rect = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(rect); if (!(x.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("x is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_x = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(x); if (!(y.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("y is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_y = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(y); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Rect2d(); } ((OpenCVForUnityPlayMakerActions.Rect2d)storeResult.Value).wrappedObject = OpenCVForUnity.CoreModule.Rect2d.inflate(wrapped_rect, wrapped_x, wrapped_y); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); if (!(x.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("x is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_x = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(x); if (!(y.Value is OpenCVForUnityPlayMakerActions.Double)) { LogError("y is not initialized. Add Action \"newDouble\"."); return; } System.Double wrapped_y = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Double, System.Double>(y); storeResult.Value = wrapped_owner.contains(wrapped_x, wrapped_y); Fsm.Event(storeResult.Value ? trueEvent : falseEvent); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.legacy_Tracker)) { LogError("owner is not initialized. Add Action \"newlegacy_Tracker\"."); return; } OpenCVForUnity.TrackingModule.legacy_Tracker wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.legacy_Tracker, OpenCVForUnity.TrackingModule.legacy_Tracker>(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 (!(boundingBox.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("boundingBox is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_boundingBox = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(boundingBox); storeResult.Value = wrapped_owner.update(wrapped_image, wrapped_boundingBox); Fsm.Event(storeResult.Value ? trueEvent : falseEvent); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); wrapped_owner.inflate((float)width.Value, (float)height.Value); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); storeResult.Value = (float)wrapped_owner.area(); }
void DoProcess() { OpenCVForUnity.CoreModule.Rect2d[] wrapped_a = new OpenCVForUnity.CoreModule.Rect2d[a.Length]; OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToArray <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(a, wrapped_a); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.MatOfRect2d)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.MatOfRect2d(); } ((OpenCVForUnityPlayMakerActions.MatOfRect2d)storeResult.Value).wrappedObject = new OpenCVForUnity.CoreModule.MatOfRect2d(wrapped_a); OpenCVForUnityPlayMakerActionsUtils.ConvertArrayToFsmArray <OpenCVForUnity.CoreModule.Rect2d, OpenCVForUnityPlayMakerActions.Rect2d>(wrapped_a, a); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); storeResult.Value = wrapped_owner.contains((float)x.Value, (float)y.Value); Fsm.Event(storeResult.Value ? trueEvent : falseEvent); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); storeResult.Value = wrapped_owner.Equals(new OpenCVForUnity.CoreModule.Rect2d((double)a_x.Value, (double)a_y.Value, (double)a_width.Value, (double)a_height.Value)); Fsm.Event(storeResult.Value ? trueEvent : falseEvent); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Point)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Point(); } ((OpenCVForUnityPlayMakerActions.Point)storeResult.Value).wrappedObject = wrapped_owner.br(); }
void DoProcess() { if (!(rect.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("rect is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_rect = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(rect); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Rect2d(); } ((OpenCVForUnityPlayMakerActions.Rect2d)storeResult.Value).wrappedObject = OpenCVForUnity.CoreModule.Rect2d.inflate(wrapped_rect, (float)x.Value, (float)y.Value); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Rect2d(); } ((OpenCVForUnityPlayMakerActions.Rect2d)storeResult.Value).wrappedObject = wrapped_owner.union(new OpenCVForUnity.CoreModule.Rect2d((double)rect_x.Value, (double)rect_y.Value, (double)rect_width.Value, (double)rect_height.Value)); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfRect2d)) { LogError("owner is not initialized. Add Action \"newMatOfRect2d\"."); return; } OpenCVForUnity.CoreModule.MatOfRect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfRect2d, OpenCVForUnity.CoreModule.MatOfRect2d>(owner); OpenCVForUnity.CoreModule.Rect2d[] wrapped_a = new OpenCVForUnity.CoreModule.Rect2d[a.Length]; OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToArray <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(a, wrapped_a); wrapped_owner.fromArray(wrapped_a); OpenCVForUnityPlayMakerActionsUtils.ConvertArrayToFsmArray <OpenCVForUnity.CoreModule.Rect2d, OpenCVForUnityPlayMakerActions.Rect2d>(wrapped_a, a); }
public Rect2d[] toArray() { int num = (int)total(); Rect2d[] a = new Rect2d[num]; if (num == 0) { return(a); } double[] buff = new double[num * _channels]; get(0, 0, buff); //TODO: check ret val! for (int i = 0; i < num; i++) { a[i] = new Rect2d(buff[i * _channels], buff[i * _channels + 1], buff[i * _channels + 2], buff[i * _channels + 3]); } return(a); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); if (!(size.Value is OpenCVForUnityPlayMakerActions.Size)) { LogError("size is not initialized. Add Action \"newSize\"."); return; } OpenCVForUnity.CoreModule.Size wrapped_size = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Size, OpenCVForUnity.CoreModule.Size>(size); wrapped_owner.inflate(wrapped_size); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); if (!(vals.Value is OpenCVForUnityPlayMakerActions.DoubleArray)) { LogError("vals is not initialized. Add Action \"newDoubleArray\"."); return; } System.Double[] wrapped_vals = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.DoubleArray, System.Double[]>(vals); wrapped_owner.set(wrapped_vals); }
public void fromArray(params Rect2d[] a) { if (a == null || a.Length == 0) { return; } int num = a.Length; alloc(num); double[] buff = new double[num * _channels]; for (int i = 0; i < num; i++) { Rect2d r = a[i]; buff[_channels * i + 0] = (double)r.x; buff[_channels * i + 1] = (double)r.y; buff[_channels * i + 2] = (double)r.width; buff[_channels * i + 3] = (double)r.height; } put(0, 0, buff); //TODO: check ret val! }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); if (!(rect.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("rect is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_rect = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(rect); storeResult.Value = wrapped_owner.intersectsWith(wrapped_rect); Fsm.Event(storeResult.Value ? trueEvent : falseEvent); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("owner is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(owner); float[] float_vals = vals.floatValues; double[] casted_vals = new double[float_vals.Length]; float_vals.CopyTo(casted_vals, 0); wrapped_owner.set(casted_vals); for (int i = 0; i < casted_vals.Length; i++) { vals.Set(i, (float)casted_vals[i]); } vals.SaveChanges(); }
void DoProcess() { if (!(a.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("a is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_a = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(a); if (!(b.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { LogError("b is not initialized. Add Action \"newRect2d\"."); return; } OpenCVForUnity.CoreModule.Rect2d wrapped_b = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Rect2d, OpenCVForUnity.CoreModule.Rect2d>(b); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Rect2d)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Rect2d(); } ((OpenCVForUnityPlayMakerActions.Rect2d)storeResult.Value).wrappedObject = OpenCVForUnity.CoreModule.Rect2d.intersect(wrapped_a, wrapped_b); }
public Rect2d(OpenCVForUnity.CoreModule.Rect2d nativeObj) : base(nativeObj) { }