java类org.opencv.core.KeyPoint的实例源码

ImageDisplayActivity.java 文件源码 项目:fingerblox 阅读 28 收藏 0 点赞 0 评论 0
public String keypointsToJSON(MatOfKeyPoint kps){
    Gson gson = new Gson();

    JsonArray jsonArr = new JsonArray();

    KeyPoint[] kpsArray = kps.toArray();
    for(KeyPoint kp : kpsArray){
        JsonObject obj = new JsonObject();

        obj.addProperty("class_id", kp.class_id);
        obj.addProperty("x", kp.pt.x);
        obj.addProperty("y", kp.pt.y);
        obj.addProperty("size", kp.size);
        obj.addProperty("angle", kp.angle);
        obj.addProperty("octave", kp.octave);
        obj.addProperty("response", kp.response);

        jsonArr.add(obj);
    }

    return gson.toJson(jsonArr);
}
Converters.java 文件源码 项目:opencv-documentscanner-android 阅读 29 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:MOAAP 阅读 25 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
MatOfKeyPoint.java 文件源码 项目:opencv-documentscanner-android 阅读 32 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
MatOfKeyPoint.java 文件源码 项目:MOAAP 阅读 28 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:NotifyTools 阅读 27 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:NotifyTools 阅读 27 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:fingerblox 阅读 29 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
Converters.java 文件源码 项目:Android-Code-Demos 阅读 28 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:Android-Code-Demos 阅读 26 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
MatOfKeyPoint.java 文件源码 项目:MOAAP 阅读 27 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:OpenCV 阅读 30 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:Sikulix2opencv 阅读 23 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
MatOfKeyPoint.java 文件源码 项目:MOAAP 阅读 25 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:DogeCV 阅读 25 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:DogeCV 阅读 23 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
MatOfKeyPoint.java 文件源码 项目:MOAAP 阅读 25 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
MatOfKeyPoint.java 文件源码 项目:renderscript_examples 阅读 25 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:MOAAP 阅读 37 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
Converters.java 文件源码 项目:renderscript_examples 阅读 27 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
Converters.java 文件源码 项目:MOAAP 阅读 29 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
Converters.java 文件源码 项目:Checkerboard-IMU-Comparator 阅读 29 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
Converters.java 文件源码 项目:Sikulix2opencv 阅读 24 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:MOAAP 阅读 24 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:Ftc2018RelicRecovery 阅读 24 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
Converters.java 文件源码 项目:Team9261-2017-2018 阅读 26 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:react-native-scan-doc 阅读 28 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:RobotIGS 阅读 28 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}
MatOfKeyPoint.java 文件源码 项目:RobotIGS 阅读 29 收藏 0 点赞 0 评论 0
public void fromArray(KeyPoint...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++) {
        KeyPoint kp = a[i];
        buff[_channels*i+0] = (float) kp.pt.x;
        buff[_channels*i+1] = (float) kp.pt.y;
        buff[_channels*i+2] = kp.size;
        buff[_channels*i+3] = kp.angle;
        buff[_channels*i+4] = kp.response;
        buff[_channels*i+5] = kp.octave;
        buff[_channels*i+6] = kp.class_id;
    }
    put(0, 0, buff); //TODO: check ret val!
}
Converters.java 文件源码 项目:real_time_circle_detection_android 阅读 22 收藏 0 点赞 0 评论 0
public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
    if (kps == null)
        throw new java.lang.IllegalArgumentException("Output List can't be null");
    int count = m.rows();
    if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
        throw new java.lang.IllegalArgumentException(
                "CvType.CV_64FC(7) != m.type() ||  m.cols()!=1\n" + m);

    kps.clear();
    double[] buff = new double[7 * count];
    m.get(0, 0, buff);
    for (int i = 0; i < count; i++) {
        kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
                (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
    }
}


问题


面经


文章

微信
公众号

扫码关注公众号