search( key, int similarity...)

format

search( long key, int similarity, int colorPercent, int shapePercent, int texturePercent, int objectPercent) throws Exception

description

Searches the MediaCollection for images similar to the given image, using the provided search options (including similarity).

parameters

key - the index key of the MediaObject you wish to retrieve
 

similarity - the percentage threshold, 0 to 100, that determines what degree of visual similarity that the search should use as criteria when retrieving images. A high threshold means images must be very similar, thus fewer images are retrieved from the search; a low threshold relaxes the criteria, thus more images are retrieved from the search.
 

shapePercent - the percentage weighting, from 0 to 100, of shape similarity in the search
 

texturePercent - the percentage weighting, from 0 to 100, of texture similarity in the search
 

objectPercent - the percentage weighting, from 0 to 100, of object similarity in the search

returns

an array of SearchResults, sorted in descending order of relevancy

throws

search() throws an Exception if path does not exist, is not a file, or is not in a supported image file format. As well, it throws an Exception if any of the percentage parameters is less than 0 (zero) or greater than 100.