Exemplo n.º 1
0
            // Methods

            public Cv.Mat At(uint pos)
            {
                Cv.Exception exception = new Cv.Exception();
                Cv.Mat       element   = new Cv.Mat(au_std_vectorMat_at(CppPtr, pos, exception.CppPtr), Utility.DeleteResponsibility.False);
                exception.Check();
                return(element);
            }
Exemplo n.º 2
0
 public static void DrawDetectedDiamonds(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners, Std.VectorVec4i diamondIds,
                                         Cv.Scalar borderColor)
 {
     Cv.Exception exception = new Cv.Exception();
     au_drawDetectedDiamonds(image.CppPtr, diamondCorners.CppPtr, diamondIds.CppPtr, borderColor.CppPtr, exception.CppPtr);
     exception.Check();
 }
Exemplo n.º 3
0
            // Static methods

            static public Cv.Mat GetBitsFromByteList(Cv.Mat byteList, int markerSiz)
            {
                Cv.Exception exception = new Cv.Exception();
                Cv.Mat       bits      = new Cv.Mat(au_Dictionary_getBitsFromByteList(byteList.CppPtr, markerSiz, exception.CppPtr));
                exception.Check();
                return(bits);
            }
Exemplo n.º 4
0
            public int GetDistanceToId(Dictionary dictionary, Cv.Mat bits, int id, bool allRotations = true)
            {
                Cv.Exception exception    = new Cv.Exception();
                int          distanceToId = au_Dictionary_getDistanceToId(CppPtr, bits.CppPtr, id, allRotations, exception.CppPtr);

                exception.Check();
                return(distanceToId);
            }
Exemplo n.º 5
0
 public static void RefineDetectedMarkers(Cv.Mat image, Board board, Std.VectorVectorPoint2f detectedCorners, Std.VectorInt detectedIds,
                                          Std.VectorVectorPoint2f rejectedCorners, Cv.Mat cameraMatrix, Cv.Mat distCoeffs, float minRepDistance = 10f,
                                          float errorCorrectionRate = 3f, bool checkAllOrders = true)
 {
     Std.VectorInt recoveredIdxs = new Std.VectorInt();
     RefineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix, distCoeffs, minRepDistance,
                           errorCorrectionRate, checkAllOrders, recoveredIdxs);
 }
Exemplo n.º 6
0
            public bool Identify(Dictionary dictionary, Cv.Mat onlyBits, out int idx, out int rotation, double maxCorrectionRate)
            {
                Cv.Exception exception = new Cv.Exception();
                bool         result    = au_Dictionary_identify(CppPtr, onlyBits.CppPtr, out idx, out rotation, maxCorrectionRate, exception.CppPtr);

                exception.Check();
                return(result);
            }
Exemplo n.º 7
0
 public static void RefineDetectedMarkers(Cv.Mat image, Board board, Std.VectorVectorPoint2f detectedCorners, Std.VectorInt detectedIds,
                                          Std.VectorVectorPoint2f rejectedCorners, Cv.Mat cameraMatrix, Cv.Mat distCoeffs, float minRepDistance, float errorCorrectionRate,
                                          bool checkAllOrders, Std.VectorInt recoveredIdxs, DetectorParameters parameters)
 {
     Cv.Exception exception = new Cv.Exception();
     au_refineDetectedMarkers(image.CppPtr, board.CppPtr, detectedCorners.CppPtr, detectedIds.CppPtr, rejectedCorners.CppPtr, cameraMatrix.CppPtr,
                              distCoeffs.CppPtr, minRepDistance, errorCorrectionRate, checkAllOrders, recoveredIdxs.CppPtr, parameters.CppPtr, exception.CppPtr);
     exception.Check();
 }
