Elaboradar  0.1
 Tutto Classi Namespace File Funzioni Variabili Tipi enumerati (enum) Gruppi
void radarelab::FullsizeIndexMapping::map_max_sample ( const PolarScan< double > &  scan,
const CoordinateMapping mapping 
)

Same as map_max_sample(PolarScan), but reuse an existing CoordinateMapping.

Definizione alla linea 94 del file cart.cpp.

Referenzia radarelab::PolarScanBase::beam_count, radarelab::PolarScan< T >::get(), radarelab::IndexMapping::map_azimuth, radarelab::IndexMapping::map_range, e radarelab::CoordinateMapping::sample().

95 {
96  for (unsigned y = 0; y < height; ++y)
97  for (unsigned x = 0; x < width; ++x)
98  {
99  bool first = true;
100  double maxval;
101  unsigned maxval_azimuth;
102  unsigned maxval_range;
103  std::function<void(unsigned, unsigned)> f = [&](unsigned azimuth, unsigned range) {
104  double sample = scan.get(azimuth, range);
105  if (first || sample > maxval)
106  {
107  maxval = sample;
108  maxval_azimuth = azimuth;
109  maxval_range = range;
110  first = false;
111  }
112  };
113  mapping.sample(scan.beam_count, x, y, f);
114 
115  // If nothing has been found, skip this sample
116  if (first) continue;
117 
118  // Store the indices for this mapping
119  map_azimuth(y, x) = maxval_azimuth;
120  map_range(y, x) = maxval_range;
121  }
122 }
Matrix2D< unsigned > map_range
Range indices to use to lookup a map point in a volume -1 means no mapping.
Definition: cart.h:76
Matrix2D< unsigned > map_azimuth
Azimuth indices to use to lookup a map point in a volume -1 means no mapping.
Definition: cart.h:73