Elaboradar 0.1
|
◆ map_max_sample()
Map cartesian cardinates to polar volume indices. When a cartesian coordinate maps to more than one polar value, take the one with the maximum data value. It requires a FullsizeIndexMapping that has been initialized with map_max_sample(). Definizione alla linea 154 del file cart.cpp. 155{
156 // ciclo sui punti della nuova matrice. per il primo prenderò il massimo tra i primi sedici etc..
157 for (unsigned y = 0; y < height; ++y)
158 for (unsigned x = 0; x < width; ++x)
159 {
160 bool first = true;
161 double maxval;
164
165 // Load each sample with a value from a 4x4 window on the original image
166 for(unsigned sy = 0; sy < fullsize_pixels_per_scaled_pixel; ++sy)
167 for(unsigned sx = 0; sx < fullsize_pixels_per_scaled_pixel; ++sx)
168 {
169 // Use the full size mapping to get the volume value at this point
172 if (src_x < 0 || src_x >= mapping.width || src_y < 0 || src_y >= mapping.height) continue;
177
178 // Find the source point with the maximum sample
180 {
181 maxval = sample;
182 maxval_az = az;
183 maxval_range = range;
184 first = false;
185 }
186 }
187
188 // If nothing has been found, skip this sample
189 if (first) continue;
190
191 // Store the indices for this mapping
192 map_azimuth(y, x) = maxval_az;
193 map_range(y, x) = maxval_range;
194 }
195}
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 Matrix2D< double > map_range Range indices to use to lookup a map point in a volume. Definition: cart.h:44 Matrix2D< double > map_azimuth Azimuth indices to use to lookup a map point in a volume. Definition: cart.h:34 void 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. Definition: cart.cpp:134 Referenzia radarelab::PolarScan< T >::get(), image_offset, radarelab::IndexMapping::map_azimuth, radarelab::IndexMapping::map_range, radarelab::IndexMapping::missing, e sample(). |