org.opencv.features2d.KeyPoint.<init>()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.5k)|赞(0)|评价(0)|浏览(101)

本文整理了Java中org.opencv.features2d.KeyPoint.<init>()方法的一些代码示例,展示了KeyPoint.<init>()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。KeyPoint.<init>()方法的具体详情如下:
包路径:org.opencv.features2d.KeyPoint
类名称:KeyPoint
方法名:<init>

KeyPoint.<init>介绍

[英]The keypoint constructors
[中]关键点构造函数

代码示例

代码示例来源:origin: com.sikulix/sikulixapi

  1. public KeyPoint[] toArray() {
  2. int num = (int) total();
  3. KeyPoint[] a = new KeyPoint[num];
  4. if(num == 0)
  5. return a;
  6. float buff[] = new float[num * _channels];
  7. get(0, 0, buff); //TODO: check ret val!
  8. for(int i=0; i<num; i++)
  9. a[i] = new KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3],
  10. buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] );
  11. return a;
  12. }

代码示例来源:origin: ytai/IOIOPlotter

  1. public KeyPoint[] toArray() {
  2. int num = (int) total();
  3. KeyPoint[] a = new KeyPoint[num];
  4. if(num == 0)
  5. return a;
  6. float buff[] = new float[num * _channels];
  7. get(0, 0, buff); //TODO: check ret val!
  8. for(int i=0; i<num; i++)
  9. a[i] = new KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3],
  10. buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] );
  11. return a;
  12. }

代码示例来源:origin: nu.pattern/opencv

  1. public KeyPoint[] toArray() {
  2. int num = (int) total();
  3. KeyPoint[] a = new KeyPoint[num];
  4. if(num == 0)
  5. return a;
  6. float buff[] = new float[num * _channels];
  7. get(0, 0, buff); //TODO: check ret val!
  8. for(int i=0; i<num; i++)
  9. a[i] = new KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3],
  10. buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] );
  11. return a;
  12. }

代码示例来源:origin: abhn/marvel

  1. public KeyPoint[] toArray() {
  2. int num = (int) total();
  3. KeyPoint[] a = new KeyPoint[num];
  4. if(num == 0)
  5. return a;
  6. float buff[] = new float[num * _channels];
  7. get(0, 0, buff); //TODO: check ret val!
  8. for(int i=0; i<num; i++)
  9. a[i] = new KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3],
  10. buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] );
  11. return a;
  12. }

代码示例来源:origin: jtsky/EasyPR_Android

  1. public KeyPoint[] toArray() {
  2. int num = (int) total();
  3. KeyPoint[] a = new KeyPoint[num];
  4. if(num == 0)
  5. return a;
  6. float buff[] = new float[num * _channels];
  7. get(0, 0, buff); //TODO: check ret val!
  8. for(int i=0; i<num; i++)
  9. a[i] = new KeyPoint( buff[_channels*i+0], buff[_channels*i+1], buff[_channels*i+2], buff[_channels*i+3],
  10. buff[_channels*i+4], (int) buff[_channels*i+5], (int) buff[_channels*i+6] );
  11. return a;
  12. }

代码示例来源:origin: stackoverflow.com

  1. import com.googlecode.javacv.cpp.opencv_core.CvMat;
  2. import com.googlecode.javacv.cpp.opencv_features2d.FeatureDetector;
  3. import com.googlecode.javacv.cpp.opencv_features2d.KeyPoint;
  4. import com.googlecode.javacv.cpp.opencv_nonfree.SIFT;
  5. import static com.googlecode.javacv.cpp.opencv_highgui.cvLoadImageM;
  6. public class any {
  7. public static void main(String args[])
  8. {
  9. final CvMat image1 = cvLoadImageM("C:/temp/316.jpg" , 0);
  10. final CvMat image2 = cvLoadImageM("C:/temp/330.jpg", 0);
  11. if(image1==null)
  12. System.out.println("image is null");
  13. if(image2==null)
  14. System.out.println("image is null");
  15. SIFT sift = new SIFT();
  16. FeatureDetector featureDetector =sift.getFeatureDetector();
  17. KeyPoint keypoint1 = new KeyPoint();
  18. KeyPoint keypoint2 = new KeyPoint() ;
  19. featureDetector.detect(image1, keypoint1 , null);
  20. featureDetector.detect(image2,keypoint2, null);
  21. System.out.println(keypoint1);
  22. }
  23. }