Exemplo n.º 8
0
                // Methods

                public void Draw(Cv.Size outSize, out Cv.Mat img, int marginSize = 0, int borderBits = 1)
                {
                    Cv.Exception  exception = new Cv.Exception();
                    System.IntPtr imgPtr;

                    au_GridBoard_draw(CppPtr, outSize.CppPtr, out imgPtr, marginSize, borderBits, exception.CppPtr);
                    img = new Cv.Mat(imgPtr);

                    exception.Check();
                }
Exemplo n.º 9
0
            // Methods

            public void DrawMarker(int id, int sidePixels, out Cv.Mat img, int borderBits)
            {
                var    exception = new Cv.Exception();
                IntPtr imgPtr;

                au_Dictionary_drawMarker(CppPtr, id, sidePixels, out imgPtr, borderBits, exception.CppPtr);
                img = new Cv.Mat(imgPtr);

                exception.Check();
            }
Exemplo n.º 10
0
        public static void DrawCharucoDiamond(Dictionary dictionary, Cv.Vec4i ids, int squareLength, int markerLength, out Cv.Mat image,
                                              int marginSize = 0, int borderBits = 1)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       imagePtr;

            au_drawCharucoDiamond(dictionary.CppPtr, ids.CppPtr, squareLength, markerLength, out imagePtr, marginSize, borderBits, exception.CppPtr);
            image = new Cv.Mat(imagePtr);

            exception.Check();
        }
Exemplo n.º 11
0
        public static void DetectMarkers(Cv.Mat image, Dictionary dictionary, out Std.VectorVectorPoint2f corners, out Std.VectorInt ids,
                                         DetectorParameters parameters, out Std.VectorVectorPoint2f rejectedImgPoints)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       cornersPtr, idsPtr, rejectedPtr;

            au_detectMarkers(image.CppPtr, dictionary.CppPtr, out cornersPtr, out idsPtr, parameters.CppPtr, out rejectedPtr, exception.CppPtr);
            corners           = new Std.VectorVectorPoint2f(cornersPtr);
            ids               = new Std.VectorInt(idsPtr);
            rejectedImgPoints = new Std.VectorVectorPoint2f(rejectedPtr);

            exception.Check();
        }
Exemplo n.º 12
0
            public unsafe Cv.Mat[] Data()
            {
                IntPtr *dataPtr = au_std_vectorMat_data(CppPtr);
                uint    size    = Size();

                Cv.Mat[] data = new Cv.Mat[size];
                for (int i = 0; i < size; i++)
                {
                    data[i] = new Cv.Mat(dataPtr[i], Utility.DeleteResponsibility.False);
                }

                return(data);
            }
Exemplo n.º 13
0
        public static void DetectCharucoDiamond(Cv.Mat image, Std.VectorVectorPoint2f markerCorners, Std.VectorInt markerIds,
                                                float squareMarkerLengthRate, out Std.VectorVectorPoint2f diamondCorners, out Std.VectorVec4i diamondIds, Cv.Mat cameraMatrix,
                                                Cv.Mat distCoeffs)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       diamondCornersPtr, diamondIdsPtr;

            au_detectCharucoDiamond(image.CppPtr, markerCorners.CppPtr, markerIds.CppPtr, squareMarkerLengthRate, out diamondCornersPtr,
                                    out diamondIdsPtr, cameraMatrix.CppPtr, distCoeffs.CppPtr, exception.CppPtr);
            diamondCorners = new Std.VectorVectorPoint2f(diamondCornersPtr);
            diamondIds     = new Std.VectorVec4i(diamondIdsPtr);

            exception.Check();
        }
Exemplo n.º 14
0
        public static bool EstimatePoseCharucoBoard(Std.VectorPoint2f charucoCorners, Std.VectorInt charucoIds, CharucoBoard board,
                                                    Cv.Mat cameraMatrix, Cv.Mat distCoeffs, out Cv.Vec3d rvec, out Cv.Vec3d tvec)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       rvecPtr, tvecPtr;

            bool valid = au_estimatePoseCharucoBoard(charucoCorners.CppPtr, charucoIds.CppPtr, board.CppPtr, cameraMatrix.CppPtr, distCoeffs.CppPtr,
                                                     out rvecPtr, out tvecPtr, exception.CppPtr);

            rvec = new Cv.Vec3d(rvecPtr);
            tvec = new Cv.Vec3d(tvecPtr);

            exception.Check();
            return(valid);
        }
