Image
similarity based on color and texture
Siva Kumar and Longin Jan Latecki
For a
given query image, this program will find the most similar images in a specified
directory.
You just need to download it from a link below and run setup.exe,
to have it on your Windows XP or 2000 computer.
Program Description:
The program is written in C# for Microsoft .NET platform. A sample screenshot is shown below:
There are 4 major sections on the application screen:
A. Query image (on left) and matching image (on right)
B. Search parameters and commands (described below).
C. The list of best matching images with
the most relevant first. The similarity values are displayed with
each image.
The first value is for Color, followed by Texture and
combined.
If you click on any image in this list, it will appear in A
(right) with more detailed information.
D. The graphs of similarity values give a better view of the
similarities to the query image.
The X axis is the image no. and Y axis
is the similarity value.
To install and pre-process directory with images:
(a) Install setup.exe from similarity.zip.
(b) Run win.exe from the location specified in (a).
(c) Select the image directory (by clicking '...' in Image Directory). The directory can contain images in formats JPG, BMP, GIF
(d) Run Compute EV incr.
(e) Select Color or Texture in Search Type if you plant to use one of them, or Combined if you want to use both
(f) Run Pre-process Dir
To run this program in a pre-processed directory:
(1) Select Search Type (we recommend Texture or Color)
(2) Open query image by clicking Open File (can be any image in formats JPG, BMP, GIF)
(3) Run Compare with Dir
A pre-processed directory with 8 example images is available here: TestPics.zip
A sample database with 1000 images is available here: images2.zip.
The pre-processing steps (d) - (f) make take a few hours for such large directories.
Commands:
Open File: opens the query image, can be one of JPG, BMP, GIF
Compare with Dir: runs the search against the pre-processed directory of images. On completion, the search results are displayed in C.
Pre-process
Dir: computes texture
representations for all images and stores them
in file db<number> .ser
(e.g., db16.ser indicates representations based on 16x16 block size).
Compute
EV: computes a
matrix that is necessary to generate image texture representations and stores
it in file ev<number>.ser
(e.g., ev16.ser for 16x16 block size). This option can be
only used for small databases. A better option for large databases is the
following one.
Compute EV incr.: the same as Compute EV but computes incrementally: initial matrix is calculated for the first image and then each block from subsequent images are added incrementally.
Additional files added to the folder will be processed selectively if Compute EV incr. is selected again.
Options:
Search Type -
Color: With this option, similarity search is done using Color property only. The EV calculation buttons are irrelevant for this case.
Texture: Similarity search using Texture property only.
Combined: When this option is selected, pre-process is done for both color and texture.
Combination of these values can be used to vary importance of texture or color in the similarity search. The coefficients can be changed by the user.
Display Graph: This check box toggles the display of graphs.
Normalize: When this option is checked, the values of texture and color similarity are normalized.
Settings:
Image Directory: Directory where the database images are stored
Rejection fraction: Percent of outlier values rejected during image distance calculation.
Block Size: Image block size (in pixels) that will be used for texture similarity
No. of PCA Comp.: Dimensionality of the matrix that generates the texture computation
Distance: Hausdorff distance calculation, Directed (one way) or symmetric (both ways)
Query Img. %: the percent of image that is used as query image, e.g., 50% specifies to use only the middle 50% portion of the image
Distance Zone (0-1): If a value of 0.2 is specified, the distance computation is done using points within a zone around it that is 20% of the mean of height and width of the image.
Alpha(incrPCA): a a parameter of the incremental matrix computation.