Example #1
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));
            }
Example #2
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));
                }
Example #3
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)
            {
                var    exception = new Exception();
                IntPtr rvecPtr, tvecPtr, rvecsLPtr, tvecsLPtr, idxPtr;

                var 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);
            }
Example #4
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 = 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);
 }
Example #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)
 {
   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);
 }
Example #6
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));
            }
Example #7
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));
            }
Example #8
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,
                                             Std.VectorDouble stdDeviationsIntrinsics,
                                             Std.VectorDouble stdDeviationsExtrinsics, Std.VectorDouble perViewErrors, Calib flags = 0)
        {
            var criteria = new TermCriteria(TermCriteria.Type.Count | TermCriteria.Type.Eps, 30, EPSILON);

            return(CalibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, out rvecs, out tvecs,
                                   stdDeviationsIntrinsics,
                                   stdDeviationsExtrinsics, perViewErrors, flags, criteria));
        }
Example #9
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)
        {
            Exception exception = new Exception();
            IntPtr    rvecsPtr, tvecsPtr;

            double 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);
        }
Example #10
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();
        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;
      }
Example #11
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);
        }
Example #12
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);
            }