1

For example I am trying to find the similarity between two images using skimage - SSIM. The code block will be as follows

from skimage.measure import compare_ssim as ssim
from skimage import io
from skimage.transform import resize

a = io.imread("http://ecx.images-amazon.com/images/I/51PV4Dd8wAL._AC_UL246_SR190,246_.jpg",as_grey=False,dtype="float64")
b = io.imread("http://ecx.images-amazon.com/images/I/914ZHE6JolL._UY500_.jpg",as_grey=False,dtype="float64")

a = resize(a,b.shape)
ssim(a, b,multichannel=True)

I got the similarity score as follows

0.21009350738786017

Although both the images are same where one images in slightly oriented , I am getting very really low scores for this comparisons. Am I missing any preprocessing steps here before I compute compare images. If so what are the things I should consider before comparing images.

Thanks In Advance !!

1 Answer 1

0

Just resizing the image to zoom in/out to match the other image is always going to yield a structural difference. When you zoom out an image, some values are aggregated (think pixelation). While when you zoom in, values are again modified. Hence in both cases there is loss/aggregation of information in all channels.

This will always yield a structural difference. Ssim is preferably used for originally same size images.(not resized)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.