Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

brip_vil_float_ops Class Reference

#include <brip_vil_float_ops.h>

List of all members.


Detailed Description

Definition at line 32 of file brip_vil_float_ops.h.

Public Member Functions

 ~brip_vil_float_ops ()

Static Public Member Functions

static vil_image_view< float > convolve (vil_image_view< float > const &input, vbl_array_2d< float > const &kernel)
 convolves with the specified kernel.
static unsigned gaussian_radius (const double sigma, const double fuzz=0.02)
 helper to determine processing border required by Gaussian smoothing.
static vil_image_view< float > gaussian (vil_image_view< float > const &input, float sigma)
 convolves with a Gaussian kernel.
static vil_image_view< float > gaussian (vil_image_view< float > const &input, float sigma, vil_image_view< float > mask)
 convolves with a Gaussian kernel and for a given mask.
static void non_maximum_suppression (vil_image_view< float > const &input, int n, float thresh, vcl_vector< float > &x_pos, vcl_vector< float > &y_pos, vcl_vector< float > &value)
 non-maximum suppression on a NxN neighborhood, with sub-pixel location.
static vil_image_view< float > half_resolution (vil_image_view< float > const &input, float filter_coef=0.359375f)
 downsamples the input using the Bert-Adelson algorithm.
static vil_image_view< float > double_resolution (vil_image_view< float > const &input, float filter_coef=0.6f)
 interpolates the input using the Bert-Adelson algorithm.
static vil_image_view< float > difference (vil_image_view< float > const &image_1, vil_image_view< float > const &image_2)
 subtracts image_1 from image_2.
static vil_image_view< float > threshold (vil_image_view< float > const &image, const float thresh, const float level=255.0)
 sets values greater than thresh to specified level and the rest to zero.
static vil_image_view< float > abs_clip_to_level (vil_image_view< float > const &image, const float thresh, const float level=0.0)
 sets absolute values greater than thresh to specified level.
static vil_image_view< float > average_NxN (vil_image_view< float > const &img, int N)
static void gradient_3x3 (vil_image_view< float > const &input, vil_image_view< float > &grad_x, vil_image_view< float > &grad_y)
 The gradient using a 3x3 kernel.
static void hessian_3x3 (vil_image_view< float > const &input, vil_image_view< float > &Ixx, vil_image_view< float > &Ixy, vil_image_view< float > &Iyy)
 Compute the Hessian of the input, use a 3x3 mask.
static vil_image_view< float > beaudet (vil_image_view< float > const &Ixx, vil_image_view< float > const &Ixy, vil_image_view< float > const &Iyy)
static void grad_matrix_NxN (vil_image_view< float > const &input, unsigned n, vil_image_view< float > &IxIx, vil_image_view< float > &IxIy, vil_image_view< float > &IyIy)
 IxIx.transpose gradient matrix elements for a NxN region(N = 2n+1).
static vil_image_view< float > trace_grad_matrix_NxN (vil_image_view< float > const &input, unsigned n)
 Tr(IxIx.transpose) for a NxN region, N = 2n+1).
static vil_image_view< float > harris (vil_image_view< float > const &IxIx, vil_image_view< float > const &IxIy, vil_image_view< float > const &IyIy, double scale=0.04)
 Computes the Harris corner measure.
static vil_image_view< float > sqrt_grad_singular_values (vil_image_view< float > &input, int n)
 computes the conditioning of the 2n+1 x 2n+1 gradient neigborhood.
static vil_image_view< float > max_scale_trace (vil_image_view< float > input, float min_scale, float max_scale, float scale_inc)
static void Lucas_KanadeMotion (vil_image_view< float > &current_frame, vil_image_view< float > &previous_frame, int n, double thresh, vil_image_view< float > &vx, vil_image_view< float > &vy)
 computes Lucas-Kanade optical flow on a 2n+1 neighborhood.
static void lucas_kanade_motion_on_view (vil_image_view< float > const &curr_frame, vil_image_view< float > const &prev_frame, const double thresh, float &vx, float &vy)
 computes velocity of a region(view) using Lucas Kanade.
static void velocity_by_correlation (vil_image_view< float > const &curr_image, vil_image_view< float > const &prev_region, const unsigned start_i, const unsigned end_i, const unsigned start_j, const unsigned end_j, const unsigned zero_i, const unsigned zero_j, float &vx, float &vy)
 computes velocity of a region(view) using correlation.
static int Horn_SchunckMotion (vil_image_view< float > const &current_frame, vil_image_view< float > const &previous_frame, vil_image_view< float > &vx, vil_image_view< float > &vy, const float alpha_coef=10000.0f, const int no_of_iterations=5)
 computes optical flow using Horn & Schunck's method.
static void fill_x_border (vil_image_view< float > &image, unsigned w, float value)
 fills a border of width w on left and right of image with value.
static void fill_y_border (vil_image_view< float > &image, unsigned h, float value)
 fills a border of width h on top and bottom of image with value.
static vil_image_view< unsigned
char > 
convert_to_byte (vil_image_view< float > const &image)
 converts a float image to a byte value range.
static vil_image_view< unsigned
char > 
convert_to_byte (vil_image_view< float > const &image, float min_val, float max_val)
 converts a float image to a byte value range within a specified range.
static vil_image_view< unsigned
char > 
convert_to_byte (vil_image_view< unsigned short > const &image, unsigned short min_val, unsigned short max_val)
 converts an unsigned short image to a byte value range within a specified range.
static vil_image_view< unsigned
char > 
convert_to_byte (vil_image_resource_sptr const &image)
 converts a generic image to a byte image. Use this instead of convert_to_grey.
static vil_image_view< unsigned
short > 
convert_to_short (vil_image_view< float > const &image, float min_val, float max_val)
 converts a float image to an unsigned short image within a range.
static vil_image_view< unsigned
short > 
convert_to_short (vil_image_view< float > const &image)
 converts a float image to an unsigned short image.
static vil_image_view< unsigned
short > 
convert_to_short (vil_image_resource_sptr const &image)
 converts a generic image to an unsigned short image.
static vil_image_view< float > convert_to_float (vil_image_resource const &image)
 converts a vil_image_resource to a float image.
static vil_image_view< float > convert_to_float (vil_image_resource_sptr const &image)
 converts a vil_image_resource to a float image (preferred interface).
static vil_image_view< float > convert_to_float (vil_image_view< unsigned char > const &image)
static vil_image_view< float > convert_to_float (vil_image_view< unsigned short > const &image)
static vil_image_view< bool > convert_to_bool (vil_image_view< unsigned char > const &image)
 converts a byte image to a bool image.
static vil_image_view< float > convert_to_float (vil_image_view< vil_rgb< vxl_byte > > const &image)
 converts an RGB image to a float image.
static void convert_to_IHS (vil_image_view< vil_rgb< vxl_byte > > const &image, vil_image_view< float > &I, vil_image_view< float > &H, vil_image_view< float > &S)
 convert a color image to float IHS images.
static void convert_to_IHS (vil_image_view< unsigned char > const &image, vil_image_view< float > &I, vil_image_view< float > &H, vil_image_view< float > &S)
static void display_IHS_as_RGB (vil_image_view< float > const &I, vil_image_view< float > const &H, vil_image_view< float > const &S, vil_image_view< vil_rgb< vxl_byte > > &image)
 display IHS images as RGB (not conversion from IHS to RGB).
static vil_image_view< vil_rgb<
vxl_byte > > 
combine_color_planes (vil_image_view< unsigned char > const &R, vil_image_view< unsigned char > const &G, vil_image_view< unsigned char > const &B)
 Create a color image from multiple view channels.
static vil_image_view< vil_rgb<
vxl_byte > > 
combine_color_planes (vil_image_resource_sptr const &R, vil_image_resource_sptr const &G, vil_image_resource_sptr const &B)
 Create a unsigned char color image from multiple resource channels.
