Code Monkey home page Code Monkey logo

Comments (4)

andrewekhalel avatar andrewekhalel commented on September 2, 2024

Hello @jianyuan2015,

Would you please supply the codes you are comparing to?

from sewar.

fkmajiji avatar fkmajiji commented on September 2, 2024

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.

andrewekhalel avatar andrewekhalel commented on September 2, 2024

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.

fkmajiji avatar fkmajiji commented on September 2, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.