45 Pds::Array<unsigned char> A(L,L);
49 Pds::Matrix(A).Scale(0,255).ExportBmpFile(Pds::Colormap::Gray,
"A-binary-circle.bmp");
52 Pds::Array<unsigned int> ID;
58 Pds::Matrix(ID).Scale(0,255).ExportBmpFile(Pds::Colormap::Steps,
"A-id-circle.bmp");
61 std::vector<std::vector<Pds::Position>> Data;
66 for(
unsigned int i=0;i<Data.size();i++)
69 unsigned int Area=Data[i].size();
71 std::cout<<
"Perimeter["<<i<<
"]:\t"<<Per<<
"\t";
72 std::cout<<
" Area["<<i<<
"]:\t"<<Area<<
"\t";
73 std::cout<<
" Gamma["<<i<<
"]:\t"<<(Per/2.0)/sqrt(Area*Pds::Ra::Pi)<<
"\n";
bool LoadDataCircles(Pds::Array< unsigned char > &BW, unsigned int L=4, double Offset=1)
Generando datos de grupos de 1s formando circulos.
double PerimeterOfConvexGroup(const std::vector< Pds::Position > &Group)
Calcula el perimetro de un grupo si este es convexo. EL perimetro es calculado usando un criterio de ...
std::vector< std::vector< Pds::Position > > VectorGroupFromIdMap(const Pds::Array< unsigned int > &ID_MAP)
Retorna todos los grupos de posiciones (std::vector<Pds::Position>) agrupados en un vector (std:vecto...
Pds::Array< unsigned int > IdMapUsingCC4(const Pds::Array< unsigned char > &BW)
Connected-component labeling para 4 conectividad.