static vil_image_view< unsigned
char > 
convert_to_grey (vil_image_resource const &img)
 converts a generic image to greyscale (RGB<unsigned char>).
static vbl_array_2d< float > load_kernel (vcl_string const &file)
 loads a 2n+1 x 2n+1 convolution kernel (see .cxx for file format).
static void basis_images (vcl_vector< vil_image_view< float > > const &input_images, vcl_vector< vil_image_view< float > > &basis)
 compute basis images for a set of input images.
static bool fourier_transform (vil_image_view< float > const &input, vil_image_view< float > &mag, vil_image_view< float > &phase)
 compute the Fourier transform using the vnl FFT algorithm.
static bool inverse_fourier_transform (vil_image_view< float > const &mag, vil_image_view< float > const &phase, vil_image_view< float > &output)
 compute the inverse Fourier transform using the vnl FFT algorithm.
static void resize (vil_image_view< float > const &input, unsigned width, unsigned height, vil_image_view< float > &output)
 resize to specified dimensions, fill with zeros if output is larger.
static bool resize_to_power_of_two (vil_image_view< float > const &input, vil_image_view< float > &output)
 resize to closest power of two larger dimensions than the input.
static bool spatial_frequency_filter (vil_image_view< float > const &input, float dir_fx, float dir_fy, float f0, float radius, bool output_fourier_mag, vil_image_view< float > &output)
 filter the input image with a Gaussian blocking filter.
static double bilinear_interpolation (vil_image_view< float > const &input, double x, double y)
 2x2 bilinear interpolation of image at specified location.
static bool homography (vil_image_view< float > const &input, vgl_h_matrix_2d< double >const &H, vil_image_view< float > &output, bool output_size_fixed=false, float output_fill_value=0.0f)
 map the input to the output by a homography.
static vil_image_view< float > rotate (vil_image_view< float > const &input, double theta_deg)
 rotate the input image counter-clockwise about the image origin.
static bool chip (vil_image_view< float > const &input, vsol_box_2d_sptr const &roi, vil_image_view< float > &chip)
 extract a region of interest. If roi does not overlap input, return false.
static bool chip (vil_image_resource_sptr const &image, brip_roi_sptr const &roi, vil_image_resource_sptr &chip)
 convert image resource to a chip of equivalent pixel type.
static float average_in_box (vil_image_view< float > const &v, vgl_box_2d< double > const &box)
 compute the average of the image intensity within the specified region.
static vcl_vector< float > scan_region (vil_image_resource_sptr img, vgl_polygon< double > poly, float &min, float &max)
 scan a polygon and return the pixel values as well as max min.
static float cross_correlate (vil_image_view< float > const &image1, vil_image_view< float > const &image2, float x, float y, int radius=5, float intensity_thresh=25.0f)
 cross-correlate two images at a given sub-pixel location.
static bool cross_correlate (vil_image_view< float > const &image1, vil_image_view< float > const &image2, vil_image_view< float > &out, int radius=5, float intensity_thresh=25.0f)
 cross_correlate two images using running sums.
static void ihs_to_rgb (vil_rgb< vxl_byte > &rgb, const float i, const float h, const float s)
 convert a single i,h,s pixel to rgb.
static void rgb_to_ihs (vil_rgb< vxl_byte > const &rgb, float &i, float &h, float &s)
 convert a single rgb pixel to ihs.
static float entropy_i (const unsigned i, const unsigned j, const unsigned i_radius, const unsigned j_radius, vil_image_view< float > const &intensity, const float range=255.0, const unsigned bins=16)
 Compute the intensity entropy of a region about the specified pixel.
static float entropy_g (const unsigned i, const unsigned j, const unsigned i_radius, const unsigned j_radius, vil_image_view< float > const &gradx, vil_image_view< float > const &grady, const float range=360.0, const unsigned bins=8)
 Compute the gradient entropy of a region about the specified pixel.
