Home | Develop | Download | Contact
example_array_lbp.cpp

Programa para el testeo de las funciones.Para compilar o código example_array_lbp.cpp:

g++ -static -o example_array_lbp example_array_lbp.cpp -lpdsramm

Para executar o programa:

./example_array_lbp

Retornando por consola:

Block.size(): 3 
Este es la imagen de entrada.


Esta es la imagen LPB.


Esta es la imagen LBPU.

Código example_array_lbp.cpp:

#include <cmath>
#include <Pds/Ra>
#include <Pds/Sp>
int main(void)
{
std::vector<Pds::Array<unsigned char>> Block;
Pds::Array<unsigned char> LBP;
Pds::Array<unsigned char> LBPU;
Block=Pds::Array<unsigned char>::ImportBmpFile("../manual/imagenes/pattern.bmp");
if(Block.size()==0) {std::cout<<"Error\n"; return 0;}
std::cout<<"Block.size(): "<<Block.size()<<std::endl;
LBP=Pds::Image::LBP(Block[0],0);
LBP.ExportBmpFile(Pds::Colormap::Gray,"pattern_lbp.bmp");
LBPU=Pds::Image::LBPU(Block[0],0);
LBPU.ExportBmpFile(Pds::Colormap::Gray,"pattern_lbpu.bmp");
return 0;
}
Pds::Array< unsigned char > LBP(const Pds::Array< unsigned char > &Gray, unsigned int T=0)
Local Binary Patterns : 0->255.
Pds::Array< unsigned char > LBPU(const Pds::Array< unsigned char > &Gray, unsigned int T=0)
Local Binary Patterns Uniforms : 0->58.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed