Sunday, October 3, 2010

Comparing images based on objects contained within an image

Hi, in this post I am writing the algoritham to compare images which is much better than tha conventional image comprison.

Convetional Way of comparison:
An image has a background and foreground. Generally we do image comparison to find out similarity or difference by comparing images pixel by pixel from (0,0) position to end of the last pixel of both the images. Also, in such kind of comparison there is one more restriction of images should be of same size.

With my appraoch:
With this appraoch we would be able to compare two images which are of different size and foreground objects are different only in form of displacement.
The restriction in this approach is that the foreground objects in an image should have same morphology as in the target image. The only difference expected between two images is size and displacement of foreground objects.

High level algorithm :
1. Accept two input image which are the candidate for comparison process
2. Extract all the objects from image-1 and image-2.
3. Crop those images from image-1 and image-2.
4. Resize all the objects in image-1 to make it of same size as in image-2 for better comparison result.
5. Compare all the objects in image-1 with that of image-2 to find out best match and output the difference and similarity.
I. Compare objects by conventional method of pixel by pixel comparison OR/AND
II. Compare objects by subset identification comparison method. (Note: in subset comparison we try to find out if one object is a part of the other object)

flowchart of the image comparison algorithm :

1 comment:

  1. Dear Vikas,

    Do you have this algorithm implemented in some kind of software? I need to check if one object exists in diffrent pictures.

    Do you have any suggestion?

    Thanks,
    Rodrigo C.

    ReplyDelete