Beispiel #1
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);
            }
Beispiel #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 = 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));
            }
Beispiel #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 = 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);
 }
Beispiel #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)
 {
   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);
 }
Beispiel #5
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));
            }
Beispiel #6
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));
        }
Beispiel #7
0
            public static void EstimatePoseSingleMarkers(Std.VectorVectorPoint2f corners, float markerLength, Cv.Core.Mat cameraMatrix, Cv.Core.Mat distCoeffs,
                                                         out Std.VectorVec3d rvecs, out Std.VectorVec3d tvecs)
            {
                Cv.Core.Exception exception = new Cv.Core.Exception();
                System.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();
            }
Beispiel #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, 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);
        }
Beispiel #9
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;
      }