3

I am new to python and currently working on an image processing project in which I need to compare two images. For image comparison, I am using structural similarity function which is already there in python. But, each and every time I use that function, it gives me proper results but also dumps a warning multiple times like this:

C:\Users\abc\Anaconda\lib\site-packages\skimage\measure\_structural_similarity.py:224: skimage_deprecation: Call to deprecated function ``structural_similarity``. Use ``compare_ssim`` instead.
  def structural_similarity(X, Y, win_size=None, gradient=False,

I thought the warning wants me to use compare_ssim function instead of structural_similarity function. So, I changed to this: from skimage.measure import compare_ssim as ssim But same warnings are coming. I am using this function for multiple images in a single execution so I need to scroll a lot to find exactly where my results are amidst the warnings.

I need to disable these deprecated warnings to keep my console clean. Any solution for this? I tried to search but everything was too complicated for me. Please help.

ALSO This might be a possible duplicate to this question but I can not understand how to implement the accepted answer on Spyder using an IPython console in windows.

Ambika Saxena
  • 215
  • 4
  • 17
  • 1
    When you use `compare_ssim` the warning should not occur, are you sure you changed it everywhere? – moritzg Jul 27 '17 at 08:19
  • 1
    Possible duplicate of [How to ignore deprecation warnings in Python](https://stackoverflow.com/questions/879173/how-to-ignore-deprecation-warnings-in-python) – Mel Jul 27 '17 at 08:19
  • @moritzg Yes the function I am calling is in loop so I needed to change it only once! – Ambika Saxena Jul 27 '17 at 08:20

0 Answers0