Professional Documents
Culture Documents
Abstract—This paper proposes an implementation for a Two images can be perceived as similar because of
web based image similarity search using a robust image the presence of similar objects (e.g. a ball, a girl, a
matching algorithm and a user definable matching Monalisa portrait) or because of a similar look (same
criterion. Matching is done using image signatures. colors, shapes, textures). Recognition of objects and
Image signatures are generated by decomposing images hence content based image retrieval is extremely
using wavelet transforms. A database of image difficult. This algorithm therefore analyzes the image
signatures is generated by using it in conjunction with a
composition in terms of colors, shapes and textures.
web crawler. Search results are found by calculating the
Euclidian distance between the signatures of the subject Another problem in implementation of a search
and the database. Proposed architecture is time
engine is that comparing images in a large scale
efficient, robust and uses a rotation, and scale and
perspective invariant method.
collection is a processing power and bandwidth
intensive task. So an image signature /fingerprint
Keywords: Image matching, Similarity, Reverse image based solution has to be used. This algorithm should
search, image signature extract features from an image and use them to
calculate a signature. The signatures generation
I. INTRODUCTION
should be such that size, rotation, segmentation
insensitive matching is possible. These signature
As internet gets highly multimedia intensive there is
/fingerprints generation in addition to allowing for
an increased need for tools to manipulate large
these comparisons should be fast enough for a viable
collections of media and to make search for media
implementation.
more intuitive. Traditionally search engines use
manual captions, text in the related webpage, size and
dimension of images for image retrieval. This method II. IMPLEMENTATION
is highly subjective and may lead to unrelated search
The implementation structure consists of three main
results. The challenge is to bridge the gap between
blocks: the crawler, the signature generator and the
the physical characteristics of digital images (e.g. similarity calculator.
color, texture) that are used for comparison, and the
semantic meaning of the images that are used by A. WEB CRAWLER
humans to query the database. A focus of significant
research is an algorithmic process for determining the The web crawler feeds the signature calculator with
perceptual similarity of images. The comparison images from the internet which in turn populates the
algorithm has to judge differences in images in a database. This is implemented in PHP. Code snippet
similar way as a human would. This is easier said as is given below:
done, because of some special properties of the
human eye and brain. class Crawler {
protected $markup = '';
What makes humans perceive two images as being
public function __construct($uri) {
similar? This is a difficult question for many reasons.
$this->markup = $this->getMarkup($uri);
} { L* = 116*((Y/Yn)^(1/3)) with Y/Yn>0.008856
{ L* = 903.3*Y/Yn with Y/Yn<=0.008856
public function getMarkup($uri) { u* = 13*(L*)*(u'-u'n)
return file_get_contents($uri); v* = 13*(L*)*(v'-v'n)
}
public function get($type) { Where u'=4*X/(X+15*Y*+3*Z) and
$method = "_get_{$type}"; v'=9*Y/(X+15*Y+3*Z) and u'n and v'n have the
if (method_exists($this, $method)){ same definitions for u' and v' but applied to the white
return call_user_method($method, $this); point reference.
}
}
The CIE XYZ is itself defined from the RGB using
protected function _get_images() {
the following transformation:
if (!empty($this->markup)){
preg_match_all('/<img([^>]+)\/>/i', $this-
|X| |0.430574 0.341550 0.178325| |Red |
>markup, $images); |Y| = |0.222015 0.706655 0.071330| * |Green|
return !empty($images[1]) ? $images[1] : |Z| |0.020183 0.129553 0.939180| |Blue |
FALSE;
} The finger print or the signature vector is composed
} of three parts: a grayscale DCT part, a color DCT
part and an EDH part.
protected function _get_links() {
if (!empty($this->markup)){
The discrete cosine transform (DCT) helps separate
preg_match_all('/<a([^>]+)\>(.*?)\<\/a\>/i', $this-
the image into parts (or spectral sub-bands) of
>markup, $links);
differing importance (with respect to the image's
return !empty($links[1]) ? $links[1] : FALSE;
visual quality). The DCT transforms a signal from the
}
spatial domain into the frequency domain. A signal in
}
the frequency domain contains the same information
}
as that in the spatial domain. The order of values
obtained by applying the DCT is coincidentally from
B. SIGNATURE (FEATURE VECTOR) lowest to highest frequency. This feature and the
GENERATOR psychological observation that the human eye is less
sensitive to recognizing the higher-order frequencies
This is the crux of the implementation where all of leads to the possibility of compressing a spatial signal
the image processing is done. The fingerprint has to by transforming it to the frequency domain and
be calculated only once for each image and then can dropping high-order values and keeping low-order
ones.
be stored in a database for fast searching and
comparing.
C. SIMILARITY CHECKER
A more efficient retrieval system can be constructed [2] Image Similarity: A Genetic Algorithm Based Approach by R.
by implementing a Hierarchical Image classification C. Joshi, and Shashikala Tapaswi
using certain tagged images and extrapolating the [3]Color spaces FAQ
groups by using this application. http://www.ilkeratalay.com/colorspacesfaq.php