Elaboradar  0.1
top.h
Vai alla documentazione di questo file.
1 
5 #ifndef RADARELAB_ALGO_TOP_H
6 #define RADARELAB_ALGO_TOP_H
7 
8 #include <radarelab/volume.h>
9 
10 namespace radarelab {
11 namespace algo {
12 
13 template<typename T>
14 void compute_top(const Volume<T>& volume, T threshold, Matrix2D<unsigned char>& top)
15 {
16  top.fill(0);
17 
18  for (unsigned l=0; l < volume.size(); ++l)
19  {
20  const auto& scan = volume[l];
21  for (unsigned i = 0; i < scan.beam_count; ++i)
22  {
23  const double elevaz = scan.elevations_real(i); //--- elev reale in gradi
24  for (unsigned k = 0; k < scan.beam_size; ++k)
25  if (scan.get(i, k) > threshold)
26  //top in ettometri
27  top(i, k) = (unsigned char)(PolarScanBase::sample_height(
28  elevaz, (k + 0.5) * scan.cell_size) / 100.);
29  }
30  }
31 }
32 
33 }
34 }
35 
36 #endif
37 
String functions.
Definition: cart.cpp:4
double sample_height(unsigned cell_idx) const
Return the height (in meters) of the sample at the given cell indexa.
Definition: volume.cpp:37
Definisce le principali strutture che contengono i dati.