# is it possible to matching b / w images without feature extraction steps? if possible which algorithm may be more suitable?

these are example of my image

i have a 245 images similar to it ,i obtained these b/w images after preprocessing stage , i want to use them for recognition persons(not verification) in matlab. can i performe matching algorithm on these image after division into 2 group(one for training and the second for testing) without implementing feature extraction algorithm such as PCA,ICA,.....?

if it is possible , which are the suitable matching algorithms that are preferable for this purpose , especially i need to use matlab ?

• PCA and ICA are not feature extraction algorithms, they're dimensionality reduction techniques. Feature extraction methods are useful because they make the recognition task much more robust - instead of using the image pixels, you transform/extract the pixels to another (much simpler) feature space. – Roronoa Zoro Feb 13 '12 at 17:40
• thanks for your good illustration.can you give me example on suitable feature extraction algorithm that you prefer for my image? – ruaa Feb 13 '12 at 19:22
• What you need to define is - which images you seem close enough which you think should be discarded. So post another image (with some variation which should also pass) and another one which should not be taken up. Also, let us know - the domain. For example are you only restricted to such Black background / white line images? or are these edge detection images? Or you may also want to have general real life images? – Dipan Mehta Feb 14 '12 at 12:56
• @Dipan.similar and different images to the original one were added.also i am only restricted to images similar to these black background / white line images .thank you in advance. – ruaa Feb 14 '12 at 13:21

Yes, it is possible!

For example, you can take pixel by pixel comparison and apply MSE (mean square error). If the error is close to zero, it is the same picture.

However, you will be able to recognize only those images which are picture perfect matching. For example, you won't be able to account for brightness variations, scale variations, minor transformations, compression loss (e.g. JPEG) etc. So while human being might just see them as SAME image - they are not on every pixel basis. Depending on how much strict or tolerant your application needs to be, do we really need to then look for advanced algorithms that are smart enough to be invariant to these factors.

EDIT:

After your clarification, it does sound like you have more of a special case of matching rather than general purpose recognition problem.

Given the following assumptions:

1. A gray scale (or color) images are first converted to binary through some thresholding process.

2. Mostly these images are lines (thick or thin) and the key differentiation is how far these edges are from others.

3. Edges could be of arbitrary shapes and contours -no geometrical assumptions.

4. Given the edge detection limitations (in the presence of noise) and thresholding algorithms, edges might be disjoint

Here is what i would suggest to apply:

1. Edge following algorithms - to make continuous edges where applicable.
Ref #1. http://www.slideshare.net/kiara1011000/edge-following-algorithm-chiara-galdi

2. Apply Housdourf distances and similar shape/contour matching
Ref #1. Haudorff Distance by Normad
Ref #2. CV Online: The Hausdorff Distance
Ref #3. Hausorff based Matching

Basic idea is that if all edges are more or less at the same locations and of same length, then the images are same.

Given that large portion of region which contains Black and implies no information- MSE would be an extremely BAD idea.

I am only giving you some basic direction toward formulating your problem. As you dig deeper you can put more specific questions. I would be keen to know what works for you finally.

EDIT 2: Adding one specific solution

One simple possible metric i can think of is:

Say, Ref[i][j] is the reference image and Test[i][j] is the test image.

pixel_similarity = 0;
For each pixel in Ref[i][j]
{
if ( Ref[i][j] == Edge_pixel )
(k,l) <- find_nearest_edge_pixel(Ref, Test, i, j, window_size)
pixel_similarity += weighted_similarity (i, j, k, l)
}

image_similarity_metric = error / (total_edge_pixels_in_ref);


Please Note that this algorithm will be quite limited for heavy scaling and rotation. This is first step. Notify me for any typo or lack of clarity!

Observations:

1. If you keep two identical images (pixel by pixel)- you will find that (k,l) will be same as (i,j) and weighted error should be = 1.

2. By dividing the number of edge pixels by total edge population, you will get similarity metric = 1.0 for perfectly matching images.

3. When edges are almost similar, but slightly misaligned score will decline gradually. The weighted_similarity function should be chosen smartly to deal with what you consider as reasonably aligned edge vs. one that should be discarded.

4. Other extreme is that if total number of edge pixels in Ref is zero - there is no way to compare it with any other one (since we are considering background pixels having no information related to match).

Try to work this out and see what results you get.

• edge following algorithm can be added later to improve the results. Can you simply try and compute some distance between images - such as hausdorff or any other distance metric between edge pixels? Select one image and try to plot such metric (error) and see if there is a clear difference in that quantity that distinguish matching vs. non matching images. If there is significant meat in the feature vector (and comparison metric) only then there is a point in optimizing it. – Dipan Mehta Feb 15 '12 at 13:48