vil_image_view< T > Class Template Reference

#include <vil_image_view.h>

Inheritance diagram for vil_image_view< T >:

Inheritance graph
[legend]

List of all members.


Detailed Description

template<class T>
class vil_image_view< T >

Concrete view of image data of type T held in memory.

Views nplanes() planes of data each of size ni() x nj(). The (i,j) element of the p'th plane is given by im.top_left_ptr()[i*im.istep() + j*im.jstep() + p*im.planestep] The actual image data is either allocated by the class (using set_size), in which case it is deleted only when it has no views observing it, or is allocated outside (and is not deleted on destruction). This allows external images to be accessed without a deep copy.

Note that copying one vil_image_view<T> to another takes a shallow copy by default - it copies the view, not the raw image data. Use the explicit deep_copy() call to take a deep copy.

Definition at line 40 of file vil_image_view.h.


Public Types

typedef T pixel_type
 The pixel type of this image.
typedef T * iterator
typedef T const * const_iterator

Public Member Functions

 vil_image_view ()
 Dflt ctor.
 vil_image_view (unsigned ni, unsigned nj, unsigned n_planes=1, unsigned n_interleaved_planes=1)
 Create an image of ni x nj pixels in (n_planes * n_interleaved_planes) planes.
 vil_image_view (const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t plane_step)
 Set this view to look at someone else's memory data.
 vil_image_view (const vil_memory_chunk_sptr &mem_chunk, const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t plane_step)
 Set this view to look at another view's data.
 vil_image_view (const vil_image_view< T > &rhs)
 Copy construct.
 vil_image_view (const vil_image_view_base &rhs)
 Construct from various vil_image_view types.
 vil_image_view (const vil_image_view_base_sptr &rhs)
 Construct from various vil_image_view types.
virtual ~vil_image_view ()
bool is_contiguous () const
 True if data all in one unbroken block and top_left_ptr() is lowest data address.
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
T * top_left_ptr ()
 Pointer to the first (top left in plane 0) pixel.
const T * top_left_ptr () const
 Pointer to the first (top left in plane 0) pixel.
vcl_ptrdiff_t istep () const
 Add this to your pixel pointer to get next i pixel.
vcl_ptrdiff_t jstep () const
 Add this to your pixel pointer to get next j pixel.
vcl_ptrdiff_t planestep () const
 Add this to your pixel pointer to get pixel on next plane.
 operator safe_bool () const
 Cast to bool is true if pointing at some data.
bool operator! () const
 Return false if pointing at some data.
unsigned size_bytes () const
 The number of bytes in the data.
const vil_memory_chunk_sptrmemory_chunk () const
 Smart pointer to the object holding the data for this view.
vil_memory_chunk_sptrmemory_chunk ()
 Smart pointer to the object holding the data for this view.
bool in_range (int i, int j) const
 Return true if (i,j) is a valid index into this buffer.
bool in_range (int i, int j, int p) const
 Return true if (i,j,p) is a valid index into this buffer.
const T & operator() (unsigned i, unsigned j) const
 Return read-only reference to pixel at (i,j) in plane 0.
T & operator() (unsigned i, unsigned j)
 Return read/write reference to pixel at (i,j) in plane 0.
const T & operator() (unsigned i, unsigned j, unsigned p) const
 Return read-only reference to pixel at (i,j) in plane p.
T & operator() (unsigned i, unsigned j, unsigned p)
 Return read-only reference to pixel at (i,j) in plane p.
virtual void set_size (unsigned ni, unsigned nj)
 resize current planes to ni x nj.
virtual void set_size (unsigned ni, unsigned nj, unsigned nplanes)
 resize to ni x nj x nplanes.
void deep_copy (const vil_image_view< T > &src)
 Make a copy of the data in src and set this to view it.
void clear ()
 Make empty.
void set_to_memory (const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, vcl_ptrdiff_t i_step, vcl_ptrdiff_t j_step, vcl_ptrdiff_t plane_step)
 Set this view to look at someone else's memory data.
void fill (T value)
 Fill view with given value.
virtual void print (vcl_ostream &) const
 Print a 1-line summary of contents.
virtual vcl_string is_a () const
 Return class name.
virtual bool is_class (vcl_string const &s) const
 True if this is (or is derived from) class s.
vil_pixel_format pixel_format () const
 Return a description of the concrete data pixel type.
bool operator== (const vil_image_view_base &other) const
 True if they share same view of same image data.
bool operator!= (const vil_image_view_base &rhs) const
 True if they do not share same view of same image data.
bool operator< (const vil_image_view_base &rhs) const
 Provides an ordering.
bool operator>= (const vil_image_view_base &rhs) const
 Provides an ordering.
bool operator> (const vil_image_view_base &rhs) const
 Provides an ordering.
bool operator<= (const vil_image_view_base &rhs) const
 Provides an ordering.
const vil_image_view< T > & operator= (const vil_image_view< T > &rhs)
 Copy a view. The rhs and lhs will point to the same image data.
const vil_image_view< T > & operator= (const vil_image_view_base &rhs)
 Copy a view. The rhs and lhs will point to the same image data.
const vil_image_view< T > & operator= (const vil_image_view_base_sptr &rhs)
 Copy a view. The rhs and lhs will point to the same image data.
unsigned ni () const
 Width.
unsigned nj () const
 Height.
unsigned nplanes () const
 Number of planes.
unsigned long size () const
 The number of pixels.

Protected Member Functions

void release_memory ()
 Disconnect this view from the underlying data,.

Protected Attributes

T * top_left_
 Pointer to pixel at origin.
vcl_ptrdiff_t istep_
 Add this to a pixel pointer to move one column left.
vcl_ptrdiff_t jstep_
 Add this to a pixel pointer to move one row down.
vcl_ptrdiff_t planestep_
 Add this to a pixel pointer to move one plane back.
vil_memory_chunk_sptr ptr_
 Reference to actual image data.
unsigned ni_
 Number of columns.
unsigned nj_
 Number of rasters.
unsigned nplanes_
 Number of planes.

Private Attributes

 VCL_SAFE_BOOL_DEFINE

Related Functions

(Note that these are not member functions.)

template<class S, class T>
void vil_cartesian_differential_invariants_3 (const vil_image_view< S > &src, vil_image_view< T > &dest, double scale, unsigned max_kernel_width=0)
 Compute up to 3rd order C.d.i. of an image.
template<class srcT, class destT, class kernelT, class accumT>
void vil_convolve_1d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
 Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.
template<class srcT, class destT, class kernelT, class accumT>
void vil_convolve_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const vil_image_view< kernelT > &kernel, accumT ac)
 Convolve kernel with srcT.
void vil_corners (const vil_image_view< float > &grad_i, const vil_image_view< float > &grad_j, vil_image_view< float > &dest, double k)
 Compute Forstner/Harris corner strength function given gradient images.
void vil_corners_rohr (const vil_image_view< float > &grad_i, const vil_image_view< float > &grad_j, vil_image_view< float > &dest)
 Compute corner strength using Rohr's recommended method.
template<class T>
void vil_corners (const vil_image_view< T > &src, vil_image_view< float > &dest, double k=0.04)
 Compute Harris corner strength function.
template<class T>
void vil_corners_rohr (const vil_image_view< T > &src, vil_image_view< float > &dest)
 Compute corner strength using Karl Rohr's recommended method.
template<class srcT, class destT, class kernelT, class accumT>
void vil_correlate_1d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const kernelT *kernel, vcl_ptrdiff_t k_lo, vcl_ptrdiff_t k_hi, accumT ac, vil_convolve_boundary_option start_option, vil_convolve_boundary_option end_option)
 correlate kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.
template<class srcT, class kernelT, class accumT>
accumT vil_correlate_2d_at_pt (const srcT *src_im, vcl_ptrdiff_t s_istep, vcl_ptrdiff_t s_jstep, vcl_ptrdiff_t s_pstep, const vil_image_view< kernelT > &kernel, accumT)
 Evaluate dot product between kernel and src_im.
template<class srcT, class destT, class kernelT, class accumT>
void vil_correlate_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const vil_image_view< kernelT > &kernel, accumT ac)
 Correlate kernel with srcT.
void vil_distance_transform (vil_image_view< float > &image)
 Compute distance function from zeros in original image.
void vil_distance_transform_one_way (vil_image_view< float > &image)
 Compute directed distance function from zeros in original image.
void vil_distance_transform (const vil_image_view< bool > &mask, vil_image_view< float > &distance_image, float max_dist)
 Compute distance function from true elements in mask.
void vil_distance_transform_r2 (vil_image_view< float > &image)
 Compute distance function from zeros in original image.
template<class T>
void vil_dog_filter_5tap (const vil_image_view< T > &src_im, vil_image_view< T > &smooth_im, vil_image_view< T > &dog_im, double sigma)
 Smooth source with gaussian filter and compute difference.
template<class T>
void vil_dog_pyramid (const vil_image_view< T > &src_image, vcl_vector< vil_image_view< T > > &smooth_pyramid, vcl_vector< vil_image_view< T > > &dog_pyramid, unsigned min_size)
 Compute a pyramid of difference of gaussian images.
bool vil_exact_distance_transform_maurer (vil_image_view< vxl_uint_32 > &im)
 Linear-time, 2D exact Euclidean distance transform (Maurer's Algorithm).
bool vil_exact_distance_transform_maurer_label (vil_image_view< vxl_uint_32 > &im, vil_image_view< vxl_uint_32 > &imlabel)
 Same as vil_exact_distance_transform_maurer, but also returns a label array indicating the closest 0-pixel.
bool vil_exact_distance_transform_saito (vil_image_view< vxl_uint_32 > &im, unsigned plane_idx=0)
 Cubic-time, exact Euclidean distance transform (Saito's algorithm).
bool vil_exact_distance_transform_saito (vil_image_view< vxl_uint_32 > &im, unsigned plane_idx, const vcl_vector< unsigned > &sq)
 Overload that assumes given a Lookup table of integer squares.
bool vil_exact_distance_transform_saito_3D (vil_image_view< vxl_uint_32 > &im)
 Exact 3D EDT.
bool vil_exact_distance_transform_signed (vil_image_view< vxl_uint_32 > &input_image, vil_image_view< float > &signed_edt_image)
 Computes signed Euclidean distance transform by using the unsigned EDT of an image and its binary complement.
bool vil_exact_distance_transform_brute_force (vil_image_view< vxl_uint_32 > &im)
 Naive implementation of exact Euclidean distance transform (for ground-truth).
bool vil_exact_distance_transform_brute_force_with_list (vil_image_view< vxl_uint_32 > &im)
 Another Naive implementation of exact Euclidean distance transform (for ground-truth).
bool vil_exact_distance_transform_brute_force_with_list_label (vil_image_view< vxl_uint_32 > &im, vil_image_view< vxl_uint_32 > &imlabel)
 Same as vil_exact_distance_transform_brute_force_with_list, but also returns a label array indicating the closest 0-pixel.
void vil_exact_distance_transform_1d_horizontal (vil_image_view< vxl_uint_32 > &im)
 Row-wise 1D EDT.
template<class srcT, class destT, class accumT>
void vil_exp_filter_i (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential filter along i to src_im to produce dest_im.
template<class srcT, class destT, class accumT>
void vil_exp_filter_j (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential filter along j to src_im to produce dest_im.
template<class srcT, class destT, class accumT>
void vil_exp_filter_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT ki, accumT kj)
 Apply exponential filter along i and j to src_im to produce dest_im.
template<class srcT, class destT, class accumT>
void vil_exp_grad_filter_i (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential gradient filter to src_im (along i direction).
template<class srcT, class destT, class accumT>
void vil_exp_grad_filter_j (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, accumT k)
 Apply exponential gradient filter to src_im (along j direction).
template<class T>
void vil_find_peaks_3x3 (vcl_vector< unsigned > &pi, vcl_vector< unsigned > &pj, const vil_image_view< T > &image, const T &min_thresh, bool clear_list=true)
 Return (pi,pj) for all points in image strictly above their 8 neighbours.
template<class T>
void vil_find_peaks_3x3_subpixel (vcl_vector< double > &px, vcl_vector< double > &py, vcl_vector< double > &val, const vil_image_view< T > &image, const T &min_thresh, bool clear_list=true)
 Return sub-pixel (px,py,val) for all points in image strictly above their 8 neighbours.
template<class T>
void vil_find_plateaus_3x3 (vcl_vector< unsigned > &pi, vcl_vector< unsigned > &pj, const vil_image_view< T > &image, const T &min_thresh, bool clear_list=true)
 Return (pi,pj) for all points in image greater than or equal to all 8 neighbours.
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 > &region)
 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 > &region)
 Flood fill on a 8-connected region, and record region.
template<class T>
void vil_gauss_reduce (const vil_image_view< T > &src, vil_image_view< T > &dest, vil_image_view< T > &work_im)
 Smooth and subsample src_im to produce dest_im.
template<class T>
void vil_gauss_reduce_2_3 (const vil_image_view< T > &src_im, vil_image_view< T > &dest_im, vil_image_view< T > &work_im)
 Smooth and subsample src_im to produce dest_im (2/3 size).
template<class T>
void vil_gauss_reduce_121 (const vil_image_view< T > &src, vil_image_view< T > &dest)
 Smooth and subsample src_im to produce dest_im.
template<class T>
void vil_gauss_reduce_general (const vil_image_view< T > &src_im, vil_image_view< T > &dest_im, const vil_gauss_reduce_params &params)
 Smooth and subsample src_im by an arbitrary factor to produce dest_im.
template<class T>
void vil_grid_merge (const vil_image_view< T > &image1, const vil_image_view< T > &image2, vil_image_view< T > &dest_image, unsigned box_ni, unsigned box_nj)
 Merge two images in a chequer-board pattern.
template<class T>
void vil_histogram (const vil_image_view< T > &image, vcl_vector< double > &histo, double min, double max, unsigned n_bins)
 Construct histogram from pixels in given image.
void vil_histogram_byte (const vil_image_view< vxl_byte > &image, vcl_vector< double > &histo)
 Construct histogram from pixels in given image of bytes.
void vil_histogram_equalise (vil_image_view< vxl_byte > &image)
 Apply histogram equalisation to given image.
template<class srcT, class kernelT, class accumT>
accumT vil_norm_corr_2d_at_pt (const srcT *src_im, vcl_ptrdiff_t s_istep, vcl_ptrdiff_t s_jstep, vcl_ptrdiff_t s_pstep, const vil_image_view< kernelT > &kernel, accumT)
 Evaluate dot product between kernel and src_im.
template<class srcT, class destT, class kernelT, class accumT>
void vil_normalised_correlation_2d (const vil_image_view< srcT > &src_im, vil_image_view< destT > &dest_im, const vil_image_view< kernelT > &kernel, accumT ac)
 Normalised cross-correlation of (pre-normalised) kernel with srcT.
void vil_orientations (const vil_image_view< float > &grad_i, const vil_image_view< float > &grad_j, vil_image_view< float > &orient_im, vil_image_view< float > &grad_mag)
 Compute orientation (in radians) and gradient magnitude at each pixel.
void vil_orientations (const vil_image_view< float > &grad_i, const vil_image_view< float > &grad_j, vil_image_view< vxl_byte > &orient_im, vil_image_view< float > &grad_mag, unsigned n_orientations=256)
 Compute discrete orientation and gradient magnitude at each pixel.
void vil_orientations_at_edges (const vil_image_view< float > &grad_i, const vil_image_view< float > &grad_j, vil_image_view< vxl_byte > &orient_im, vil_image_view< float > &grad_mag, float grad_threshold, unsigned n_orientations=255)
 Compute discrete orientation and gradient magnitude at edge pixels.
template<class T>
void vil_orientations_from_sobel (const vil_image_view< T > &src_image, vil_image_view< float > &orient_im, vil_image_view< float > &grad_mag)
 Compute orientation and gradient magnitude using sobel to get gradients.
template<class T>
void vil_orientations_from_sobel (const vil_image_view< T > &src_image, vil_image_view< vxl_byte > &orient_im, vil_image_view< float > &grad_mag, unsigned n_orientations=256)
 Compute discrete orientation and gradient using sobel operations.
template<class srcT, class destT>
void vil_quad_distance_function (const vil_image_view< srcT > &src, double ai, double aj, vil_image_view< destT > &dest)
 Apply quadratic distance transform along each row of src.
template<class srcT, class destT, class posT>
void vil_quad_distance_function (const vil_image_view< srcT > &src, double ai, double aj, vil_image_view< destT > &dest, vil_image_view< posT > &pos)
 Apply quadratic distance transform along each row of src.
template<class srcT, class destT>
void vil_sobel_1x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_i, vil_image_view< destT > &grad_j)
 Compute gradients of an image using 1x3 Sobel filters.
template<class srcT, class destT>
void vil_sobel_1x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_ij)
 Compute gradients of an image using 1x3 Sobel filters.
