# Object Retrieval in Microscopic Images of Rocks Using the Query by Sketch Method
## 2 Query by Example  
Image retrieval, in its most general form, is divided into two main approaches. The first approach retrieves images based on the metadata describing the image (TBIR--text-based image retrieval, concept-based image indexing). The second approach (discussed in this paper) retrieves images based on the analysis of the content of the images (CB(V)IR--content-based (visual) image retrieval) [9; 10; 11]. TBIR-type image retrieval systems are impractical for extensive collections of geological images, as they require the labelling of each image with a text description. The natural upshot of the situation described is the inclination towards image retrieval systems which are founded on the analysis of the content of the images (CBIR). To a considerable extent, these systems can reflect the way in which images are compared by the human brain. The idea behind the CBIR systems is the identification of an effective way to compare images by referring to the content represented by image pixels. These techniques are used in certain aspects of computer graphics, interactions between the computer and the human, and database mining--for example--image mining. The common denominator of research on CBIR-related issues is the analysis of digital images in terms of differences between colours, textures and content of the images, e.g., in the context of quantitative analysis, the analysis of object shapes, for both the search key and the viewed images.  
There are different forms of posing a query by image. In general, a query can be specified by means of an example of an image (QBIC--Query by Image Content, QBE--Query by Example), by an example of a group of images (QBGE--Query by Group Example), and by means of a simplified sketch of the image (QBS--Query by Sketch, or QBC--Query by Canvas) [12; 13; 14; 15; 16]. These methods are founded on the principal assumptions of the CBIR methodology, where both the search query and the database of the images explored are processed in order to extract their characteristic features, which are then compared and adjusted according to set criteria [17].  
A diagram of image retrieval based on the query by sketch assumes that in order to find a specific image or object, the user sends a query to the system in the form of a manually created sketch of an object and in response receives an image with a certain similarity (or group of images). Both the sketch (search query) and the set of images in the database may be subject to appropriate processing, for instance to extract their characteristic features. These features are compared and adjusted according to the established criteria. The result may be a ranking of images included in the search, sorted in the order of decreasing similarity to the query in the form of an image (see Figure 1).  
A key problem in the system described is the selection of appropriate parameters describing the objects and the selection of their adjustment criteria. The criteria for the adjustment of image parameters are determined by many factors, for instance: the purpose of the system and the functional operation (searching for a fragment of the image, searching for similar fragments of the image, tracking a given object or similar objects), the type of data comprising the system, and factors other than functional requirements, such as the speed of operation.