// 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.
//// Arguments
[lhs,rhs]=argn(0);
if lhs < 1
error('Insuficient parameters');
end
if lhs < 2
p = EIA_HFC(data,10^(-5));
end
if p < 0
p = EIA_HFC(data,10^(-5));
end
if lhs < 3
t = 10^(-6);
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