template<class srcT, class destT>
void vil_sobel_3x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_i, vil_image_view< destT > &grad_j)
 Compute gradients of an image using 3x3 Sobel filters.
template<class srcT, class destT>
void vil_sobel_3x3 (const vil_image_view< srcT > &src, vil_image_view< destT > &grad_ij)
 Compute gradients of an image using 3x3 Sobel filters.
template<class T>
void vil_suppress_non_max_3x3 (const vil_image_view< T > &src_im, vil_image_view< T > &dest_im, T threshold=0, T non_max_value=0)
 Suppress all non-maximal (non peaks) pixels in the image.
template<class srcT, class destT>
void vil_suppress_non_max_edges (const vil_image_view< srcT > &grad_i, const vil_image_view< srcT > &grad_j, double grad_mag_threshold, vil_image_view< destT > &grad_mag)
 Given gradient images, computes magnitude image containing maximal edges.
template<class srcT, class destT>
void vil_suppress_non_max_edges_subpixel (const vil_image_view< srcT > &grad_i, const vil_image_view< srcT > &grad_j, double grad_mag_threshold, vil_image_view< destT > &grad_mag_orient_offset)
 Given gradient images, computes a subpixel edgemap with magnitudes and orientations.
template<class T>
void vil_suppress_non_plateau_3x3 (const vil_image_view< T > &src_im, vil_image_view< T > &dest_im, T threshold=0, T non_max_value=0)
 Suppress all non-plateau pixels in the image.
template<class srcT>
void vil_threshold_above (const vil_image_view< srcT > &src, vil_image_view< bool > &dest, srcT t)
 Apply threshold such that dest(i,j,p)=true if src(i,j,p)>=t.
template<class srcT>
void vil_threshold_below (const vil_image_view< srcT > &src, vil_image_view< bool > &dest, srcT t)
 Apply threshold such that dest(i,j,p)=true if src(i,j,p)<=t.
template<class srcT>
void vil_threshold_inside (const vil_image_view< srcT > &src, vil_image_view< bool > &dest, srcT t0, srcT t1)
 Apply threshold such that dest(i,j,p)=true if t0<=src(i,j,p)<=t1.
template<class srcT>
void vil_threshold_outside (const vil_image_view< srcT > &src, vil_image_view< bool > &dest, srcT t0, srcT t1)
 Apply threshold such that dest(i,j,p)=true if src(i,j,p)<=t0 or src(i,j,p)>=t1.
template<class T>
void vil_tile_images (vil_image_view< T > &big_image, const vcl_vector< vil_image_view< T > > &patches)
 Create a big image by tiling images in patches (must be of same size).
void vil_trace_4con_boundary (vcl_vector< int > &bi, vcl_vector< int > &bj, const vil_image_view< bool > &image, int i0, int j0)
 Trace 4-connected boundary around region in boolean image.
void vil_trace_8con_boundary (vcl_vector< int > &bi, vcl_vector< int > &bj, const vil_image_view< bool > &image, int i0, int j0)
 Trace 8-connected boundary around region in boolean image.
template<class T>
void vsl_b_write (vsl_b_ostream &os, const vil_image_view< T > &image)
 Binary save vil_image_view<T> to stream.
template<class T>
void vsl_b_read (vsl_b_istream &is, vil_image_view< T > &image)
 Binary load vil_image_view<T> from stream.
template<class T>
void vsl_b_read (vsl_b_istream &is, vil_image_view< T > *&p)
 Binary load vil_image_view<T> from stream onto the heap.
template<class T>
void vsl_print_summary (vcl_ostream &os, const vil_image_view< T > &image)
 Print human readable summary of a vil_image_view<T> object to a stream.
template<class T>
double vil_bicub_interp_safe (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bicubic interpolation at (x,y), with bound checks.
template<class T>
double vil_bicub_interp (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bicubic interpolation at (x,y), with minimal bound checks.
template<class T>
double vil_bicub_interp_safe_extend (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bicubic interpolation at (x,y), with bound checks.
template<class T>
double vil_bilin_interp_safe (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bilinear interpolation at (x,y), with bound checks.
template<class T>
double vil_bilin_interp (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bilinear interpolation at (x,y), with minimal bound checks.
template<class T>
double vil_bilin_interp_safe_extend (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute bilinear interpolation at (x,y), with bound checks.
template<class T>
void vil_clamp (const vil_image_view< T > &src, vil_image_view< T > &dest, T lo, T hi)
 Clamp an image view between two values.
template<class T>
void vil_clamp_below (vil_image_view< T > &src, T t, T v)
 Clamp an image view above a given value t, setting it to v if below or on t.
template<class T>
void vil_clamp_below (vil_image_view< T > &src, T t)
 Clamp an image view above a given value t, setting it to this t if below t.
template<class inP, class outP>
void vil_convert_cast (const vil_image_view< inP > &src, vil_image_view< outP > &dest)
 Cast one pixel type to another (with rounding).
template<class inP, class outP>
void vil_convert_round (const vil_image_view< inP > &src, vil_image_view< outP > &dest)
 Convert one pixel type to another with rounding.
template<class T>
void vil_convert_stretch_range (const vil_image_view< T > &src, vil_image_view< vxl_byte > &dest)
 Convert src to byte image dest by stretching to range [0,255].
template<class T>
void vil_copy_reformat (const vil_image_view< T > &src, vil_image_view< T > &dest)
 Copy src to dest, without changing dest's view parameters.
template<class T>
void vil_copy_to_window (const vil_image_view< T > &src, vil_image_view< T > &dest, unsigned i0, unsigned j0)
 Copy src to window in dest.
template<class T>
void vil_copy_deep (const vil_image_view< T > &src, vil_image_view< T > &dest)
 Deep copy src to dest.
template<class T>
vil_image_view< T > vil_copy_deep (const vil_image_view< T > &src)
 Create a deep copy of an image, with completely new underlying memory.
template<class T>
vil_image_view< T > vil_crop (const vil_image_view< T > &im, unsigned i0, unsigned n_i, unsigned j0, unsigned n_j)
 Create a view which is a cropped version of src.
template<class T>
vil_image_view< T > vil_decimate (const vil_image_view< T > &im, unsigned i_factor, unsigned j_factor=0)
 Create a view which is a decimated version of src.
template<class T>
void vil_fill (vil_image_view< T > &view, T value)
 Fill view with given value.
template<class T>
void vil_fill_line (vil_image_view< T > &im, int ai, int aj, int bi, int bj, T value)
 Fill line from (ai,aj) to (bi,bj) using Bresenham's algorithm.
template<class T>
void vil_fill_row (vil_image_view< T > &view, unsigned j, T value)
 Fill row j in view with given value.
template<class T>
void vil_fill_col (vil_image_view< T > &view, unsigned i, T value)
 Fill column i in view with given value.
template<class srcT>
void vil_fill_mask (vil_image_view< srcT > &image, const vil_image_view< bool > &mask, srcT value, bool b=true)
 Writes given value into each pixel of image under the elements of the mask set to b.
template<class T>
void vil_fill_disk (vil_image_view< T > &image, double ci, double cj, double r, T value)
 Fills pixels in disk with centre (ci,cj), radius r, with given value.
template<class T>
vil_image_view< T > vil_flatten_planes (const vil_image_view< T > &im)
 Rearrange multiple planes into a multiple tiles of a single-plane image.
template<class T>
vil_image_view< T > vil_flip_lr (const vil_image_view< T > &v)
 Create a reflected view in which i -> ni-1-i.
template<class T>
vil_image_view< T > vil_flip_ud (const vil_image_view< T > &v)
 Create a reflected view in which y -> nj-1-j.
template<class T>
bool vil_image_view_deep_equality (const vil_image_view< T > &lhs, const vil_image_view< T > &rhs)
 True if the actual images are identical.
vil_image_view_base_sptr vil_load (const char *, bool verbose=true)
 Convenience function for loading an image into an image view.
template<class T>
void vil_math_value_range_percentiles (const vil_image_view< T > &im, const vcl_vector< double > &fraction, vcl_vector< T > &value)
 Compute the values corresponding to several percentiles of the range of im.
template<class T>
void vil_math_value_range_percentile (const vil_image_view< T > &im, const double fraction, T &value)
 Compute the value corresponding to a percentile of the range of im.
template<class imT, class sumT>
sumT vil_math_ssd (const vil_image_view< imT > &imA, const vil_image_view< imT > &imB, sumT)
 Sum of squared differences between two images.
template<class imT, class sumT>
sumT vil_math_ssd_complex (const vil_image_view< vcl_complex< imT > > &imA, const vil_image_view< vcl_complex< imT > > &imB, sumT)
 Sum squared magnitude differences between two complex images.
template<class aT, class sumT>
void vil_math_mean_over_planes (const vil_image_view< aT > &src, vil_image_view< sumT > &dest)
 Calc the mean of each pixel over all the planes.
template<class inT, class outT, class sumT>
void vil_math_mean_over_planes (const vil_image_view< inT > &src, vil_image_view< outT > &dest, sumT)
 Calc the mean of each pixel over all the planes.
template<class imT, class sumT>
void vil_math_sum (sumT &sum, const vil_image_view< imT > &im, unsigned p)
 Sum of elements in plane p of image.
template<class imT, class sumT>
void vil_math_mean (sumT &mean, const vil_image_view< imT > &im, unsigned p)
 Mean of elements in plane p of image.
template<class imT>
void vil_math_median (imT &median, const vil_image_view< imT > &im, unsigned p)
 Median of elements in plane p of an image.
template<class imT, class sumT>
void vil_math_sum_squares (sumT &sum, sumT &sum_sq, const vil_image_view< imT > &im, unsigned p)
 Sum of squares of elements in plane p of image.
template<class imT, class sumT>
void vil_math_mean_and_variance (sumT &mean, sumT &var, const vil_image_view< imT > &im, unsigned p)
 Mean and variance of elements in plane p of image.
template<class T>
void vil_math_sqrt (vil_image_view< T > &image)
 Compute square-root of each pixel element (or zero if negative).
template<class T>
void vil_math_truncate_range (vil_image_view< T > &image, T min_v, T max_v)
 Truncate each pixel value so it fits into range [min_v,max_v].
template<class T>
void vil_math_scale_values (vil_image_view< T > &image, double scale)
 Multiply values in-place in image view by scale.
template<class imT, class offsetT>
void vil_math_scale_and_offset_values (vil_image_view< imT > &image, double scale, offsetT offset)
 Multiply values in-place in image view by scale and add offset.
template<class aT, class bT, class sumT>
void vil_math_image_sum (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_sum)
 Compute sum of two images (im_sum = imA+imB).
template<class aT, class bT, class sumT>
void vil_math_image_product (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_product)
 Compute pixel-wise product of two images (im_prod(i,j) = imA(i,j)*imB(i,j).
template<class aT, class bT, class maxT>
void vil_math_image_max (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< maxT > &im_max)
 Compute the max of two images (im_max = max(imA, imB)).
template<class aT, class bT, class minT>
void vil_math_image_min (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< minT > &im_min)
 Compute the min of two images (im_min = min(imA, imB)).
template<class aT, class bT, class sumT>
void vil_math_image_ratio (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_ratio)
 Compute pixel-wise ratio of two images : im_ratio(i,j) = imA(i,j)/imB(i,j).
template<class aT, class bT, class sumT>
void vil_math_image_difference (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_sum)
 Compute difference of two images (im_sum = imA-imB).
template<class aT, class bT, class sumT>
void vil_math_image_abs_difference (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< sumT > &im_sum)
 Compute absolute difference of two images (im_sum = |imA-imB|).
template<class aT, class bT>
double vil_math_image_abs_difference (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB)
 Compute sum of absolute difference between two images (|imA-imB|).
template<class aT, class bT, class magT>
void vil_math_image_vector_mag (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< magT > &im_mag)
 Compute magnitude of two images taken as vector components, sqrt(A^2 + B^2).
template<class aT, class bT, class scaleT>
void vil_math_add_image_fraction (vil_image_view< aT > &imA, scaleT fa, const vil_image_view< bT > &imB, scaleT fb)
 imA = fa*imA + fb*imB (Useful for moving averages!).
template<class aT, class sumT>
void vil_math_integral_image (const vil_image_view< aT > &imA, vil_image_view< sumT > &im_sum)
 Compute integral image im_sum(i+1,j+1) = sum (x<=i,y<=j) imA(x,y).
template<class aT, class sumT>
void vil_math_integral_sqr_image (const vil_image_view< aT > &imA, vil_image_view< sumT > &im_sum, vil_image_view< sumT > &im_sum_sq)
 Compute integral image im_sum_sq(i+1,j+1) = sum (x<=i,y<=j) imA(x,y)^2.
template<class T>
vil_nearest_interp_unsafe (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute nearest neighbour interpolation at (x,y), no bound checks. Requires -0.5<=x<ni-0.5, -0.5<=y<nj-0.5.
template<class T>
vil_nearest_interp_safe (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute nearest neighbour interpolation at (x,y), with bound checks.
template<class T>
vil_nearest_interp (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute nearest neighbour interpolation at (x,y), with minimal bound checks.
template<class T>
vil_nearest_interp_safe_extend (const vil_image_view< T > &view, double x, double y, unsigned p=0)
 Compute nearest_neighbourear interpolation at (x,y), with bound checks.
template<class T>
vil_image_view< T > vil_new_image_view_plane_i_j (unsigned ni, unsigned nj, unsigned nplanes, T)
 Create a new image view whose j_step is 1.
template<class T>
vil_image_view< T > vil_new_image_view_i_j_plane (unsigned ni, unsigned nj, unsigned nplanes, T)
 Create a new image view whose plane step is 1 and whose j_step is nplanes.
vil_image_view_base_sptr vil_new_image_view_base_sptr (const vil_image_view_base &)
 Create a shallow copy of an image and wrap it in a vil_image_view_base_sptr.
template<class T>
vil_image_view< T > vil_plane (const vil_image_view< T > &im, unsigned p)
 Return a view of im's plane p.
template<class T>
void vil_print_value (vcl_ostream &s, const T &value)
 How to print value in vil_print_all(image_view).
template<class T>
void vil_print_all (vcl_ostream &os, const vil_image_view< T > &view)
 Print all image data to os in a grid (rounds output to int).
void vil_print_all (vcl_ostream &os, vil_image_view_base_sptr const &view)
 Print all image data to os in a grid.
template<class sType, class dType>
void vil_resample_bicub (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using bicubic interpolation.
template<class sType, class dType>
void vil_resample_bicub (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, int n1, int n2)
 Resample image to a specified width (n1) and height (n2).
template<class sType, class dType>
void vil_resample_bilin (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using bilinear interpolation.
template<class sType, class dType>
void vil_resample_bilin (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, int n1, int n2)
 Resample image to a specified width (n1) and height (n2).
template<class sType, class dType>
void vil_resample_bilin_edge_extend (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using bilinear interpolation.
template<class sType, class dType>
void vil_resample_bilin_edge_extend (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, int n1, int n2)
 Resample image to a specified width (n1) and height (n2).
template<class sType, class dType>
void vil_resample_nearest (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using nearest neighbour interpolation.
template<class sType, class dType>
void vil_resample_nearest (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, int n1, int n2)
 Resample image to a specified width (n1) and height (n2).
template<class sType, class dType>
void vil_resample_nearest_edge_extend (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid of points in one image and place in another, using nearest neighbour interpolation.
template<class sType, class dType>
void vil_resample_nearest_edge_extend (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, int n1, int n2)
 Resample image to a specified width (n1) and height (n2).
template<class sType, class dType>
void vil_rotate_image (const vil_image_view< sType > &src_image, vil_image_view< dType > &dest_image, double theta_deg)
 Rotate image by angle theta.
template<class imType, class vecType>
void vil_sample_grid_bicub (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid from image, using bicubic interpolation.
template<class imType, class vecType>
void vil_sample_grid_bilin (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx1, double dy1, double dx2, double dy2, int n1, int n2)
 Sample grid from image, using bilinear interpolation.
template<class imType, class vecType>
void vil_sample_profile_bicub (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx, double dy, int n)
 Sample along profile, using bicubic interpolation.
template<class imType, class vecType>
void vil_sample_profile_bilin (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx, double dy, int n)
 Sample along profile, using bilinear interpolation.
bool vil_save (const vil_image_view_base &, char const *filename)
 Send a vil_image_view to disk, deducing format from filename.
bool vil_save (const vil_image_view_base &, char const *filename, char const *file_format)
 Send a vil_image_view to disk, given filename.
template<class T, class F>
void vil_transform (vil_image_view< T > &image, F functor)
 Apply a unary operation to each pixel in image.
template<class inP, class outP, class Op>
void vil_transform (const vil_image_view< inP > &src, vil_image_view< outP > &dest, Op functor)
 Apply a unary operation to each pixel in src to get dest.
template<class inP, class outP, class Op>
void vil_transform2 (const vil_image_view< inP > &src, vil_image_view< outP > &dest, Op functor)
 Apply a binary function to each pixel in src and dest that modifies dest.
template<class inA, class inB, class outP, class BinOp>
void vil_transform (const vil_image_view< inA > &srcA, const vil_image_view< inB > &srcB, vil_image_view< outP > &dest, BinOp functor)
 Apply a binary operation to each pixel in srcA and srcB to get dest.
template<class inA, class inB, class outP, class BinOp>
void vil_transform (const vil_image_view< inA > &srcA, const vil_image_view< inB > &srcB, const vil_image_view< outP > &dest, BinOp functor)
 Apply a binary operation to each pixel in srcA and srcB to get dest.
template<class T>
vil_image_view< T > vil_transpose (const vil_image_view< T > &v)
 Create a view which appears as the transpose of this view.
template<class T>
vil_image_view< typename
T::value_type > 
vil_view_as_planes (const vil_image_view< T > &v)
 Return a 3-plane view of an RGB image, or a 4-plane view of an RGBA, or a 2-plane view of a complex image.
template<class T>
vil_image_view< vil_rgb< T > > vil_view_as_rgb (const vil_image_view< T > &v)
 Return an RGB component view of a 3-plane image.
template<class T>
vil_image_view< vil_rgba< T > > vil_view_as_rgba (const vil_image_view< T > &v)
 Return an RGBA component view of a 4-plane image.
template<class T>
vil_image_view< vcl_complex< T > > vil_view_as_complex (const vil_image_view< T > &v)
 Return an complex component view of a 2N-plane image.
template<class T>
vil_image_view< T > vil_view_part (vil_image_view< vcl_complex< T > > img, int pt)
 Base function to do the work for both vil_view_real/imag_part.
template<class T>
vil_image_view< T > vil_view_real_part (vil_image_view< vcl_complex< T > > img)
 Return a view of the real part of a complex image.
template<class T>
vil_image_view< T > vil_view_imag_part (vil_image_view< vcl_complex< T > > img)
 Return a view of the imaginary part of a complex image.
template<class sType, class dType, class MapFunctor, class InterpFunctor>
void vil_warp (const vil_image_view< sType > &in, vil_image_view< dType > &out, MapFunctor mapper, InterpFunctor interp)
 Warp an image under a 2D map.

Member Typedef Documentation

template<class T>
typedef T vil_image_view< T >::pixel_type

The pixel type of this image.

Definition at line 121 of file vil_image_view.h.

template<class T>
typedef T* vil_image_view< T >::iterator

Definition at line 127 of file vil_image_view.h.

template<class T>
typedef T const* vil_image_view< T >::const_iterator

Definition at line 131 of file vil_image_view.h.


Constructor & Destructor Documentation

template<class T>
vil_image_view< T >::vil_image_view (  )  [inline]

Dflt ctor.

Creates an empty one-plane image.

Definition at line 64 of file vil_image_view.h.

template<class T>
vil_image_view< T >::vil_image_view ( unsigned  ni,
unsigned  nj,
unsigned  n_planes = 1,
unsigned  n_interleaved_planes = 1 
)

Create an image of ni x nj pixels in (n_planes * n_interleaved_planes) planes.

If n_interleaved_planes > 1, the planes are interleaved. If n_planes > 1, each plane of pixels is stored contiguously. n_planes and n_components should not be both different from 1. n_planes * n_interleaved_planes should be 1 unless T is scalar.

template<class T>
vil_image_view< T >::vil_image_view ( const T *  top_left,
unsigned  ni,
unsigned  nj,
unsigned  nplanes,
vcl_ptrdiff_t  i_step,
vcl_ptrdiff_t  j_step,
vcl_ptrdiff_t  plane_step 
)

Set this view to look at someone else's memory data.

If the data goes out of scope then this view could be invalid, and there's no way of knowing until it's too late - so take care!

template<class T>
vil_image_view< T >::vil_image_view ( const vil_memory_chunk_sptr mem_chunk,
const T *  top_left,
unsigned  ni,
unsigned  nj,
unsigned  nplanes,
vcl_ptrdiff_t  i_step,
vcl_ptrdiff_t  j_step,
vcl_ptrdiff_t  plane_step 
)

Set this view to look at another view's data.

Typically used by functions which generate a manipulated view of another's image data. Need to pass the memory chunk to set up the internal smart ptr appropriately

template<class T>
vil_image_view< T >::vil_image_view ( const vil_image_view< T > &  rhs  ) 

Copy construct.

The new object will point to the same underlying image as the rhs.

template<class T>
vil_image_view< T >::vil_image_view ( const vil_image_view_base rhs  ) 

Construct from various vil_image_view types.

The new object will point to the same underlying image as the rhs You can assign a vil_image_view<compound_type<T>> to a vil_image_view<T> in all reasonable cases - the lhs will have as many planes as the rhs has components. You can assign a vil_image_view<T> to a vil_image_view<compound_type<T>> when the underlying data is formatted appropriately and the lhs has as many components as the rhs has planes. O(1). If the view types are not compatible this object will be set to empty.

template<class T>
vil_image_view< T >::vil_image_view ( const vil_image_view_base_sptr rhs  ) 

Construct from various vil_image_view types.

The new object will point to the same underlying image as the rhs.

You can assign a vil_image_view<compound_type<T>> to a vil_image_view<T> in all reasonable cases - the lhs will have as many planes as the rhs has components. You can assign a vil_image_view<T> to a vil_image_view<compound_type<T>> when the underlying data is formatted appropriately and the lhs has as many components as the rhs has planes. O(1).

Exceptions:
vil_exception_pixel_formats_incompatible if view types are not compatible. Or returns a null image if exceptions are disabled.

template<class T>
virtual vil_image_view< T >::~vil_image_view (  )  [inline, virtual]

Definition at line 114 of file vil_image_view.h.


Member Function Documentation

template<class T>
void vil_image_view< T >::release_memory (  )  [inline, protected]

Disconnect this view from the underlying data,.

Definition at line 58 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::is_contiguous (  )  const

True if data all in one unbroken block and top_left_ptr() is lowest data address.

template<class T>
iterator vil_image_view< T >::begin (  )  [inline]

Definition at line 128 of file vil_image_view.h.

template<class T>
iterator vil_image_view< T >::end (  )  [inline]

Definition at line 129 of file vil_image_view.h.

template<class T>
const_iterator vil_image_view< T >::begin (  )  const [inline]

Definition at line 132 of file vil_image_view.h.

template<class T>
const_iterator vil_image_view< T >::end (  )  const [inline]

Definition at line 133 of file vil_image_view.h.

template<class T>
T* vil_image_view< T >::top_left_ptr (  )  [inline]

Pointer to the first (top left in plane 0) pixel.

Note that this is not necessarily the lowest data memory address.

Definition at line 139 of file vil_image_view.h.

template<class T>
const T* vil_image_view< T >::top_left_ptr (  )  const [inline]

Pointer to the first (top left in plane 0) pixel.

Note that this is not necessarily the lowest data memory address.

Definition at line 142 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::istep (  )  const [inline]

Add this to your pixel pointer to get next i pixel.

Note that istep() may well be negative; see e.g. vil_flip_lr

Definition at line 146 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::jstep (  )  const [inline]

Add this to your pixel pointer to get next j pixel.

Note that jstep() may well be negative; see e.g. vil_flip_ud

Definition at line 149 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::planestep (  )  const [inline]

Add this to your pixel pointer to get pixel on next plane.

Note that planestep() may well be negative, e.g. with BMP file images

Definition at line 152 of file vil_image_view.h.

template<class T>
vil_image_view< T >::operator safe_bool (  )  const [inline]

Cast to bool is true if pointing at some data.

Definition at line 155 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::operator! (  )  const [inline]

Return false if pointing at some data.

Definition at line 159 of file vil_image_view.h.

template<class T>
unsigned vil_image_view< T >::size_bytes (  )  const [inline]

The number of bytes in the data.

Definition at line 163 of file vil_image_view.h.

template<class T>
const vil_memory_chunk_sptr& vil_image_view< T >::memory_chunk (  )  const [inline]

Smart pointer to the object holding the data for this view.

Will be a null pointer if this view looks at `third-party' data, e.g. using set_to_memory.

Typically used when creating new views of the data

Definition at line 170 of file vil_image_view.h.

template<class T>
vil_memory_chunk_sptr& vil_image_view< T >::memory_chunk (  )  [inline]

Smart pointer to the object holding the data for this view.

Will be a null pointer if this view looks at `third-party' data, e.g. using set_to_memory

Typically used when creating new views of the data

Definition at line 177 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::in_range ( int  i,
int  j 
) const [inline]

Return true if (i,j) is a valid index into this buffer.

Definition at line 182 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::in_range ( int  i,
int  j,
int  p 
) const [inline]

Return true if (i,j,p) is a valid index into this buffer.

Definition at line 186 of file vil_image_view.h.

template<class T>
const T& vil_image_view< T >::operator() ( unsigned  i,
unsigned  j 
) const [inline]

Return read-only reference to pixel at (i,j) in plane 0.

Definition at line 191 of file vil_image_view.h.

template<class T>
T& vil_image_view< T >::operator() ( unsigned  i,
unsigned  j 
) [inline]

Return read/write reference to pixel at (i,j) in plane 0.

Definition at line 196 of file vil_image_view.h.

template<class T>
const T& vil_image_view< T >::operator() ( unsigned  i,
unsigned  j,
unsigned  p 
) const [inline]

Return read-only reference to pixel at (i,j) in plane p.

Definition at line 201 of file vil_image_view.h.

template<class T>
T& vil_image_view< T >::operator() ( unsigned  i,
unsigned  j,
unsigned  p 
) [inline]

Return read-only reference to pixel at (i,j) in plane p.

Definition at line 206 of file vil_image_view.h.

template<class T>
virtual void vil_image_view< T >::set_size ( unsigned  ni,
unsigned  nj 
) [virtual]

resize current planes to ni x nj.

If already correct size, this function returns quickly

Implements vil_image_view_base.

template<class T>
virtual void vil_image_view< T >::set_size ( unsigned  ni,
unsigned  nj,
unsigned  nplanes 
) [virtual]

resize to ni x nj x nplanes.

If already correct size, this function returns quickly

Implements vil_image_view_base.

template<class T>
void vil_image_view< T >::deep_copy ( const vil_image_view< T > &  src  ) 

Make a copy of the data in src and set this to view it.

template<class T>
void vil_image_view< T >::clear (  )  [inline]

Make empty.

Disconnects view from underlying data.

Definition at line 226 of file vil_image_view.h.

template<class T>
void vil_image_view< T >::set_to_memory ( const T *  top_left,
unsigned  ni,
unsigned  nj,
unsigned  nplanes,
vcl_ptrdiff_t  i_step,
vcl_ptrdiff_t  j_step,
vcl_ptrdiff_t  plane_step 
)

Set this view to look at someone else's memory data.

If the data goes out of scope then this view could be invalid, and there's no way of knowing until it's too late -- so take care!

Note that though top_left is passed in as const, the data may be manipulated through the view.

template<class T>
void vil_image_view< T >::fill ( value  ) 

Fill view with given value.

template<class T>
virtual void vil_image_view< T >::print ( vcl_ostream &   )  const [virtual]

Print a 1-line summary of contents.

Implements vil_image_view_base.

template<class T>
virtual vcl_string vil_image_view< T >::is_a (  )  const [virtual]

Return class name.

Implements vil_image_view_base.

template<class T>
virtual bool vil_image_view< T >::is_class ( vcl_string const &  s  )  const [virtual]

True if this is (or is derived from) class s.

Reimplemented from vil_image_view_base.

template<class T>
vil_pixel_format vil_image_view< T >::pixel_format (  )  const [inline, virtual]

Return a description of the concrete data pixel type.

The value corresponds directly to pixel_type.

Implements vil_image_view_base.

Definition at line 251 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::operator== ( const vil_image_view_base other  )  const

True if they share same view of same image data.

This does not do a deep equality on image data. If the images point to different image data objects that contain identical images, then the result will still be false.

template<class T>
bool vil_image_view< T >::operator!= ( const vil_image_view_base rhs  )  const [inline]

True if they do not share same view of same image data.

This does not do a deep inequality on image data. If the images point to different image data objects that contain identical images, then the result will still be true.

Definition at line 263 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::operator< ( const vil_image_view_base rhs  )  const

Provides an ordering.

Useful for ordered containers. There is no guaranteed meaning to the less than operator, except that (a<b && b<a) is false and !(a<b) && !(b<a) is equivalent to a==b

template<class T>
bool vil_image_view< T >::operator>= ( const vil_image_view_base rhs  )  const [inline]

Provides an ordering.

Definition at line 272 of file vil_image_view.h.

template<class T>
bool vil_image_view< T >::operator> ( const vil_image_view_base rhs  )  const

Provides an ordering.

template<class T>
bool vil_image_view< T >::operator<= ( const vil_image_view_base rhs  )  const [inline]

Provides an ordering.

Definition at line 278 of file vil_image_view.h.

template<class T>
const vil_image_view<T>& vil_image_view< T >::operator= ( const vil_image_view< T > &  rhs  ) 

Copy a view. The rhs and lhs will point to the same image data.

template<class T>
const vil_image_view<T>& vil_image_view< T >::operator= ( const vil_image_view_base rhs  ) 

Copy a view. The rhs and lhs will point to the same image data.

You can assign a vil_image_view<compound_type<T>> to a vil_image_view<T> in all reasonable cases - the lhs will have as many planes as the rhs has components. You can assign a vil_image_view<T> to a vil_image_view<compound_type<T>> when the underlying data is formatted appropriately and the lhs has as many components as the rhs has planes. O(1). If the view types are not compatible this object will be set to empty.

template<class T>
const vil_image_view<T>& vil_image_view< T >::operator= ( const vil_image_view_base_sptr rhs  )  [inline]

Copy a view. The rhs and lhs will point to the same image data.

You can assign a vil_image_view<compound_type<T>> to a vil_image_view<T> in all reasonable cases - the lhs will have as many planes as the rhs has components. You can assign a vil_image_view<T> to a vil_image_view<compound_type<T>> when the underlying data is formatted appropriately and the lhs has as many components as the rhs has planes. O(1). If the view types are not compatible this object will be set to empty. If the pointer is null, this object will be set to empty. See also vil_convert_to_component_order().

Definition at line 301 of file vil_image_view.h.

unsigned vil_image_view_base::ni (  )  const [inline, inherited]

Width.

Definition at line 49 of file vil_image_view_base.h.

unsigned vil_image_view_base::nj (  )  const [inline, inherited]

Height.

Definition at line 51 of file vil_image_view_base.h.

unsigned vil_image_view_base::nplanes (  )  const [inline, inherited]

Number of planes.

Definition at line 53 of file vil_image_view_base.h.

unsigned long vil_image_view_base::size (  )  const [inline, inherited]

The number of pixels.

Definition at line 56 of file vil_image_view_base.h.


Friends And Related Function Documentation

template<class S, class T>
void vil_cartesian_differential_invariants_3 ( const vil_image_view< S > &  src,
vil_image_view< T > &  dest,
double  scale,
unsigned  max_kernel_width = 0 
) [related]

Compute up to 3rd order C.d.i. of an image.

Finds the first 8 Cartesian differential invariants of an image. That is 1x1st order, 3x2nd order and 4x3rd order. The results are returned in 8 adjacent planes (for each input plane) The results are unscaled. If the range of your input is $r$, you can normalise the results by dividing the planes by $r, r^{-1}, r^{-1}, r^{-1}, r^{-2}, r^{-2}, r^{-2}, r^{-2}$

See Romeny et al. Proc.IPMI1993, pp77-93. and Walker et al. Proc.BMVC1997 pp541-549.

Parameters:
max_kernel_width. Set this value (to an odd number) if you want to restrict the size of the kernel. 0 will let the function choose an appropriate kernel size for the scale.

Definition at line 151 of file vil_cartesian_differential_invariants.txx.

template<class srcT, class destT, class kernelT, class accumT>
void vil_convolve_1d ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
const kernelT *  kernel,
vcl_ptrdiff_t  k_lo,
vcl_ptrdiff_t  k_hi,
accumT  ac,
vil_convolve_boundary_option  start_option,
vil_convolve_boundary_option  end_option 
) [related]

Convolve kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.

On exit dest_im(i,j) = sum src(i-x,j)*kernel(x) (x=k_lo..k_hi)

Note:
This function reverses the kernel. If you don't want the kernel reversed, use vil_correlate_1d instead. The kernel must not be larger than src_im.ni()
Parameters:
kernel should point to tap 0.
dest_im will be resized to size of src_im.

Definition at line 246 of file vil_convolve_1d.h.

template<class srcT, class destT, class kernelT, class accumT>
void vil_convolve_2d ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
const vil_image_view< kernelT > &  kernel,
accumT  ac 
) [related]

Convolve kernel with srcT.

dest is resized to (1+src_im.ni()-kernel.ni())x(1+src_im.nj()-kernel.nj()) (a one plane image). On exit dest(x,y) = sum_ij src_im(x-i,y-j)*kernel(i,j)

Definition at line 20 of file vil_convolve_2d.h.

template<class T>
void vil_corners ( const vil_image_view< float > &  grad_i,
const vil_image_view< float > &  grad_j,
vil_image_view< float > &  dest,
double  k 
) [related]

Compute Forstner/Harris corner strength function given gradient images.

Compute Harris corner strength function given gradient images.

grad_i and grad_j are assumed to be the i and j gradient images (single plane), such as produced by vil_sobel_3x3(). At each pixel compute the Forstner/Harris corner function: det(H)-k*sqr(trace(H)), where H is the 2x2 matrix of second derivatives, generated by applying a Sobel operator to the gradient images.

The local peaks of the output image correspond to corner candidates.

grad_i and grad_j are assumed to be the i and j gradient images (single plane), such as produced by vil_sobel_3x3(). At each pixel compute the Harris corner function: det(H)-k*sqr(trace(H)), where H is the 2x2 matrix of second derivatives, generated by applying a Sobel operator to the gradient images.

The local peaks of the output image correspond to corner candidates.

Definition at line 21 of file vil_corners.cxx.

template<class T>
void vil_corners_rohr ( const vil_image_view< float > &  grad_i,
const vil_image_view< float > &  grad_j,
vil_image_view< float > &  dest 
) [related]

Compute corner strength using Rohr's recommended method.

This computes the determinant of the matrix C=g.g' after the elements of C have been smoothed. g is the vector of first derivatives (gx,gy)' It relies only on first derivatives.

Definition at line 183 of file vil_corners.cxx.

template<class T>
void vil_corners ( const vil_image_view< T > &  src,
vil_image_view< float > &  dest,
double  k = 0.04 
) [related]

Compute Harris corner strength function.

At each pixel compute the Harris corner function: det(H)-k*sqr(trace(H)), where H is the 2x2 matrix of second derivatives, generated by applying a Sobel operator twice. The filters thus effectively have 5x5 support.

The local peaks of the output image correspond to corner candidates.

Definition at line 49 of file vil_corners.h.

template<class T>
void vil_corners_rohr ( const vil_image_view< T > &  src,
vil_image_view< float > &  dest 
) [related]

Compute corner strength using Karl Rohr's recommended method.

This computes the determinant of the matrix C=g.g' after the elements of C have been smoothed. g is the vector of first derivatives (gx,gy)' It relies only on first derivatives.

Definition at line 65 of file vil_corners.h.

template<class srcT, class destT, class kernelT, class accumT>
void vil_correlate_1d ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
const kernelT *  kernel,
vcl_ptrdiff_t  k_lo,
vcl_ptrdiff_t  k_hi,
accumT  ac,
vil_convolve_boundary_option  start_option,
vil_convolve_boundary_option  end_option 
) [related]

correlate kernel[i] (i in [k_lo,k_hi]) with srcT in i-direction.

On exit dest_im(i,j) = sum src(i+x,j)*kernel(x) (x=k_lo..k_hi)

Note:
This function does not reverse the kernel. If you want the kernel reversed, use vil_convolve_1d instead.
Parameters:
kernel should point to tap 0.
dest_im will be resized to size of src_im.

Definition at line 59 of file vil_correlate_1d.h.

template<class srcT, class kernelT, class accumT>
accumT vil_correlate_2d_at_pt ( const srcT *  src_im,
vcl_ptrdiff_t  s_istep,
vcl_ptrdiff_t  s_jstep,
vcl_ptrdiff_t  s_pstep,
const vil_image_view< kernelT > &  kernel,
accumT   
) [related]

Evaluate dot product between kernel and src_im.

Returns sum_ijp src_im[i*istep+j*jstep+p*pstep]*kernel(i,j,p)

Definition at line 17 of file vil_correlate_2d.h.

template<class srcT, class destT, class kernelT, class accumT>
void vil_correlate_2d ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
const vil_image_view< kernelT > &  kernel,
accumT  ac 
) [related]

Correlate kernel with srcT.

dest is resized to (1+src_im.ni()-kernel.ni())x(1+src_im.nj()-kernel.nj()) (a one plane image). On exit dest(x,y) = sum_ij src_im(x+i,y+j)*kernel(i,j)

Definition at line 54 of file vil_correlate_2d.h.

template<class T>
void vil_distance_transform ( vil_image_view< float > &  image  )  [related]

Compute distance function from zeros in original image.

Image is assumed to be filled with max_dist where there is background, and zero at the places of interest. On exit, the values are the 8-connected distance to the nearest original zero region.

Definition at line 16 of file vil_distance_transform.cxx.

template<class T>
void vil_distance_transform_one_way ( vil_image_view< float > &  image  )  [related]

Compute directed distance function from zeros in original image.

Image is assumed to be filled with max_dist where there is background, and zero at the places of interest. On exit, the values are the 8-connected distance to the nearest original zero region above or to the left of current point. One pass of distance transform, going from low to high i,j.

Definition at line 37 of file vil_distance_transform.cxx.

template<class T>
void vil_distance_transform ( const vil_image_view< bool > &  mask,
vil_image_view< float > &  distance_image,
float  max_dist 
) [related]

Compute distance function from true elements in mask.

On exit, the values are the 8-connected distance to the nearest original zero region (or max_dist, if that is smaller).

Definition at line 84 of file vil_distance_transform.cxx.

template<class T>
void vil_distance_transform_r2 ( vil_image_view< float > &  image  )  [related]

Compute distance function from zeros in original image.

Image is assumed to be filled with max_dist where there is background, and zero at the places of interest. On exit, the values are the 24-connected distance to the nearest original zero region. (ie considers neighbours in a +/-2 pixel region around each point). More accurate than vil_distance_transform(image), but approximately twice the processing required.

Definition at line 230 of file vil_distance_transform.cxx.

template<class T>
void vil_dog_filter_5tap ( const vil_image_view< T > &  src_im,
vil_image_view< T > &  smooth_im,
vil_image_view< T > &  dog_im,
double  sigma 
) [related]

Smooth source with gaussian filter and compute difference.

Uses a 5-tap filter with gaussian width sigma.

Parameters:
sigma Width of gaussian
smooth_im Result of smoothing the src_im
dog_im src_im - smooth_im

Definition at line 19 of file vil_dog_filter_5tap.h.

template<class T>
void vil_dog_pyramid ( const vil_image_view< T > &  src_image,
vcl_vector< vil_image_view< T > > &  smooth_pyramid,
vcl_vector< vil_image_view< T > > &  dog_pyramid,
unsigned  min_size 
) [related]

Compute a pyramid of difference of gaussian images.

Computes each layer of a pyramid by smoothing then computing the difference from the original image. The smoothed is then subsampled using a reduction factor of 1.5 (ie each level is 2/3 the size of the level below) and used to produced the next level.

min_size defines the smallest dimension (restricting the number of levels that will be constructed)

This is useful for finding locally interesting points and their associated scales - see "Object Recognition from Scale Invariant Features" D.Lowe, ICCV1999, pp.1150-1157.

Definition at line 29 of file vil_dog_pyramid.h.

template<class T>
bool vil_exact_distance_transform_maurer ( vil_image_view< vxl_uint_32 > &  im  )  [related]

Linear-time, 2D exact Euclidean distance transform (Maurer's Algorithm).

This is one of the fastest methods according to my experiments (distance.sourceforge.net) Paper: Calvin Maurer et. al. PAMI feb. 2003

Squared Euclidean distances are computed in-place for every pixel relative to the zero-pixels.

Parameters:
[in,out] im The input binary image using vxl_uint_32 storage. The squared distance map is output to the same array, since the squared Euclidean distances are integers, assuming pixels are unit distance apart.
Remarks:
Non-contiguous images not currently supported.
Implementation influenced by the LTI lib, which is licensed under LGPL: http://ltilib.sourceforge.net

Definition at line 294 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_maurer_label ( vil_image_view< vxl_uint_32 > &  im,
vil_image_view< vxl_uint_32 > &  imlabel 
) [related]

Same as vil_exact_distance_transform_maurer, but also returns a label array indicating the closest 0-pixel.

Parameters:
[out] imlabel An array indicating the closet feature pixel. imlabel[i] == row_major linear index of the closest feature voxel. Assuming the image im is also stored in row_major order, im[i] will contain the corresponding distance.

Definition at line 324 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_saito ( vil_image_view< vxl_uint_32 > &  im,
unsigned  plane_idx = 0 
) [related]

Cubic-time, exact Euclidean distance transform (Saito's algorithm).

This algorithm is linear-time on average, but it is cubic-time in the worst case. It has reasonably good performance compared to newer algorithms, according to my experiments (distance.sourceforge.net).

Paper: T. Saito and J.I. Toriwaki, "New algorithms for Euclidean distance transformations of an n-dimensional digitised picture with applications", Pattern Recognition, 27(11), pp. 1551-1565, 1994

Squared Distances are computed for every pixel relative to the zero-pixels.

Parameters:
[in,out] im The input binary image using vxl_uint_32 storage. The squared distance map is output to the same array, since the squared Euclidean distances are integers, assuming pixels are unit distance apart.
Remarks:
Non-contiguous images not currently supported.
Final implementation by Ricardo Fabbri, based on two independent implementations by Olivier Cuisenaire and Julio Torelli.

Definition at line 377 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_saito ( vil_image_view< vxl_uint_32 > &  im,
unsigned  plane_idx,
const vcl_vector< unsigned > &  sq 
) [related]

Overload that assumes given a Lookup table of integer squares.

Also assumes the image im already has infinity in all non-zero points.

See also:
see documentation of vil_exact_distance_transform_saito( vil_image_view<vxl_uint_32> &im, unsigned plane_idx=0);

Definition at line 516 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_saito_3D ( vil_image_view< vxl_uint_32 > &  im  )  [related]

Exact 3D EDT.

Remarks:
See comment on vil_exact_distance_transform_saito

Definition at line 407 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_signed ( vil_image_view< vxl_uint_32 > &  input_image,
vil_image_view< float > &  signed_edt_image 
) [related]

Computes signed Euclidean distance transform by using the unsigned EDT of an image and its binary complement.

The input image will be modified as an auxiliary array, so if you want to keep the input you are responsible for making a copy before calling this function.

Regions on input image are pixels where intensity > 0; Distance Transform is > 0 INSIDE the regions amd < 0 OUTSIDE the regions.

The code for combining the interior and exterior distance maps has been blindly adapted from a previous implementation; the original code was from a legacy repository at Brown University (algo/contourtracing/signed_dt.cpp)

Definition at line 802 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_brute_force ( vil_image_view< vxl_uint_32 > &  im  )  [related]

Naive implementation of exact Euclidean distance transform (for ground-truth).

Quadratic complexity: O(N^2) for image with N pixels. Works for both 3D and 2D.

Squared Euclidean distances are computed in-place for every pixel relative to the zero-pixels.

Parameters:
[in,out] im The input binary image using vxl_uint_32 storage. The squared distance map is output to the same array, since the squared Euclidean distances are integers, assuming pixels are unit distance apart.

Definition at line 629 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_brute_force_with_list ( vil_image_view< vxl_uint_32 > &  im  )  [related]

Another Naive implementation of exact Euclidean distance transform (for ground-truth).

This implementation uses about 2x more memory than plain brute-force but is faster in most cases. It is O(N^2) if the number of white pixels is about the same as the number of black pixels. In general, the complexity is between O(N) and O(N^2) depending on the content (N is the total number of pixels).

See also:
description of vil_exact_distance_transform_brute_force

Definition at line 682 of file vil_exact_distance_transform.cxx.

template<class T>
bool vil_exact_distance_transform_brute_force_with_list_label ( vil_image_view< vxl_uint_32 > &  im,
vil_image_view< vxl_uint_32 > &  imlabel 
) [related]

Same as vil_exact_distance_transform_brute_force_with_list, but also returns a label array indicating the closest 0-pixel.

Parameters:
[out] imlabel An array indicating the closet feature pixel. imlabel[i] == row_major linear index of the closest feature voxel. Assuming the image im is also stored in row_major order, im[i] will contain the corresponding distance.

Definition at line 734 of file vil_exact_distance_transform.cxx.

template<class T>
void vil_exact_distance_transform_1d_horizontal ( vil_image_view< vxl_uint_32 > &  im  )  [related]

Row-wise 1D EDT.

This is the first step for independent-scanning EDT algorithms.

Parameters:
[in,out] im : input image. The non-zero pixels must have a very large value (larger than the number of rows of the image). In the output, non-zero pixels will contain minimum distance to the zero-pixels along the rows.
This particular implementation is based on the 1st part of the following method: R. Lotufo and F. Zampirolli, Fast multidimensional parallel euclidean distance transform based on mathematical morphology, in T. Wu and D. Borges, editors, Proccedings of SIBGRAPI 2001, XIV Brazilian Symposium on Computer Graphics and Image Processing, pages 100-105. IEEE Computer Society, 2001.

Definition at line 38 of file vil_exact_distance_transform.cxx.

template<class srcT, class destT, class accumT>
void vil_exp_filter_i ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
accumT  k 
) [related]

Apply exponential filter along i to src_im to produce dest_im.

Symmetric exponential filter of the form exp(c*|i|) applied. c=log(k) Uses fast recursive implementation.

Definition at line 52 of file vil_exp_filter_1d.h.

template<class srcT, class destT, class accumT>
void vil_exp_filter_j ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
accumT  k 
) [related]

Apply exponential filter along j to src_im to produce dest_im.

Symmetric exponential filter of the form exp(c*|j|) applied. c=log(k) Uses fast recursive implementation.

Definition at line 77 of file vil_exp_filter_1d.h.

template<class srcT, class destT, class accumT>
void vil_exp_filter_2d ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
accumT  ki,
accumT  kj 
) [related]

Apply exponential filter along i and j to src_im to produce dest_im.

Symmetric exponential filter of the form exp(c*|j|) applied. c=log(k) Uses fast recursive implementation.

Definition at line 15 of file vil_exp_filter_2d.h.

template<class srcT, class destT, class accumT>
void vil_exp_grad_filter_i ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
accumT  k 
) [related]

Apply exponential gradient filter to src_im (along i direction).

Exponential gradient filter of the form sign(i)*exp(c*|i|) applied. c=log(k) Uses fast recursive implementation.

Definition at line 58 of file vil_exp_grad_filter_1d.h.

template<class srcT, class destT, class accumT>
void vil_exp_grad_filter_j ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
accumT  k 
) [related]

Apply exponential gradient filter to src_im (along j direction).

Exponential gradient filter of the form sign(j)*exp(c*|j|) applied. c=log(k) Uses fast recursive implementation.

Definition at line 83 of file vil_exp_grad_filter_1d.h.

template<class T>
void vil_find_peaks_3x3 ( vcl_vector< unsigned > &  pi,
vcl_vector< unsigned > &  pj,
const vil_image_view< T > &  image,
const T &  min_thresh,
bool  clear_list = true 
) [related]

Return (pi,pj) for all points in image strictly above their 8 neighbours.

Compute position of all local peaks (pi[k],pj[k]) above given threshold value.

Parameters:
clear_list If true (the default) then empty lists before adding new examples
See also:
vil_find_plateaus_3x3()

Definition at line 35 of file vil_find_peaks.h.

template<class T>
void vil_find_peaks_3x3_subpixel ( vcl_vector< double > &  px,
vcl_vector< double > &  py,
vcl_vector< double > &  val,
const vil_image_view< T > &  image,
const T &  min_thresh,
bool  clear_list = true 
) [related]

Return sub-pixel (px,py,val) for all points in image strictly above their 8 neighbours.

Interpolation sub-pixel position of all local peaks (px[k],py[k]) above given threshold value by fitting a parabaloid. Interpolated peak values are returned in val.

Parameters:
clear_list If true (the default) then empty lists before adding new examples.

Definition at line 144 of file vil_find_peaks.h.

template<class T>
void vil_find_plateaus_3x3 ( vcl_vector< unsigned > &  pi,
vcl_vector< unsigned > &  pj,
const vil_image_view< T > &  image,
const T &  min_thresh,
bool  clear_list = true 
) [related]

Return (pi,pj) for all points in image greater than or equal to all 8 neighbours.

Compute position of all local plateau points (pi[k],pj[k]) above given threshold value.

Parameters:
clear_list If true (the default) then empty lists before adding new examples
See also:
vil_find_peaks_3x3()

Definition at line 35 of file vil_find_plateaus.h.

template<class T>
void vil_flood_fill_row ( vil_image_view< T > &  image,
unsigned  i,
unsigned  j,
v,
new_v,
unsigned &  ilo,
unsigned &  ihi 
) [related]

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.

template<class T>
void vil_flood_fill4 ( vil_image_view< T > &  image,
unsigned  seed_i,
unsigned  seed_j,
v,
new_v 
) [related]

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.

template<class T>
void vil_flood_fill4 ( vil_image_view< T > &  image,
unsigned  seed_i,
unsigned  seed_j,
v,
new_v,
vcl_vector< vil_chord > &  region 
) [related]

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.

template<class T>
void vil_flood_fill8 ( vil_image_view< T > &  image,
unsigned  seed_i,
unsigned  seed_j,
v,
new_v 
) [related]

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.

template<class T>
void vil_flood_fill8 ( vil_image_view< T > &  image,
unsigned  seed_i,
unsigned  seed_j,
v,
new_v,
vcl_vector< vil_chord > &  region 
) [related]

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.

template<class T>
void vil_gauss_reduce ( const vil_image_view< T > &  src,
vil_image_view< T > &  dest,
vil_image_view< T > &  work_im 
) [related]

Smooth and subsample src_im to produce dest_im.

Applies 1-5-8-5-1 smoothing filter in x and y, then samples every other pixel. work_im provides workspace

Definition at line 19 of file vil_gauss_reduce.txx.

template<class T>
void vil_gauss_reduce_2_3 ( const vil_image_view< T > &  src_im,
vil_image_view< T > &  dest_im,
vil_image_view< T > &  work_im 
) [related]

Smooth and subsample src_im to produce dest_im (2/3 size).

Applies filter in x and y, then samples every other pixel. work_im provides workspace

Definition at line 57 of file vil_gauss_reduce.txx.

template<class T>
void vil_gauss_reduce_121 ( const vil_image_view< T > &  src,
vil_image_view< T > &  dest 
) [related]

Smooth and subsample src_im to produce dest_im.

Applies 1-2-1 smoothing filter in x and y, then samples every other pixel.

Definition at line 94 of file vil_gauss_reduce.txx.

template<class T>
void vil_gauss_reduce_general ( const vil_image_view< T > &  src_im,
vil_image_view< T > &  dest_im,
const vil_gauss_reduce_params params 
) [related]

Smooth and subsample src_im by an arbitrary factor to produce dest_im.

Definition at line 110 of file vil_gauss_reduce.h.

template<class T>
void vil_grid_merge ( const vil_image_view< T > &  image1,
const vil_image_view< T > &  image2,
vil_image_view< T > &  dest_image,
unsigned  box_ni,
unsigned  box_nj 
) [related]

Merge two images in a chequer-board pattern.

image1 and image2 are merged by copying boxes of size (box_ni x box_nj) alternatively from each one. Useful for comparing two images.

Definition at line 17 of file vil_grid_merge.h.

template<class T>
void vil_histogram ( const vil_image_view< T > &  image,
vcl_vector< double > &  histo,
double  min,
double  max,
unsigned  n_bins 
) [related]

Construct histogram from pixels in given image.

Definition at line 17 of file vil_histogram.h.

template<class T>
void vil_histogram_byte ( const vil_image_view< vxl_byte > &  image,
vcl_vector< double > &  histo 
) [related]

Construct histogram from pixels in given image of bytes.

Resulting histogram has 256 bins

Definition at line 10 of file vil_histogram.cxx.

template<class T>
void vil_histogram_equalise ( vil_image_view< vxl_byte > &  image  )  [related]

Apply histogram equalisation to given image.

Definition at line 11 of file vil_histogram_equalise.cxx.

template<class srcT, class kernelT, class accumT>
accumT vil_norm_corr_2d_at_pt ( const srcT *  src_im,
vcl_ptrdiff_t  s_istep,
vcl_ptrdiff_t  s_jstep,
vcl_ptrdiff_t  s_pstep,
const vil_image_view< kernelT > &  kernel,
accumT   
) [related]

Evaluate dot product between kernel and src_im.

Assumes that the kernel has been normalised to have zero mean and unit variance

Definition at line 18 of file vil_normalised_correlation_2d.h.

template<class srcT, class destT, class kernelT, class accumT>
void vil_normalised_correlation_2d ( const vil_image_view< srcT > &  src_im,
vil_image_view< destT > &  dest_im,
const vil_image_view< kernelT > &  kernel,
accumT  ac 
) [related]

Normalised cross-correlation of (pre-normalised) kernel with srcT.

dest is resized to (1+src_im.ni()-kernel.ni())x(1+src_im.nj()-kernel.nj()) (a one plane image). On exit dest(x,y) = sum_ij src_im(x+i,y+j)*kernel(i,j)/sd_under_region

Assumes that the kernel has been normalised to have zero mean and unit variance

Definition at line 67 of file vil_normalised_correlation_2d.h.

template<class T>
void vil_orientations ( const vil_image_view< float > &  grad_i,
const vil_image_view< float > &  grad_j,
vil_image_view< float > &  orient_im,
vil_image_view< float > &  grad_mag 
) [related]

Compute orientation (in radians) and gradient magnitude at each pixel.

Images assumed to be single plane

Definition at line 11 of file vil_orientations.cxx.

template<class T>
void vil_orientations ( const vil_image_view< float > &  grad_i,
const vil_image_view< float > &  grad_j,
vil_image_view< vxl_byte > &  orient_im,
vil_image_view< float > &  grad_mag,
unsigned  n_orientations = 256 
) [related]

Compute discrete orientation and gradient magnitude at each pixel.

Comutes orientation at each pixel and scales to range [0,n_orientations-1].

Orientation of i corresponds to angles in range [(i-0.5)dA,(i+0.5)dA] where dA=2*pi/n_orientations.

Images assumed to be single plane

Definition at line 53 of file vil_orientations.cxx.

template<class T>
void vil_orientations_at_edges ( const vil_image_view< float > &  grad_i,
const vil_image_view< float > &  grad_j,
vil_image_view< vxl_byte > &  orient_im,
vil_image_view< float > &  grad_mag,
float  grad_threshold,
unsigned  n_orientations = 255 
) [related]

Compute discrete orientation and gradient magnitude at edge pixels.

Comutes orientation at each pixel and scales to range [0,n_orientations]. If gradient magnitude is less than grad_threshold, then orientation of zero is set, meaning undefined orientation.

Orientation of i>0 corresponds to angles in range [(i-1.5)dA,(i-0.5)dA] where dA=2*pi/n_orientations.

Images assumed to be single plane

Definition at line 106 of file vil_orientations.cxx.

template<class T>
void vil_orientations_from_sobel ( const vil_image_view< T > &  src_image,
vil_image_view< float > &  orient_im,
vil_image_view< float > &  grad_mag 
) [related]

Compute orientation and gradient magnitude using sobel to get gradients.

Definition at line 54 of file vil_orientations.h.

template<class T>
void vil_orientations_from_sobel ( const vil_image_view< T > &  src_image,
vil_image_view< vxl_byte > &  orient_im,
vil_image_view< float > &  grad_mag,
unsigned  n_orientations = 256 
) [related]

Compute discrete orientation and gradient using sobel operations.

Comutes orientation at each pixel and scales to range [0,n_orientations-1].

Orientation of i corresponds to angles in range [(i-0.5)dA,(i+0.5)dA] where dA=2*pi/n_orientations.

Images assumed to be single plane

Definition at line 72 of file vil_orientations.h.

template<class srcT, class destT>
void vil_quad_distance_function ( const vil_image_view< srcT > &  src,
double  ai,
double  aj,
vil_image_view< destT > &  dest 
) [related]

Apply quadratic distance transform along each row of src.

$ dest(x,y)=min_i,j (src(x+i,y+j)+ai(i^2)+aj(j^2)) $

Definition at line 159 of file vil_quad_distance_function.h.

template<class srcT, class destT, class posT>
void vil_quad_distance_function ( const vil_image_view< srcT > &  src,
double  ai,
double  aj,
vil_image_view< destT > &  dest,
vil_image_view< posT > &  pos 
) [related]

Apply quadratic distance transform along each row of src.

$ dest(x,y)=min_i,j (src(x+i,y+j)+ai(i^2)+aj(j^2)) $ (pos(x,y,0),pos(x,y,1)) gives the position (x+i,y+j) leading to minima

Definition at line 198 of file vil_quad_distance_function.h.

template<class srcT, class destT>
void vil_sobel_1x3 ( const vil_image_view< srcT > &  src,
vil_image_view< destT > &  grad_i,
vil_image_view< destT > &  grad_j 
) [related]

Compute gradients of an image using 1x3 Sobel filters.

Computes both i and j gradients of an ni x nj plane of data 1 pixel border around grad images is set to zero

Definition at line 35 of file vil_sobel_1x3.txx.

template<class srcT, class destT>
void vil_sobel_1x3 ( const vil_image_view< srcT > &  src,
vil_image_view< destT > &  grad_ij 
) [related]

Compute gradients of an image using 1x3 Sobel filters.

Computes both i and j gradients of an nx x ny plane of data grad_ij has twice as many planes as src, with dest plane (2i) being the i-gradient of source plane i and dest plane (2i+1) being the j-gradient. 1 pixel border around grad images is set to zero

Definition at line 15 of file vil_sobel_1x3.txx.

template<class srcT, class destT>
void vil_sobel_3x3 ( const vil_image_view< srcT > &  src,
vil_image_view< destT > &  grad_i,
vil_image_view< destT > &  grad_j 
) [related]

Compute gradients of an image using 3x3 Sobel filters.

Computes both i and j gradients of an ni x nj plane of data 1 pixel border around grad images is set to zero

Definition at line 35 of file vil_sobel_3x3.txx.

template<class srcT, class destT>
void vil_sobel_3x3 ( const vil_image_view< srcT > &  src,
vil_image_view< destT > &  grad_ij 
) [related]

Compute gradients of an image using 3x3 Sobel filters.

Computes both i and j gradients of an nx x ny plane of data grad_ij has twice as many planes as src, with dest plane (2i) being the i-gradient of source plane i and dest plane (2i+1) being the j-gradient. 1 pixel border around grad images is set to zero

Definition at line 15 of file vil_sobel_3x3.txx.

template<class T>
void vil_suppress_non_max_3x3 ( const vil_image_view< T > &  src_im,
vil_image_view< T > &  dest_im,
threshold = 0,
non_max_value = 0 
) [related]

Suppress all non-maximal (non peaks) pixels in the image.

If image(i,j) is strictly larger than all neighbouring pixels, and is above the threshold, then it is retained. All other pixels are set to non_max_value.

non_max_value must be below the threshold (so the default value of zero is inappropriate if the image contains peaks of interest with negative values)

Note that where there are neighbouring pixels with identical values on a raised plateau, then all the pixels on the plateau will be suppressed. This can cause some peaks to be missed. The effect can be reduced by using float images and pre-smoothing slightly. Alternatively, use vil_suppress_non_plateau_3x3() to retain plateau points as well as strict maxima.

See also:
vil_suppress_non_plateau_3x3()

Definition at line 33 of file vil_suppress_non_max.h.

template<class srcT, class destT>
void vil_suppress_non_max_edges ( const vil_image_view< srcT > &  grad_i,
const vil_image_view< srcT > &  grad_j,
double  grad_mag_threshold,
vil_image_view< destT > &  grad_mag 
) [related]

Given gradient images, computes magnitude image containing maximal edges.

Computes magnitude image. Zeros any below a threshold. Points with magnitude above a threshold are tested against gradient along normal to the edge and retained only if they are higher than their neighbours.

Note: Currently assumes single plane only. 2 pixel border around output set to zero. If two neighbouring edges have exactly the same strength, it retains both (ie an edge is eliminated if it is strictly lower than a neighbour, but not if it is the same as two neighbours).

Definition at line 24 of file vil_suppress_non_max_edges.txx.

template<class srcT, class destT>
void vil_suppress_non_max_edges_subpixel ( const vil_image_view< srcT > &  grad_i,
const vil_image_view< srcT > &  grad_j,
double  grad_mag_threshold,
vil_image_view< destT > &  grad_mag_orient_offset 
) [related]

Given gradient images, computes a subpixel edgemap with magnitudes and orientations.

Computes magnitude image. Zeros any below a threshold. Points with magnitude above a threshold are tested against gradient along normal to the edge and retained only if they are higher than their neighbours. The magnitude of retained points is revised using parabolic interpolation in the normal direction. The same interpolation provides a subpixel offset from the integral pixel location.

This algorithm returns a 3-plane image where the planes are:

  • 0 - The interpolated peak magnitude
  • 1 - The orientation (in radians)
  • 2 - The offset to the subpixel peak in the gradient direction All non-maximal edge pixel have the value zero in all three planes.
    See also:
    vil_orientations_at_edges
    The subpixel location for pixel (i,j) is computed as
        double theta = grad_mag_orient_offset(i,j,1);
        double offset = grad_mag_orient_offset(i,j,2);
        double x = i + vcl_cos(theta)*offset;
        double y = j + vcl_sin(theta)*offset;
    

Note: Currently assumes single plane only. 2 pixel border around output set to zero. If two neighbouring edges have exactly the same strength, it retains both (ie an edge is eliminated if it is strictly lower than a neighbour, but not if it is the same as two neighbours).

Definition at line 135 of file vil_suppress_non_max_edges.txx.

template<class T>
void vil_suppress_non_plateau_3x3 ( const vil_image_view< T > &  src_im,
vil_image_view< T > &  dest_im,
threshold = 0,
non_max_value = 0 
) [related]

Suppress all non-plateau pixels in the image.

If image(i,j) is greater than or equal to all neighbouring pixels, and is above the threshold, then it is retained. All other pixels are set to non_max_value.

non_max_value must be below the threshold (so the default value of zero is inappropriate if the image contains plateaus of interest with negative values)

See also:
vil_suppress_non_max_3x3()

Definition at line 26 of file vil_suppress_non_plateau.h.

template<class srcT>
void vil_threshold_above ( const vil_image_view< srcT > &  src,
vil_image_view< bool > &  dest,
srcT  t 
) [related]

Apply threshold such that dest(i,j,p)=true if src(i,j,p)>=t.

Definition at line 12 of file vil_threshold.txx.

template<class srcT>
void vil_threshold_below ( const vil_image_view< srcT > &  src,
vil_image_view< bool > &  dest,
srcT  t 
) [related]

Apply threshold such that dest(i,j,p)=true if src(i,j,p)<=t.

Definition at line 38 of file vil_threshold.txx.

template<class srcT>
void vil_threshold_inside ( const vil_image_view< srcT > &  src,
vil_image_view< bool > &  dest,
srcT  t0,
srcT  t1 
) [related]

Apply threshold such that dest(i,j,p)=true if t0<=src(i,j,p)<=t1.

Definition at line 64 of file vil_threshold.txx.

template<class srcT>
void vil_threshold_outside ( const vil_image_view< srcT > &  src,
vil_image_view< bool > &  dest,
srcT  t0,
srcT  t1 
) [related]

Apply threshold such that dest(i,j,p)=true if src(i,j,p)<=t0 or src(i,j,p)>=t1.

Definition at line 90 of file vil_threshold.txx.

template<class T>
void vil_tile_images ( vil_image_view< T > &  big_image,
const vcl_vector< vil_image_view< T > > &  patches 
) [related]

Create a big image by tiling images in patches (must be of same size).

Creates a large image by putting smaller images into an approximately square grid. If there are n small images, the grid will have sqrt(n) columns.

See also:
contrib/mul/tools/tile_images_2d

Definition at line 21 of file vil_tile_images.h.

template<class T>
void vil_trace_4con_boundary ( vcl_vector< int > &  bi,
vcl_vector< int > &  bj,
const vil_image_view< bool > &  image,
int  i0,
int  j0 
) [related]

Trace 4-connected boundary around region in boolean image.

Assumes that (i0,j0) is a boundary point. Searches for the boundary pixels and runs around until it gets back to beginning. On exit the boundary points are given by (bi[k],bj[k])

Point to note: If (i0,j0) is in the middle of a 1 pixel wide line connecting two regions, then the point will occur twice in the list, once as the first point, then once in the middle of the list as we trace through it to get to the other side of the blob.

See also:
vil_trace_8con_boundary

Definition at line 52 of file vil_trace_4con_boundary.cxx.

template<class T>
void vil_trace_8con_boundary ( vcl_vector< int > &  bi,
vcl_vector< int > &  bj,
const vil_image_view< bool > &  image,
int  i0,
int  j0 
) [related]

Trace 8-connected boundary around region in boolean image.

Assumes that (i0,j0) is a boundary point. Searches for the boundary pixels and runs around until it gets back to beginning. On exit the boundary points are given by (bi[k],bj[k])

Point to note: If (i0,j0) is in the middle of a 1 pixel wide line connecting two regions, then the point will occur twice in the list, once as the first point, then once in the middle of the list as we trace through it to get to the other side of the blob.

See also:
vil_trace_4con_boundary

Definition at line 75 of file vil_trace_8con_boundary.cxx.

template<class T>
void vsl_b_write ( vsl_b_ostream os,
const vil_image_view< T > &  image 
) [related]

Binary save vil_image_view<T> to stream.

Definition at line 16 of file vil_io_image_view.h.

template<class T>
void vsl_b_read ( vsl_b_istream is,
vil_image_view< T > &  image 
) [related]

Binary load vil_image_view<T> from stream.

Definition at line 40 of file vil_io_image_view.h.

template<class T>
void vsl_b_read ( vsl_b_istream is,
vil_image_view< T > *&  p 
) [related]

Binary load vil_image_view<T> from stream onto the heap.

Definition at line 90 of file vil_io_image_view.h.

template<class T>
void vsl_print_summary ( vcl_ostream &  os,
const vil_image_view< T > &  image 
) [related]

Print human readable summary of a vil_image_view<T> object to a stream.

Definition at line 107 of file vil_io_image_view.h.

template<class T>
double vil_bicub_interp_safe ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute bicubic interpolation at (x,y), with bound checks.

If (x,y) is outside interpolatable image region, zero is returned. The safe interpolatable region is [1,view.ni()-2]*[1,view.nj()-2].

Definition at line 82 of file vil_bicub_interp.h.

template<class T>
double vil_bicub_interp ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute bicubic interpolation at (x,y), with minimal bound checks.

If (x,y) is outside interpolatable image region and NDEBUG is not defined the code will fail an ASSERT. The safe interpolatable region is [1,view.ni()-2]*[1,view.nj()-2].

Definition at line 113 of file vil_bicub_interp.h.

template<class T>
double vil_bicub_interp_safe_extend ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute bicubic interpolation at (x,y), with bound checks.

If (x,y) is outside safe interpolatable image region, nearest pixel value is returned. The safe interpolatable region is [1,view.ni()-2]*[1,view.nj()-2].

Definition at line 142 of file vil_bicub_interp.h.

template<class T>
double vil_bilin_interp_safe ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute bilinear interpolation at (x,y), with bound checks.

If (x,y) is outside interpolatable image region, zero is returned. The safe interpolatable region is [0,view.ni()-1]*[0,view.nj()-1].

Definition at line 113 of file vil_bilin_interp.h.

template<class T>
double vil_bilin_interp ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute bilinear interpolation at (x,y), with minimal bound checks.

If (x,y) is outside interpolatable image region and NDEBUG is not defined the code will fail an ASSERT. The safe interpolatable region is [0,view.ni()-1]*[0,view.nj()-1].

Definition at line 145 of file vil_bilin_interp.h.

template<class T>
double vil_bilin_interp_safe_extend ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute bilinear interpolation at (x,y), with bound checks.

If (x,y) is outside safe interpolatable image region, nearest pixel value is returned. The safe interpolatable region is [0,view.ni()-1]*[0,view.nj()-1].

Definition at line 175 of file vil_bilin_interp.h.

template<class T>
void vil_clamp ( const vil_image_view< T > &  src,
vil_image_view< T > &  dest,
lo,
hi 
) [related]

Clamp an image view between two values.

Definition at line 23 of file vil_clamp.h.

template<class T>
void vil_clamp_below ( vil_image_view< T > &  src,
t,
v 
) [related]

Clamp an image view above a given value t, setting it to v if below or on t.

Definition at line 85 of file vil_clamp.h.

template<class T>
void vil_clamp_below ( vil_image_view< T > &  src,
t 
) [related]

Clamp an image view above a given value t, setting it to this t if below t.

Definition at line 105 of file vil_clamp.h.

template<class inP, class outP>
void vil_convert_cast ( const vil_image_view< inP > &  src,
vil_image_view< outP > &  dest 
) [related]

Cast one pixel type to another (with rounding).

There must be a cast operator from inP to outP

If the two pixel types are the same, the destination may only be a shallow copy of the source.

Definition at line 242 of file vil_convert.h.

template<class inP, class outP>
void vil_convert_round ( const vil_image_view< inP > &  src,
vil_image_view< outP > &  dest 
) [related]

Convert one pixel type to another with rounding.

This should only be used to convert scalar pixel types to other scalar pixel types, or RGBs to RGBs. This function only rounds in terms of the destination type.

If the two pixel types are the same, the destination may only be a shallow copy of the source.

Definition at line 440 of file vil_convert.h.

template<class T>
void vil_convert_stretch_range ( const vil_image_view< T > &  src,
vil_image_view< vxl_byte > &  dest 
) [related]

Convert src to byte image dest by stretching to range [0,255].

Definition at line 508 of file vil_convert.h.

template<class T>
void vil_copy_reformat ( const vil_image_view< T > &  src,
vil_image_view< T > &  dest 
) [related]

Copy src to dest, without changing dest's view parameters.

This is useful if you want to copy an image into a window on another image. src and dest must have identical sizes, and types. O(size).

Definition at line 37 of file vil_copy.txx.

template<class T>
void vil_copy_to_window ( const vil_image_view< T > &  src,
vil_image_view< T > &  dest,
unsigned  i0,
unsigned  j0 
) [related]

Copy src to window in dest.

Size of window is defined by src. O(src.size).

Definition at line 53 of file vil_copy.txx.

template<class T>
void vil_copy_deep ( const vil_image_view< T > &  src,
vil_image_view< T > &  dest 
) [related]

Deep copy src to dest.

O(size).

Definition at line 18 of file vil_copy.txx.

template<class T>
vil_image_view< T > vil_copy_deep ( const vil_image_view< T > &  src  )  [related]

Create a deep copy of an image, with completely new underlying memory.

O(size).

Definition at line 25 of file vil_copy.txx.

template<class T>
vil_image_view< T > vil_crop ( const vil_image_view< T > &  im,
unsigned  i0,
unsigned  n_i,
unsigned  j0,
unsigned  n_j 
) [related]

Create a view which is a cropped version of src.

Doesn't modify underlying data. O(1).

Returns:
an n_i x n_j window of im with offset (i0,j0)

Definition at line 21 of file vil_crop.h.

template<class T>
vil_image_view< T > vil_decimate ( const vil_image_view< T > &  im,
unsigned  i_factor,
unsigned  j_factor = 0 
) [related]

Create a view which is a decimated version of src.

Doesn't modify underlying data. O(1).

The factor describes the number of input rows (or columns) that are equivalent to one output. If you don't specify the j_factor, it will be set equal to i_factor.

Definition at line 22 of file vil_decimate.h.

template<class T>
void vil_fill ( vil_image_view< T > &  view,
value 
) [related]

Fill view with given value.

O(size).

Definition at line 17 of file vil_fill.h.

template<class T>
void vil_fill_line ( vil_image_view< T > &  im,
int  ai,
int  aj,
int  bi,
int  bj,
value 
) [related]

Fill line from (ai,aj) to (bi,bj) using Bresenham's algorithm.

Only modifies first plane.

Definition at line 55 of file vil_fill.h.

template<class T>
void vil_fill_row ( vil_image_view< T > &  view,
unsigned  j,
value 
) [related]

Fill row j in view with given value.

O(ni).

Definition at line 130 of file vil_fill.h.

template<class T>
void vil_fill_col ( vil_image_view< T > &  view,
unsigned  i,
value 
) [related]

Fill column i in view with given value.

O(nj).

Definition at line 145 of file vil_fill.h.

template<class srcT>
void vil_fill_mask ( vil_image_view< srcT > &  image,
const vil_image_view< bool > &  mask,
srcT  value,
bool  b = true 
) [related]

Writes given value into each pixel of image under the elements of the mask set to b.

If mask.nplanes()==1 then the same mask is applied to every image plane, otherwise there must be the same number of mask planes as image planes.

Definition at line 162 of file vil_fill.h.

template<class T>
void vil_fill_disk ( vil_image_view< T > &  image,
double  ci,
double  cj,
double  r,
value 
) [related]

Fills pixels in disk with centre (ci,cj), radius r, with given value.

Fills all planes of image with the value.

Definition at line 198 of file vil_fill.h.

template<class T>
vil_image_view< T > vil_flatten_planes ( const vil_image_view< T > &  im  )  [related]

Rearrange multiple planes into a multiple tiles of a single-plane image.

A ni x nj x nplanes images will be arranged into an ni x (nj*nplanes) x 1 image. A view transformation will be used if possible.

Definition at line 18 of file vil_flatten.h.

template<class T>
vil_image_view< T > vil_flip_lr ( const vil_image_view< T > &  v  )  [related]

Create a reflected view in which i -> ni-1-i.

i.e. vil_flip_lr(view)(i,j,p) = view(ni-1-i,j,p) O(1).

Definition at line 20 of file vil_flip.h.

template<class T>
vil_image_view< T > vil_flip_ud ( const vil_image_view< T > &  v  )  [related]

Create a reflected view in which y -> nj-1-j.

i.e. vil_flip_ud(view)(i,j,p) = view(i,nj-1-j,p) O(1).

Definition at line 33 of file vil_flip.h.

template<class T>
bool vil_image_view_deep_equality ( const vil_image_view< T > &  lhs,
const vil_image_view< T > &  rhs 
) [related]

True if the actual images are identical.

$\bigwedge_{i,j,p} {\textstyle src}(i,j,p) == {\textstyle dest}(i,j,p)$ The data may be formatted differently in each memory chunk. O(size).

template<class T>
vil_image_view_base_sptr vil_load ( const char *  ,
bool  verbose = true 
) [related]

Convenience function for loading an image into an image view.

Definition at line 115 of file vil_load.cxx.

template<class T>
void vil_math_value_range_percentiles ( const vil_image_view< T > &  im,
const vcl_vector< double > &  fraction,
vcl_vector< T > &  value 
) [related]

Compute the values corresponding to several percentiles of the range of im.

Percentiles are expressed as fraction, e.g. 0.05, or 0.95.

Parameters:
im The image to examine.
fraction The fractions of the data range (from the lower end).
Return values:
value The image data values corresponding to the specified percentiles.
Note:
This function requires the sorting of large parts of the image data and can be very expensive in terms of both processing and memory.

Definition at line 83 of file vil_math.h.

template<class T>
void vil_math_value_range_percentile ( const vil_image_view< T > &  im,
const double  fraction,
T &  value 
) [related]

Compute the value corresponding to a percentile of the range of im.

Percentile is expressed as fraction, e.g. 0.05, or 0.95.

Parameters:
im The image to examine.
fraction The fraction of the data range (from the lower end).
Return values:
value The image data value corresponding to the specified percentile.
Note:
This function requires the sorting of large parts of the image data and can be very expensive in terms of both processing and memory.

Definition at line 148 of file vil_math.h.

template<class imT, class sumT>
sumT vil_math_ssd ( const vil_image_view< imT > &  imA,
const vil_image_view< imT > &  imB,
sumT   
) [related]

Sum of squared differences between two images.

Definition at line 163 of file vil_math.h.

template<class imT, class sumT>
sumT vil_math_ssd_complex ( const vil_image_view< vcl_complex< imT > > &  imA,
const vil_image_view< vcl_complex< imT > > &  imB,
sumT   
) [related]

Sum squared magnitude differences between two complex images.

Definition at line 181 of file vil_math.h.

template<class aT, class sumT>
void vil_math_mean_over_planes ( const vil_image_view< aT > &  src,
vil_image_view< sumT > &  dest 
) [related]

Calc the mean of each pixel over all the planes.

Definition at line 200 of file vil_math.h.

template<class inT, class outT, class sumT>
void vil_math_mean_over_planes ( const vil_image_view< inT > &  src,
vil_image_view< outT > &  dest,
sumT   
) [related]

Calc the mean of each pixel over all the planes.

Definition at line 222 of file vil_math.h.

template<class imT, class sumT>
void vil_math_sum ( sumT &  sum,
const vil_image_view< imT > &  im,
unsigned  p 
) [related]

Sum of elements in plane p of image.

Definition at line 240 of file vil_math.h.

template<class imT, class sumT>
void vil_math_mean ( sumT &  mean,
const vil_image_view< imT > &  im,
unsigned  p 
) [related]

Mean of elements in plane p of image.

Definition at line 257 of file vil_math.h.

template<class imT>
void vil_math_median ( imT &  median,
const vil_image_view< imT > &  im,
unsigned  p 
) [related]

Median of elements in plane p of an image.

For integral types, if the the median is half way between two values, the result will be the floor of the average.

Definition at line 275 of file vil_math.h.

template<class imT, class sumT>
void vil_math_sum_squares ( sumT &  sum,
sumT &  sum_sq,
const vil_image_view< imT > &  im,
unsigned  p 
) [related]

Sum of squares of elements in plane p of image.

Definition at line 290 of file vil_math.h.

template<class imT, class sumT>
void vil_math_mean_and_variance ( sumT &  mean,
sumT &  var,
const vil_image_view< imT > &  im,
unsigned  p 
) [related]

Mean and variance of elements in plane p of image.

Definition at line 307 of file vil_math.h.

template<class T>
void vil_math_sqrt ( vil_image_view< T > &  image  )  [related]

Compute square-root of each pixel element (or zero if negative).

Definition at line 331 of file vil_math.h.

template<class T>
void vil_math_truncate_range ( vil_image_view< T > &  image,
min_v,
max_v 
) [related]

Truncate each pixel value so it fits into range [min_v,max_v].

If value < min_v value=min_v If value > max_v value=max_v

Definition at line 342 of file vil_math.h.

template<class T>
void vil_math_scale_values ( vil_image_view< T > &  image,
double  scale 
) [related]

Multiply values in-place in image view by scale.

Definition at line 421 of file vil_math.h.

template<class imT, class offsetT>
void vil_math_scale_and_offset_values ( vil_image_view< imT > &  image,
double  scale,
offsetT  offset 
) [related]

Multiply values in-place in image view by scale and add offset.

Definition at line 429 of file vil_math.h.

template<class aT, class bT, class sumT>
void vil_math_image_sum ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< sumT > &  im_sum 
) [related]

Compute sum of two images (im_sum = imA+imB).

Definition at line 605 of file vil_math.h.

template<class aT, class bT, class sumT>
void vil_math_image_product ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< sumT > &  im_product 
) [related]

Compute pixel-wise product of two images (im_prod(i,j) = imA(i,j)*imB(i,j).

If images have the same number of planes, then im_prod(i,j,p) = imA(i,j,p)*imB(i,j,p). If imB only has one plane, then im_prod(i,j,p) = imA(i,j,p)*imB(i,j,0).

Definition at line 641 of file vil_math.h.

template<class aT, class bT, class maxT>
void vil_math_image_max ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< maxT > &  im_max 
) [related]

Compute the max of two images (im_max = max(imA, imB)).

Definition at line 680 of file vil_math.h.

template<class aT, class bT, class minT>
void vil_math_image_min ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< minT > &  im_min 
) [related]

Compute the min of two images (im_min = min(imA, imB)).

Definition at line 713 of file vil_math.h.

template<class aT, class bT, class sumT>
void vil_math_image_ratio ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< sumT > &  im_ratio 
) [related]

Compute pixel-wise ratio of two images : im_ratio(i,j) = imA(i,j)/imB(i,j).

Pixels cast to type sumT before calculation. If imB(i,j,p)==0, im_ration(i,j,p)=0

If images have the same number of planes, then im_ratio(i,j,p) = imA(i,j,p)/imB(i,j,p). If imB only has one plane, then im_ratio(i,j,p) = imA(i,j,p)/imB(i,j,0).

Definition at line 752 of file vil_math.h.

template<class aT, class bT, class sumT>
void vil_math_image_difference ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< sumT > &  im_sum 
) [related]

Compute difference of two images (im_sum = imA-imB).

Definition at line 793 of file vil_math.h.

template<class aT, class bT, class sumT>
void vil_math_image_abs_difference ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< sumT > &  im_sum 
) [related]

Compute absolute difference of two images (im_sum = |imA-imB|).

Definition at line 826 of file vil_math.h.

template<class aT, class bT>
double vil_math_image_abs_difference ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB 
) [related]

Compute sum of absolute difference between two images (|imA-imB|).

Definition at line 862 of file vil_math.h.

template<class aT, class bT, class magT>
void vil_math_image_vector_mag ( const vil_image_view< aT > &  imA,
const vil_image_view< bT > &  imB,
vil_image_view< magT > &  im_mag 
) [related]

Compute magnitude of two images taken as vector components, sqrt(A^2 + B^2).

Definition at line 894 of file vil_math.h.

template<class aT, class bT, class scaleT>
void vil_math_add_image_fraction ( vil_image_view< aT > &  imA,
scaleT  fa,
const vil_image_view< bT > &  imB,
scaleT  fb 
) [related]

imA = fa*imA + fb*imB (Useful for moving averages!).

Can do running sum using vil_add_image_fraction(running_mean,1-f,new_im,f) to update current mean by a fraction f of new_im

Definition at line 934 of file vil_math.h.

template<class aT, class sumT>
void vil_math_integral_image ( const vil_image_view< aT > &  imA,
vil_image_view< sumT > &  im_sum 
) [related]

Compute integral image im_sum(i+1,j+1) = sum (x<=i,y<=j) imA(x,y).

Useful thing for quickly computing mean over large regions, as demonstrated in Viola and Jones (CVPR01). The sum of elements in the ni x nj square with corner (i,j) is given by im_sum(i,j)+im_sum(i+ni,j+nj)-im_sum(i+ni,j)-im_sum(i,j+nj)

Definition at line 965 of file vil_math.h.

template<class aT, class sumT>
void vil_math_integral_sqr_image ( const vil_image_view< aT > &  imA,
vil_image_view< sumT > &  im_sum,
vil_image_view< sumT > &  im_sum_sq 
) [related]

Compute integral image im_sum_sq(i+1,j+1) = sum (x<=i,y<=j) imA(x,y)^2.

Also computes sum im_sum(i+1,j+1) = sum (x<=i,y<=j) imA(x,y)

Useful thing for quickly computing mean and variance over large regions, as demonstrated in Viola and Jones (CVPR01).

The sum of elements in the ni x nj square with corner (i,j) is given by im_sum(i,j)+im_sum(i+ni,j+nj)-im_sum(i+ni,j)-im_sum(i,j+nj)

Similar result holds for sum of squares, allowing rapid calculation of variance etc.

Definition at line 1015 of file vil_math.h.

template<class T>
T vil_nearest_interp_unsafe ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute nearest neighbour interpolation at (x,y), no bound checks. Requires -0.5<=x<ni-0.5, -0.5<=y<nj-0.5.

No bound checks are done.

Definition at line 36 of file vil_nearest_interp.h.

template<class T>
T vil_nearest_interp_safe ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute nearest neighbour interpolation at (x,y), with bound checks.

If (x,y) is outside interpolatable image region, zero is returned. The safe interpolatable region is [-0.5,view.ni()-0.5)*[0,view.nj()-0.5).

Definition at line 63 of file vil_nearest_interp.h.

template<class T>
T vil_nearest_interp ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute nearest neighbour interpolation at (x,y), with minimal bound checks.

If (x,y) is outside interpolatable image region and NDEBUG is not defined the code will fail an ASSERT. The safe interpolatable region is [-0.5,view.ni()-0.5)*[0.5,view.nj()-0.5).

Definition at line 97 of file vil_nearest_interp.h.

template<class T>
T vil_nearest_interp_safe_extend ( const vil_image_view< T > &  view,
double  x,
double  y,
unsigned  p = 0 
) [related]

Compute nearest_neighbourear interpolation at (x,y), with bound checks.

If (x,y) is outside safe interpolatable image region, nearest pixel value is returned. The safe interpolatable region is [-0.5,view.ni()-0.5)*[-0.5,view.nj()-0.5).

Definition at line 135 of file vil_nearest_interp.h.

template<class T>
vil_image_view< T > vil_new_image_view_plane_i_j ( unsigned  ni,
unsigned  nj,
unsigned  nplanes,
 
) [related]

Create a new image view whose j_step is 1.

Pixel data type is the type of the last (dummy) argument. i_step will be nj, planestep will be ni x nj.

Definition at line 182 of file vil_new.h.

template<class T>
vil_image_view< T > vil_new_image_view_i_j_plane ( unsigned  ni,
unsigned  nj,
unsigned  nplanes,
 
) [related]

Create a new image view whose plane step is 1 and whose j_step is nplanes.

Pixel data type is the type of the last (dummy) argument. i_step will be nplanes x nj.

Definition at line 195 of file vil_new.h.

template<class T>
vil_image_view_base_sptr vil_new_image_view_base_sptr ( const vil_image_view_base  )  [related]

Create a shallow copy of an image and wrap it in a vil_image_view_base_sptr.

Note:
vil_image_view_base_sptr almost certainly doesn't behave as you would expect, and this function should really only be used by experts.

Definition at line 278 of file vil_new.cxx.

template<class T>
vil_image_view< T > vil_plane ( const vil_image_view< T > &  im,
unsigned  p 
) [related]

Return a view of im's plane p.

O(1).

Definition at line 20 of file vil_plane.h.

template<class T>
void vil_print_value ( vcl_ostream &  s,
const T &  value 
) [related]

How to print value in vil_print_all(image_view).

template<class T>
void vil_print_all ( vcl_ostream &  os,
const vil_image_view< T > &  view 
) [related]

Print all image data to os in a grid (rounds output to int).

Definition at line 77 of file vil_print.h.

template<class T>
void vil_print_all ( vcl_ostream &  os,
vil_image_view_base_sptr const &  view 
) [related]

Print all image data to os in a grid.

template<class sType, class dType>
void vil_resample_bicub ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
double  x0,
double  y0,
double  dx1,
double  dy1,
double  dx2,
double  dy2,
int  n1,
int  n2 
) [related]

Sample grid of points in one image and place in another, using bicubic interpolation.

dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return zero.

See also:
vil_resample_bilin
dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return zero.

Definition at line 34 of file vil_resample_bicub.txx.

template<class sType, class dType>
void vil_resample_bicub ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
int  n1,
int  n2 
) [related]