Exemplo n.º 15
0
        public static double CalibrateCameraCharuco(Std.VectorVectorPoint2f charucoCorners, Std.VectorVectorInt charucoIds, CharucoBoard board,
                                                    Cv.Size imageSize, Cv.Mat cameraMatrix, Cv.Mat distCoeffs, out Std.VectorMat rvecs, out Std.VectorMat tvecs, Cv.Calib flags,
                                                    Cv.TermCriteria criteria)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       rvecsPtr, tvecsPtr;

            double reProjectionError = au_calibrateCameraCharuco(charucoCorners.CppPtr, charucoIds.CppPtr, board.CppPtr, imageSize.CppPtr,
                                                                 cameraMatrix.CppPtr, distCoeffs.CppPtr, out rvecsPtr, out tvecsPtr, (int)flags, criteria.CppPtr, exception.CppPtr);

            rvecs = new Std.VectorMat(rvecsPtr);
            tvecs = new Std.VectorMat(tvecsPtr);

            exception.Check();
            return(reProjectionError);
        }
Exemplo n.º 16
0
        public static void EstimatePoseSingleMarkers(Std.VectorVectorPoint2f corners, float markerLength, Cv.Mat cameraMatrix, Cv.Mat distCoeffs,
                                                     out Std.VectorVec3d rvecs, out Std.VectorVec3d tvecs)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       rvecsPtr, tvecsPtr;

            au_estimatePoseSingleMarkers(corners.CppPtr, markerLength, cameraMatrix.CppPtr, distCoeffs.CppPtr, out rvecsPtr, out tvecsPtr,
                                         exception.CppPtr);
            rvecs = new Std.VectorVec3d(rvecsPtr);
            tvecs = new Std.VectorVec3d(tvecsPtr);

            exception.Check();
        }
Exemplo n.º 17
0
 public static void RefineDetectedMarkers(Cv.Mat image, Board board, Std.VectorVectorPoint2f detectedCorners, Std.VectorInt detectedIds,
                                          Std.VectorVectorPoint2f rejectedCorners)
 {
     Cv.Mat cameraMatrix = new Cv.Mat();
     RefineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix);
 }
Exemplo n.º 18
0
 public static void DrawDetectedDiamonds(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners, Std.VectorVec4i diamondIds)
 {
     Cv.Scalar borderColor = new Cv.Scalar(0, 0, 255);
     DrawDetectedDiamonds(image, diamondCorners, diamondIds, borderColor);
 }
Exemplo n.º 19
0
 public static void DrawDetectedCornersCharuco(Cv.Mat image, Std.VectorPoint2f charucoCorners, Std.VectorInt charucoIds, Cv.Scalar cornerColor)
 {
     Cv.Exception exception = new Cv.Exception();
     au_drawDetectedCornersCharuco(image.CppPtr, charucoCorners.CppPtr, charucoIds.CppPtr, cornerColor.CppPtr, exception.CppPtr);
     exception.Check();
 }
Exemplo n.º 20
0
 public static void DrawDetectedCornersCharuco(Cv.Mat image, Std.VectorPoint2f charucoCorners)
 {
     Std.VectorInt charucoIds = new Std.VectorInt();
     DrawDetectedCornersCharuco(image, charucoCorners, charucoIds);
 }
Exemplo n.º 21
0
 public static int InterpolateCornersCharuco(Std.VectorVectorPoint2f markerCorners, Std.VectorInt markerIds, Cv.Mat image, CharucoBoard board,
                                             out Std.VectorPoint2f charucoCorners, out Std.VectorInt charucoIds)
 {
     Cv.Mat cameraMatrix = new Cv.Mat();
     return(InterpolateCornersCharuco(markerCorners, markerIds, image, board, out charucoCorners, out charucoIds, cameraMatrix));
 }
