public static void Main() { { TestLogger.Log("Testing cpobj..."); var s = new Struct(); TestLogger.Log(s.ToString()); s.a = 3; s.b = true; s.c = 'x'; s.d = 4; s.e = 2.5f; s.f = 9.4; s.g.x = 10; s.g.y = 12; s.h = "test"; TestLogger.Log(s.ToString()); var t = new Struct(); TestLogger.Log(t.ToString()); CopyStruct(ref s, ref t); TestLogger.Log(t.ToString()); } { TestLogger.Log("Testing ldflda..."); var s = new Struct(); s.a = 3; s.g.x = 10; LogInt(ref s.a); LogInt(ref s.g.x); } { TestLogger.Log("Testing indexer..."); Arr arr = new Arr(); for (var i = 0; i < arr.Count; i++) arr[i] = i * 37 % 11; for (var i = 0; i < arr.Count; i++) TestLogger.Log(arr[i]); } { TestLogger.Log("Testing parameters..."); var p = new Params(1, 2, 3, 4, 5); TestLogger.Log(p.ToString()); } }
internal static extern double cvThreshold( Arr src, Arr dst, double threshold, double max_value, ThresholdTypes threshold_type);
internal static extern void cvCalcArrBackProject(IntPtr[] image, Arr dst, Histogram hist);
internal static extern void cvCopyMakeBorder(Arr src, Arr dst, Point offset, IplBorder bordertype, Scalar value);
internal static extern void cvRunningAvg(Arr image, Arr acc, double alpha, Arr mask);
internal static extern void cvMatchTemplate(Arr image, Arr templ, Arr result, TemplateMatchingMethod method);
internal static extern void cvGetRectSubPix(Arr src, Arr dst, Point2f center);
internal static extern void cvSquareAcc(Arr image, Arr sqsum, Arr mask);
internal static void DrawEdge(int row, int column, Arr gradientMap, Arr directionMap, Arr edgeMap, int rows, int columns) { var edgel = edgeMap.GetReal(row, column); if (edgel != 0) { return; } var direction = directionMap.GetReal(row, column); if (direction == Gradients.HorizontalValue) { // go horizontal GoLeft(row, column, gradientMap, directionMap, edgeMap, rows, columns); GoRight(row, column, gradientMap, directionMap, edgeMap, rows, columns); } else { // go vertical GoUp(row, column, gradientMap, directionMap, edgeMap, rows, columns); GoDown(row, column, gradientMap, directionMap, edgeMap, rows, columns); } }
internal static extern void cvShowImage(string name, Arr image);
internal static extern void cvAddText(Arr img, string text, Point org, Font arg2);
internal static extern void cvConvertImage(Arr src, Arr dst, ConvertImageFlags flags);
internal static extern IntPtr cvEncodeImage(string ext, Arr image, int[] parameters);
internal static extern int cvSaveImage(string filename, Arr image, int[] parameters);
public void TestIndexOfNull() { Assert.AreEqual(-1, Arr.IndexOf(null, new[] { "d", "e" })); }
static void MarkWorkspacesInactive(Arr<Json> workspaces) { foreach (LayoutInfo layoutInfo in workspaces) { layoutInfo.ActiveWorkspace = false; } }
internal static extern void cvDilate(Arr src, Arr dst, IplConvKernel element, int iterations);
internal static extern void cvWarpPerspective(Arr src, Arr dst, Mat map_matrix, WarpFlags flags, Scalar fillval);
internal static extern int cvSampleLine(Arr image, Point pt1, Point pt2, IntPtr buffer, LineType connectivity);
internal static extern void cvRemap(Arr src, Arr dst, Arr mapx, Arr mapy, WarpFlags flags, Scalar fillval);
internal static extern void cvGetQuadrangleSubPix(Arr src, Arr dst, Mat map_matrix);
internal static extern void cvConvertMaps(Arr mapx, Arr mapy, Arr mapxy, Arr mapalpha);
internal static extern void cvMultiplyAcc(Arr image1, Arr image2, Arr acc, Arr mask);
internal static extern void cvLogPolar(Arr src, Arr dst, Point2f center, double M, WarpFlags flags);
internal static extern Seq cvPointSeqFromMat(int seq_kind, Arr mat, Contour contour_header, IntPtr block);
internal static extern void cvLinearPolar(Arr src, Arr dst, Point2f center, double maxRadius, WarpFlags flags);
internal static extern void cvCalcArrHist(IntPtr[] arr, Histogram hist, int accumulate, Arr mask);
internal static extern void cvUndistort2(Arr src, Arr dst, Mat camera_matrix, Mat distortion_coeffs, Mat new_camera_matrix);
internal static extern void cvEqualizeHist(Arr src, Arr dst);
internal static extern void cvInitUndistortMap(Mat camera_matrix, Mat distortion_coeffs, Arr mapx, Arr mapy);
internal static extern void cvCanny(Arr image, Arr edges, double threshold1, double threshold2, int aperture_size);
internal static extern void cvAcc(Arr image, Arr sum, Arr mask);