Search in sources :

Example 1 with MatOfDMatch

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

the class Converters method Mat_to_vector_vector_DMatch.

public static void Mat_to_vector_vector_DMatch(Mat m, List<MatOfDMatch> lvdm) {
    if (lvdm == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    if (m == null)
        throw new java.lang.IllegalArgumentException("Input Mat can't be null");
    List<Mat> mats = new ArrayList<Mat>(m.rows());
    Mat_to_vector_Mat(m, mats);
    lvdm.clear();
    for (Mat mi : mats) {
        MatOfDMatch vdm = new MatOfDMatch(mi);
        lvdm.add(vdm);
        mi.release();
    }
    mats.clear();
}
Also used : Mat(org.opencv.core.Mat) MatOfDMatch(org.opencv.core.MatOfDMatch) ArrayList(java.util.ArrayList)

Example 2 with MatOfDMatch

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

the class Converters method vector_vector_DMatch_to_Mat.

// vector_vector_DMatch
public static Mat vector_vector_DMatch_to_Mat(List<MatOfDMatch> lvdm, List<Mat> mats) {
    Mat res;
    int lCount = (lvdm != null) ? lvdm.size() : 0;
    if (lCount > 0) {
        for (MatOfDMatch vdm : lvdm) mats.add(vdm);
        res = vector_Mat_to_Mat(mats);
    } else {
        res = new Mat();
    }
    return res;
}
Also used : Mat(org.opencv.core.Mat) MatOfDMatch(org.opencv.core.MatOfDMatch) Point(org.opencv.core.Point) MatOfKeyPoint(org.opencv.core.MatOfKeyPoint) KeyPoint(org.opencv.core.KeyPoint) MatOfPoint(org.opencv.core.MatOfPoint)

Aggregations

Mat (org.opencv.core.Mat)2 MatOfDMatch (org.opencv.core.MatOfDMatch)2 ArrayList (java.util.ArrayList)1 KeyPoint (org.opencv.core.KeyPoint)1 MatOfKeyPoint (org.opencv.core.MatOfKeyPoint)1 MatOfPoint (org.opencv.core.MatOfPoint)1 Point (org.opencv.core.Point)1