if (id == 0) { // random images
for (int i = 0; i < numres; i++) {
int rid = generator.nextInt(DB_NUM_IMGS) + 1; // +1 so id 0 is
// not selected
dbImageList.add(new DbImageResult(rid, 0.0, this.imgIdDb
.getUrlForImg(rid)));
}
} else { // similarity search
// searching by default on DB Space 1
Object[] params = new Object[] { 1, (int) id, numres, fast };
try {
Object[] result = (Object[]) iskClient.client.execute("queryImgID",
params);
for (Object res : result) {
Object[] r = (Object[]) res;
int rid = (Integer) r[0];
dbImageList.add(new DbImageResult(rid, (Double) r[1],
this.imgIdDb.getUrlForImg(rid)));
}
return dbImageList;
} catch (XmlRpcException e) {
// TODO Auto-generated catch block