Resample image to a specified width (n1) and height (n2).

See also:
vil_resample_bilin

Definition at line 126 of file vil_resample_bicub.txx.

template<class sType, class dType>
void vil_resample_bilin ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
double  x0,
double  y0,
double  dx1,
double  dy1,
double  dx2,
double  dy2,
int  n1,
int  n2 
) [related]

Sample grid of points in one image and place in another, using bilinear interpolation.

dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return zero.

See also:
vil_resample_bicub
dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return zero.

Definition at line 36 of file vil_resample_bilin.txx.

template<class sType, class dType>
void vil_resample_bilin ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
int  n1,
int  n2 
) [related]

Resample image to a specified width (n1) and height (n2).

See also:
vil_resample_bicub

Definition at line 136 of file vil_resample_bilin.txx.

template<class sType, class dType>
void vil_resample_bilin_edge_extend ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
double  x0,
double  y0,
double  dx1,
double  dy1,
double  dx2,
double  dy2,
int  n1,
int  n2 
) [related]

Sample grid of points in one image and place in another, using bilinear interpolation.

dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return the value of the nearest valid pixel.

dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return zero.

Definition at line 158 of file vil_resample_bilin.txx.

template<class sType, class dType>
void vil_resample_bilin_edge_extend ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
int  n1,
int  n2 
) [related]

