Skip to content

Using mask with end member extraction algorithm returns wrong index? #5

Description

@dennisai

If I use a mask for the end member extraction algorithm (e.g. FIPPI), then it calls the compress method on the HSI cube. I've pasted the source code below.

def _compress(vec, mask):
    n = np.sum(mask)
    cmp = np.ndarray((n, vec.shape[1]), dtype=np.float)
    i = 0
    for j in range(mask.shape[0]):
        if mask[j] == 1:
            cmp[i] = vec[j]
            i += 1
    return cmp

Then if we get the indexes of the endmembers later on, won't be computing the wrong indexes, since the index i will pertain to the compressed array (see code below)?

self.E, self.idx = eea.FIPPI(cM, q=q, maxit=maxit)
self.idx3D = [(i % self.w, i // self.w) for i in self.idx]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions