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

◆ to_cart() [2/2]

template<typename T >
void radarelab::IndexMapping::to_cart ( const std::function< T(unsigned, unsigned)> &  src,
Matrix2D< T > &  dst 
) const
inline

Fill the cartesian map dst with the output of the function src(azimuth, range)

Definizione alla linea 109 del file cart.h.

110 {
111 // In case dst is not a square with side beam_size*2, center it
112 int dx = ((int)width - dst.cols()) / 2;
113 int dy = ((int)height - dst.rows()) / 2;
114
115 for (unsigned y = 0; y < dst.rows(); ++y)
116 {
117 if (y + dy < 0 || y + dy >= height) continue;
118
119 for (unsigned x = 0; x < dst.cols(); ++x)
120 {
121 if (x + dx < 0 || x + dx >= width) continue;
122
123 auto azimuth = map_azimuth(y + dy, x + dx);
124 auto range = map_range(y + dy, x + dx);
125
126 if (azimuth == missing || range == missing) continue;
127 dst(y, x) = src(azimuth, range);
128 }
129 }
130 }
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 map_azimuth, map_range, e missing.