Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CW-SSIM: Are summation axises mixed? #37

Open
aneepi opened this issue Aug 31, 2020 · 5 comments
Open

CW-SSIM: Are summation axises mixed? #37

aneepi opened this issue Aug 31, 2020 · 5 comments

Comments

@aneepi
Copy link

aneepi commented Aug 31, 2020

Hello!

I checked the CW-SSIM calculation part and I realized that there is something fishy in the summation axises.
scipy.signal.cwt returns continuous wavelet transformations as numpy.ndarray with output shape (M,N), where M is the number of width parameters given and N is the lenght of the input array. On other words, there should be numpy.sum(..., axis=1) intstead of numpy.sum(..., axis=0).
This way CW-SSIM is calculated within one width parameter and then averaged over the different transformations.

I would also add some notification or comment, which tells that CWT in scipy is done in 1D even though image actually is in 2D.

@jterrace
Copy link
Owner

jterrace commented Sep 3, 2020

You may be right, I honestly don't know. Any other reference implementation we could compare it to?

@jterrace
Copy link
Owner

jterrace commented Sep 3, 2020

paging @chaosmail who wrote this

@aneepi
Copy link
Author

aneepi commented Sep 4, 2020

In the original paper of Zhou Wang and E.P. Simoncelli, Translation insensitive image similarity in complex wavelet domain, authors write:
"cx=... and cy=... are two sets of coefficients extracted at the same spatial location in the same wavelet subbands of the two images being compared, respectively."

Later in the "Test" section they describe process as:

"To apply the CW-SSIM measure for comparing images, we first
decompose the two given images being compared using a complex
version [6] of the “steerable pyramid” transform [7] (a type of
redundant wavelet transform that avoids aliasing in subbands). We
then move a sliding window (of size 7×7) step by step across each
wavelet subband. At each step, the CW-SSIM index is calculated
within the sliding window using Eq. (4). The overall similarity
of the two images is estimated using the average of the local CW-
SSIM measures in all subbands (or a subset of all the subbands)."

According to these I'd say that the original CW-SSIM is calculated in a similar fashion as SSIM using sliding windows over the image, which has been subjected to CWT. The results are averaged within a subbands, which I think here means a one width parameter of the used wavelet. In the end these results can also be averaged over a subbands.

I have been making some research using similar ideas as in CW-SSIM and I got some weird results with summations with the ordering mentioned in the first post. However, I was not totally sure.

@jterrace
Copy link
Owner

jterrace commented Sep 4, 2020

You're welcome to submit a pull request. I honestly didn't look that closely when @chaosmail implemented it.

@Hs-Cheng
Copy link

Hello everyone,

I would like to ask if the CW-SSIM results are correct right now. Could you please give me an update on this issue?

Thank you very much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants