Java 类org.opencv.core.DMatch 实例源码

项目:opencv-documentscanner-android    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:MOAAP    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:opencv-documentscanner-android    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:opencv-documentscanner-android    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:NotifyTools    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:NotifyTools    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:fingerblox    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:react-native-scan-doc    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:MOAAP    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:Android-Code-Demos    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:react-native-scan-doc    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:Android-Code-Demos    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:OpenCV    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:OpenCV    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:OpenCV    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:Team9261-2017-2018    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:react-native-scan-doc    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:mao-android    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:Microsphere    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:DogeCV    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:DNNLibrary    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:Sikulix2opencv    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:Sikulix2opencv    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:renderscript_examples    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:renderscript_examples    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:FTC2016    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:Checkerboard-IMU-Comparator    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:MOAAP    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:Image-Detection-Samples    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:Image-Detection-Samples    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:Image-Detection-Samples    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:react-native-scan-doc    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:Ftc2018RelicRecovery    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:DNNLibrary    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:EyeShopping    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:FaceDetectDemo    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}
项目:FaceDetectDemo    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:Sikulix2opencv    文件:MatOfDMatch.java   
public DMatch[] toArray() {
    int num = (int) total();
    DMatch[] a = new DMatch[num];
    if(num == 0)
        return a;
    float buff[] = new float[num * _channels];
    get(0, 0, buff); //TODO: check ret val!
    for(int i=0; i<num; i++)
        a[i] = new DMatch((int) buff[_channels*i+0], (int) buff[_channels*i+1], (int) buff[_channels*i+2], buff[_channels*i+3]);
    return a;
}
项目:RobotIGS    文件:Converters.java   
public static void Mat_to_vector_DMatch(Mat m, List<DMatch> matches) {
    if (matches == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC4 != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC4 != m.type() ||  m.cols()!=1\n" + m);

    matches.clear();
    double[] buff = new double[4 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        matches.add(new DMatch((int) buff[4 * i], (int) buff[4 * i + 1], (int) buff[4 * i + 2], (float) buff[4 * i + 3]));
    }
}
项目:RobotIGS    文件:MatOfDMatch.java   
public void fromArray(DMatch...a) {
    if(a==null || a.length==0)
        return;
    int num = a.length;
    alloc(num);
    float buff[] = new float[num * _channels];
    for(int i=0; i<num; i++) {
        DMatch m = a[i];
        buff[_channels*i+0] = m.queryIdx;
        buff[_channels*i+1] = m.trainIdx;
        buff[_channels*i+2] = m.imgIdx;
        buff[_channels*i+3] = m.distance;
    }
    put(0, 0, buff); //TODO: check ret val!
}