Advanced Image Search by Color and Content

Developed in collaboration with the Kunsthistorisches Museum, this feature enables advanced image searches based on color and content analysis.

Project Overview

This project involves an advanced search feature developed for the Kunsthistorisches Museum, enabling users to find artworks based on color and content. This feature uses custom algorithms to analyze the primary colors in an image and match them with a dataset of artworks, facilitating searches by visual similarity.

The search feature is valuable for curators, researchers, and art enthusiasts who want to explore art collections based on specific visual characteristics, such as dominant colors or specific themes depicted in the artwork.

Key Features

Color and Content Matching Algorithm

The color-matching algorithm utilizes a set of color detection functions that identify the most prominent colors in an artwork. The detected colors are then compared to the colors in the search query image within a specified threshold.

The following code shows the primary function used for color-based matching:


def match_image_by_color(image, color, threshold=60, number_of_colors=10):
    image_colors = get_colors(image, number_of_colors, False)
    selected_color = rgb2lab(np.uint8(np.asarray([color])))

    select_image = False
    for i in range(number_of_colors):
        curr_color = rgb2lab(np.uint8(np.asarray([image_colors[i]])))
        if deltaE_cie76(selected_color, curr_color) < threshold:
            select_image = True
            break
    return select_image
                

Data and Implementation

The feature was implemented using a combination of color detection techniques and content-based image recognition. Here are some steps involved:

Implementation Results

The color and content-based search feature provides accurate matching for artworks with similar visual elements, allowing users to discover art based on both aesthetic and thematic characteristics. This search functionality has been experimentally implemented with the Kunsthistorisches Museum’s image collection, and early results indicate high accuracy in finding relevant artworks based on user-defined visual criteria.