ImgRoutines Class Reference

Inheritance diagram for ImgRoutines:

Data2D< int > List of all members.

Public Member Functions

 ImgRoutines (Data2D< int > a)
void diff (Data2D< int > a)
int maxVal ()
int markRegions ()
int markRegions (int low_thresh, int high_thresh)
int linearizeRegions (LinearFit **lfit)
void markLines (LinearFit *allLines, int numLines, int val)
void morphClose (int val)
void morphDilate (int val)
void morphErode ()
void morphMakeConnected (int val)
int thinRegions ()
void markBoundary (int dx, int dy, int mark)
void lowerBound (int thresh, int val)
void upperBound (int thresh, int val)
void thresh (int lowerThresh, int upperThresh, int val)
void removeSpeckle (int half_kernel_size)
void dispEdgeFilter ()
int getNumTransitions (int i, int j)
int getNumNeighbors (int i, int j)
int write_pgm (const char *filename, int scaleValues=0) const
 Writes the data out to a pgm (portable gray map) file.
void showImage (const char *filename, bool inBackground) const
 Shows image by using the "xv" command found in your search path.
void set_val (int x, int y, intinput_value)
 Set the value at xth row and yth col.
void set_val (intinput_value)
 Set all values to be input_value.
int get_val (int x, int y) const
 Get the value at xth row and yth col.
int dim_x () const
 Number of rows.
int dim_y () const
 Number of cols.
int num_copies () const
 Number of copies.
void incr (int x, int y, intincr_val=1)
 Increment pixel at x,y by incr_val.
XImage * create_ximage (Display *display, Visual *visual, XColor *colors) const
 Creates an XImage out of the data .
char mapped_color (intdata_value, XColor *colors) const
 Overlad this call to get a new color mapping.
Data2D< int > twin () const
 To construct two separate instances of the data.
Data2D< int > roundOff () const
 Will round off all the values in a Data2D<double>, for example.
Data2D< int > crop (size_t x1, size_t y1, size_t x2, size_t y2) const
 Crop the image to the top-left and bottom-right location given.
Data2D< int > zeropad (int newSize) const
 Zeropad and return a square object of size newSize,newSize.
Data2D< int > removezeropad (int newSize) const
 Crop the image around the edges to get a square object of size newSize, newSize.
void convolve (const Data2D< double > &kernel)
 Convolve this data using the kernel provided.
void convolve (const Data2D< int > &kernel)
 Convolve this data using the kernel provided.
void print_out () const
 prints, to standard output, the elements of the array as a table
void print_out (const char *format) const
 prints, to standard output, the elements of the array as a table
void surface_print_out () const
 prints, to standard output, the elements of the array for inpuyt into a surface plot.

Static Public Member Functions

static Data2D< int > makeBigger (Data2D< int > a, int num)
static Data2D< int > makeSmaller (Data2D< int > a, int denom)
static Data2D< int > read_pgm (const char *filename)
 To read a 2D data from a pgm file.

Protected Member Functions

int allocateData2D (int sx, int sy)
 To allocate data of sx rows and sy columns.
void destruct_self ()
 Release allocated data.

Protected Attributes

int ** data
 2D array of data.
int size_x
 Number of rows.
int size_y
 Number of columns.
int * num_pointers
 The total number of objects pointing to this data.

Constructor & Destructor Documentation

ImgRoutines::ImgRoutines ( Data2D< int >  a  )  [inline]


Member Function Documentation

int Data2D< int >::allocateData2D ( int  sx,
int  sy 
) [protected, inherited]

To allocate data of sx rows and sy columns.

void Data2D< int >::convolve ( const Data2D< int > &  kernel  )  [inherited]

Convolve this data using the kernel provided.

See FFTObj for a more efficient implementation.

void Data2D< int >::convolve ( const Data2D< double > &  kernel  )  [inherited]

Convolve this data using the kernel provided.

See FFTObj for a more efficient implementation.

XImage* Data2D< int >::create_ximage ( Display *  display,
Visual *  visual,
XColor *  colors 
) const [inherited]

Creates an XImage out of the data .

.. This uses Xlib calls. Remember to destroy using XDestroyImage ... Overload the mapped color call to get a new color mapping ...

Data2D<int > Data2D< int >::crop ( size_t  x1,
size_t  y1,
size_t  x2,
size_t  y2 
) const [inherited]

Crop the image to the top-left and bottom-right location given.

void Data2D< int >::destruct_self (  )  [protected, inherited]

Release allocated data.

