Esempio n. 1
0
            public static double CalibrateCameraAruco(Std.VectorVectorPoint2f corners, Std.VectorInt ids, Std.VectorInt counter, Board board, Cv.Core.Size imageSize,
                                                      Cv.Core.Mat cameraMatrix, Cv.Core.Mat distCoeffs)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();

                double reProjectionError = au_calibrateCameraAruco5(corners.cppPtr, ids.cppPtr, counter.cppPtr, board.cppPtr, imageSize.cppPtr, cameraMatrix.cppPtr,
                                                                    distCoeffs.cppPtr, exception.cppPtr);

                exception.Check();
                return(reProjectionError);
            }
Esempio n. 2
0
            public static void DetectCharucoDiamond(Cv.Core.Mat image, Std.VectorVectorPoint2f markerCorners, Std.VectorInt markerIds, float squareMarkerLengthRate,
                                                    out Std.VectorVectorPoint2f diamondCorners, out Std.VectorVec4i diamondIds)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();
                System.IntPtr     diamondCornersPtr, diamondIdsPtr;

                au_detectCharucoDiamond3(image.cppPtr, markerCorners.cppPtr, markerIds.cppPtr, squareMarkerLengthRate, out diamondCornersPtr,
                                         out diamondIdsPtr, exception.cppPtr);
                diamondCorners = new Std.VectorVectorPoint2f(diamondCornersPtr);
                diamondIds     = new Std.VectorVec4i(diamondIdsPtr);

                exception.Check();
            }
Esempio n. 3
0
            public static bool EstimatePoseCharucoBoard(Std.VectorPoint2f charucoCorners, Std.VectorInt charucoIds, CharucoBoard board, Cv.Core.Mat cameraMatrix,
                                                        Cv.Core.Mat distCoeffs, out Cv.Core.Vec3d rvec, out Cv.Core.Vec3d tvec)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();
                System.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.Core.Vec3d(rvecPtr);
                tvec = new Cv.Core.Vec3d(tvecPtr);

                exception.Check();
                return(valid);
            }
Esempio n. 4
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));
 }
Esempio 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);
 }
Esempio n. 6
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();
 }
Esempio n. 7
0
 public static void DrawDetectedMarkers(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners)
 {
     Std.VectorInt ids = new Std.VectorInt();
     DrawDetectedMarkers(image, diamondCorners, ids);
 }
Esempio n. 8
0
        // Static methods

        public static double CalibrateCameraAruco(Std.VectorVectorPoint2f corners, Std.VectorInt ids, Std.VectorInt counter, Board 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_calibrateCameraAruco(corners.CppPtr, ids.CppPtr, counter.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);
        }
Esempio n. 9
0
 public static double CalibrateCameraAruco(Std.VectorVectorPoint2f corners, Std.VectorInt ids, Std.VectorInt counter, Board board,
                                           Cv.Size imageSize, Cv.Mat cameraMatrix, Cv.Mat distCoeffs, out Std.VectorMat rvecs, out Std.VectorMat tvecs, Cv.Calib flags = 0)
 {
     Cv.TermCriteria criteria = new Cv.TermCriteria(Cv.TermCriteria.Type.Count | Cv.TermCriteria.Type.Eps, 30, Cv.EPSILON);
     return(CalibrateCameraAruco(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, out rvecs, out tvecs, flags, criteria));
 }
Esempio n. 10
0
 public static void RefineDetectedMarkers(Cv.Core.Mat image, Board board, Std.VectorVectorPoint2f detectedCorners, Std.VectorInt detectedIds,
                                          Std.VectorVectorPoint2f rejectedCorners, Cv.Core.Mat cameraMatrix, Cv.Core.Mat distCoeffs, float minRepDistance)
 {
     Cv.Core.Exception exception = new Cv.Core.Exception();
     au_refineDetectedMarkers5(image.cppPtr, board.cppPtr, detectedCorners.cppPtr, detectedIds.cppPtr, rejectedCorners.cppPtr, cameraMatrix.cppPtr,
                               distCoeffs.cppPtr, minRepDistance, exception.cppPtr);
     exception.Check();
 }
Esempio n. 11
0
 public static void RefineDetectedMarkers(Cv.Core.Mat image, Board board, Std.VectorVectorPoint2f detectedCorners, Std.VectorInt detectedIds,
                                          Std.VectorVectorPoint2f rejectedCorners)
 {
     Cv.Core.Exception exception = new Cv.Core.Exception();
     au_refineDetectedMarkers8(image.cppPtr, board.cppPtr, detectedCorners.cppPtr, detectedIds.cppPtr, rejectedCorners.cppPtr, exception.cppPtr);
     exception.Check();
 }
Esempio n. 12
0
 public static void DrawDetectedMarkers(Cv.Core.Mat image, Std.VectorVectorPoint2f corners, Std.VectorInt ids)
 {
     Cv.Core.Exception exception = new Cv.Core.Exception();
     au_drawDetectedMarkers2(image.cppPtr, corners.cppPtr, ids.cppPtr, exception.cppPtr);
     exception.Check();
 }
Esempio n. 13
0
 public static void DrawDetectedMarkers(Cv.Core.Mat image, Std.VectorVectorPoint2f corners, Std.VectorInt ids, Color borderColor)
 {
     Cv.Core.Exception exception         = new Cv.Core.Exception();
     Cv.Core.Scalar    borderColorScalar = borderColor;
     au_drawDetectedMarkers1(image.cppPtr, corners.cppPtr, ids.cppPtr, borderColorScalar.cppPtr, exception.cppPtr);
     exception.Check();
 }
