// ==================================================================== // This file is part of the Endmember Induction Algorithms Toolbox for MATLAB // Copyright (C) Grupo de Inteligencia Computacional, Universidad del // País Vasco (UPV/EHU), Spain, released under the terms of the GNU // General Public License. // // Endmember Induction Algorithms Toolbox is free software: you can redistribute // it and/or modify it under the terms of the GNU General Public License // as published by the Free Software Foundation, either version 3 of the // License, or (at your option) any later version. // // Endmember Induction Algorithms Toolbox is distributed in the hope that it will // be useful, but WITHOUT ANY WARRANTY; without even the implied warranty // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // General Public License for more details. // // You should have received a copy of the GNU General Public License // along with Endmember Induction Algorithms Toolbox. // If not, see . // ==================================================================== function [E] = EIA_CCA(data,p,t) //// [E] = EIA_CCA(data,p,t) // // Manuel Grana // Miguel Angel Veganzones // Grupo de Inteligencia Computacional (GIC), Universidad del Pais Vasco / // Euskal Herriko Unibertsitatea (UPV/EHU) // http://www.ehu.es/computationalintelligence // // Copyright (2011) Grupo de Inteligencia Computacional @ Universidad del Pais Vasco, Spain. // // Convex Cone Analysis (CCA) endmembers induction algorithm. // ------------------------------------------------------------------------------ // Input: hyper : hyperspectral image cube [nrows x ncols x nchannels] // p : number of endmembers to be induced // t : tolerance for numerical errors. By default 10^(-6) // // Output: E : set of induced endmembers [nchannels x p] // // Bibliographical references: // [1] Ifarraguerri, A., “Multispectral and hyperspectral image analysis with convex cones”, Geoscience and Remote Sensing, IEEE Transactions on, vol. 37, nº. 2, págs. 756-770, 1999. //// Parameters if p < 0 p = EIA_HFC(data,10^(-5)); end if t < 0 t = 10^(-6); end //// data size [nvariables,nsamples] = size(data); //// normalization for i=1:nsamples norm_data = norm(data(:,i)); data(:,i) = data(:,i) / norm_data; end //// Correlation matrix and eigen decomposition correlation=data*data'; [V,D]=spec(correlation+0*%i); V=V(:,nvariables-p+1:nvariables); //// Algorithm // num of selected endmembers endmembers_selec=0; // init endmembers set E = zeros(nvariables,p); // algorithm while endmembers_selec

(-t) endmembers_selec=endmembers_selec+1 E(:,endmembers_selec)=x; end end endfunction