Fills a connected region with a given value. More...
#include <vil/vil_image_view.h>
#include <vcl_vector.h>
#include <vcl_utility.h>
#include <vil/vil_chord.h>
Go to the source code of this file.
Functions | |
template<class T > | |
void | vil_flood_fill_row (vil_image_view< T > &image, unsigned i, unsigned j, T v, T new_v, unsigned &ilo, unsigned &ihi) |
Search along i direction either side for limits of pixels matching v. | |
template<class T > | |
void | vil_flood_fill4 (vil_image_view< T > &image, unsigned seed_i, unsigned seed_j, T v, T new_v) |
Flood fill on a 4-connected region. | |
template<class T > | |
void | vil_flood_fill4 (vil_image_view< T > &image, unsigned seed_i, unsigned seed_j, T v, T new_v, vcl_vector< vil_chord > ®ion) |
Flood fill on a 4-connected region, and record region. | |
template<class T > | |
void | vil_flood_fill8 (vil_image_view< T > &image, unsigned seed_i, unsigned seed_j, T v, T new_v) |
Flood fill on a 8-connected region. | |
template<class T > | |
void | vil_flood_fill8 (vil_image_view< T > &image, unsigned seed_i, unsigned seed_j, T v, T new_v, vcl_vector< vil_chord > ®ion) |
Flood fill on a 8-connected region, and record region. |
Fills a connected region with a given value.
Definition in file vil_flood_fill.h.
void vil_flood_fill4 | ( | vil_image_view< T > & | image, |
unsigned | seed_i, | ||
unsigned | seed_j, | ||
T | v, | ||
T | new_v | ||
) |
Flood fill on a 4-connected region.
Find every point in 4-connected region with values image(i,j)==v containing (seed_i,seed_j), and change their values to new_v
Note, currently uses inefficient (x,y) access to image. Could be improved using fast pointer access to work along the rows.
Definition at line 41 of file vil_flood_fill.h.
void vil_flood_fill4 | ( | vil_image_view< T > & | image, |
unsigned | seed_i, | ||
unsigned | seed_j, | ||
T | v, | ||
T | new_v, | ||
vcl_vector< vil_chord > & | region | ||
) |
Flood fill on a 4-connected region, and record region.
Find every point in 4-connected region with values image(i,j)==v containing (seed_i,seed_j), and change their values to new_v
On exit region is filled with a set of image chords which cover the region.
Note, currently uses inefficient (x,y) access to image. Could be improved using fast pointer access to work along the rows.
Definition at line 94 of file vil_flood_fill.h.
void vil_flood_fill8 | ( | vil_image_view< T > & | image, |
unsigned | seed_i, | ||
unsigned | seed_j, | ||
T | v, | ||
T | new_v | ||
) |
Flood fill on a 8-connected region.
Find every point in 8-connected region with values image(i,j)==v containing (seed_i,seed_j), and change their values to new_v
Note, currently uses inefficient (x,y) access to image. Could be improved using fast pointer access to work along the rows.
Definition at line 149 of file vil_flood_fill.h.
void vil_flood_fill8 | ( | vil_image_view< T > & | image, |
unsigned | seed_i, | ||
unsigned | seed_j, | ||
T | v, | ||
T | new_v, | ||
vcl_vector< vil_chord > & | region | ||
) |
Flood fill on a 8-connected region, and record region.
Find every point in 8-connected region with values image(i,j)==v containing (seed_i,seed_j), and change their values to new_v
On exit region is filled with a set of image chords which cover the region.
Note, currently uses inefficient (x,y) access to image. Could be improved using fast pointer access to work along the rows.
Definition at line 205 of file vil_flood_fill.h.
void vil_flood_fill_row | ( | vil_image_view< T > & | image, |
unsigned | i, | ||
unsigned | j, | ||
T | v, | ||
T | new_v, | ||
unsigned & | ilo, | ||
unsigned & | ihi | ||
) | [inline] |
Search along i direction either side for limits of pixels matching v.
Fills in all such pixels with new_v. Returns limits in ilo and ihi
Definition at line 17 of file vil_flood_fill.h.