Public Member Functions | Protected Member Functions | Protected Attributes
brip_gain_offset_solver Class Reference

#include <brip_gain_offset_solver.h>

List of all members.

Public Member Functions

 brip_gain_offset_solver ()
 brip_gain_offset_solver (vil_image_view< float > const &model_image, vil_image_view< float > const &test_image)
 constructor with images, which are used in entirety.
 brip_gain_offset_solver (vil_image_view< float > const &model_image, vil_image_view< float > const &test_image, vil_image_view< unsigned char > const &model_mask, vil_image_view< unsigned char > const &test_mask)
 constructor with images and masks. pixels with mask(i,j)=true are valid.
 ~brip_gain_offset_solver ()
void set_model_image (vil_image_view< float > const &image)
 set images after default construction.
void set_test_image (vil_image_view< float > const &image)
void set_model_mask (vil_image_view< unsigned char > const &mask)
 set masks to define valid pixels in each image. Otherwise entire image is used.
void set_test_mask (vil_image_view< unsigned char > const &mask)
unsigned ni () const
 accessors.
unsigned nj () const
float gain () const
float offset () const
bool solve ()
 operations.
vil_image_view< float > mapped_test_image ()
 transform the test image by the solved gain and offset.

Protected Member Functions

void compute_valid_pix ()
 internal methods.

Protected Attributes

unsigned ni_
 members.
unsigned nj_
vil_image_view< float > model_image_
vil_image_view< float > test_image_
float gain_
float offset_
vil_image_view< unsigned char > model_mask_
vil_image_view< unsigned char > test_mask_
bool t_mask_
bool m_mask_
unsigned n_valid_pix_

Detailed Description

Definition at line 25 of file brip_gain_offset_solver.h.


Constructor & Destructor Documentation

brip_gain_offset_solver::brip_gain_offset_solver ( ) [inline]

Definition at line 29 of file brip_gain_offset_solver.h.

brip_gain_offset_solver::brip_gain_offset_solver ( vil_image_view< float > const &  model_image,
vil_image_view< float > const &  test_image 
)

constructor with images, which are used in entirety.

Definition at line 57 of file brip_gain_offset_solver.cxx.

brip_gain_offset_solver::brip_gain_offset_solver ( vil_image_view< float > const &  model_image,
vil_image_view< float > const &  test_image,
vil_image_view< unsigned char > const &  model_mask,
vil_image_view< unsigned char > const &  test_mask 
)

constructor with images and masks. pixels with mask(i,j)=true are valid.

Definition at line 66 of file brip_gain_offset_solver.cxx.

brip_gain_offset_solver::~brip_gain_offset_solver ( ) [inline]

Definition at line 42 of file brip_gain_offset_solver.h.


Member Function Documentation

void brip_gain_offset_solver::compute_valid_pix ( ) [protected]

internal methods.

compute the number of valid corresponding pixels in the case of masks.

Definition at line 9 of file brip_gain_offset_solver.cxx.

float brip_gain_offset_solver::gain ( ) const [inline]

Definition at line 54 of file brip_gain_offset_solver.h.

vil_image_view< float > brip_gain_offset_solver::mapped_test_image ( )

transform the test image by the solved gain and offset.

Definition at line 124 of file brip_gain_offset_solver.cxx.

unsigned brip_gain_offset_solver::ni ( ) const [inline]

accessors.

Definition at line 52 of file brip_gain_offset_solver.h.

unsigned brip_gain_offset_solver::nj ( ) const [inline]

Definition at line 53 of file brip_gain_offset_solver.h.

float brip_gain_offset_solver::offset ( ) const [inline]

Definition at line 55 of file brip_gain_offset_solver.h.

void brip_gain_offset_solver::set_model_image ( vil_image_view< float > const &  image) [inline]

set images after default construction.

Definition at line 45 of file brip_gain_offset_solver.h.

void brip_gain_offset_solver::set_model_mask ( vil_image_view< unsigned char > const &  mask) [inline]

set masks to define valid pixels in each image. Otherwise entire image is used.

Definition at line 48 of file brip_gain_offset_solver.h.

void brip_gain_offset_solver::set_test_image ( vil_image_view< float > const &  image) [inline]

Definition at line 46 of file brip_gain_offset_solver.h.

void brip_gain_offset_solver::set_test_mask ( vil_image_view< unsigned char > const &  mask) [inline]

Definition at line 49 of file brip_gain_offset_solver.h.

bool brip_gain_offset_solver::solve ( )

operations.

Im = model_image intensity, It = test_image intensity.

each pixel defines an equation

gain*It(i,j) + off = Im(i,j)

Define the matrix A, and vector b

       [It(0,0)        1]     [Im(0,0)      ]
       [It(1,0)        1]     [Im(1,0)      ]
   A = [     ...        ]  b =[  ...        ]
       [It(ni-1, nj-1) 1]     [Im(ni-1,nj-1)]
   

Use SVD to solve A [gain] = b [off]

Definition at line 94 of file brip_gain_offset_solver.cxx.


Member Data Documentation

float brip_gain_offset_solver::gain_ [protected]

Definition at line 67 of file brip_gain_offset_solver.h.

Definition at line 72 of file brip_gain_offset_solver.h.

Definition at line 65 of file brip_gain_offset_solver.h.

Definition at line 69 of file brip_gain_offset_solver.h.

Definition at line 73 of file brip_gain_offset_solver.h.

unsigned brip_gain_offset_solver::ni_ [protected]

members.

Definition at line 64 of file brip_gain_offset_solver.h.

unsigned brip_gain_offset_solver::nj_ [protected]

Definition at line 64 of file brip_gain_offset_solver.h.

Definition at line 68 of file brip_gain_offset_solver.h.

Definition at line 71 of file brip_gain_offset_solver.h.

Definition at line 66 of file brip_gain_offset_solver.h.

Definition at line 70 of file brip_gain_offset_solver.h.


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