Home | Develop | Download | Contact
example_array_hog.cpp
1 
25 #include <cmath>
26 #include <Pds/Ra>
27 #include <Pds/Sp>
28 
29 int main(void)
30 {
31  std::vector<Pds::Array<unsigned char>> Block;
32  Pds::Matrix Mag;
33  Pds::Matrix Ang;
34 
35  Block=Pds::Array<unsigned char>::ImportBmpFile("../manual/imagenes/pattern.bmp");
36  if(Block.size()==0) {std::cout<<"Error\n"; return 0;}
37 
38  std::cout<<"Block.size(): "<<Block.size()<<std::endl;
39 
40  Pds::Image::Gradient(Block[0],Mag,Ang);
41 
42  Mag.Scale(0,255).ExportBmpFile(Pds::Colormap::Gray,"pattern_hog_magnitude.bmp");
43  Ang.Scale(0,255).ExportBmpFile(Pds::Colormap::Gray,"pattern_hog_angle.bmp");
44 
45 
46  return 0;
47 }
bool Gradient(const Pds::Array< unsigned char > &Gray, Pds::Matrix &Mag, Pds::Matrix &Angle)
Cálculo del gradiente.

Enlaces de interés

HomePage Bazaar Download Bug report Ayuda Developer Feed