
## This program 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.

## This program 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 this program.  If not, see <http://www.gnu.org/licenses/>.



If you use these functions, please cite our work:

ARCHETYPAL ANALYSIS: AN ALTERNATIVE TO CLUSTERING FOR UNSUPERVISED TEXTURE SEGMENTATION

The following data and functions are used for obtaining the results:

-INTRODUCTION:

*iexample.R: functions for the toy example in the Introduction.

-SECTION RESULTS: 

	Illustrative example

	*Data: orojo.tif, overde.tif, oazul.tif

	*Functions:
 	  -localgranulometries.m computes the local granulometries of the data in Matlab. They are save on file mfdgrsq294curvas50.txt
  	  -AAlocalgra.R computes in R the archetypes of the local granulometries and obtain the results of the segmentation
  	  -clusterlocalgra.R makes the comparison with the classical unsupervised learning procedures.

-SUBSECTION APPLICATION: (the first file correspond with the first orthophoto, and the second file to the second orthophoto)

	*Data: or13.tif, ortofoto3.tif

	*Functions: 
		-gabor_orto.m, gabor_orto2.m: it makes the segmentation with Gabor filters.
		-localgranulometries_orto.m, localgranulometries_orto2.m: computes the granulometries of a sample in Matlab. They are saved on files mfdgrsq572curvas50.txt and mfdgrsqcurvas50_orto2.txt.
                -localgranulometries_orto_all.m, localgranulometries_orto2_all.m: computes the granulometries for image segmentation in Matlab. They are saved on mfdall_orto.txt and mfdall_orto2.txt.
                  It also displays the segmentation.
                -class_all_orto.R, class_all_orto2.R: computes AA in R and obtain the segmentation. They are saved on eallorto4.txt and eallorto2.txt
                  It also computes the segmentation with clustering. They are saved on eallortok4.txt and eallorto2k.txt 