static float entropy_hs (const unsigned i, const unsigned j, const unsigned i_radius, const unsigned j_radius, vil_image_view< float > const &hue, vil_image_view< float > const &sat, const float range=360.0, const unsigned bins=8)
 Compute the hue and saturation entropy of a region about the specified pixel.
static vil_image_view< float > entropy (const unsigned i_radius, const unsigned j_radius, const unsigned step, vil_image_resource_sptr const &img, const float sigma=1.0f, const bool intensity=true, const bool gradient=true, const bool ihs=false)
 Compute the entropy of the specified region about each pixel.
static float minfo_i (const unsigned i0, const unsigned j0, const unsigned i1, const unsigned j1, const unsigned i_radius, const unsigned j_radius, vil_image_view< float > const &intensity0, vil_image_view< float > const &intensity1, const float range=255.0, const unsigned bins=16)
static float minfo_g (const unsigned i0, const unsigned j0, const unsigned i1, const unsigned j1, const unsigned i_radius, const unsigned j_radius, vil_image_view< float > const &gradx0, vil_image_view< float > const &grady0, vil_image_view< float > const &gradx1, vil_image_view< float > const &grady1, const float range=360.0, const unsigned bins=8)
 Compute the gradient minfo of a region about the specified pixel.
static float minfo_hs (const unsigned i0, const unsigned j0, const unsigned i1, const unsigned j1, const unsigned i_radius, const unsigned j_radius, vil_image_view< float > const &hue0, vil_image_view< float > const &sat0, vil_image_view< float > const &hue1, vil_image_view< float > const &sat1, const float range=360.0, const unsigned bins=8)
 Compute the hue and saturation minfo of a region about the specified pixel.
static bool minfo (const unsigned i_radius, const unsigned j_radius, const unsigned step, vil_image_resource_sptr const &img0, vil_image_resource_sptr const &img1, vil_image_view< float > &MI0, vil_image_view< float > &MI1, const float sigma=1.0f, const bool intensity=true, const bool gradient=true, const bool ihs=false)
 compute the minfo of the specified region about each pixel.
static vil_image_resource_sptr sum (vil_image_resource_sptr const &img0, vil_image_resource_sptr const &img1)
 Add two images from a general resource (forces types to be the same).
static vil_image_resource_sptr difference (vil_image_resource_sptr const &img0, vil_image_resource_sptr const &img1)
 subtract two generic images, return img0-img1 (forces types to the same).
static vil_image_resource_sptr negate (vil_image_resource_sptr const &imgr)
 negate an image returning the same pixel type (only greyscale).

Private Member Functions

 brip_vil_float_ops ()
 Default constructor is private.

Static Private Member Functions

static bool local_maximum (vbl_array_2d< float > const &nighborhood, int n, float &value)
 find if the center pixel of a neighborhood is the maximum value.
static void interpolate_center (vbl_array_2d< float > const &neighborhood, float &dx, float &dy)
 find the sub-pixel offset to the maximum using a 3x3 quad interpolation.
static void half_resolution_1d (const float *input, unsigned n, float k0, float k1, float k2, float *output)
 sub-sample a 1-d array using the Bert-Adelson algorithm.
static void double_resolution_1d (const float *input, const unsigned n_input, const float k0, const float k1, const float k2, float *output)
 interpolate a 1-d array using the Bert-Adelson algorithm.
static bool fft_1d (int dir, int m, double *x, double *y)
 One dimensional fft.
static bool fft_2d (vnl_matrix< vcl_complex< double > > &c, int nx, int ny, int dir)
 Two dimensonal fft.
static void ftt_fourier_2d_reorder (vnl_matrix< vcl_complex< double > > const &F1, vnl_matrix< vcl_complex< double > > &F2)
 Transform the fft coefficients from/to fft/frequency order(self inverse).
static float gaussian_blocking_filter (float dir_fx, float dir_fy, float f0, float radius, float fx, float fy)
 Blocking filter function.


