29 std::vector<Pds::Matrix> Block;
31 Block=Pds::Matrix::ImportBmpFile(
"imagen1.bmp");
32 unsigned int Nlin=Block[0].Nlin();
33 unsigned int Ncol=Block[0].Ncol();
34 Pds::Matrix X=Pds::Matrix::GetSamples(Block);
35 Block[0].MakeEmpty(); Block[1].MakeEmpty(); Block[2].MakeEmpty();
39 Pds::Array<unsigned int> MAPID;
45 MAPID.Reshape(Nlin,Ncol);
46 MAPID.ExportBmpFile(Pds::Array<unsigned char>(Colors),
"imagen1-kmeans.bmp");
La clase tipo Pds::IterationConf . Esta clase genera una matriz de Nlin lineas y 1 columna....
bool SetMinError(double MinError)
Coloca el valor MinError.
Pds::Matrix Kmeans(Pds::IterationConf &Conf, const std::vector< Pds::Matrix > &Block, unsigned int K, Pds::Array< unsigned int > &IDMAP)
Calculo de los centroides.