Resample image to a specified width (n1) and height (n2).

Definition at line 259 of file vil_resample_bilin.txx.

template<class sType, class dType>
void vil_resample_nearest ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
double  x0,
double  y0,
double  dx1,
double  dy1,
double  dx2,
double  dy2,
int  n1,
int  n2 
) [related]

Sample grid of points in one image and place in another, using nearest neighbour interpolation.

dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return zero.

Definition at line 42 of file vil_resample_nearest.txx.

template<class sType, class dType>
void vil_resample_nearest ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
int  n1,
int  n2 
) [related]

Resample image to a specified width (n1) and height (n2).

Definition at line 142 of file vil_resample_nearest.txx.

template<class sType, class dType>
void vil_resample_nearest_edge_extend ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
double  x0,
double  y0,
double  dx1,
double  dy1,
double  dx2,
double  dy2,
int  n1,
int  n2 
) [related]

Sample grid of points in one image and place in another, using nearest neighbour interpolation.

Sample grid of points in one image and place in another, using bilinear interpolation.

dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return the value of the nearest valid pixel.

dest_image(i,j,p) is sampled from the src_image at (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] dest_image resized to (n1,n2,src_image.nplanes()) Points outside image return zero.

Definition at line 164 of file vil_resample_nearest.txx.

template<class sType, class dType>
void vil_resample_nearest_edge_extend ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
int  n1,
int  n2 
) [related]

