void DoProcess() { 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 (!(box.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("box is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_box = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(box); if (!(color.Value is OpenCVForUnityPlayMakerActions.Scalar)) { LogError("color is not initialized. Add Action \"newScalar\"."); return; } OpenCVForUnity.CoreModule.Scalar wrapped_color = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Scalar, OpenCVForUnity.CoreModule.Scalar>(color); OpenCVForUnity.ImgprocModule.Imgproc.ellipse(wrapped_img, wrapped_box, wrapped_color, thickness.Value, lineType.Value); }
void DoProcess() { if (!(rect1.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("rect1 is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_rect1 = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(rect1); if (!(rect2.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("rect2 is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_rect2 = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(rect2); if (!(intersectingRegion.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("intersectingRegion is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_intersectingRegion = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(intersectingRegion); storeResult.Value = OpenCVForUnity.ImgprocModule.Imgproc.rotatedRectangleIntersection(wrapped_rect1, wrapped_rect2, wrapped_intersectingRegion); }
void DoProcess() { OpenCVForUnity.CoreModule.RotatedRect[] wrapped_a = new OpenCVForUnity.CoreModule.RotatedRect[a.Length]; OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToArray <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(a, wrapped_a); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.MatOfRotatedRect)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.MatOfRotatedRect(); } ((OpenCVForUnityPlayMakerActions.MatOfRotatedRect)storeResult.Value).wrappedObject = new OpenCVForUnity.CoreModule.MatOfRotatedRect(wrapped_a); OpenCVForUnityPlayMakerActionsUtils.ConvertArrayToFsmArray <OpenCVForUnity.CoreModule.RotatedRect, OpenCVForUnityPlayMakerActions.RotatedRect>(wrapped_a, a); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("owner is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(owner); if (!(storeResult.Value is OpenCVForUnityPlayMakerActions.Rect)) { storeResult.Value = new OpenCVForUnityPlayMakerActions.Rect(); } ((OpenCVForUnityPlayMakerActions.Rect)storeResult.Value).wrappedObject = wrapped_owner.boundingRect(); }
//@Override public override bool Equals(Object obj) { if (!(obj is RotatedRect)) { return(false); } if ((RotatedRect)obj == this) { return(true); } RotatedRect it = (RotatedRect)obj; return(center.Equals(it.center) && size.Equals(it.size) && angle == it.angle); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.MatOfRotatedRect)) { LogError("owner is not initialized. Add Action \"newMatOfRotatedRect\"."); return; } OpenCVForUnity.CoreModule.MatOfRotatedRect wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.MatOfRotatedRect, OpenCVForUnity.CoreModule.MatOfRotatedRect>(owner); OpenCVForUnity.CoreModule.RotatedRect[] wrapped_a = new OpenCVForUnity.CoreModule.RotatedRect[a.Length]; OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToArray <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(a, wrapped_a); wrapped_owner.fromArray(wrapped_a); OpenCVForUnityPlayMakerActionsUtils.ConvertArrayToFsmArray <OpenCVForUnity.CoreModule.RotatedRect, OpenCVForUnityPlayMakerActions.RotatedRect>(wrapped_a, a); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("owner is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(owner); OpenCVForUnity.CoreModule.Point[] wrapped_pt = new OpenCVForUnity.CoreModule.Point[pt.Length]; OpenCVForUnityPlayMakerActionsUtils.ConvertFsmArrayToArray <OpenCVForUnityPlayMakerActions.Point, OpenCVForUnity.CoreModule.Point>(pt, wrapped_pt); wrapped_owner.points(wrapped_pt); OpenCVForUnityPlayMakerActionsUtils.ConvertArrayToFsmArray <OpenCVForUnity.CoreModule.Point, OpenCVForUnityPlayMakerActions.Point>(wrapped_pt, pt); }
public RotatedRect[] toArray() { int num = (int)total(); RotatedRect[] a = new RotatedRect[num]; if (num == 0) { return(a); } float[] buff = new float[_channels]; for (int i = 0; i < num; i++) { get(i, 0, buff); //TODO: check ret val! a[i] = new RotatedRect(new Point(buff[0], buff[1]), new Size(buff[2], buff[3]), buff[4]); } return(a); }
void DoProcess() { if (!(box.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("box is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_box = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(box); if (!(points.Value is OpenCVForUnityPlayMakerActions.Mat)) { LogError("points is not initialized. Add Action \"newMat\"."); return; } OpenCVForUnity.CoreModule.Mat wrapped_points = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.Mat, OpenCVForUnity.CoreModule.Mat>(points); OpenCVForUnity.ImgprocModule.Imgproc.boxPoints(wrapped_box, wrapped_points); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("owner is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(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); }
void DoProcess() { if (!(owner.Value is OpenCVForUnityPlayMakerActions.RotatedRect)) { LogError("owner is not initialized. Add Action \"newRotatedRect\"."); return; } OpenCVForUnity.CoreModule.RotatedRect wrapped_owner = OpenCVForUnityPlayMakerActionsUtils.GetWrappedObject <OpenCVForUnityPlayMakerActions.RotatedRect, OpenCVForUnity.CoreModule.RotatedRect>(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(); }
public void fromArray(params RotatedRect[] a) { if (a == null || a.Length == 0) { return; } int num = a.Length; alloc(num); float[] buff = new float[num * _channels]; for (int i = 0; i < num; i++) { RotatedRect r = a[i]; buff[_channels * i + 0] = (float)r.center.x; buff[_channels * i + 1] = (float)r.center.y; buff[_channels * i + 2] = (float)r.size.width; buff[_channels * i + 3] = (float)r.size.height; buff[_channels * i + 4] = (float)r.angle; } put(0, 0, buff); //TODO: check ret val! }
public RotatedRect(OpenCVForUnity.CoreModule.RotatedRect nativeObj) : base(nativeObj) { }