Home | Develop | Download | Contact
example_array_hog2.cpp
1 
28 #include <cmath>
29 #include <Pds/Ra>
30 #include <Pds/Sp>
31 
32 int main(void)
33 {
34  std::vector<Pds::Array<unsigned char>> Block;
35  Pds::Array<unsigned char> Gray;
36  Pds::Matrix Mag;
37  Pds::Matrix Ang;
38 
39  Block=Pds::Array<unsigned char>::ImportBmpFile("../manual/imagenes/pattern2.bmp");
40 
41  std::cout<<"Block.size(): "<<Block.size()<<std::endl;
42 
43  Gray=Pds::Array<unsigned char>::MeanSampleBlock(Block);
44 
45  Pds::Image::Gradient(Gray,Mag,Ang);
46 
47  Gray.ExportBmpFile(Pds::Colormap::Gray,"pattern_hog2_gray.bmp");
48  Mag.Scale(0,255).ExportBmpFile(Pds::Colormap::Gray,"pattern_hog2_magnitude.bmp");
49  Ang.Scale(0,255).ExportBmpFile(Pds::Colormap::Gray,"pattern_hog2_angle.bmp");
50 
51 
52  return 0;
53 }
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