コード例 #1
0
        //
        // C++:  double stereoCalibrate(vector_Mat& objectPoints, vector_Mat& imagePoints1, vector_Mat& imagePoints2, Size imageSize1, Size imageSize2, Mat& K1, Mat& xi1, Mat& D1, Mat& K2, Mat& xi2, Mat& D2, Mat& rvec, Mat& tvec, vector_Mat& rvecsL, vector_Mat& tvecsL, int flags, TermCriteria criteria, Mat& idx = Mat())
        //

        //javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, imageSize1, imageSize2, K1, xi1, D1, K2, xi2, D2, rvec, tvec, rvecsL, tvecsL, flags, criteria, idx)
        public static double stereoCalibrate(List <Mat> objectPoints, List <Mat> imagePoints1, List <Mat> imagePoints2, Size imageSize1, Size imageSize2, Mat K1, Mat xi1, Mat D1, Mat K2, Mat xi2, Mat D2, Mat rvec, Mat tvec, List <Mat> rvecsL, List <Mat> tvecsL, int flags, TermCriteria criteria, Mat idx)
        {
            if (K1 != null)
            {
                K1.ThrowIfDisposed();
            }
            if (xi1 != null)
            {
                xi1.ThrowIfDisposed();
            }
            if (D1 != null)
            {
                D1.ThrowIfDisposed();
            }
            if (K2 != null)
            {
                K2.ThrowIfDisposed();
            }
            if (xi2 != null)
            {
                xi2.ThrowIfDisposed();
            }
            if (D2 != null)
            {
                D2.ThrowIfDisposed();
            }
            if (rvec != null)
            {
                rvec.ThrowIfDisposed();
            }
            if (tvec != null)
            {
                tvec.ThrowIfDisposed();
            }
            if (idx != null)
            {
                idx.ThrowIfDisposed();
            }

#if UNITY_PRO_LICENSE || ((UNITY_ANDROID || UNITY_IOS) && !UNITY_EDITOR) || UNITY_5
            Mat    objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints);
            Mat    imagePoints1_mat = Converters.vector_Mat_to_Mat(imagePoints1);
            Mat    imagePoints2_mat = Converters.vector_Mat_to_Mat(imagePoints2);
            Mat    rvecsL_mat       = new Mat();
            Mat    tvecsL_mat       = new Mat();
            double retVal           = ccalib_Ccalib_stereoCalibrate_10(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, imageSize1.width, imageSize1.height, imageSize2.width, imageSize2.height, K1.nativeObj, xi1.nativeObj, D1.nativeObj, K2.nativeObj, xi2.nativeObj, D2.nativeObj, rvec.nativeObj, tvec.nativeObj, rvecsL_mat.nativeObj, tvecsL_mat.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon, idx.nativeObj);
            Converters.Mat_to_vector_Mat(objectPoints_mat, objectPoints);
            objectPoints_mat.release();
            Converters.Mat_to_vector_Mat(imagePoints1_mat, imagePoints1);
            imagePoints1_mat.release();
            Converters.Mat_to_vector_Mat(imagePoints2_mat, imagePoints2);
            imagePoints2_mat.release();
            Converters.Mat_to_vector_Mat(rvecsL_mat, rvecsL);
            rvecsL_mat.release();
            Converters.Mat_to_vector_Mat(tvecsL_mat, tvecsL);
            tvecsL_mat.release();
            return(retVal);
#else
            return(-1);
#endif
        }