Exemplo n.º 22
0
 public static void DrawDetectedDiamonds(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners)
 {
     Std.VectorVec4i diamondIds = new Std.VectorVec4i();
     DrawDetectedDiamonds(image, diamondCorners, diamondIds);
 }
Exemplo n.º 23
0
 public void PushBack(Cv.Mat value)
 {
     au_std_vectorMat_push_back(CppPtr, value.CppPtr);
 }
Exemplo n.º 24
0
        public static int EstimatePoseBoard(Std.VectorVectorPoint2f corners, Std.VectorInt ids, Board board, Cv.Mat cameraMatrix, Cv.Mat distCoeffs,
                                            out Cv.Vec3d rvec, out Cv.Vec3d tvec)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       rvecPtr, tvecPtr;

            int valid = au_estimatePoseBoard(corners.CppPtr, ids.CppPtr, board.CppPtr, cameraMatrix.CppPtr, distCoeffs.CppPtr, out rvecPtr, out tvecPtr,
                                             exception.CppPtr);

            rvec = new Cv.Vec3d(rvecPtr);
            tvec = new Cv.Vec3d(tvecPtr);

            exception.Check();
            return(valid);
        }
Exemplo n.º 25
0
 public static void DrawDetectedMarkers(Cv.Mat image, Std.VectorVectorPoint2f corners, Std.VectorInt ids, Cv.Scalar borderColor)
 {
     Cv.Exception exception = new Cv.Exception();
     au_drawDetectedMarkers(image.CppPtr, corners.CppPtr, ids.CppPtr, borderColor.CppPtr, exception.CppPtr);
     exception.Check();
 }
Exemplo n.º 26
0
 public static void DrawDetectedMarkers(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners, Std.VectorInt ids)
 {
     Cv.Scalar borderColor = new Cv.Scalar(0, 255, 0);
     DrawDetectedMarkers(image, diamondCorners, ids, borderColor);
 }
Exemplo n.º 27
0
            // Constructors & destructor

            public Dictionary(Cv.Mat bytesList, int markerSize = 0, int maxCorrectionBits = 0)
                : base(au_Dictionary_new1(bytesList.CppPtr, markerSize, maxCorrectionBits))
            {
            }
Exemplo n.º 28
0
        public static int InterpolateCornersCharuco(Std.VectorVectorPoint2f markerCorners, Std.VectorInt markerIds, Cv.Mat image, CharucoBoard board,
                                                    out Std.VectorPoint2f charucoCorners, out Std.VectorInt charucoIds, Cv.Mat cameraMatrix, Cv.Mat distCoeffs)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       charucoCornersPtr, charucoIdsPtr;

            int interpolateCorners = au_interpolateCornersCharuco(markerCorners.CppPtr, markerIds.CppPtr, image.CppPtr, board.CppPtr,
                                                                  out charucoCornersPtr, out charucoIdsPtr, cameraMatrix.CppPtr, distCoeffs.CppPtr, exception.CppPtr);

            charucoCorners = new Std.VectorPoint2f(charucoCornersPtr);
            charucoIds     = new Std.VectorInt(charucoIdsPtr);
            exception.Check();

            return(interpolateCorners);
        }
Exemplo n.º 29
0
 public static void DrawDetectedMarkers(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners)
 {
     Std.VectorInt ids = new Std.VectorInt();
     DrawDetectedMarkers(image, diamondCorners, ids);
 }
Exemplo n.º 30
0
 public static void DrawDetectedCornersCharuco(Cv.Mat image, Std.VectorPoint2f charucoCorners, Std.VectorInt charucoIds)
 {
     Cv.Scalar cornerColor = new Cv.Scalar(255, 0, 0);
     DrawDetectedCornersCharuco(image, charucoCorners, charucoIds, cornerColor);
 }