# 从数据库中寻找视觉上相似的照片的算法？[英] Algorithm for finding visually similar photos from a database?

### 问题描述

"视觉上相似"，我的意思是非常相似.即，在Photoshop中轻轻触摸/重新着色的照片，略微裁剪或调整大小，快速连续拍摄的照片，或翻转或旋转的图像.

## 推荐答案

A valid approach you can consider is the Bag-of-Words model .

## 其他推荐答案

### 问题描述

TinEye, Google and others offer a "reverse image search" -- you can upload a photo and within seconds it will find similar photos.

Is there an open-source version of these algorithms?

I know about "SIFT" and other algorithms for finding "visually similar" photos, but they only work for comparing one photo directly to another. i.e., to find similar photos to a given photo is an O(n) operation, to find all visually similar photos would be O(n^2) -- both of which are prohibitively slow.

I need a feature descriptor that is indexable by a [relational] database to reduce the result set to something more manageable.

By "visually similar" I mean very similar. i.e, a photo that has been lightly touched up/recolored in Photoshop, slightly cropped or resized, photos taken in rapid succession of the same scene, or flipped or rotated images.

## 推荐答案

A valid approach you can consider is the Bag-of-Words model.

Basically you can do an offline computation of the target images. You can extract from those images a bunch of features in order to create a codebook with algorithms like k-means clustering. Searching for the nearest images will lead to the applications of an algorithm like Nearest neighbor search in the space of the codebook.

For the neighbour search you can use FLANN

Take a look also at: Visual similarity search algorithm

This is only a possibility and, truth must be told, this topic is really challenging and litterature on it is really huge.

Just some references:

## 其他推荐答案

Take a look at http://vision.caltech.edu/malaa/software/research/image-search/ it uses LSH algorithm and some kind of kd-tree. Also this task is called CBIR or image duplicate search.