void ImgRoutines::diff ( Data2D< int >  a  ) 

int Data2D< int >::dim_x (  )  const [inline, inherited]

Number of rows.

int Data2D< int >::dim_y (  )  const [inline, inherited]

Number of cols.

void ImgRoutines::dispEdgeFilter (  ) 

int Data2D< int >::get_val ( int  x,
int  y 
) const [inline, inherited]

Get the value at xth row and yth col.

Does no bound-checking.

int ImgRoutines::getNumNeighbors ( int  i,
int  j 
)

int ImgRoutines::getNumTransitions ( int  i,
int  j 
)

void Data2D< int >::incr ( int  x,
int  y,
int   incr_val = 1 
) [inline, inherited]

Increment pixel at x,y by incr_val.

int ImgRoutines::linearizeRegions ( LinearFit **  lfit  ) 

void ImgRoutines::lowerBound ( int  thresh,
int  val 
)

static Data2D<int> ImgRoutines::makeBigger ( Data2D< int >  a,
int  num 
) [static]

static Data2D<int> ImgRoutines::makeSmaller ( Data2D< int >  a,
int  denom 
) [static]

char Data2D< int >::mapped_color ( int   data_value,
XColor *  colors 
) const [inherited]

Overlad this call to get a new color mapping.

void ImgRoutines::markBoundary ( int  dx,
int  dy,
int  mark 
)

void ImgRoutines::markLines ( LinearFit allLines,
int  numLines,
int  val 
)

int ImgRoutines::markRegions ( int  low_thresh,
int  high_thresh 
)

int ImgRoutines::markRegions (  ) 

int ImgRoutines::maxVal (  ) 

void ImgRoutines::morphClose ( int  val  ) 

void ImgRoutines::morphDilate ( int  val  ) 

void ImgRoutines::morphErode (  ) 

void ImgRoutines::morphMakeConnected ( int  val  ) 

int Data2D< int >::num_copies (  )  const [inline, inherited]

Number of copies.

void Data2D< int >::print_out ( const char *  format  )  const [inherited]

prints, to standard output, the elements of the array as a table

void Data2D< int >::print_out (  )  const [inherited]

prints, to standard output, the elements of the array as a table

static Data2D<int> Data2D< int >::read_pgm ( const char *  filename  )  [static, inherited]

To read a 2D data from a pgm file.

void ImgRoutines::removeSpeckle ( int  half_kernel_size  ) 

Data2D<int > Data2D< int >::removezeropad ( int  newSize  )  const [inherited]

Crop the image around the edges to get a square object of size newSize, newSize.

Data2D<int> Data2D< int >::roundOff (  )  const [inherited]

Will round off all the values in a Data2D<double>, for example.

void Data2D< int >::set_val ( int   input_value  )  [inline, inherited]

Set all values to be input_value.

void Data2D< int >::set_val ( int  x,
int  y,
int   input_value 
) [inline, inherited]

Set the value at xth row and yth col.

Does no bound-checking.

void Data2D< int >::showImage ( const char *  filename,
bool  inBackground 
) const [inherited]

Shows image by using the "xv" command found in your search path.

void Data2D< int >::surface_print_out (  )  const [inherited]

prints, to standard output, the elements of the array for inpuyt into a surface plot.

int ImgRoutines::thinRegions (  ) 

void ImgRoutines::thresh ( int  lowerThresh,
int  upperThresh,
int  val 
)

Data2D<int > Data2D< int >::twin (  )  const [inherited]

To construct two separate instances of the data.

void ImgRoutines::upperBound ( int  thresh,
int  val 
)

int Data2D< int >::write_pgm ( const char *  filename,
int  scaleValues = 0 
) const [inherited]

Writes the data out to a pgm (portable gray map) file.

The default is to not modify the data in any way. If your data can be > 255, you could scale it for viewing. Negative numbers are always written out as zero.

Data2D<int > Data2D< int >::zeropad ( int  newSize  )  const [inherited]

Zeropad and return a square object of size newSize,newSize.

A rectangular version is not provided because I've never needed it.


Member Data Documentation

int ** Data2D< int >::data [protected, inherited]

2D array of data.

int* Data2D< int >::num_pointers [protected, inherited]

The total number of objects pointing to this data.

int Data2D< int >::size_x [protected, inherited]

Number of rows.

int Data2D< int >::size_y [protected, inherited]

Number of columns.


Generated on Fri May 4 13:40:21 2012 for WDSS-IIw2algs by  doxygen 1.4.7