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

Image_Local_Neighborhood Class Reference

A class representing a neighborhood system defined locally on an image. More...

#include <Neighborhood_System.hpp>

Inheritance diagram for Image_Local_Neighborhood:

Neighborhood_System List of all members.

Public Member Functions

 Image_Local_Neighborhood ()
 Default constructor.
 Image_Local_Neighborhood (uint Nl, uint Nc)
 Constructor.
 ~Image_Local_Neighborhood ()
 Destructor.
void DeleteAll ()
 Free all memory used.
void SetWeights (vector< int > window, vector< double > wghts)
 Set the neighborhood specification.
void GetNeighbors (uint site, vector< Weighted_Neighbor * > &neighs)
void ReadFromFile (string filename)
 Read from a text file.
void WriteToFile (string filename)
 Write to a text file.
void DumpAsGeneric ()
 Display as a generic neighborhood.
void Info ()
 Display some info about the neighborhood system.

Detailed Description

Author:
Lemine Abdallahi
Date:
Aug. 2005
This is a class defining a neighborhood system on an image .

The neighborhood is defined locally and identically around each site.

A site nighbors are supposed to lie within a rectangular window. More precisely , for a given point I=(Ix, Iy) in the image, its neighbors , J=(Jx, Jy) , verify :

dlmin <= Ix - Jx <= dlmax

and

dcmin <= Iy - Jy <= dcmax

A matrix of weights is also given.

There are (Nlines * Ncols) sites. Sites are numbered line by line. The site 0 is located on the top left corner of the image.


Constructor & Destructor Documentation

Image_Local_Neighborhood::Image_Local_Neighborhood  ) 
 

Default constructor.

Empty image, empty neighborhood.

Image_Local_Neighborhood::Image_Local_Neighborhood uint  Nl,
uint  Nc
 

Constructor.

Parameters:
[in] Nl : Number of columns in the image
[in] Nc : Number of lines in the image
Defines a default neighborhood system on an Nl * Nc image.

This is a first order local neighborhood. Each site has 4 neighbors (N, E, S, W). weights are all equal to 1.0

Image_Local_Neighborhood::~Image_Local_Neighborhood  ) 
 

Deletes the object

Calls DeleteAll .


Member Function Documentation

void Image_Local_Neighborhood::DeleteAll  ) 
 

Frees all the memory used by the object.

void Image_Local_Neighborhood::DumpAsGeneric  ) 
 

Displays the object as a generic neighborhood.

Dumps the full structure of the neighborhood as if it was a generic one.

For verification purposes.

void Image_Local_Neighborhood::GetNeighbors uint  site,
vector< Weighted_Neighbor * > &  neighs
[virtual]
 

The set of neighbors for a given site is computed locally based on the window information and the weights associated.

Reimplemented from Neighborhood_System.

void Image_Local_Neighborhood::Info  )  [virtual]
 

Display some info about the neighborhood system.

Abstract. to be defined for the derived classes.

Reimplemented from Neighborhood_System.

void Image_Local_Neighborhood::ReadFromFile string  filename  )  [virtual]
 

Reads the object definition from a text file.

Parameters:
[in] filename : name of the input file.
Details of the file format may be described as follows:

the first four numbers are the windoiw specification (dlmin, dlmax, dcmin, dcmax).

the reamining sequence of numbers gives the weights on the window.

a typical ( correctly formatted ) example file is :

   -1 1
   -1 1
     1    0    1
     0    0  0.3
   0.7  0.6  0.5

Reimplemented from Neighborhood_System.

void Image_Local_Neighborhood::SetWeights vector< int >  window,
vector< double >  wghts
 

Set the neighborhood specification.

Parameters:
[in] window : vector containg window limits.
[in] wghts : vector containing th weights on the window.
window is used to set (dlmin, dlmax, dcmin, dcmax) values. Sets the weiughts according to the values of wghts.

void Image_Local_Neighborhood::WriteToFile string  filename  ) 
 

Write the neighborhood definition to a text file.

Parameters:
[in] filename : name of the output file.
The format is described in ReadFromFile .


The documentation for this class was generated from the following files:
Generated on Thu Jan 12 11:55:02 2006 for NEM by  doxygen 1.4.4