Efficient approximate retrieval in databases of structured images