public void loadFeatures() throws IOException {
  File f=new File(path.getAbsolutePath() + ".features");
  if (f.exists()) {
    DataInputStream dis=new DataInputStream(new FileInputStream(f));
    try {
      if (dis.available() < 4) {
        return;
      }
      int count=dis.readInt();
      imageLocations.clear();
      for (int i=0; i < count; i++) {
        imageLocations.put(new Feature(dis.readLong()),new Point2d(dis.readDouble(),dis.readDouble()));
      }
    }
  finally {
      dis.close();
    }
  }
 else {
    String absolutePath=path.getAbsolutePath();
    f=new File(absolutePath.substring(0,absolutePath.length() - 3) + "txt");
    if (f.exists()) {
      double[] values=MatrixUtils.loadMatrix(f," ");
      for (int i=0; i < values.length; i+=3) {
        imageLocations.put(new Feature((long)values[i]),new Point2d(values[i + 1],values[i + 2]));
      }
    }
  }
}

public void loadFeatures ( ) throws IOException { File f = new File ( path . getAbsolutePath ( ) + ".features" ) ; if ( f . exists ( ) ) { DataInputStream dis = new DataInputStream ( new FileInputStream ( f ) ) ; try { if ( dis . available ( ) < 4 ) { return ; } int count = dis . readInt ( ) ; imageLocations . clear ( ) ; for ( int i = 0 ; i < count ; i ++ ) { imageLocations . put ( new Feature ( dis . readLong ( ) ) , new Point2d ( dis . readDouble ( ) , dis . readDouble ( ) ) ) ; } } finally { dis . close ( ) ; } } else { String absolutePath = path . getAbsolutePath ( ) ; f = new File ( absolutePath . substring ( 0 , absolutePath . length ( ) - 3 ) + "txt" ) ; if ( f . exists ( ) ) { double [ ] values = MatrixUtils . loadMatrix ( f , " " ) ; for ( int i = 0 ; i < values . length ; i += 3 ) { imageLocations . put ( new Feature ( ( long ) values [ i ] ) , new Point2d ( values [ i + 1 ] , values [ i + 2 ] ) ) ; } } } }
looks for a file named path + " . features " and if it exists , tries to load features from the file .