Resample image to a specified width (n1) and height (n2).

Definition at line 265 of file vil_resample_nearest.txx.

template<class sType, class dType>
void vil_rotate_image ( const vil_image_view< sType > &  src_image,
vil_image_view< dType > &  dest_image,
double  theta_deg 
) [related]

Rotate image by angle theta.

Definition at line 29 of file vil_rotate.txx.

template<class imType, class vecType>
void vil_sample_grid_bicub ( vecType *  v,
const vil_image_view< imType > &  image,
double  x0,
double  y0,
double  dx1,
double  dy1,
double  dx2,
double  dy2,
int  n1,
int  n2 
) [related]

Sample grid from image, using bicubic interpolation.

Grid points are (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] Vector v is filled with n1*n2*np elements, where np=image.nplanes()*image.ncomponents() v[0]..v[np-1] are the values from point (x0,y0) Samples are taken along direction (dx2,dy2) first, then along (dx1,dy1). Points outside image return zero.

Definition at line 33 of file vil_sample_grid_bicub.txx.

template<class imType, class vecType>
void vil_sample_grid_bilin ( vecType *  v,
const vil_image_view< imType > &  image,
double  x0,
double  y0,
double  dx1,
double  dy1,
double  dx2,
double  dy2,
int  n1,
int  n2 
) [related]

