org.opencv.core.KeyPoint Java Examples
The following examples show how to use
org.opencv.core.KeyPoint.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: MatOfKeyPoint.java From MOAAP with MIT License | 6 votes |
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! }
Example #2
Source File: MatOfKeyPoint.java From VIA-AI with MIT License | 6 votes |
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! }
Example #3
Source File: Converters.java From opencv-documentscanner-android with Apache License 2.0 | 6 votes |
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])); } }
Example #4
Source File: Converters.java From SmartPaperScan with Apache License 2.0 | 6 votes |
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])); } }
Example #5
Source File: Converters.java From LPR with Apache License 2.0 | 6 votes |
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])); } }
Example #6
Source File: MatOfKeyPoint.java From Chinese-number-gestures-recognition with BSD 2-Clause "Simplified" License | 6 votes |
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! }
Example #7
Source File: Converters.java From MOAAP with MIT License | 6 votes |
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])); } }
Example #8
Source File: Converters.java From Chinese-number-gestures-recognition with BSD 2-Clause "Simplified" License | 6 votes |
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])); } }
Example #9
Source File: MatOfKeyPoint.java From opencv-documentscanner-android with Apache License 2.0 | 6 votes |
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! }
Example #10
Source File: MatOfKeyPoint.java From real_time_circle_detection_android with MIT License | 6 votes |
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! }
Example #11
Source File: Converters.java From MOAAP with MIT License | 6 votes |
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])); } }
Example #12
Source File: Converters.java From LicensePlateDiscern with MIT License | 6 votes |
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])); } }
Example #13
Source File: MatOfKeyPoint.java From LicensePlateDiscern with MIT License | 6 votes |
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! }
Example #14
Source File: Converters.java From MOAAP with MIT License | 6 votes |
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])); } }
Example #15
Source File: MatOfKeyPoint.java From OpenCvFaceDetect with Apache License 2.0 | 6 votes |
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! }
Example #16
Source File: Converters.java From OpenCvFaceDetect with Apache License 2.0 | 6 votes |
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])); } }
Example #17
Source File: MatOfKeyPoint.java From MOAAP with MIT License | 6 votes |
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! }
Example #18
Source File: MatOfKeyPoint.java From pasm-yolov3-Android with GNU General Public License v3.0 | 6 votes |
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! }
Example #19
Source File: Converters.java From VIA-AI with MIT License | 6 votes |
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])); } }
Example #20
Source File: MatOfKeyPoint.java From MOAAP with MIT License | 6 votes |
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! }
Example #21
Source File: MatOfKeyPoint.java From OpenCV-android with Apache License 2.0 | 6 votes |
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! }
Example #22
Source File: Converters.java From MOAAP with MIT License | 6 votes |
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])); } }
Example #23
Source File: MatOfKeyPoint.java From MOAAP with MIT License | 6 votes |
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! }
Example #24
Source File: Converters.java From Image-Detection-Samples with Apache License 2.0 | 6 votes |
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])); } }
Example #25
Source File: Converters.java From OpenCV-android with Apache License 2.0 | 6 votes |
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])); } }
Example #26
Source File: MatOfKeyPoint.java From MOAAP with MIT License | 5 votes |
public KeyPoint[] toArray() { int num = (int) total(); KeyPoint[] a = new KeyPoint[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 KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3], buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] ); return a; }
Example #27
Source File: MatOfKeyPoint.java From Chinese-number-gestures-recognition with BSD 2-Clause "Simplified" License | 5 votes |
public KeyPoint[] toArray() { int num = (int) total(); KeyPoint[] a = new KeyPoint[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 KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3], buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] ); return a; }
Example #28
Source File: MatOfKeyPoint.java From SmartPaperScan with Apache License 2.0 | 5 votes |
public KeyPoint[] toArray() { int num = (int) total(); KeyPoint[] a = new KeyPoint[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 KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3], buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] ); return a; }
Example #29
Source File: MatOfKeyPoint.java From Machine-Learning-Projects-for-Mobile-Applications with MIT License | 5 votes |
public KeyPoint[] toArray() { int num = (int) total(); KeyPoint[] a = new KeyPoint[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 KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3], buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] ); return a; }
Example #30
Source File: MatOfKeyPoint.java From Image-Detection-Samples with Apache License 2.0 | 5 votes |
public KeyPoint[] toArray() { int num = (int) total(); KeyPoint[] a = new KeyPoint[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 KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3], buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] ); return a; }