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-based search that identifies the dominant colors in an image and matches them with similar artworks.
- Content analysis that detects specific objects or themes within an artwork, enhancing search precision.
- Integration with the Kunsthistorisches Museum's image database for seamless retrieval of relevant artwork matches.
Figure: Example of color-matching search results for artwork from the museum's collection.
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:
- Extracting dominant colors in each artwork image to create a searchable color profile.
- Using LAB color space to ensure color matching accuracy across different lighting and image conditions.
- Utilizing a threshold mechanism to control color match sensitivity and enhance search accuracy.
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.