The matches in spatial layout are found by assigning each matched color region from an image in the database to one of three spatial classes with corresponding spatial distances: (1) encapsulation:
, query region completely completely encloses the image region, (2) intersection:
, query region intersects with the border of the image region, (3) disjoin:
, query region does not overlap with the image region. The overall image spatial distance
is computed by summing the individual region's spatial distance scores using
where K is the number of regions in the query. The query server assigns a total match score to each image match with K regions. The images are returned to the user in lowest match score order. The match score
is given by