Elaboradar 0.1
Caricamento in corso...
Ricerca in corso...
Nessun risultato

◆ to_cart() [1/2]

template<typename SRC , typename DST >
void radarelab::IndexMapping::to_cart ( const PolarScan< SRC > & src,
Matrix2D< DST > & dst ) const
inline

Copy data from the polar scan src to the cartesian map dst.

Definizione alla linea 82 del file cart.h.

83 {
84 // In case dst is not a square with side beam_size*2, center it
85 int dx = ((int)width - dst.cols()) / 2;
86 int dy = ((int)height - dst.rows()) / 2;
87
88 for (unsigned y = 0; y < dst.rows(); ++y)
89 {
90 if (y + dy < 0 || y + dy >= height) continue;
91
92 for (unsigned x = 0; x < dst.cols(); ++x)
93 {
94 if (x + dx < 0 || x + dx >= width) continue;
95
96 auto azimuth = map_azimuth(y + dy, x + dx);
97 auto range = map_range(y + dy, x + dx);
98
99 if (azimuth == missing || range == missing) continue;
100 if (azimuth >= src.beam_count || range >= src.beam_size) continue;
101
102 dst(y, x) = src(azimuth, range);
103 }
104 }
105 }
static const unsigned missing
Missing value in the azimuth and range index mappings.
Definition cart.h:66
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

Referenzia radarelab::PolarScanBase::beam_count, radarelab::PolarScanBase::beam_size, map_azimuth, map_range, e missing.