Constructor & Destructor Documentation

brip_vil_float_ops::~brip_vil_float_ops  )  [inline]
 

Definition at line 35 of file brip_vil_float_ops.h.

brip_vil_float_ops::brip_vil_float_ops  )  [inline, private]
 

Default constructor is private.

Definition at line 495 of file brip_vil_float_ops.h.


Member Function Documentation

vil_image_view< float > brip_vil_float_ops::abs_clip_to_level vil_image_view< float > const &  image,
const float  thresh,
const float  level = 0.0
[static]
 

sets absolute values greater than thresh to specified level.

Definition at line 572 of file brip_vil_float_ops.cxx.

float brip_vil_float_ops::average_in_box vil_image_view< float > const &  v,
vgl_box_2d< double > const &  box
[static]
 

compute the average of the image intensity within the specified region.

Definition at line 3234 of file brip_vil_float_ops.cxx.

vil_image_view< float > brip_vil_float_ops::average_NxN vil_image_view< float > const &  img,
int  N
[static]
 

Definition at line 589 of file brip_vil_float_ops.cxx.

void brip_vil_float_ops::basis_images vcl_vector< vil_image_view< float > > const &  input_images,
vcl_vector< vil_image_view< float > > &  basis
[static]
 

compute basis images for a set of input images.

Definition at line 1864 of file brip_vil_float_ops.cxx.

vil_image_view< float > brip_vil_float_ops::beaudet vil_image_view< float > const &  Ixx,
vil_image_view< float > const &  Ixy,
vil_image_view< float > const &  Iyy
[static]
 

Definition at line 682 of file brip_vil_float_ops.cxx.

double brip_vil_float_ops::bilinear_interpolation vil_image_view< float > const &  input,
double  x,
double  y
[static]
 

2x2 bilinear interpolation of image at specified location.

        xr
     yr 0  x
        x  x
   

Definition at line 2309 of file brip_vil_float_ops.cxx.

bool brip_vil_float_ops::chip vil_image_resource_sptr const &  image,
brip_roi_sptr const &  roi,
vil_image_resource_sptr chip
[static]
 

convert image resource to a chip of equivalent pixel type.

Definition at line 2538 of file brip_vil_float_ops.cxx.

bool brip_vil_float_ops::chip vil_image_view< float > const &  input,
vsol_box_2d_sptr const &  roi,
vil_image_view< float > &  chip
[static]
 

extract a region of interest. If roi does not overlap input, return false.

< changed < to <= to include the boundary points too

Definition at line 2509 of file brip_vil_float_ops.cxx.

vil_image_view< vil_rgb< vxl_byte > > brip_vil_float_ops::combine_color_planes vil_image_resource_sptr const &  R,
vil_image_resource_sptr const &  G,
vil_image_resource_sptr const &  B
[static]
 

Create a unsigned char color image from multiple resource channels.

images do not have to be the same size arraysp

Definition at line 1691 of file brip_vil_float_ops.cxx.

vil_image_view< vil_rgb< vxl_byte > > brip_vil_float_ops::combine_color_planes vil_image_view< unsigned char > const &  R,
vil_image_view< unsigned char > const &  G,
vil_image_view< unsigned char > const &  B
[static]
 

Create a color image from multiple view channels.

all views have to have the same array dimensions

Definition at line 1674 of file brip_vil_float_ops.cxx.

vil_image_view< bool > brip_vil_float_ops::convert_to_bool vil_image_view< unsigned char > const &  image  )  [static]
 

converts a byte image to a bool image.

Definition at line 1464 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned char > brip_vil_float_ops::convert_to_byte vil_image_resource_sptr const &  image  )  [static]
 

converts a generic image to a byte image. Use this instead of convert_to_grey.

Definition at line 1319 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned char > brip_vil_float_ops::convert_to_byte vil_image_view< unsigned short > const &  image,
unsigned short  min_val,
unsigned short  max_val
[static]
 

