Exemplo n.º 1
0
                // Static methods

                public static double Calibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints, Size imageSize,
                                               Mat cameraMatrix, Mat xi, Mat distCoeffs, out Std.VectorVec3d rvecs, out Std.VectorVec3d tvecs, Calib flags, TermCriteria criteria,
                                               out Mat idx)
                {
                    Exception exception = new Exception();

                    System.IntPtr rvecsPtr, tvecsPtr, idxPtr;

                    double error = au_cv_ccalib_omnidir_calibrate(objectPoints.CppPtr, imagePoints.CppPtr, imageSize.CppPtr, cameraMatrix.CppPtr,
                                                                  xi.CppPtr, distCoeffs.CppPtr, out rvecsPtr, out tvecsPtr, (int)flags, criteria.CppPtr, out idxPtr, exception.CppPtr);

                    rvecs = new Std.VectorVec3d(rvecsPtr);
                    tvecs = new Std.VectorVec3d(tvecsPtr);
                    idx   = new Mat(idxPtr);

                    exception.Check();
                    return(error);
                }
Exemplo n.º 2
0
        public static double CalibrateCamera(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints,
                                             Size imageSize,
                                             Mat cameraMatrix, Mat distCoeffs, out Std.VectorVec3d rvecs, out Std.VectorVec3d tvecs, Calib flags,
                                             TermCriteria criteria)
        {
            var    exception = new Exception();
            IntPtr rvecsPtr, tvecsPtr;

            var error = au_cv_calib3d_calibrateCamera2(objectPoints.CppPtr, imagePoints.CppPtr, imageSize.CppPtr,
                                                       cameraMatrix.CppPtr,
                                                       distCoeffs.CppPtr, out rvecsPtr, out tvecsPtr, (int)flags, criteria.CppPtr, exception.CppPtr);

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

            exception.Check();
            return(error);
        }
Exemplo n.º 3
0
        public static double StereoCalibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints1,
                                             Std.VectorVectorPoint2f imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize,
                                             out Mat rotationMatrix, out Vec3d tvec, out Mat essentialMatrix, out Mat fundamentalMatrix, Calib flags, TermCriteria criteria)
        {
            Exception exception = new Exception();
            IntPtr    rotationMatrixPtr, tvecPtr, essentialMatrixPtr, fundamentalMatrixPtr;

            double error = au_cv_calib3d_stereoCalibrate(objectPoints.CppPtr, imagePoints1.CppPtr, imagePoints2.CppPtr, cameraMatrix1.CppPtr,
                                                         distCoeffs1.CppPtr, cameraMatrix2.CppPtr, distCoeffs2.CppPtr, imageSize.CppPtr, out rotationMatrixPtr, out tvecPtr, out essentialMatrixPtr,
                                                         out fundamentalMatrixPtr, (int)flags, criteria.CppPtr, exception.CppPtr);

            rotationMatrix    = new Mat(rotationMatrixPtr);
            tvec              = new Vec3d(tvecPtr);
            essentialMatrix   = new Mat(essentialMatrixPtr);
            fundamentalMatrix = new Mat(fundamentalMatrixPtr);

            exception.Check();
            return(error);
        }
Exemplo n.º 4
0
            public static double StereoCalibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints1,
                                                 Std.VectorVectorPoint2f imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, out Vec3d rvec,
                                                 out Vec3d tvec, out Mat E, out Mat F, Calib flags, TermCriteria criteria)
            {
                Exception exception = new Exception();

                System.IntPtr rvecPtr, tvecPtr, EPtr, FPtr;

                double error = au_cv_calib3d_stereoCalibrate(objectPoints.CppPtr, imagePoints1.CppPtr, imagePoints2.CppPtr, cameraMatrix1.CppPtr,
                                                             distCoeffs1.CppPtr, cameraMatrix2.CppPtr, distCoeffs2.CppPtr, imageSize.CppPtr, out rvecPtr, out tvecPtr, out EPtr, out FPtr, (int)flags,
                                                             criteria.CppPtr, exception.CppPtr);

                rvec = new Vec3d(rvecPtr);
                tvec = new Vec3d(tvecPtr);
                E    = new Mat(EPtr);
                F    = new Mat(FPtr);

                exception.Check();
                return(error);
            }
