Comments (4)
Hello @jianyuan2015,
Would you please supply the codes you are comparing to?
from sewar.
In my opinion, if the size of input data GT is "[M, N, K]", where K is number of spectral band, the code shouble be like this:
GT = GT.reshape((GT.shape[0]*GT.shape[1],GT.shape[2]))
P = P.reshape((P.shape[0]*P.shape[1],P.shape[2]))
N = GT.shape[0]
sam_angles = np.zeros(N)
for i in range(GT.shape[0]):
val = np.clip(np.dot(GT[i,:],P[i,:]) / (np.linalg.norm(GT[i,:])*np.linalg.norm(P[i,:])),-1,1)
sam_angles[i] = np.arccos(val)
from sewar.
Hi @fkmajiji,
I think the current implementation is the correct one. We use the K (spectral band) as N. See example Matlab implementation here.
Closing this now. Feel free to reopen if you disagree
from sewar.
I'm sorry, I saw the example Matlab implementation you mentioned and still think the current implementation is not correct. The introduction of Matlab function in https://github.com/davidkun/HyperSpectralToolbox/tree/master/functions has said "N The total number of pixels." and "p Number of bands."
from sewar.
Related Issues (20)
- Compare two images HOT 3
- About ERGAS HOT 3
- cs value
- 无参考图像质量评价,为什么还需要两个图片? HOT 1
- Trying to use SAM as a loss metric in KERAS HOT 1
- Request for additional metric (q2n: Q4/Q8)
- Request for additional metric (q2n: Q4/Q8) HOT 4
- Divide by zero error/warning in RASE HOT 1
- Errors in reference and code for spectral distortion index
- No module named sewar HOT 1
- How to calculate the SSIM between two images HOT 1
- circular import problem HOT 4
- Hi Andrew, should all inputs be np.unit8 or np.float, maybe they should be normalized to 0~1. Thanks a lot. HOT 1
- ERGAS extremely high HOT 2
- second output (loop) is not consistent anymore SSIM HOT 1
- A Question about "rmse_sw"
- full_ref.msssim() and aspect ratio of images
- Add command-line support for No-reference metrics HOT 2
- pip install swear will not install the package
- Make it clear that metric functions expect Numpy arrays as input
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sewar.