Search in sources :

Example 61 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Calib3d method decomposeHomographyMat.

// 
// C++:  int decomposeHomographyMat(Mat H, Mat K, vector_Mat& rotations, vector_Mat& translations, vector_Mat& normals)
// 
// javadoc: decomposeHomographyMat(H, K, rotations, translations, normals)
public static int decomposeHomographyMat(Mat H, Mat K, List<Mat> rotations, List<Mat> translations, List<Mat> normals) {
    Mat rotations_mat = new Mat();
    Mat translations_mat = new Mat();
    Mat normals_mat = new Mat();
    int retVal = decomposeHomographyMat_0(H.nativeObj, K.nativeObj, rotations_mat.nativeObj, translations_mat.nativeObj, normals_mat.nativeObj);
    Converters.Mat_to_vector_Mat(rotations_mat, rotations);
    rotations_mat.release();
    Converters.Mat_to_vector_Mat(translations_mat, translations);
    translations_mat.release();
    Converters.Mat_to_vector_Mat(normals_mat, normals);
    normals_mat.release();
    return retVal;
}
Also used : Mat(org.opencv.core.Mat) Point(org.opencv.core.Point)

Example 62 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Calib3d method stereoCalibrate.

// javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, imageSize, R, T, E, F, flags)
public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Size imageSize, Mat R, Mat T, Mat E, Mat F, int flags) {
    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);
    double retVal = stereoCalibrate_1(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, E.nativeObj, F.nativeObj, flags);
    return retVal;
}
Also used : Mat(org.opencv.core.Mat)

Example 63 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Calib3d method getOptimalNewCameraMatrix.

// 
// C++:  Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize = Size(), Rect* validPixROI = 0, bool centerPrincipalPoint = false)
// 
// javadoc: getOptimalNewCameraMatrix(cameraMatrix, distCoeffs, imageSize, alpha, newImgSize, validPixROI, centerPrincipalPoint)
public static Mat getOptimalNewCameraMatrix(Mat cameraMatrix, Mat distCoeffs, Size imageSize, double alpha, Size newImgSize, Rect validPixROI, boolean centerPrincipalPoint) {
    double[] validPixROI_out = new double[4];
    Mat retVal = new Mat(getOptimalNewCameraMatrix_0(cameraMatrix.nativeObj, distCoeffs.nativeObj, imageSize.width, imageSize.height, alpha, newImgSize.width, newImgSize.height, validPixROI_out, centerPrincipalPoint));
    if (validPixROI != null) {
        validPixROI.x = (int) validPixROI_out[0];
        validPixROI.y = (int) validPixROI_out[1];
        validPixROI.width = (int) validPixROI_out[2];
        validPixROI.height = (int) validPixROI_out[3];
    }
    return retVal;
}
Also used : Mat(org.opencv.core.Mat)

Example 64 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Calib3d method rectify3Collinear.

// 
// C++:  float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, vector_Mat imgpt1, vector_Mat imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat& R1, Mat& R2, Mat& R3, Mat& P1, Mat& P2, Mat& P3, Mat& Q, double alpha, Size newImgSize, Rect* roi1, Rect* roi2, int flags)
// 
// javadoc: rectify3Collinear(cameraMatrix1, distCoeffs1, cameraMatrix2, distCoeffs2, cameraMatrix3, distCoeffs3, imgpt1, imgpt3, imageSize, R12, T12, R13, T13, R1, R2, R3, P1, P2, P3, Q, alpha, newImgSize, roi1, roi2, flags)
public static float rectify3Collinear(Mat cameraMatrix1, Mat distCoeffs1, Mat cameraMatrix2, Mat distCoeffs2, Mat cameraMatrix3, Mat distCoeffs3, List<Mat> imgpt1, List<Mat> imgpt3, Size imageSize, Mat R12, Mat T12, Mat R13, Mat T13, Mat R1, Mat R2, Mat R3, Mat P1, Mat P2, Mat P3, Mat Q, double alpha, Size newImgSize, Rect roi1, Rect roi2, int flags) {
    Mat imgpt1_mat = Converters.vector_Mat_to_Mat(imgpt1);
    Mat imgpt3_mat = Converters.vector_Mat_to_Mat(imgpt3);
    double[] roi1_out = new double[4];
    double[] roi2_out = new double[4];
    float retVal = rectify3Collinear_0(cameraMatrix1.nativeObj, distCoeffs1.nativeObj, cameraMatrix2.nativeObj, distCoeffs2.nativeObj, cameraMatrix3.nativeObj, distCoeffs3.nativeObj, imgpt1_mat.nativeObj, imgpt3_mat.nativeObj, imageSize.width, imageSize.height, R12.nativeObj, T12.nativeObj, R13.nativeObj, T13.nativeObj, R1.nativeObj, R2.nativeObj, R3.nativeObj, P1.nativeObj, P2.nativeObj, P3.nativeObj, Q.nativeObj, alpha, newImgSize.width, newImgSize.height, roi1_out, roi2_out, flags);
    if (roi1 != null) {
        roi1.x = (int) roi1_out[0];
        roi1.y = (int) roi1_out[1];
        roi1.width = (int) roi1_out[2];
        roi1.height = (int) roi1_out[3];
    }
    if (roi2 != null) {
        roi2.x = (int) roi2_out[0];
        roi2.y = (int) roi2_out[1];
        roi2.width = (int) roi2_out[2];
        roi2.height = (int) roi2_out[3];
    }
    return retVal;
}
Also used : Mat(org.opencv.core.Mat)

Example 65 with Mat

use of org.opencv.core.Mat in project Relic_Main by TeamOverdrive.

the class Calib3d method findHomography.

// javadoc: findHomography(srcPoints, dstPoints)
public static Mat findHomography(MatOfPoint2f srcPoints, MatOfPoint2f dstPoints) {
    Mat srcPoints_mat = srcPoints;
    Mat dstPoints_mat = dstPoints;
    Mat retVal = new Mat(findHomography_2(srcPoints_mat.nativeObj, dstPoints_mat.nativeObj));
    return retVal;
}
Also used : Mat(org.opencv.core.Mat)

Aggregations

Mat (org.opencv.core.Mat)239 ArrayList (java.util.ArrayList)34 Point (org.opencv.core.Point)33 MatOfPoint (org.opencv.core.MatOfPoint)27 MatOfKeyPoint (org.opencv.core.MatOfKeyPoint)19 KeyPoint (org.opencv.core.KeyPoint)18 Size (org.opencv.core.Size)17 Rect (org.opencv.core.Rect)15 Scalar (org.opencv.core.Scalar)9 File (java.io.File)7 BufferedImage (java.awt.image.BufferedImage)5 FilterContext (de.serviceflow.frankenstein.plugin.api.FilterContext)4 SegmentVideoFilter (de.serviceflow.frankenstein.plugin.api.SegmentVideoFilter)4 DefaultFilterContext (de.serviceflow.frankenstein.vf.DefaultFilterContext)4 VideoFilter (de.serviceflow.frankenstein.vf.VideoFilter)4 DataBufferByte (java.awt.image.DataBufferByte)4 FilterElement (de.serviceflow.frankenstein.vf.FilterElement)3 IOException (java.io.IOException)3 InvocationTargetException (java.lang.reflect.InvocationTargetException)3 ImageNotFoundException (org.getopentest.exceptions.ImageNotFoundException)3