Exemplo n.º 5
0
      public static double StereoCalibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints1,
        Std.VectorVectorPoint2f imagePoints2, Size imageSize1, Size imageSize2, Mat cameraMatrix1, Mat xi1, Mat distCoeffs1, Mat cameraMatrix2,
        Mat xi2, Mat distCoeffs2, out Vec3d rvec, out Vec3d tvec, out Std.VectorVec3d rvecsL, out Std.VectorVec3d tvecsL, Calib flags,
        TermCriteria criteria, out Mat idx)
      {
        Exception exception = new Exception();
        IntPtr rvecPtr, tvecPtr, rvecsLPtr, tvecsLPtr, idxPtr;

        double error = au_cv_ccalib_omnidir_stereoCalibrate(objectPoints.CppPtr, imagePoints1.CppPtr, imagePoints2.CppPtr, imageSize1.CppPtr,
          imageSize2.CppPtr, cameraMatrix1.CppPtr, xi1.CppPtr, distCoeffs1.CppPtr, cameraMatrix2.CppPtr, xi2.CppPtr, distCoeffs2.CppPtr, out rvecPtr,
          out tvecPtr, out rvecsLPtr, out tvecsLPtr, (int)flags, criteria.CppPtr, out idxPtr, exception.CppPtr);
        rvec = new Vec3d(rvecPtr);
        tvec = new Vec3d(tvecPtr);
        rvecsL = new Std.VectorVec3d(rvecsLPtr);
        tvecsL = new Std.VectorVec3d(tvecsLPtr);
        idx = new Mat(idxPtr);

        exception.Check();
        return error;
      }
Exemplo n.º 6
0
 public static double Calibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints, Size imageSize,
   Mat cameraMatrix, Mat xi, Mat distCoeffs, out Std.VectorVec3d rvecs, out Std.VectorVec3d tvecs, Calib flags, TermCriteria criteria)
 {
   Mat idx;
   return Calibrate(objectPoints, imagePoints, imageSize, cameraMatrix, xi, distCoeffs, out rvecs, out tvecs, flags, criteria, out idx);
 }
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 = new Cv.Mat();
     RefineDetectedMarkers(image, board, detectedCorners, detectedIds, rejectedCorners, cameraMatrix);
 }
Exemplo n.º 8
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));
 }
Exemplo n.º 9
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.º 10
0
                public static double StereoCalibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints1,
                                                     Std.VectorVectorPoint2f imagePoints2, Size imageSize1, Size imageSize2, Mat cameraMatrix1, Mat xi1, Mat distCoeffs1, Mat cameraMatrix2,
                                                     Mat xi2, Mat distCoeffs2, out Vec3d rvec, out Vec3d tvec, out Mat rvecsL, out Mat tvecsL, Calib flags, TermCriteria criteria)
                {
                    Mat idx;

                    return(StereoCalibrate(objectPoints, imagePoints1, imagePoints2, imageSize1, imageSize2, cameraMatrix1, xi1, distCoeffs1, cameraMatrix2,
                                           xi2, distCoeffs2, out rvec, out tvec, out rvecsL, out tvecsL, flags, criteria, out idx));
                }
Exemplo n.º 11
0
            public static void DetectMarkers(Cv.Core.Mat image, Dictionary dictionary, out Std.VectorVectorPoint2f corners, out Std.VectorInt ids,
                                             DetectorParameters parameters, out Std.VectorVectorPoint2f rejectedImgPoints)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();
                System.IntPtr     cornersPtr, idsPtr, rejectedPtr;

                au_detectMarkers1(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 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.º 13
0
 public static void DrawDetectedDiamonds(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners)
 {
     Std.VectorVec4i diamondIds = new Std.VectorVec4i();
     DrawDetectedDiamonds(image, diamondCorners, diamondIds);
 }
Exemplo n.º 14
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);
 }
Exemplo n.º 15
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);
        }
Exemplo n.º 16
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);
 }
Exemplo n.º 17
0
 public static double CalibrateCameraCharuco(Std.VectorVectorPoint2f charucoCorners, Std.VectorVectorInt charucoIds, CharucoBoard board,
                                             Cv.Size imageSize, Cv.Mat cameraMatrix, Cv.Mat distCoeffs)
 {
     Std.VectorMat rvecs;
     return(CalibrateCameraCharuco(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, out rvecs));
 }
Exemplo n.º 18
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 = 0)
 {
     Cv.TermCriteria criteria = new Cv.TermCriteria(Cv.TermCriteria.Type.Count | Cv.TermCriteria.Type.Eps, 30, Cv.EPSILON);
     return(CalibrateCameraCharuco(charucoCorners, charucoIds, board, imageSize, cameraMatrix, distCoeffs, out rvecs, out tvecs, flags, criteria));
 }
Exemplo n.º 19
0
 public static void DrawDetectedDiamonds(Cv.Core.Mat image, Std.VectorVectorPoint2f diamondCorners, Std.VectorVec4i diamondIds, Cv.Core.Scalar borderColor)
 {
     Cv.Core.Exception exception = new Cv.Core.Exception();
     au_drawDetectedDiamonds1(image.cppPtr, diamondCorners.cppPtr, diamondIds.cppPtr, borderColor.cppPtr, exception.cppPtr);
     exception.Check();
 }
Exemplo n.º 20
0
            public static double CalibrateCamera(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints, Size imageSize,
                                                 Mat cameraMatrix, Mat distCoeffs, out Std.VectorVec3d rvecs, out Std.VectorVec3d tvecs, Calib flags = 0)
            {
                TermCriteria criteria = new TermCriteria(TermCriteria.Type.Count | TermCriteria.Type.Eps, 30, EPSILON);

                return(CalibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, out rvecs, out tvecs, flags, criteria));
            }
Exemplo n.º 21
0
 public static void DrawDetectedDiamonds(Cv.Core.Mat image, Std.VectorVectorPoint2f diamondCorners)
 {
     Cv.Core.Exception exception = new Cv.Core.Exception();
     au_drawDetectedDiamonds3(image.cppPtr, diamondCorners.cppPtr, exception.cppPtr);
     exception.Check();
 }
Exemplo n.º 22
0
            public static double StereoCalibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints1,
                                                 Std.VectorVectorPoint2f imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize,
                                                 out Mat rotationMatrix, out Vec3d tvec, out Mat essentialMatrix, out Mat fundamentalMatrix, Calib flags = Calib.FixIntrinsic)
            {
                TermCriteria criteria = new TermCriteria(TermCriteria.Type.Count | TermCriteria.Type.Eps, 30, 1e-6);

                return(StereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize,
                                       out rotationMatrix, out tvec, out essentialMatrix, out fundamentalMatrix, flags, criteria));
            }
Exemplo n.º 23
0
                public static double StereoCalibrate(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints1,
                                                     Std.VectorVectorPoint2f imagePoints2, Size imageSize1, Size imageSize2, Mat cameraMatrix1, Mat xi1, Mat distCoeffs1, Mat cameraMatrix2,
                                                     Mat xi2, Mat distCoeffs2, out Vec3d rvec, out Vec3d tvec, out Mat rvecsL, out Mat tvecsL, Calib flags)
                {
                    TermCriteria criteria = new TermCriteria(TermCriteria.Type.Count | TermCriteria.Type.Eps, 200, EPSILON);

                    return(StereoCalibrate(objectPoints, imagePoints1, imagePoints2, imageSize1, imageSize2, cameraMatrix1, xi1, distCoeffs1, cameraMatrix2,
                                           xi2, distCoeffs2, out rvec, out tvec, out rvecsL, out tvecsL, flags, criteria));
                }
Exemplo n.º 24
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();
            }
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.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();
 }
Exemplo n.º 27
0
            public static Mat InitCameraMatrix2D(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints, Size imageSize,
                                                 double aspectRatio = 1.0)
            {
                Exception exception = new Exception();

                System.IntPtr cameraMatrixPtr = au_cv_calib3d_initCameraMatrix2D(objectPoints.CppPtr, imagePoints.CppPtr, imageSize.CppPtr, aspectRatio,
                                                                                 exception.CppPtr);
                exception.Check();
                return(new Mat(cameraMatrixPtr));
            }
Exemplo n.º 28
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.º 29
0
            // Static methods

            public static double CalibrateCamera(Std.VectorVectorPoint3f objectPoints, Std.VectorVectorPoint2f imagePoints, Size imageSize,
                                                 Mat cameraMatrix, Mat distCoeffs, out Std.VectorVec3d rvecs, out Std.VectorVec3d tvecs, Std.VectorDouble stdDeviationsIntrinsics,
                                                 Std.VectorDouble stdDeviationsExtrinsics, Std.VectorDouble perViewErrors, Calib flags, TermCriteria criteria)
            {
                Exception exception = new Exception();

                System.IntPtr rvecsPtr, tvecsPtr;

                double error = au_cv_calib3d_calibrateCamera1(objectPoints.CppPtr, imagePoints.CppPtr, imageSize.CppPtr, cameraMatrix.CppPtr,
                                                              distCoeffs.CppPtr, out rvecsPtr, out tvecsPtr, stdDeviationsIntrinsics.CppPtr, stdDeviationsExtrinsics.CppPtr, perViewErrors.CppPtr,
                                                              (int)flags, criteria.CppPtr, exception.CppPtr);

                rvecs = new Std.VectorVec3d(rvecsPtr);
                tvecs = new Std.VectorVec3d(tvecsPtr);
                exception.Check();

                return(error);
            }
Exemplo n.º 30
0
 public static void DrawDetectedMarkers(Cv.Mat image, Std.VectorVectorPoint2f diamondCorners)
 {
     Std.VectorInt ids = new Std.VectorInt();
     DrawDetectedMarkers(image, diamondCorners, ids);
 }