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

full_ref.msssim() and aspect ratio of images #37

Open
T-Bone-17 opened this issue May 24, 2023 · 0 comments
Open

full_ref.msssim() and aspect ratio of images #37

T-Bone-17 opened this issue May 24, 2023 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@T-Bone-17
Copy link

Hi,

Thank you so much for writing and maintaining this...it's all good work for sure.

I'm finding that whenever I pass images with an aspect ratio greater than about 1.7 or so it always fails....
I'm using all the default params etc and the input sizes are are matching and not tiny etc ....
All your other routines work fine.

I have run thousands of images through it and reliably - the ones with aspect ratio below ~1.7 work fine.

For example, the run below the shapes match and are : (90, 1920, 3)

Traceback (most recent call last):
File "c:\Users\NHEL\T_code\Image_work\sewar_tests\side_tests\side_test_sewar testing for images_200_Whay_doesnt_MS-ssim_work_hmmm.py", line 221, in
res_ms_ssim = full_ref.msssim( TILE, lo_IMGS[ k ] ).real
File "C:\Users\NHEL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\sewar\full_ref.py", line 305, in msssim
_ssim, _cs = ssim(GT, P, ws=ws,K1=K1,K2=K2,MAX=MAX,fltr_specs=fltr_specs)
File "C:\Users\NHEL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\sewar\full_ref.py", line 157, in ssim
ssim,cs = _ssim_single(GT[:,:,i],P[:,:,i],ws,C1,C2,fltr_specs,mode)
File "C:\Users\NHEL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\sewar\full_ref.py", line 118, in _ssim_single
GT_sum_sq,P_sum_sq,GT_P_sum_mul = _get_sums(GT,P,win,mode)
File "C:\Users\NHEL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\sewar\utils.py", line 32, in _get_sums
mu1,mu2 = (filter2(GT,win,mode),filter2(P,win,mode))
File "C:\Users\NHEL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\sewar\utils.py", line 60, in filter2
return signal.convolve2d(img, np.rot90(fltr,2), mode=mode)
File "C:\Users\NHEL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\scipy\signal_signaltools.py", line 1698, in convolve2d
if _inputs_swap_needed(mode, in1.shape, in2.shape):
File "C:\Users\NHEL\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.9_qbz5n2kfra8p0\LocalCache\local-packages\Python39\site-packages\scipy\signal_signaltools.py", line 84, in _inputs_swap_needed
raise ValueError("For 'valid' mode, one must be at least "
ValueError: For 'valid' mode, one must be at least as large as the other in every dimension

attached input jpeg ::

00t_circ_swatches0__000_000

Many Thanks again -

@andrewekhalel andrewekhalel added the bug Something isn't working label Jul 30, 2023
@andrewekhalel andrewekhalel added the good first issue Good for newcomers label Aug 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants