Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: cannot import name 'structural_similarity' error

In my image comparision code following: https://www.pyimagesearch.com/2014/09/15/python-compare-two-images/

While using from skimage.measure import structural_similarity as ssim

and then s = ssim(imageA, imageB)

I am getting error:

from skimage.measure import structural_similarity as ssim 

ImportError: cannot import name 'structural_similarity'

like image 450
Om Sao Avatar asked Mar 15 '19 08:03

Om Sao


1 Answers

I found the solution. As this question is unique and not covered anywhere. So, posting the answer.

#from skimage.measure import structural_similarity as ssim from skimage import measure . . . #s = ssim(imageA, imageB) s = measure.compare_ssim(imageA, imageB) 

Change commented line to uncommented line.

like image 103
Om Sao Avatar answered Sep 17 '22 04:09

Om Sao