converts an unsigned short image to a byte value range within a specified range.

Definition at line 1293 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned char > brip_vil_float_ops::convert_to_byte vil_image_view< float > const &  image,
float  min_val,
float  max_val
[static]
 

converts a float image to a byte value range within a specified range.

Definition at line 1268 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned char > brip_vil_float_ops::convert_to_byte vil_image_view< float > const &  image  )  [static]
 

converts a float image to a byte value range.

Definition at line 1237 of file brip_vil_float_ops.cxx.

vil_image_view< float > brip_vil_float_ops::convert_to_float vil_image_view< vil_rgb< vxl_byte > > const &  image  )  [static]
 

converts an RGB image to a float image.

Definition at line 1479 of file brip_vil_float_ops.cxx.

vil_image_view< float > brip_vil_float_ops::convert_to_float vil_image_view< unsigned short > const &  image  )  [static]
 

Definition at line 1452 of file brip_vil_float_ops.cxx.

vil_image_view< float > brip_vil_float_ops::convert_to_float vil_image_view< unsigned char > const &  image  )  [static]
 

Definition at line 1440 of file brip_vil_float_ops.cxx.

static vil_image_view<float> brip_vil_float_ops::convert_to_float vil_image_resource_sptr const &  image  )  [inline, static]
 

converts a vil_image_resource to a float image (preferred interface).

Definition at line 211 of file brip_vil_float_ops.h.

vil_image_view< float > brip_vil_float_ops::convert_to_float vil_image_resource const &  image  )  [static]
 

converts a vil_image_resource to a float image.

Definition at line 1731 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned char > brip_vil_float_ops::convert_to_grey vil_image_resource const &  img  )  [static]
 

converts a generic image to greyscale (RGB<unsigned char>).

Definition at line 1765 of file brip_vil_float_ops.cxx.

void brip_vil_float_ops::convert_to_IHS vil_image_view< unsigned char > const &  image,
vil_image_view< float > &  I,
vil_image_view< float > &  H,
vil_image_view< float > &  S
[static]
 

Definition at line 1589 of file brip_vil_float_ops.cxx.

void brip_vil_float_ops::convert_to_IHS vil_image_view< vil_rgb< vxl_byte > > const &  image,
vil_image_view< float > &  I,
vil_image_view< float > &  H,
vil_image_view< float > &  S
[static]
 

convert a color image to float IHS images.

Definition at line 1568 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned short > brip_vil_float_ops::convert_to_short vil_image_resource_sptr const &  image  )  [static]
 

converts a generic image to an unsigned short image.

Definition at line 1371 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned short > brip_vil_float_ops::convert_to_short vil_image_view< float > const &  image  )  [static]
 

converts a float image to an unsigned short image.

range determined automatically

Definition at line 1353 of file brip_vil_float_ops.cxx.

vil_image_view< unsigned short > brip_vil_float_ops::convert_to_short vil_image_view< float > const &  image,
float  min_val,
float  max_val
[static]
 

converts a float image to an unsigned short image within a range.

Definition at line 1325 of file brip_vil_float_ops.cxx.

vil_image_view< float > brip_vil_float_ops::convolve vil_image_view< float > const &  input,
vbl_array_2d< float > const &  kernel
[static]
 

convolves with the specified kernel.

It's assumed that the kernel is square with odd dimensions

Definition at line 61 of file brip_vil_float_ops.cxx.

bool brip_vil_float_ops::cross_correlate vil_image_view< float > const &  image1,
vil_image_view< float > const &  image2,
vil_image_view< float > &  out,
int  radius = 5,
float  intensity_thresh = 25.0f
[static]
 

cross_correlate two images using running sums.

Definition at line 2767 of file brip_vil_float_ops.cxx.

float brip_vil_float_ops::cross_correlate vil_image_view< float > const &  image1,
vil_image_view< float > const &  image2,
float  x,
float  y,
int