Search in sources :

Example 56 with Mat

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

the class Imgproc method findContours.

// javadoc: findContours(image, contours, hierarchy, mode, method)
public static void findContours(Mat image, List<MatOfPoint> contours, Mat hierarchy, int mode, int method) {
    Mat contours_mat = new Mat();
    findContours_1(image.nativeObj, contours_mat.nativeObj, hierarchy.nativeObj, mode, method);
    Converters.Mat_to_vector_vector_Point(contours_mat, contours);
    contours_mat.release();
    return;
}
Also used : Mat(org.opencv.core.Mat)

Example 57 with Mat

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

the class Imgproc method goodFeaturesToTrack.

// 
// C++:  void goodFeaturesToTrack(Mat image, vector_Point& corners, int maxCorners, double qualityLevel, double minDistance, Mat mask = Mat(), int blockSize = 3, bool useHarrisDetector = false, double k = 0.04)
// 
// javadoc: goodFeaturesToTrack(image, corners, maxCorners, qualityLevel, minDistance, mask, blockSize, useHarrisDetector, k)
public static void goodFeaturesToTrack(Mat image, MatOfPoint corners, int maxCorners, double qualityLevel, double minDistance, Mat mask, int blockSize, boolean useHarrisDetector, double k) {
    Mat corners_mat = corners;
    goodFeaturesToTrack_0(image.nativeObj, corners_mat.nativeObj, maxCorners, qualityLevel, minDistance, mask.nativeObj, blockSize, useHarrisDetector, k);
    return;
}
Also used : Mat(org.opencv.core.Mat)

Example 58 with Mat

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

the class Imgproc method drawContours.

// 
// C++:  void drawContours(Mat& image, vector_vector_Point contours, int contourIdx, Scalar color, int thickness = 1, int lineType = LINE_8, Mat hierarchy = Mat(), int maxLevel = INT_MAX, Point offset = Point())
// 
// javadoc: drawContours(image, contours, contourIdx, color, thickness, lineType, hierarchy, maxLevel, offset)
public static void drawContours(Mat image, List<MatOfPoint> contours, int contourIdx, Scalar color, int thickness, int lineType, Mat hierarchy, int maxLevel, Point offset) {
    List<Mat> contours_tmplm = new ArrayList<Mat>((contours != null) ? contours.size() : 0);
    Mat contours_mat = Converters.vector_vector_Point_to_Mat(contours, contours_tmplm);
    drawContours_0(image.nativeObj, contours_mat.nativeObj, contourIdx, color.val[0], color.val[1], color.val[2], color.val[3], thickness, lineType, hierarchy.nativeObj, maxLevel, offset.x, offset.y);
    return;
}
Also used : Mat(org.opencv.core.Mat) ArrayList(java.util.ArrayList)

Example 59 with Mat

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

the class Calib3d method stereoCalibrate.

// 
// C++:  double stereoCalibrate(vector_Mat objectPoints, vector_Mat imagePoints1, vector_Mat imagePoints2, Mat& K1, Mat& D1, Mat& K2, Mat& D2, Size imageSize, Mat& R, Mat& T, int flags = fisheye::CALIB_FIX_INTRINSIC, TermCriteria criteria = TermCriteria(TermCriteria::COUNT + TermCriteria::EPS, 100, DBL_EPSILON))
// 
// javadoc: stereoCalibrate(objectPoints, imagePoints1, imagePoints2, K1, D1, K2, D2, imageSize, R, T, flags, criteria)
public static double stereoCalibrate(List<Mat> objectPoints, List<Mat> imagePoints1, List<Mat> imagePoints2, Mat K1, Mat D1, Mat K2, Mat D2, Size imageSize, Mat R, Mat T, int flags, TermCriteria criteria) {
    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_3(objectPoints_mat.nativeObj, imagePoints1_mat.nativeObj, imagePoints2_mat.nativeObj, K1.nativeObj, D1.nativeObj, K2.nativeObj, D2.nativeObj, imageSize.width, imageSize.height, R.nativeObj, T.nativeObj, flags, criteria.type, criteria.maxCount, criteria.epsilon);
    return retVal;
}
Also used : Mat(org.opencv.core.Mat)

Example 60 with Mat

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

the class Calib3d method calibrateCameraExtended.

// javadoc: calibrateCamera(objectPoints, imagePoints, imageSize, cameraMatrix, distCoeffs, rvecs, tvecs, stdDeviationsIntrinsics, stdDeviationsExtrinsics, perViewErrors, flags)
public static double calibrateCameraExtended(List<Mat> objectPoints, List<Mat> imagePoints, Size imageSize, Mat cameraMatrix, Mat distCoeffs, List<Mat> rvecs, List<Mat> tvecs, Mat stdDeviationsIntrinsics, Mat stdDeviationsExtrinsics, Mat perViewErrors, int flags) {
    Mat objectPoints_mat = Converters.vector_Mat_to_Mat(objectPoints);
    Mat imagePoints_mat = Converters.vector_Mat_to_Mat(imagePoints);
    Mat rvecs_mat = new Mat();
    Mat tvecs_mat = new Mat();
    double retVal = calibrateCameraExtended_1(objectPoints_mat.nativeObj, imagePoints_mat.nativeObj, imageSize.width, imageSize.height, cameraMatrix.nativeObj, distCoeffs.nativeObj, rvecs_mat.nativeObj, tvecs_mat.nativeObj, stdDeviationsIntrinsics.nativeObj, stdDeviationsExtrinsics.nativeObj, perViewErrors.nativeObj, flags);
    Converters.Mat_to_vector_Mat(rvecs_mat, rvecs);
    rvecs_mat.release();
    Converters.Mat_to_vector_Mat(tvecs_mat, tvecs);
    tvecs_mat.release();
    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