Concrete view of image data of type T held in memory. More...
#include <vil_fwd.h>

Public Types | |
| typedef T | pixel_type |
| The pixel type of this image. More... | |
| typedef T * | iterator |
| typedef T const * | const_iterator |
Public Member Functions | |
| vil_image_view () | |
| Dflt ctor. More... | |
| 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. More... | |
| vil_image_view (const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, std::ptrdiff_t i_step, std::ptrdiff_t j_step, std::ptrdiff_t plane_step) | |
| Set this view to look at someone else's memory data. More... | |
| vil_image_view (const vil_memory_chunk_sptr &mem_chunk, const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, std::ptrdiff_t i_step, std::ptrdiff_t j_step, std::ptrdiff_t plane_step) | |
| Set this view to look at another view's data. More... | |
| vil_image_view (const vil_image_view< T > &rhs) | |
| Copy constructor. More... | |
| vil_image_view (const vil_image_view_base &rhs) | |
| Construct from various vil_image_view types. More... | |
| vil_image_view (const vil_image_view_base_sptr &rhs) | |
| Construct from various vil_image_view types. More... | |
| ~vil_image_view () override=default | |
| bool | is_contiguous () const |
| True if data all in one unbroken block and top_left_ptr() is lowest data address. More... | |
| 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. More... | |
| const T * | top_left_ptr () const |
| Pointer to the first (top left in plane 0) pixel. More... | |
| std::ptrdiff_t | istep () const |
| Add this to your pixel pointer to get next i pixel. More... | |
| std::ptrdiff_t | jstep () const |
| Add this to your pixel pointer to get next j pixel. More... | |
| std::ptrdiff_t | planestep () const |
| Add this to your pixel pointer to get pixel on next plane. More... | |
| operator bool () const | |
| Cast to bool is true if pointing at some data. More... | |
| bool | operator! () const |
| Return false if pointing at some data. More... | |
| unsigned | size_bytes () const |
| The number of bytes in the data. More... | |
| const vil_memory_chunk_sptr & | memory_chunk () const |
| Smart pointer to the object holding the data for this view. More... | |
| vil_memory_chunk_sptr & | memory_chunk () |
| Smart pointer to the object holding the data for this view. More... | |
| bool | in_range (int i, int j) const |
| Return true if (i,j) is a valid index into this buffer. More... | |
| bool | in_range (int i, int j, int p) const |
| Return true if (i,j,p) is a valid index into this buffer. More... | |
| const T & | operator() (unsigned i, unsigned j) const |
| Return read-only reference to pixel at (i,j) in plane 0. More... | |
| T & | operator() (unsigned i, unsigned j) |
| Return read/write reference to pixel at (i,j) in plane 0. More... | |
| const T & | operator() (unsigned i, unsigned j, unsigned p) const |
| Return read-only reference to pixel at (i,j) in plane p. More... | |
| T & | operator() (unsigned i, unsigned j, unsigned p) |
| Return read-only reference to pixel at (i,j) in plane p. More... | |
| void | set_size (unsigned ni, unsigned nj) override |
| resize current planes to ni x nj. More... | |
| void | set_size (unsigned ni, unsigned nj, unsigned nplanes) override |
| resize to ni x nj x nplanes. More... | |
| void | deep_copy (const vil_image_view< T > &src) |
| Make a copy of the data in src and set this to view it. More... | |
| void | clear () |
| Make empty. More... | |
| void | set_to_memory (const T *top_left, unsigned ni, unsigned nj, unsigned nplanes, std::ptrdiff_t i_step, std::ptrdiff_t j_step, std::ptrdiff_t plane_step) |
| Set this view to look at someone else's memory data. More... | |
| void | fill (T value) |
| Fill view with given value. More... | |
| void | print (std::ostream &) const override |
| Print a 1-line summary of contents. More... | |
| std::string | is_a () const override |
| Return class name. More... | |
| bool | is_class (std::string const &s) const override |
| True if this is (or is derived from) class s. More... | |
| vil_pixel_format | pixel_format () const override |
| Return a description of the concrete data pixel type. More... | |
| bool | operator== (const vil_image_view_base &other) const |
| True if they share same view of same image data. More... | |
| bool | operator!= (const vil_image_view_base &rhs) const |
| True if they do not share same view of same image data. More... | |
| bool | operator< (const vil_image_view_base &rhs) const |
| Provides an ordering. More... | |
| bool | operator>= (const vil_image_view_base &rhs) const |
| Provides an ordering. More... | |
| bool | operator> (const vil_image_view_base &rhs) const |
| Provides an ordering. More... | |
| bool | operator<= (const vil_image_view_base &rhs) const |
| Provides an ordering. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| unsigned | ni () const |
| Width. More... | |
| unsigned | nj () const |
| Height. More... | |
| unsigned | nplanes () const |
| Number of planes. More... | |
| unsigned long | size () const |
| The number of pixels. More... | |
Protected Member Functions | |
| void | release_memory () |
| Disconnect this view from the underlying data,. More... | |
Protected Attributes | |
| T * | top_left_ |
| Pointer to pixel at origin. More... | |
| std::ptrdiff_t | istep_ |
| Add this to a pixel pointer to move one column left. More... | |
| std::ptrdiff_t | jstep_ |
| Add this to a pixel pointer to move one row down. More... | |
| std::ptrdiff_t | planestep_ |
| Add this to a pixel pointer to move one plane back. More... | |
| vil_memory_chunk_sptr | ptr_ |
| Reference to actual image data. More... | |
| unsigned | ni_ |
| Number of columns. More... | |
| unsigned | nj_ |
| Number of rasters. More... | |
| unsigned | nplanes_ |
| Number of planes. More... | |
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. More... | |
| 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, std::ptrdiff_t k_lo, std::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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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, std::ptrdiff_t k_lo, std::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. More... | |
| template<class srcT , class kernelT , class accumT > | |
| accumT | vil_correlate_2d_at_pt (const srcT *src_im, std::ptrdiff_t s_istep, std::ptrdiff_t s_jstep, std::ptrdiff_t s_pstep, const vil_image_view< kernelT > &kernel, accumT) |
| Evaluate dot product between kernel and src_im. More... | |
| 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. More... | |
| void | vil_distance_transform (vil_image_view< float > &image) |
| Compute distance function from zeros in original image. More... | |
| void | vil_distance_transform_one_way (vil_image_view< float > &image) |
| Compute directed distance function from zeros in original image. More... | |
| 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. More... | |
| void | vil_distance_transform_r2 (vil_image_view< float > &image) |
| Compute distance function from zeros in original image. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_dog_pyramid (const vil_image_view< T > &src_image, std::vector< vil_image_view< T > > &smooth_pyramid, std::vector< vil_image_view< T > > &dog_pyramid, unsigned min_size) |
| Compute a pyramid of difference of gaussian images. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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). More... | |
| 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). More... | |
| template<class T > | |
| void | vil_find_peaks_3x3 (std::vector< unsigned > &pi, std::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. More... | |
| template<class T > | |
| void | vil_find_peaks_3x3_subpixel (std::vector< double > &px, std::vector< double > &py, std::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. More... | |
| template<class T > | |
| void | vil_find_plateaus_3x3 (std::vector< unsigned > &pi, std::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. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_flood_fill4 (vil_image_view< T > &image, unsigned seed_i, unsigned seed_j, T v, T new_v, std::vector< vil_chord > ®ion) |
| Flood fill on a 4-connected region, and record region. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_flood_fill8 (vil_image_view< T > &image, unsigned seed_i, unsigned seed_j, T v, T new_v, std::vector< vil_chord > ®ion) |
| Flood fill on a 8-connected region, and record region. More... | |
| 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. More... | |
| 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). More... | |
| 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. More... | |
| 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 ¶ms) |
| Smooth and subsample src_im by an arbitrary factor to produce dest_im. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_histogram (const vil_image_view< T > &image, std::vector< double > &histo, double min, double max, unsigned n_bins) |
| Construct histogram from pixels in given image. More... | |
| void | vil_histogram_byte (const vil_image_view< vxl_byte > &image, std::vector< double > &histo) |
| Construct histogram from pixels in given image of bytes. More... | |
| void | vil_histogram_equalise (vil_image_view< vxl_byte > &image) |
| Apply histogram equalisation to given byte image. More... | |
| void | vil_histogram_equalise (vil_image_view< float > &image) |
| Apply histogram equalisation to given float image. More... | |
| template<class srcT , class kernelT , class accumT > | |
| accumT | vil_norm_corr_2d_at_pt (const srcT *src_im, std::ptrdiff_t s_istep, std::ptrdiff_t s_jstep, std::ptrdiff_t s_pstep, const vil_image_view< kernelT > &kernel, accumT) |
| Evaluate dot product between kernel and src_im. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_tile_images (vil_image_view< T > &big_image, const std::vector< vil_image_view< T > > &patches) |
| Create a big image by tiling images in patches (must be of same size). More... | |
| 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. More... | |
| template<class T > | |
| void | vsl_b_read (vsl_b_istream &is, vil_image_view< T > &image) |
| Binary load vil_image_view<T> from stream. More... | |
| 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. More... | |
| template<class T > | |
| void | vsl_print_summary (std::ostream &os, const vil_image_view< T > &image) |
| Print human readable summary of a vil_image_view<T> object to a stream. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| double | vil_bilin_interp_safe_edgena (const vil_image_view< T > &view, double x, double y, unsigned p=0) |
| Compute bilinear interpolation at (x,y), with bound checks. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_clamp_above (vil_image_view< T > &src, T t, T v) |
| Clamp an image view below a given value t, setting it to v if above or on t. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_clamp_above (vil_image_view< T > &src, T t) |
| Clamp an image view below a given value t, setting it to this t if above t. More... | |
| 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. More... | |
| 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. More... | |
| 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]. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_copy_deep (const vil_image_view< T > &src, vil_image_view< T > &dest) |
| Deep copy src to dest. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_fill (vil_image_view< T > &view, T value) |
| Fill view with given value. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_fill_row (vil_image_view< T > &view, unsigned j, T value) |
| Fill row j in view with given value. More... | |
| template<class T > | |
| void | vil_fill_col (vil_image_view< T > &view, unsigned i, T value) |
| Fill column i in view with given value. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| vil_image_view_base_sptr | vil_load (const char *, bool verbose=true) |
| Convenience function for loading an image into an image view. More... | |
| template<class T > | |
| void | vil_math_value_range_percentiles (const vil_image_view< T > &im, const std::vector< double > &fraction, std::vector< T > &value) |
| Compute the values corresponding to several percentiles of the range of im. More... | |
| 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. More... | |
| 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. More... | |
| template<class imT , class sumT > | |
| sumT | vil_math_ssd_complex (const vil_image_view< std::complex< imT > > &imA, const vil_image_view< std::complex< imT > > &imB, sumT) |
| Sum squared magnitude differences between two complex images. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class imT , class sumT > | |
| bool | vil_math_sum_squares (sumT &sum, sumT &sum_sq, unsigned int &count, const vil_image_view< imT > &im, const vil_image_view< bool > &mask, unsigned p) |
| Sum of squares of masked elements in plane p of image. More... | |
| 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. More... | |
| template<class imT , class sumT > | |
| bool | vil_math_mean_and_variance (sumT &mean, sumT &var, const vil_image_view< imT > &im, const vil_image_view< bool > &mask, unsigned p) |
| Mean and variance of masked elements in plane p of image. More... | |
| template<class T > | |
| void | vil_math_sqrt (vil_image_view< T > &image) |
| Compute square-root of each pixel element (or zero if negative). More... | |
| 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]. More... | |
| template<class T > | |
| void | vil_math_scale_values (vil_image_view< T > &image, double scale) |
| Multiply values in-place in image view by scale. More... | |
| 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. More... | |
| 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). More... | |
| 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). More... | |
| 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)). More... | |
| 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)). More... | |
| 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). More... | |
| 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). More... | |
| template<class aT , class bT , class dT > | |
| void | vil_math_image_abs_difference_1d_generic (const aT *pxA, std::ptrdiff_t isA, const bT *pxB, std::ptrdiff_t isB, dT *pxD, std::ptrdiff_t isD, unsigned len) |
| Compute absolute difference of two 1D images (im_sum = |imA-imB|). More... | |
| template<class aT , class bT , class dT > | |
| void | vil_math_image_abs_difference (const vil_image_view< aT > &imA, const vil_image_view< bT > &imB, vil_image_view< dT > &imD) |
| Compute absolute difference of two images (im_sum = |imA-imB|). More... | |
| 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|). More... | |
| 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). More... | |
| 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!). More... | |
| 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). More... | |
| 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. More... | |
| template<class T > | |
| 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. More... | |
| template<class T > | |
| 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. More... | |
| template<class T > | |
| 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. More... | |
| template<class T > | |
| T | vil_nearest_interp_safe_extend (const vil_image_view< T > &view, double x, double y, unsigned p=0) |
| Compute nearest neighbour interpolation at (x,y), with bound checks. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| void | vil_print_value (std::ostream &s, const T &value, unsigned=0) |
| How to print value in vil_print_all(image_view). More... | |
| template<class T > | |
| void | vil_print_all (std::ostream &os, const vil_image_view< T > &view, unsigned width=0) |
| Print all image data to os in a grid (rounds output to int). More... | |
| void | vil_print_all (std::ostream &os, vil_image_view_base_sptr const &view) |
| Print all image data to os in a grid. More... | |
| 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. More... | |
| 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). More... | |
| template<class sType , class dType > | |
| void | vil_resample_bicub_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 bicubic interpolation. More... | |
| template<class sType , class dType > | |
| void | vil_resample_bicub_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. More... | |
| 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. More... | |
| 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). More... | |
| 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. More... | |
| 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). More... | |
| 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. More... | |
| 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). More... | |
| 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. More... | |
| 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). More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class imType , class vecType > | |
| void | vil_sample_grid_bilin_edgena (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. More... | |
| 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. More... | |
| 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. More... | |
| template<class imType , class vecType > | |
| void | vil_sample_profile_bilin_edgena (vecType *v, const vil_image_view< imType > &image, double x0, double y0, double dx, double dy, int n) |
| Sample along profile, using bilinear interpolation. More... | |
| bool | vil_save (const vil_image_view_base &, char const *filename) |
| Send a vil_image_view to disk, deducing format from filename. More... | |
| bool | vil_save (const vil_image_view_base &, char const *filename, char const *file_format) |
| Send a vil_image_view to disk, given filename. More... | |
| template<class T , class F > | |
| void | vil_transform (vil_image_view< T > &image, F functor) |
| Apply a unary operation to each pixel in image. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| template<class T > | |
| vil_image_view< std::complex< T > > | vil_view_as_complex (const vil_image_view< T > &v) |
| Return a complex component view of a 2N-plane image. More... | |
| template<class T > | |
| vil_image_view< T > | vil_view_part (vil_image_view< std::complex< T > > img, int pt) |
| Base function to do the work for both vil_view_real/imag_part. More... | |
| template<class T > | |
| vil_image_view< T > | vil_view_real_part (vil_image_view< std::complex< T > > img) |
| Return a view of the real part of a complex image. More... | |
| template<class T > | |
| vil_image_view< T > | vil_view_imag_part (vil_image_view< std::complex< T > > img) |
| Return a view of the imaginary part of a complex image. More... | |
| 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. More... | |
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.
| typedef T const* vil_image_view< T >::const_iterator |
Definition at line 131 of file vil_image_view.h.
| typedef T* vil_image_view< T >::iterator |
Definition at line 127 of file vil_image_view.h.
| typedef T vil_image_view< T >::pixel_type |
The pixel type of this image.
Definition at line 120 of file vil_image_view.h.
|
inline |
| 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_interleaved_planes should not be both different from 1. n_planes * n_interleaved_planes should be 1 unless T is scalar.
Definition at line 39 of file vil_image_view.hxx.
| vil_image_view< T >::vil_image_view | ( | const T * | top_left, |
| unsigned | ni, | ||
| unsigned | nj, | ||
| unsigned | nplanes, | ||
| std::ptrdiff_t | i_step, | ||
| std::ptrdiff_t | j_step, | ||
| std::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!
Definition at line 52 of file vil_image_view.hxx.
| vil_image_view< T >::vil_image_view | ( | const vil_memory_chunk_sptr & | mem_chunk, |
| const T * | top_left, | ||
| unsigned | n_i, | ||
| unsigned | n_j, | ||
| unsigned | n_planes, | ||
| std::ptrdiff_t | i_step, | ||
| std::ptrdiff_t | j_step, | ||
| std::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
Need to pass the memory chunk to set up the internal smart ptr appropriately
Definition at line 61 of file vil_image_view.hxx.
| vil_image_view< T >::vil_image_view | ( | const vil_image_view< T > & | that | ) |
Copy constructor.
The new object will point to the same underlying image as the rhs.
If this view cannot set itself to view the other data (e.g. because the types are incompatible) it will set itself to empty.
Definition at line 97 of file vil_image_view.hxx.
| vil_image_view< T >::vil_image_view | ( | const vil_image_view_base & | that | ) |
Construct from various vil_image_view types.
Sort of copy constructor.
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.
If this view cannot set itself to view the other data (e.g. because the types are incompatible) it will set itself to empty.
Definition at line 108 of file vil_image_view.hxx.
| vil_image_view< T >::vil_image_view | ( | const vil_image_view_base_sptr & | that | ) |
Construct from various vil_image_view types.
Sort of copy constructor.
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).
| vil_exception_pixel_formats_incompatible | if view types are not compatible. Or returns a null image if exceptions are disabled. |
If this view cannot set itself to view the other data (e.g. because the types are incompatible) it will set itself to empty.
Definition at line 118 of file vil_image_view.hxx.
|
overridedefault |
|
inline |
Definition at line 128 of file vil_image_view.h.
|
inline |
Definition at line 132 of file vil_image_view.h.
|
inline |
| 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.
Perform deep copy of the src image, placing in this image.
Definition at line 126 of file vil_image_view.hxx.
|
inline |
Definition at line 129 of file vil_image_view.h.
|
inline |
Definition at line 133 of file vil_image_view.h.
| void vil_image_view< T >::fill | ( | T | value | ) |
Fill view with given value.
Definition at line 711 of file vil_image_view.hxx.
|
inline |
Return true if (i,j) is a valid index into this buffer.
Definition at line 183 of file vil_image_view.h.
|
inline |
Return true if (i,j,p) is a valid index into this buffer.
Definition at line 187 of file vil_image_view.h.
|
overridevirtual |
Return class name.
Implements vil_image_view_base.
Definition at line 881 of file vil_image_view.hxx.
|
overridevirtual |
True if this is (or is derived from) class s.
Reimplemented from vil_image_view_base.
Definition at line 763 of file vil_image_view.hxx.
| bool vil_image_view< T >::is_contiguous | ( | ) | const |
True if data all in one unbroken block and top_left_ptr() is lowest data address.
Definition at line 609 of file vil_image_view.hxx.
|
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.
|
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.
|
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 171 of file vil_image_view.h.
|
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 178 of file vil_image_view.h.
|
inlineinherited |
Width.
Definition at line 49 of file vil_image_view_base.h.
|
inlineinherited |
Height.
Definition at line 51 of file vil_image_view_base.h.
|
inlineinherited |
Number of planes.
Definition at line 53 of file vil_image_view_base.h.
|
inline |
Cast to bool is true if pointing at some data.
Definition at line 156 of file vil_image_view.h.
|
inline |
Return false if pointing at some data.
Definition at line 160 of file vil_image_view.h.
|
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.
|
inline |
Return read-only reference to pixel at (i,j) in plane 0.
Definition at line 192 of file vil_image_view.h.
|
inline |
Return read/write reference to pixel at (i,j) in plane 0.
Definition at line 197 of file vil_image_view.h.
|
inline |
Return read-only reference to pixel at (i,j) in plane p.
Definition at line 202 of file vil_image_view.h.
|
inline |
Return read-only reference to pixel at (i,j) in plane p.
Definition at line 207 of file vil_image_view.h.
| 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
Definition at line 807 of file vil_image_view.hxx.
|
inline |
Provides an ordering.
Definition at line 278 of file vil_image_view.h.
| 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.
Definition at line 556 of file vil_image_view.hxx.
| 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.
Definition at line 563 of file vil_image_view.hxx.
|
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.
| bool vil_image_view< T >::operator== | ( | const vil_image_view_base & | rhs | ) | 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.
Definition at line 782 of file vil_image_view.hxx.
| 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) is equivalent to (b<a)
Definition at line 829 of file vil_image_view.hxx.
|
inline |
Provides an ordering.
Definition at line 272 of file vil_image_view.h.
|
inlineoverridevirtual |
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.
|
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.
|
overridevirtual |
Print a 1-line summary of contents.
Implements vil_image_view_base.
Definition at line 771 of file vil_image_view.hxx.
|
inlineprotected |
Disconnect this view from the underlying data,.
Definition at line 58 of file vil_image_view.h.
|
overridevirtual |
resize current planes to ni x nj.
If already correct size, this function returns quickly
Implements vil_image_view_base.
Definition at line 599 of file vil_image_view.hxx.
|
overridevirtual |
resize to ni x nj x nplanes.
If already correct size, this function returns quickly
Implements vil_image_view_base.
Definition at line 664 of file vil_image_view.hxx.
| void vil_image_view< T >::set_to_memory | ( | const T * | top_left, |
| unsigned | ni, | ||
| unsigned | nj, | ||
| unsigned | nplanes, | ||
| std::ptrdiff_t | i_step, | ||
| std::ptrdiff_t | j_step, | ||
| std::ptrdiff_t | plane_step | ||
| ) |
Set this view to look at someone else's memory data.
Set this view to look at someone else's memory.
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.
Definition at line 692 of file vil_image_view.hxx.
|
inlineinherited |
The number of pixels.
Definition at line 56 of file vil_image_view_base.h.
|
inline |
The number of bytes in the data.
Definition at line 164 of file vil_image_view.h.
|
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.
|
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.
|
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 116 of file vil_bicub_interp.h.
|
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 85 of file vil_bicub_interp.h.
|
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 145 of file vil_bicub_interp.h.
|
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 176 of file vil_bilin_interp.h.
|
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 131 of file vil_bilin_interp.h.
|
related |
Compute bilinear interpolation at (x,y), with bound checks.
If (x,y) is outside interpolatable image region, NA is returned. The safe interpolatable region is [0,view.ni()-1]*[0,view.nj()-1].
Definition at line 145 of file vil_bilin_interp.h.
|
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 206 of file vil_bilin_interp.h.
|
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
, you can normalise the results by dividing the planes by 
See Romeny et al. Proc.IPMI1993, pp77-93. and Walker et al. Proc.BMVC1997 pp541-549.
| 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. |
|
related |
Clamp an image view between two values.
Definition at line 23 of file vil_clamp.h.
|
related |
Clamp an image view below a given value t, setting it to v if above or on t.
Definition at line 105 of file vil_clamp.h.
|
related |
Clamp an image view below a given value t, setting it to this t if above t.
Definition at line 133 of file vil_clamp.h.
|
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.
|
related |
Clamp an image view above a given value t, setting it to this t if below t.
Definition at line 125 of file vil_clamp.h.
|
related |
Cast one pixel type to another.
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 245 of file vil_convert.h.
|
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 443 of file vil_convert.h.
|
related |
Convert src to byte image dest by stretching to range [0,255].
Definition at line 530 of file vil_convert.h.
|
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)
| kernel | should point to tap 0. |
| dest_im | will be resized to size of src_im. |
Definition at line 248 of file vil_convolve_1d.h.
|
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 22 of file vil_convolve_2d.h.
|
related |
Deep copy src to dest.
O(size).
|
related |
Create a deep copy of an image, with completely new underlying memory.
O(size).
|
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).
|
related |
Copy src to window in dest.
Size of window is defined by src. O(src.size).
|
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 24 of file vil_corners.cxx.
|
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.
|
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 186 of file vil_corners.cxx.
|
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.
|
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)
| kernel | should point to tap 0. |
| dest_im | will be resized to size of src_im. |
Definition at line 62 of file vil_correlate_1d.h.
|
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 56 of file vil_correlate_2d.h.
|
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 19 of file vil_correlate_2d.h.
|
related |
Create a view which is a cropped version of src.
Doesn't modify underlying data. O(1).
Definition at line 21 of file vil_crop.h.
|
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 20 of file vil_decimate.h.
|
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 20 of file vil_distance_transform.cxx.
|
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 88 of file vil_distance_transform.cxx.
|
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 41 of file vil_distance_transform.cxx.
|
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 234 of file vil_distance_transform.cxx.
|
related |
Smooth source with gaussian filter and compute difference.
Uses a 5-tap filter with gaussian width sigma.
| 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.
|
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 32 of file vil_dog_pyramid.h.
|
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.
|
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.
|
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.
|
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.
|
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.
|
related |
|
related |
|
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 201 of file vil_fill.h.
|
related |
Fill line from (ai,aj) to (bi,bj) using Bresenham's algorithm.
Only modifies first plane.
Definition at line 58 of file vil_fill.h.
|
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 165 of file vil_fill.h.
|
related |
|
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.
| clear_list | If true (the default) then empty lists before adding new examples |
Definition at line 37 of file vil_find_peaks.h.
|
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 paraboloid. Interpolated peak values are returned in val.
| clear_list | If true (the default) then empty lists before adding new examples. |
Definition at line 146 of file vil_find_peaks.h.
|
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.
| clear_list | If true (the default) then empty lists before adding new examples |
Definition at line 37 of file vil_find_plateaus.h.
|
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.
|
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 17 of file vil_flip.h.
|
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 30 of file vil_flip.h.
|
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 44 of file vil_flood_fill.h.
|
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 97 of file vil_flood_fill.h.
|
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 152 of file vil_flood_fill.h.
|
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 208 of file vil_flood_fill.h.
|
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 20 of file vil_flood_fill.h.
|
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
|
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.
|
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
|
related |
Smooth and subsample src_im by an arbitrary factor to produce dest_im.
Definition at line 110 of file vil_gauss_reduce.h.
|
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 20 of file vil_grid_merge.h.
|
related |
Construct histogram from pixels in given image.
Definition at line 20 of file vil_histogram.h.
|
related |
Construct histogram from pixels in given image of bytes.
Resulting histogram has 256 bins
Definition at line 10 of file vil_histogram.cxx.
|
related |
Apply histogram equalisation to given byte image.
Definition at line 12 of file vil_histogram_equalise.cxx.
|
related |
Apply histogram equalisation to given float image.
Definition at line 47 of file vil_histogram_equalise.cxx.
|
related |
True if the actual images are identical.
The data may be formatted differently in each memory chunk. O(size).
Definition at line 855 of file vil_image_view.hxx.
|
related |
Convenience function for loading an image into an image view.
Definition at line 128 of file vil_load.cxx.
|
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 1060 of file vil_math.h.
|
related |
Compute absolute difference of two images (im_sum = |imA-imB|).
Definition at line 955 of file vil_math.h.
|
related |
Compute sum of absolute difference between two images (|imA-imB|).
Definition at line 988 of file vil_math.h.
|
related |
Compute absolute difference of two 1D images (im_sum = |imA-imB|).
Definition at line 924 of file vil_math.h.
|
related |
Compute difference of two images (im_sum = imA-imB).
Definition at line 890 of file vil_math.h.
|
related |
Compute the max of two images (im_max = max(imA, imB)).
Definition at line 775 of file vil_math.h.
|
related |
Compute the min of two images (im_min = min(imA, imB)).
Definition at line 808 of file vil_math.h.
|
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 736 of file vil_math.h.
|
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 847 of file vil_math.h.
|
related |
Compute sum of two images (im_sum = imA+imB).
Definition at line 700 of file vil_math.h.
|
related |
Compute magnitude of two images taken as vector components, sqrt(A^2 + B^2).
Definition at line 1020 of file vil_math.h.
|
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 1091 of file vil_math.h.
|
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 1140 of file vil_math.h.
|
related |
Mean of elements in plane p of image.
Definition at line 264 of file vil_math.h.
|
related |
Mean and variance of elements in plane p of image.
Definition at line 350 of file vil_math.h.
|
related |
Mean and variance of masked elements in plane p of image.
Definition at line 362 of file vil_math.h.
|
related |
Calc the mean of each pixel over all the planes.
Definition at line 207 of file vil_math.h.
|
related |
Calc the mean of each pixel over all the planes.
Definition at line 229 of file vil_math.h.
|
related |
Median of elements in plane p of an image.
For integral types, if the median is half way between two values, the result will be the floor of the average.
Definition at line 282 of file vil_math.h.
|
related |
Multiply values in-place in image view by scale and add offset.
Definition at line 524 of file vil_math.h.
|
related |
Multiply values in-place in image view by scale.
Definition at line 516 of file vil_math.h.
|
related |
Compute square-root of each pixel element (or zero if negative).
Definition at line 427 of file vil_math.h.
|
related |
Sum of squared differences between two images.
Definition at line 170 of file vil_math.h.
|
related |
Sum squared magnitude differences between two complex images.
Definition at line 188 of file vil_math.h.
|
related |
Sum of elements in plane p of image.
Definition at line 247 of file vil_math.h.
|
related |
Sum of squares of elements in plane p of image.
Definition at line 297 of file vil_math.h.
|
related |
Sum of squares of masked elements in plane p of image.
Definition at line 314 of file vil_math.h.
|
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 438 of file vil_math.h.
|
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.
| im | The image to examine. |
| fraction | The fraction of the data range (from the lower end). |
| value | The image data value corresponding to the specified percentile. |
Definition at line 155 of file vil_math.h.
|
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.
| im | The image to examine. |
| fraction | The fractions of the data range (from the lower end). |
| value | The image data values corresponding to the specified percentiles. |
Definition at line 90 of file vil_math.h.
|
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 101 of file vil_nearest_interp.h.
|
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 67 of file vil_nearest_interp.h.
|
related |
Compute nearest neighbour 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 139 of file vil_nearest_interp.h.
|
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 40 of file vil_nearest_interp.h.
|
related |
Create a shallow copy of an image and wrap it in a vil_image_view_base_sptr.
Definition at line 278 of file vil_new.cxx.
|
related |
|
related |
|
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 22 of file vil_normalised_correlation_2d.h.
|
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 71 of file vil_normalised_correlation_2d.h.
|
related |
Compute orientation (in radians) and gradient magnitude at each pixel.
Images assumed to be single plane
Definition at line 14 of file vil_orientations.cxx.
|
related |
Compute discrete orientation and gradient magnitude at each pixel.
Computes 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 56 of file vil_orientations.cxx.
|
related |
Compute discrete orientation and gradient magnitude at edge pixels.
Computes 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 109 of file vil_orientations.cxx.
|
related |
Compute orientation and gradient magnitude using sobel to get gradients.
Definition at line 54 of file vil_orientations.h.
|
related |
Compute discrete orientation and gradient using sobel operations.
Computes 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.
|
related |
|
related |
Print all image data to os in a grid (rounds output to int).
Definition at line 77 of file vil_print.h.
|
related |
Print all image data to os in a grid.
Definition at line 434 of file vil_print.cxx.
|
related |
How to print value in vil_print_all(image_view).
|
related |
Apply quadratic distance transform along each row of src.
Definition at line 162 of file vil_quad_distance_function.h.
|
related |
Apply quadratic distance transform along each row of src.
(pos(x,y,0),pos(x,y,1)) gives the position (x+i,y+j) leading to minima
Definition at line 201 of file vil_quad_distance_function.h.
|
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.
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.hxx.
|
related |
Resample image to a specified width (n1) and height (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 the nearest valid value.
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 131 of file vil_resample_bicub.hxx.
|
related |
Resample image to a specified width n1 and height n2.
Points outside image return the nearest valid value.
|
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.
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 35 of file vil_resample_bilin.hxx.
|
related |
Resample image to a specified width (n1) and height (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 157 of file vil_resample_bilin.hxx.
|
related |
Resample image to a specified width (n1) and height (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 41 of file vil_resample_nearest.hxx.
|
related |
Resample image to a specified width (n1) and height (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 163 of file vil_resample_nearest.hxx.
|
related |
Resample image to a specified width (n1) and height (n2).
|
related |
Rotate image by angle theta.
|
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.
|
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.
|
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 NA.
|
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.
|
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.
|
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 NA.
|
related |
Send a vil_image_view to disk, deducing format from filename.
Definition at line 123 of file vil_save.cxx.
|
related |
Send a vil_image_view to disk, given filename.
Definition at line 30 of file vil_save.cxx.
|
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
|
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
|
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
|
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
|
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.
Definition at line 36 of file vil_suppress_non_max.h.
|
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).
|
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:
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).
|
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)
Definition at line 29 of file vil_suppress_non_plateau.h.
|
related |
Apply threshold such that dest(i,j,p)=true if src(i,j,p)>=t.
|
related |
Apply threshold such that dest(i,j,p)=true if src(i,j,p)<=t.
|
related |
Apply threshold such that dest(i,j,p)=true if t0<=src(i,j,p)<=t1.
|
related |
Apply threshold such that dest(i,j,p)=true if src(i,j,p)<=t0 or src(i,j,p)>=t1.
|
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.
Definition at line 24 of file vil_tile_images.h.
|
related |
Apply a unary operation to each pixel in image.
| functor | should take a value of type T and return same type |
Definition at line 19 of file vil_transform.h.
|
related |
Apply a unary operation to each pixel in src to get dest.
| functor | should take a value of type inP, and return a value of type outP |
Definition at line 74 of file vil_transform.h.
|
related |
Apply a binary operation to each pixel in srcA and srcB to get dest.
Definition at line 134 of file vil_transform.h.
|
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.
|
related |
Apply a binary function to each pixel in src and dest that modifies dest.
| functor | should take two parameters (inP src, outP &dest); |
Definition at line 104 of file vil_transform.h.
|
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 16 of file vil_transpose.h.
|
related |
Return a complex component view of a 2N-plane image.
Definition at line 84 of file vil_view_as.h.
|
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.
Definition at line 26 of file vil_view_as.h.
|
related |
Return an RGB component view of a 3-plane image.
Definition at line 47 of file vil_view_as.h.
|
related |
Return an RGBA component view of a 4-plane image.
Definition at line 63 of file vil_view_as.h.
|
related |
Return a view of the imaginary part of a complex image.
O(1).
Definition at line 137 of file vil_view_as.h.
|
related |
Base function to do the work for both vil_view_real/imag_part.
O(1).
Definition at line 105 of file vil_view_as.h.
|
related |
Return a view of the real part of a complex image.
O(1).
Definition at line 123 of file vil_view_as.h.
|
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.
| 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 |
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.
|
related |
Binary load vil_image_view<T> from stream.
Definition at line 43 of file vil_io_image_view.h.
|
related |
Binary load vil_image_view<T> from stream onto the heap.
Definition at line 103 of file vil_io_image_view.h.
|
related |
Binary save vil_image_view<T> to stream.
Definition at line 19 of file vil_io_image_view.h.
|
related |
Print human readable summary of a vil_image_view<T> object to a stream.
Definition at line 120 of file vil_io_image_view.h.
|
protected |
Add this to a pixel pointer to move one column left.
Definition at line 48 of file vil_image_view.h.
|
protected |
Add this to a pixel pointer to move one row down.
Definition at line 50 of file vil_image_view.h.
|
protectedinherited |
Number of columns.
Definition at line 31 of file vil_image_view_base.h.
|
protectedinherited |
Number of rasters.
Definition at line 33 of file vil_image_view_base.h.
|
protectedinherited |
Number of planes.
Definition at line 35 of file vil_image_view_base.h.
|
protected |
Add this to a pixel pointer to move one plane back.
Definition at line 52 of file vil_image_view.h.
|
protected |
Reference to actual image data.
Definition at line 55 of file vil_image_view.h.
|
protected |
Pointer to pixel at origin.
Definition at line 46 of file vil_image_view.h.
1.8.15