Esempio n. 14
0
            public static void DetectMarkers(Cv.Core.Mat image, Dictionary dictionary, out Std.VectorVectorPoint2f corners, out Std.VectorInt ids)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();
                System.IntPtr     cornersPtr, idsPtr;

                au_detectMarkers3(image.cppPtr, dictionary.cppPtr, out cornersPtr, out idsPtr, exception.cppPtr);
                corners = new Std.VectorVectorPoint2f(cornersPtr);
                ids     = new Std.VectorInt(idsPtr);

                exception.Check();
            }
Esempio n. 15
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);
 }
Esempio n. 16
0
 public static double CalibrateCameraAruco(Std.VectorVectorPoint2f corners, Std.VectorInt ids, Std.VectorInt counter, Board board,
                                           Cv.Size imageSize, Cv.Mat cameraMatrix, Cv.Mat distCoeffs)
 {
     Std.VectorMat rvecs;
     return(CalibrateCameraAruco(corners, ids, counter, board, imageSize, cameraMatrix, distCoeffs, out rvecs));
 }
Esempio n. 17
0
 public static void DrawDetectedCornersCharuco(Cv.Mat image, Std.VectorPoint2f charucoCorners)
 {
     Std.VectorInt charucoIds = new Std.VectorInt();
     DrawDetectedCornersCharuco(image, charucoCorners, charucoIds);
 }
Esempio n. 18
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();
        }
Esempio n. 19
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);
 }
Esempio n. 20
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 = new Cv.Mat();
     DetectCharucoDiamond(image, markerCorners, markerIds, squareMarkerLengthRate, out diamondCorners, out diamondIds, cameraMatrix);
 }
Esempio n. 21
0
        public static void GetBoardObjectAndImagePoints(Board board, Std.VectorVectorPoint2f detectedCorners, Std.VectorInt detectedIds,
                                                        out Std.VectorPoint3f objPoints, out Std.VectorPoint2f imgPoints)
        {
            Cv.Exception exception = new Cv.Exception();
            IntPtr       objPointsPtr, imgPointsPtr;

            au_getBoardObjectAndImagePoints(board.CppPtr, detectedCorners.CppPtr, detectedIds.CppPtr, out objPointsPtr, out imgPointsPtr,
                                            exception.CppPtr);
            objPoints = new Std.VectorPoint3f(objPointsPtr);
            imgPoints = new Std.VectorPoint2f(imgPointsPtr);

            exception.Check();
        }
Esempio n. 22
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();
        }
Esempio n. 23
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();
 }
Esempio n. 24
0
 public static void DetectMarkers(Cv.Mat image, Dictionary dictionary, out Std.VectorVectorPoint2f corners, out Std.VectorInt ids,
                                  DetectorParameters parameters)
 {
     Std.VectorVectorPoint2f rejectedImgPoints;
     DetectMarkers(image, dictionary, out corners, out ids, parameters, out rejectedImgPoints);
 }
Esempio n. 25
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);
 }
Esempio n. 26
0
        public static void DetectMarkers(Cv.Mat image, Dictionary dictionary, out Std.VectorVectorPoint2f corners, out Std.VectorInt ids)
        {
            DetectorParameters parameters = new DetectorParameters();

            DetectMarkers(image, dictionary, out corners, out ids, parameters);
        }
Esempio n. 27
0
 public static void DrawDetectedCornersCharuco(Cv.Core.Mat image, Std.VectorPoint2f charucoCorners, Std.VectorInt charucoIds)
 {
     Cv.Core.Exception exception = new Cv.Core.Exception();
     au_drawDetectedCornersCharuco2(image.cppPtr, charucoCorners.cppPtr, charucoIds.cppPtr, exception.cppPtr);
     exception.Check();
 }
Esempio n. 28
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();
 }
Esempio n. 29
0
            public static int InterpolateCornersCharuco(Std.VectorVectorPoint2f markerCorners, Std.VectorInt markerIds, Cv.Core.Mat image, CharucoBoard board,
                                                        out Std.VectorPoint2f charucoCorners, out Std.VectorInt charucoIds, Cv.Core.Mat cameraMatrix)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();
                System.IntPtr     charucoCornersPtr, charucoIdsPtr;

                int interpolateCorners = au_interpolateCornersCharuco2(markerCorners.cppPtr, markerIds.cppPtr, image.cppPtr, board.cppPtr,
                                                                       out charucoCornersPtr, out charucoIdsPtr, cameraMatrix.cppPtr, exception.cppPtr);

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

                return(interpolateCorners);
            }
Esempio n. 30
0
            public static double CalibrateCameraAruco(Std.VectorVectorPoint2f corners, Std.VectorInt ids, Std.VectorInt counter, Board board, Cv.Core.Size imageSize,
                                                      Cv.Core.Mat cameraMatrix, Cv.Core.Mat distCoeffs, out Std.VectorMat rvecs, out Std.VectorMat tvecs)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();
                System.IntPtr     rvecsPtr, tvecsPtr;

                double reProjectionError = au_calibrateCameraAruco3(corners.cppPtr, ids.cppPtr, counter.cppPtr, board.cppPtr, imageSize.cppPtr, cameraMatrix.cppPtr,
                                                                    distCoeffs.cppPtr, out rvecsPtr, out tvecsPtr, exception.cppPtr);

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

                exception.Check();
                return(reProjectionError);
            }