Deepak,
I'm not sure what you want to do about the images of different sizes. If you are trying to locate a smaller image within a larger image, you will need to use pattern matching or correlation. If you are trying to compare equal sized regions, you can do direct pixel to pixel comparisions.
One possibility would be using IMAQ Compare to remove the matching pixels, then subtract the resulting image from the original, which would only leave the matching pixels. This would only work on exact matches. If there is any noise in the image, you won't get an exact match on most of the pixels.
If you are using binary images, you can just AND the two images together, and the resulting image is only the pixels that are common between the two.
Bruce
Bruce Ammons
Ammons Engineering