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

◆ sample()

void radarelab::ScaledIndexMapping::sample ( unsigned beam_count,
unsigned x,
unsigned y,
std::function< void(unsigned, unsigned)> & f )

Generate all the (azimuth, range) indices corresponding to a map point.

Definizione alla linea 134 del file cart.cpp.

135{
136 // Load each sample with a value from a 4x4 window on the original image
137 for(unsigned sy = 0; sy < fullsize_pixels_per_scaled_pixel; ++sy)
138 for(unsigned sx = 0; sx < fullsize_pixels_per_scaled_pixel; ++sx)
139 {
140 // Use the full size mapping to get the volume value at this point
141 int src_x = x * fullsize_pixels_per_scaled_pixel + sx + image_offset;
142 int src_y = y * fullsize_pixels_per_scaled_pixel + sy + image_offset;
143 if (src_x < 0 || src_x >= mapping.beam_size || src_y < 0 || src_y >= mapping.beam_size) continue;
144
145 // Generate all the azimuth/range elements for this point in the
146 // full size map
147 std::function<void(unsigned, unsigned)> fullsize_sample = [&f](unsigned azimuth, unsigned range) {
148 f(azimuth, range);
149 };
150 mapping.sample(beam_count, src_x, src_y, fullsize_sample);
151 }
152}
const unsigned beam_size
Beam size of the volume that we are mapping to cartesian coordinates.
Definition cart.h:24
void sample(unsigned beam_count, unsigned x, unsigned y, std::function< void(unsigned, unsigned)> &f) const
Generate all the (azimuth, range) indices corresponding to a map point.
Definition cart.cpp:44
int image_offset
Image offset in full size pixels.
Definition cart.h:167

Referenzia radarelab::CoordinateMapping::beam_size, image_offset, e radarelab::CoordinateMapping::sample().

Referenziato da map_max_sample().