@Override public boolean findMatches(List<T> keys1) { matches = new ArrayList<Pair<T>>(); byte [][] data = new byte[keys1.size()][]; for (int i=0; i<keys1.size(); i++) data[i] = keys1.get(i).ivec; int [][] argmins = new int[keys1.size()][2]; float [][] mins = new float[keys1.size()][2]; modelKeypointsKNN.searchKNN(data, 2, argmins, mins); for (int i=0; i<keys1.size(); i++) { float distsq1 = mins[i][0]; float distsq2 = mins[i][1]; if (10 * 10 * distsq1 < thresh * thresh * distsq2) { matches.add(new Pair<T>(keys1.get(i), modelKeypoints.get(argmins[i][0]))); } if (matches.size() >= limit) break; } return true; } }
@Override public boolean findMatches(List<T> keys1) { matches = new ArrayList<Pair<T>>(); byte [][] data = new byte[keys1.size()][]; for (int i=0; i<keys1.size(); i++) data[i] = keys1.get(i).ivec; int [][] argmins = new int[keys1.size()][2]; float [][] mins = new float[keys1.size()][2]; modelKeypointsKNN.searchKNN(data, 2, argmins, mins); for (int i=0; i<keys1.size(); i++) { float distsq1 = mins[i][0]; float distsq2 = mins[i][1]; if (10 * 10 * distsq1 < thresh * thresh * distsq2) { matches.add(new Pair<T>(keys1.get(i), modelKeypoints.get(argmins[i][0]))); } if (matches.size() >= limit) break; } return true; } }
/** * Given a pair of images and their keypoints, pick the first keypoint from * one image and find its closest match in the second set of keypoints. Then * write the result to a file. */ @Override public boolean findMatches(List<T> keys1) { matches = new ArrayList<Pair<T>>(); final byte[][] data = new byte[keys1.size()][]; for (int i = 0; i < keys1.size(); i++) data[i] = keys1.get(i).ivec; final int[][] argmins = new int[keys1.size()][2]; final float[][] mins = new float[keys1.size()][2]; modelKeypointsKNN.searchKNN(data, 2, argmins, mins); for (int i = 0; i < keys1.size(); i++) { final float distsq1 = mins[i][0]; final float distsq2 = mins[i][1]; if (10 * 10 * distsq1 < thresh * thresh * distsq2) { matches.add(new Pair<T>(keys1.get(i), modelKeypoints.get(argmins[i][0]))); } } return true; }
/** * Given a pair of images and their keypoints, pick the first keypoint from * one image and find its closest match in the second set of keypoints. Then * write the result to a file. */ @Override public boolean findMatches(List<T> keys1) { matches = new ArrayList<Pair<T>>(); final byte[][] data = new byte[keys1.size()][]; for (int i = 0; i < keys1.size(); i++) data[i] = keys1.get(i).ivec; final int[][] argmins = new int[keys1.size()][2]; final float[][] mins = new float[keys1.size()][2]; modelKeypointsKNN.searchKNN(data, 2, argmins, mins); for (int i = 0; i < keys1.size(); i++) { final float distsq1 = mins[i][0]; final float distsq2 = mins[i][1]; if (10 * 10 * distsq1 < thresh * thresh * distsq2) { matches.add(new Pair<T>(keys1.get(i), modelKeypoints.get(argmins[i][0]))); } } return true; }
float [][] mins = new float[keys1.size()][this.count]; modelKeypointsKNN.searchKNN(data, this.count, argmins, mins); double threshProp = (1.0 + thresh) * (1.0 + thresh) ;
float [][] mins = new float[keys1.size()][this.count]; modelKeypointsKNN.searchKNN(data, this.count, argmins, mins); double threshProp = (1.0 + thresh) * (1.0 + thresh) ;