Esempio n. 1
0
 public static extern ErrorType opencv_line_float(IntPtr mat,
                                                  IntPtr p1,
                                                  IntPtr p2,
                                                  IntPtr scalar,
                                                  int thickness,
                                                  CvLineTypes lineType,
                                                  int shift);
Esempio n. 2
0
 public static extern ErrorType opencv_rectangle2_float(IntPtr mat,
                                                        IntPtr pt1,
                                                        IntPtr pt2,
                                                        IntPtr scalar,
                                                        int thickness,
                                                        CvLineTypes lineType,
                                                        int shift);
Esempio n. 3
0
 public static extern ErrorType opencv_circle_float(IntPtr mat,
                                                    IntPtr center,
                                                    int radius,
                                                    IntPtr scalar,
                                                    int thickness,
                                                    CvLineTypes lineType,
                                                    int shift);
Esempio n. 4
0
        public static void Rectangle(Mat mat,
                                     Rect <float> rect,
                                     Scalar <double> scalar,
                                     int thickness        = 1,
                                     CvLineTypes lineType = CvLineTypes.Line8,
                                     int shift            = 0)
        {
            if (mat == null)
            {
                throw new ArgumentNullException(nameof(mat));
            }

            mat.ThrowIfDisposed();

            using (var nativeRect = rect.ToNative())
                using (var nativeScalar = scalar.ToNative())
                {
                    NativeMethods.opencv_rectangle_float(mat.NativePtr,
                                                         nativeRect.NativePtr,
                                                         nativeScalar.NativePtr,
                                                         thickness,
                                                         lineType,
                                                         shift);
                }
        }
Esempio n. 5
0
        public static void Circle(Mat mat,
                                  Point <float> center,
                                  int radius,
                                  Scalar <double> scalar,
                                  int thickness        = 1,
                                  CvLineTypes lineType = CvLineTypes.Line8,
                                  int shift            = 0)
        {
            if (mat == null)
            {
                throw new ArgumentNullException(nameof(mat));
            }

            mat.ThrowIfDisposed();

            using (var nativeCenter = center.ToNative())
                using (var nativeScalar = scalar.ToNative())
                {
                    NativeMethods.opencv_circle_float(mat.NativePtr,
                                                      nativeCenter.NativePtr,
                                                      radius,
                                                      nativeScalar.NativePtr,
                                                      thickness,
                                                      lineType,
                                                      shift);
                }
        }
Esempio n. 6
0
        public static void Rectangle(Mat mat,
                                     Point <int> pt1,
                                     Point <int> pt2,
                                     Scalar <double> scalar,
                                     int thickness        = 1,
                                     CvLineTypes lineType = CvLineTypes.Line8,
                                     int shift            = 0)
        {
            if (mat == null)
            {
                throw new ArgumentNullException(nameof(mat));
            }

            mat.ThrowIfDisposed();

            using (var nativePt1 = pt1.ToNative())
                using (var nativePt2 = pt2.ToNative())
                    using (var nativeScalar = scalar.ToNative())
                    {
                        NativeMethods.opencv_rectangle2_int32_t(mat.NativePtr,
                                                                nativePt1.NativePtr,
                                                                nativePt2.NativePtr,
                                                                nativeScalar.NativePtr,
                                                                thickness,
                                                                lineType,
                                                                shift);
                    }
        }
Esempio n. 7
0
        public static void PutText(Mat mat,
                                   string text,
                                   Point <double> point,
                                   CvHersheyFonts fontFace,
                                   double fontScale,
                                   Scalar <double> scalar,
                                   int thickness         = 1,
                                   CvLineTypes lineType  = CvLineTypes.Line8,
                                   bool bottomLeftOrigin = false)
        {
            if (mat == null)
            {
                throw new ArgumentNullException(nameof(mat));
            }

            mat.ThrowIfDisposed();

            var str = Ncnn.Encoding.GetBytes(text ?? "");

            using (var nativePoint = point.ToNative())
                using (var nativeScalar = scalar.ToNative())
                {
                    NativeMethods.opencv_putText_double(mat.NativePtr,
                                                        str,
                                                        str.Length,
                                                        nativePoint.NativePtr,
                                                        fontFace,
                                                        fontScale,
                                                        nativeScalar.NativePtr,
                                                        thickness,
                                                        lineType,
                                                        bottomLeftOrigin);
                }
        }
Esempio n. 8
0
 public static extern ErrorType opencv_putText_float(IntPtr mat,
                                                     byte[] text,
                                                     int textLength,
                                                     IntPtr point,
                                                     CvHersheyFonts fontFace,
                                                     double fontScale,
                                                     IntPtr scalar,
                                                     int thickness,
                                                     CvLineTypes lineType,
                                                     bool bottomLeftOrigin);
Esempio n. 9
0
 public static extern ErrorType opencv_rectangle_int32_t(IntPtr mat,
                                                         IntPtr rect,
                                                         IntPtr scalar,
                                                         int thickness,
                                                         CvLineTypes lineType,
                                                         int shift);