Sample grid from image, using bilinear interpolation.

Grid points are (x0+i.dx1+j.dx2,y0+i.dy1+j.dy2), where i=[0..n1-1], j=[0..n2-1] Vector v is filled with n1*n2*np elements, where np=image.nplanes()*image.ncomponents() v[0]..v[np-1] are the values from point (x0,y0) Samples are taken along direction (dx2,dy2) first, then along (dx1,dy1). Points outside image return zero.

Definition at line 34 of file vil_sample_grid_bilin.txx.

template<class imType, class vecType>
void vil_sample_profile_bicub ( vecType *  v,
const vil_image_view< imType > &  image,
double  x0,
double  y0,
double  dx,
double  dy,
int  n 
) [related]

Sample along profile, using bicubic interpolation.

Profile points are (x0+i.dx,y0+i.dy), where i=[0..n-1]. Vector v is filled with n*np elements, where np=image.nplanes()*image.ncomponents() v[0]..v[np-1] are the values from point (x0,y0) Points outside image return zero.

Definition at line 39 of file vil_sample_profile_bicub.txx.

template<class imType, class vecType>
void vil_sample_profile_bilin ( vecType *  v,
const vil_image_view< imType > &  image,
double  x0,
double  y0,
double  dx,
double  dy,
int  n 
) [related]

