Search in sources :

Example 1 with MatOfKeyPoint

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

the class Converters method Mat_to_vector_vector_KeyPoint.

public static void Mat_to_vector_vector_KeyPoint(Mat m, List<MatOfKeyPoint> kps) {
    if (kps == 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);
    for (Mat mi : mats) {
        MatOfKeyPoint vkp = new MatOfKeyPoint(mi);
        kps.add(vkp);
        mi.release();
    }
    mats.clear();
}
Also used : Mat(org.opencv.core.Mat) MatOfKeyPoint(org.opencv.core.MatOfKeyPoint) ArrayList(java.util.ArrayList)

Example 2 with MatOfKeyPoint

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

the class Converters method vector_vector_KeyPoint_to_Mat.

// vector_vector_KeyPoint
public static Mat vector_vector_KeyPoint_to_Mat(List<MatOfKeyPoint> kps, List<Mat> mats) {
    Mat res;
    int lCount = (kps != null) ? kps.size() : 0;
    if (lCount > 0) {
        for (MatOfKeyPoint vkp : kps) mats.add(vkp);
        res = vector_Mat_to_Mat(mats);
    } else {
        res = new Mat();
    }
    return res;
}
Also used : Mat(org.opencv.core.Mat) MatOfKeyPoint(org.opencv.core.MatOfKeyPoint) 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 MatOfKeyPoint (org.opencv.core.MatOfKeyPoint)2 ArrayList (java.util.ArrayList)1 KeyPoint (org.opencv.core.KeyPoint)1 MatOfPoint (org.opencv.core.MatOfPoint)1 Point (org.opencv.core.Point)1