HadoopLocalFeaturesTool extends Configured implements Tool { public static void main(String[] args) throws Exception { ToolRunner.run(new HadoopLocalFeaturesTool(), args); }  @Override int run(String[] args); static void main(String[] args);  }
@Test public void testKeypointGeneration() throws Exception { final File featureSeqFile = folder.newFile("seq-testKeypointGeneration.features"); final File featureSeqFileASCII = folder.newFile("seq-testKeypointGeneration.featuresASCII"); final File featureSeqFileASIFT = folder.newFile("seq-testKeypointGeneration.featuresASIFT"); featureSeqFile.delete(); featureSeqFileASCII.delete(); featureSeqFileASIFT.delete(); final File quantisedOutput = folder.newFile("seq-testKeypointGeneration.quantised"); quantisedOutput.delete(); HadoopLocalFeaturesTool.main(new String[] { "-D", "mapred.child.java.opts=\"-Xmx3000M\"", "-i", imageSeqFile.getAbsolutePath(), "-o", featureSeqFile.getAbsolutePath() }); HadoopLocalFeaturesTool.main(new String[] { "-D", "mapred.child.java.opts=\"-Xmx3000M\"", "-i", imageSeqFile.getAbsolutePath(), "-o", featureSeqFileASCII.getAbsolutePath(), "-a" }); assertTrue(featureSeqFile.exists()); assertTrue(featureSeqFileASCII.exists()); final LocalFeatureList<Keypoint> firstKPL = getKPLFromSequence(keys.get(0), featureSeqFile); final LocalFeatureList<Keypoint> secondKPL = getKPLFromSequence(keys.get(0), featureSeqFileASCII); assertTrue(firstKPL.size() == secondKPL.size()); for (int i = 0; i < firstKPL.size(); i++) { assertTrue(Arrays.equals(firstKPL.get(i).ivec, secondKPL.get(i).ivec)); } }
@Test public void testKeypointImageTransform() throws Exception { final File featureSeqFile = folder.newFile("seq-testKeypointImageTransform.features"); final File featureSeqFileDouble = folder.newFile("seq-testKeypointImageTransform2.features"); HadoopLocalFeaturesTool.main(new String[] { "-D", "mapred.child.java.opts=\"-Xmx3000M\"", "-i", imageSeqFile.getAbsolutePath(), "-o", featureSeqFileDouble.getAbsolutePath(), "-m", "ASIFTENRICHED", "-rm" }); HadoopLocalFeaturesTool.main(new String[] { "-D", "mapred.child.java.opts=\"-Xmx3000M\"", "-i", imageSeqFile.getAbsolutePath(), "-o", featureSeqFile.getAbsolutePath(), "-m", "ASIFTENRICHED", "-rm", "-nds" }); final LocalFeatureList<Keypoint> firstKPL = getKPLFromSequence(keys.get(0), featureSeqFile); final LocalFeatureList<Keypoint> firstKPLDouble = getKPLFromSequence(keys.get(0), featureSeqFileDouble); assertTrue(firstKPL.size() < firstKPLDouble.size()); }