/** * Loads the Interestpoints from file. * * @param fileName the file name * @return the list */ public static List<InterestPoint> loadFromFile(String fileName) { try { Scanner in = new Scanner(new File(fileName)); int iptsSize = in.nextInt(); List ipts = new ArrayList(iptsSize); for (int i = 0; i < iptsSize; i++) { float x = in.nextFloat(); float y = in.nextFloat(); float strength = in.nextFloat(); float trace = in.nextFloat(); float scale = in.nextFloat(); float ori = in.nextFloat(); int descSize = in.nextInt(); InterestPoint ipt = new InterestPoint(x, y, strength, trace, scale); ipt.orientation = ori; if (descSize > 0) { ipt.descriptor = new float[descSize]; for (int j = 0; j < descSize; j++) ipt.descriptor[j] = in.nextFloat(); } ipts.add(ipt); } in.close(); return ipts; } catch (FileNotFoundException e) { } return null; }