代码示例来源:origin: com.sikulix/sikulixapi

  1. public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
  2. if (kps == null)
  3. throw new java.lang.IllegalArgumentException("Output List can't be null");
  4. int count = m.rows();
  5. if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
  6. throw new java.lang.IllegalArgumentException(
  7. "CvType.CV_64FC(7) != m.type() || m.cols()!=1\n" + m);
  8. kps.clear();
  9. double[] buff = new double[7 * count];
  10. m.get(0, 0, buff);
  11. for (int i = 0; i < count; i++) {
  12. kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
  13. (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
  14. }
  15. }

代码示例来源:origin: abhn/marvel

  1. public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
  2. if (kps == null)
  3. throw new java.lang.IllegalArgumentException("Output List can't be null");
  4. int count = m.rows();
  5. if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
  6. throw new java.lang.IllegalArgumentException(
  7. "CvType.CV_64FC(7) != m.type() || m.cols()!=1\n" + m);
  8. kps.clear();
  9. double[] buff = new double[7 * count];
  10. m.get(0, 0, buff);
  11. for (int i = 0; i < count; i++) {
  12. kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
  13. (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
  14. }
  15. }

代码示例来源:origin: nu.pattern/opencv

  1. public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
  2. if (kps == null)
  3. throw new java.lang.IllegalArgumentException("Output List can't be null");
  4. int count = m.rows();
  5. if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
  6. throw new java.lang.IllegalArgumentException(
  7. "CvType.CV_64FC(7) != m.type() || m.cols()!=1\n" + m);
  8. kps.clear();
  9. double[] buff = new double[7 * count];
  10. m.get(0, 0, buff);
  11. for (int i = 0; i < count; i++) {
  12. kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
  13. (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
  14. }
  15. }

代码示例来源:origin: ytai/IOIOPlotter

  1. public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
  2. if (kps == null)
  3. throw new java.lang.IllegalArgumentException("Output List can't be null");
  4. int count = m.rows();
  5. if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
  6. throw new java.lang.IllegalArgumentException(
  7. "CvType.CV_64FC(7) != m.type() || m.cols()!=1\n" + m);
  8. kps.clear();
  9. double[] buff = new double[7 * count];
  10. m.get(0, 0, buff);
  11. for (int i = 0; i < count; i++) {
  12. kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
  13. (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
  14. }
  15. }

代码示例来源:origin: jtsky/EasyPR_Android

  1. public static void Mat_to_vector_KeyPoint(Mat m, List<KeyPoint> kps) {
  2. if (kps == null)
  3. throw new java.lang.IllegalArgumentException("Output List can't be null");
  4. int count = m.rows();
  5. if (CvType.CV_64FC(7) != m.type() || m.cols() != 1)
  6. throw new java.lang.IllegalArgumentException(
  7. "CvType.CV_64FC(7) != m.type() || m.cols()!=1\n" + m);
  8. kps.clear();
  9. double[] buff = new double[7 * count];
  10. m.get(0, 0, buff);
  11. for (int i = 0; i < count; i++) {
  12. kps.add(new KeyPoint((float) buff[7 * i], (float) buff[7 * i + 1], (float) buff[7 * i + 2], (float) buff[7 * i + 3],
  13. (float) buff[7 * i + 4], (int) buff[7 * i + 5], (int) buff[7 * i + 6]));
  14. }
  15. }

代码示例来源:origin: stackoverflow.com

  1. KeyPoint kp = new KeyPoint();

代码示例来源:origin: stackoverflow.com

  1. KeyPoint kp = new KeyPoint();

代码示例来源:origin: stackoverflow.com

  1. KeyPoint impKeyPoint = new KeyPoint();
  2. KeyPoint tempKeyPoint = new KeyPoint();
  3. tempKeyPoint = impKeyPoint;
  4. tempKeyPoint.size = 120;
  5. KeyPoint tempKeyPoint = new KeyPoint();
  6. tempKeyPoint = impKeyPoint;
  7. tempKeyPoint.size = 120;

相关文章

KeyPoint类方法