Sample along profile, using bilinear interpolation.

Profile points are (x0+i.dx,y0+i.dy), where i=[0..n-1]. Vector v is filled with n*np elements, where np=image.nplanes()*image.ncomponents() v[0]..v[np-1] are the values from point (x0,y0) Points outside image return zero.

Definition at line 40 of file vil_sample_profile_bilin.txx.

template<class T>
bool vil_save ( const vil_image_view_base ,
char const *  filename 
) [related]

Send a vil_image_view to disk, deducing format from filename.

Definition at line 122 of file vil_save.cxx.

template<class T>
bool vil_save ( const vil_image_view_base ,
char const *  filename,
char const *  file_format 
) [related]

Send a vil_image_view to disk, given filename.

Definition at line 30 of file vil_save.cxx.

template<class T, class F>
void vil_transform ( vil_image_view< T > &  image,
functor 
) [related]

Apply a unary operation to each pixel in image.

Parameters:
functor should take a value of type T and return same type

Definition at line 19 of file vil_transform.h.

template<class inP, class outP, class Op>
void vil_transform ( const vil_image_view< inP > &  src,
vil_image_view< outP > &  dest,
Op  functor 
) [related]

Apply a unary operation to each pixel in src to get dest.

Parameters:
functor should take a value of type inP, and return a value of type outP

Definition at line 74 of file vil_transform.h.

template<class inP, class outP, class Op>
void vil_transform2 ( const vil_image_view< inP > &  src,
vil_image_view< outP > &  dest,
Op  functor 
) [related]

Apply a binary function to each pixel in src and dest that modifies dest.

Parameters:
functor should take two parameters (inP src, outP &dest);

Definition at line 104 of file vil_transform.h.

template<class inA, class inB, class outP, class BinOp>
void vil_transform ( const vil_image_view< inA > &  srcA,
const vil_image_view< inB > &  srcB,
vil_image_view< outP > &  dest,
BinOp  functor 
) [related]

Apply a binary operation to each pixel in srcA and srcB to get dest.

Definition at line 134 of file vil_transform.h.

template<class inA, class inB, class outP, class BinOp>
void vil_transform ( const vil_image_view< inA > &  srcA,
const vil_image_view< inB > &  srcB,
const vil_image_view< outP > &  dest,
BinOp  functor 
) [related]

Apply a binary operation to each pixel in srcA and srcB to get dest.

non-const dest version, assumes dest is already correct size.

Definition at line 151 of file vil_transform.h.

template<class T>
vil_image_view< T > vil_transpose ( const vil_image_view< T > &  v  )  [related]

Create a view which appears as the transpose of this view.

i.e. transpose(i,j,p) = view(j,i,p). O(1).

Definition at line 19 of file vil_transpose.h.

template<class T>
vil_image_view< typename T::value_type > vil_view_as_planes ( const vil_image_view< T > &  v  )  [related]

Return a 3-plane view of an RGB image, or a 4-plane view of an RGBA, or a 2-plane view of a complex image.

Class T must be a compound pixel type.

Returns:
an empty view if it can't do the conversion. O(1).

Definition at line 26 of file vil_view_as.h.

template<class T>
vil_image_view< vil_rgb< T > > vil_view_as_rgb ( const vil_image_view< T > &  v  )  [related]

Return an RGB component view of a 3-plane image.

Returns:
an empty view if it can't do the conversion (e.g. planestep != 1) O(1).

Definition at line 47 of file vil_view_as.h.

template<class T>
vil_image_view< vil_rgba< T > > vil_view_as_rgba ( const vil_image_view< T > &  v  )  [related]

Return an RGBA component view of a 4-plane image.

Returns:
an empty view if it can't do the conversion (e.g. planestep != 1) O(1).

Definition at line 63 of file vil_view_as.h.

template<class T>
vil_image_view< vcl_complex< T > > vil_view_as_complex ( const vil_image_view< T > &  v  )  [related]

Return an complex component view of a 2N-plane image.

Returns:
an empty view if it can't do the conversion (e.g. planestep != 1) O(1).

Definition at line 80 of file vil_view_as.h.

template<class T>
vil_image_view< T > vil_view_part ( vil_image_view< vcl_complex< T > >  img,
int  pt 
) [related]

Base function to do the work for both vil_view_real/imag_part.

O(1).

Definition at line 97 of file vil_view_as.h.

template<class T>
vil_image_view< T > vil_view_real_part ( vil_image_view< vcl_complex< T > >  img  )  [related]

Return a view of the real part of a complex image.

O(1).

Definition at line 111 of file vil_view_as.h.

template<class T>
vil_image_view< T > vil_view_imag_part ( vil_image_view< vcl_complex< T > >  img  )  [related]

Return a view of the imaginary part of a complex image.

O(1).

Definition at line 121 of file vil_view_as.h.

template<class sType, class dType, class MapFunctor, class InterpFunctor>
void vil_warp ( const vil_image_view< sType > &  in,
vil_image_view< dType > &  out,
MapFunctor  mapper,
InterpFunctor  interp 
) [related]

Warp an image under a 2D map.

The size of the output map and the mapper defines the region of the input image to be scanned.

Parameters:
mapper,is the inverse of the mapping from the input image's co-ordinate frame to the output image's frame. i.e. out() = in(mapper(x,y)). It should be a functor with a signature
    void mapper(double x_in, double y_in, double* x_out, double* y_out);
interp,is an interpolator, with a signature similar to
   S vil_bilin_interp_safe(const vil_image_view<T>&, double, double, unsigned)
Note that if you want to store a warp with an image to create a registered image, the vimt library (in contrib/mul/vimt) provides efficient registered images with transforms up to projective.

Definition at line 40 of file vil_warp.h.


Member Data Documentation

template<class T>
vil_image_view< T >::VCL_SAFE_BOOL_DEFINE [private]

Definition at line 43 of file vil_image_view.h.

template<class T>
T* vil_image_view< T >::top_left_ [protected]

Pointer to pixel at origin.

Definition at line 46 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::istep_ [protected]

Add this to a pixel pointer to move one column left.

Definition at line 48 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::jstep_ [protected]

Add this to a pixel pointer to move one row down.

Definition at line 50 of file vil_image_view.h.

template<class T>
vcl_ptrdiff_t vil_image_view< T >::planestep_ [protected]

Add this to a pixel pointer to move one plane back.

Definition at line 52 of file vil_image_view.h.

template<class T>
vil_memory_chunk_sptr vil_image_view< T >::ptr_ [protected]

Reference to actual image data.

Definition at line 55 of file vil_image_view.h.

unsigned vil_image_view_base::ni_ [protected, inherited]

Number of columns.

Definition at line 31 of file vil_image_view_base.h.

unsigned vil_image_view_base::nj_ [protected, inherited]

Number of rasters.

Definition at line 33 of file vil_image_view_base.h.

unsigned vil_image_view_base::nplanes_ [protected, inherited]

Number of planes.

Definition at line 35 of file vil_image_view_base.h.


The documentation for this class was generated from the following files:

Generated on Sun Nov 22 06:19:02 2009 for core/vil by  doxygen 1.5.5