Java CBIR implementation