BIAS::PyramidImage< StorageType > Class Template Reference
[PyramidImage, Camera, Histogram]

Class for holding multiple downsampled images. More...

#include <Image/PyramidImage.hh>

Inheritance diagram for BIAS::PyramidImage< StorageType >:

Inheritance graph
[legend]
Collaboration diagram for BIAS::PyramidImage< StorageType >:

Collaboration graph
[legend]

List of all members.

Public Member Functions

void AddDebugLevel (const std::string &name)
void AddDebugLevel (const long int lv)
void clear ()
void Clear ()
int CreateAdditionalLayer (unsigned int numnewLayers=1, unsigned int minImageWidth=32)
 resizes this and fills correctly with smaller images
bool DebugLevelIsSet (const std::string &name) const
bool DebugLevelIsSet (const long int lv) const
int Downsample ()
 downsamples from (*this)[0] assumes that all pointers e.g.
void Dump (std::ostream &os=std::cout) const
bool empty () const
 deprecated interface
int GetAnisotropicImageValue (const double &xsource, const double &ysource, const Matrix2x2< double > &Cov, double &T, unsigned int channel=0) const
 computes (Gaussian) expectation value across a region, used e.g.
int GetDebugLevel () const
void GetDebugStream (std::ostream &os) const
std::ostream & GetDebugStream () const
std::vector< double > GetFactors ()
const std::vector< double > & GetFactors () const
double GetImageValue (const double &x, const double &y, unsigned int scale, int channel=0) const
 bilinear value from scale space: (x,y) is position in pyramid[0], 0<=scale<=size()-1 is pyramid level
double GetPositionOffset () const
unsigned GetPyramidSize () const
 deprecated interface
double GetRescaleFactor () const
void GetSingleImage (Image< StorageType > &im) const
 returns a single image containing all pyramid images
int GetTrilinearImageValue (const double &x, const double &y, const double &scale, double &T, int channel=0) const
 trilinear value from scale space: (x,y) is position in pyramid[0], 0<=scale<=size()-1 is pyramid level
void Init (const unsigned pyramid_size)
 initializes with empty images
void Init (const unsigned int width, const unsigned int height, const unsigned int channelcount, const unsigned py_size)
void Init (const Image< StorageType > &image, const unsigned py_size=0)
 copy image into level 0 and create other levels according to parameters set so far (pyramidsize, filter,.
void InitFromImageBase (const ImageBase &image, const unsigned py_size=0)
 same as Init(Image) but can use different ST, e.g.
bool IsEmpty () const
bool IsInROI (double x, double y, int layer) const
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel
PyramidImage< StorageType > & operator= (const PyramidImage< StorageType > &pim)
 deep copy assignement
SharedPtr< const Image
< StorageType > > 
operator[] (const unsigned index) const
SharedPtr< Image< StorageType > > & operator[] (const unsigned index)
 element access
void PrintDebugLevel (std::ostream &os=std::cout) const
 PyramidImage (const double factor, const std::vector< SharedPtr< Image< StorageType > > > &imgs)
 PyramidImage (const PyramidImage< StorageType > &pim)
 PyramidImage ()
void RemoveDebugLevel (const std::string &name)
void RemoveDebugLevel (const long int lv)
virtual void resize (const unsigned size)
void SetDebugLevel (const std::string &name)
void SetDebugLevel (const long int lv)
void SetDebugStream (const std::ostream &os)
void SetLowPassFilter (const FilterNToN< StorageType, StorageType > &filter)
void SetLowPassType (int lpt)
void SetRescaleFactor (const double factor)
int SetROI (const ROI &roi)
 set the ROI for all images from original ROI from Img
int SetROI (unsigned minx, unsigned miny, unsigned maxx, unsigned maxy)
 set the ROI for all images
void SetUID (BIAS::UUID uid)
void SetZero ()
 sets all pixels in all images to zero
virtual PyramidImageInterface
< StorageType > * 
ShallowClone () const
 create a shallow clone
PyramidImage< StorageType > & ShallowCopy (const PyramidImage< StorageType > &pim)
 sets this as shallow copy of pim
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels
unsigned size () const
 deprecated interface
unsigned Size () const
int WriteImages (const std::string &prefix) const
 writes a file in mip format per pyramid level using prefix
 ~PyramidImage ()

Static Public Member Functions

static long int GetGlobalDebugLevel ()
static void SetGlobalDebugLevel (long int lev)

Protected Member Functions

void _CreateLevels ()
 creates the levels by downsampling from (*this)[0]
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel
virtual void push_back (SharedPtr< Image< StorageType > > img)

Protected Attributes

std::vector< SharedPtr< Image
< StorageType > > > 
_Images
long int _liDebugLevel
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class
double _PositionOffset
 Offset which needs to be used when transferring point locations between pyramid levels:.
Rescale< StorageType, StorageType > _rescale
double _RescaleFactor
std::map< std::string, long int > _String2Debuglevel
std::vector< double > _vFactor

Static Protected Attributes

static std::ostream _zDebugStream
static long int GlobalDebugLevel = 0


Detailed Description

template<class StorageType>
class BIAS::PyramidImage< StorageType >

Class for holding multiple downsampled images.

Represent a pyramid image, i.e. multiple downsampled images. The image with index 0 has the original size, while each (i+1)-th image has half the size of the i-th image.

Note:
Pointers to the images are held in this class.
Author:
woelk 09/2004
Examples:

EvaluateAlignment.cpp, ExampleAlignment.cpp, ExamplePyramidImage.cpp, ExampleTracker.cpp, TestGui.cpp, TestGuiCV.cpp, TestGuiPyramid.cpp, and TestPyramidImage.cpp.

Definition at line 55 of file PyramidImage.hh.


Constructor & Destructor Documentation

template<class StorageType>
PyramidImage::PyramidImage (  )  [inline]

template<class StorageType>
PyramidImage::PyramidImage ( const PyramidImage< StorageType > &  pim  )  [inline]

template<class StorageType>
BIAS::PyramidImage< StorageType >::PyramidImage ( const double  factor,
const std::vector< SharedPtr< Image< StorageType > > > &  imgs 
)

template<class StorageType>
PyramidImage::~PyramidImage (  )  [inline]

Definition at line 90 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::clear().


Member Function Documentation

template<class StorageType>
void PyramidImage::_CreateLevels (  )  [inline, protected]

void BIAS::Debug::AddDebugLevel ( const std::string &  name  )  [inline, inherited]

Definition at line 363 of file Debug.hh.

void BIAS::Debug::AddDebugLevel ( const long int  lv  )  [inline, inherited]

template<class StorageType>
void BIAS::PyramidImage< StorageType >::clear (  )  [inline]

Definition at line 88 of file PyramidImage.hh.

Referenced by BIAS::PyramidImage< StorageType >::~PyramidImage().

template<class StorageType>
void PyramidImage::Clear (  )  [inline, virtual]

long BIAS::Debug::ConsumeNextFreeDebuglevel_ (  )  [inline, protected, inherited]

returns the next available debuglevel

Author:
woelk 09/2006

Definition at line 522 of file Debug.hh.

template<class StorageType>
int PyramidImage::CreateAdditionalLayer ( unsigned int  numnewLayers = 1,
unsigned int  minImageWidth = 32 
) [inline]

resizes this and fills correctly with smaller images

Make sure that you do not change the filter type between initial pyramid creation and the call to this function, otherwise the global scalar _PositionOffset becomes inconsistent

No images smaller than minImageWidth will be created. I case such an image is rejected, return value is set to +1.

Returns:
=0:ok, <0:error, >0 pyramid size limited by min image width
Author:
koeser 08/2007

Definition at line 448 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::_Images, BIAS::PyramidImage< StorageType >::_rescale, BIAS::PyramidImage< StorageType >::_RescaleFactor, BIAS::PyramidImage< StorageType >::_vFactor, BIAS::Rescale< InputStorageType, OutputStorageType >::Filter(), BIAS::PyramidImage< StorageType >::IsEmpty(), and BIAS::PyramidImage< StorageType >::push_back().

Referenced by BIAS::BackwardMapping< InputStorageType, OutputStorageType >::GetTrilinearImageValue_(), BIAS::BackwardMapping< InputStorageType, OutputStorageType >::MapTrilinearGreySimple_(), and BIAS::BackwardMapping< InputStorageType, OutputStorageType >::SetPyramidSize().

bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name  )  const [inline, inherited]

Definition at line 351 of file Debug.hh.

bool BIAS::Debug::DebugLevelIsSet ( const long int  lv  )  const [inline, inherited]

Examples:
ExampleTriangulateOptimal.cpp.

Definition at line 342 of file Debug.hh.

Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::Rescale< InputStorageType, OutputStorageType >::_ApplyMeanFilter(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::_CalcCornerness(), BIAS::GaussThreshold< InputStorageType, OutputStorageType >::_CalculateKernels(), BIAS::Gauss< InputStorageType, OutputStorageType >::_CalculateKernels(), BIAS::LinearRegionDetector< StorageType, CalculationType >::_ComputeCornerness(), BIAS::CornerDetectorKLT< StorageType, CalculationType >::_ComputeCornerness(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::Rescale< InputStorageType, OutputStorageType >::_FillInterpolated(), BIAS::Rescale< InputStorageType, OutputStorageType >::_FillInterpolatedColor(), BIAS::Rescale< InputStorageType, OutputStorageType >::_FillInterpolatedGrey(), BIAS::ImageBlender::BlendImages(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor3x3(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor5x5(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensor7x7(), BIAS::StructureTensor< InputStorageType, OutputStorageType >::CalcStructureTensorValid(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::CornerDetectorGradient< StorageType, CalculationType >::Detect(), BIAS::Rescale< InputStorageType, OutputStorageType >::DownsampleBy2Color(), BIAS::Binomial< InputStorageType, OutputStorageType >::Filter3x3ValidGreyFloat(), BIAS::Binomial< InputStorageType, OutputStorageType >::Filter5x5ValidGreyFloat(), BIAS::Convolution< InputStorageType, OutputStorageType >::FilterFloat(), BIAS::Convolution< InputStorageType, OutputStorageType >::FilterInt(), BIAS::RANSAC< SolutionType >::GenerateSamplesRandom(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::Tracker< StorageType, CalculationType >::PreparePyramide(), and BIAS::MonteCarloTransform::Transform().

template<class StorageType>
int PyramidImage::Downsample (  )  [inline, virtual]

downsamples from (*this)[0] assumes that all pointers e.g.

(*this)[1] are valid and point to an image of correct size returns 0 on success, anything else on failure

Author:
woelk

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 285 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::_Images, BIAS::PyramidImage< StorageType >::_PositionOffset, BIAS::PyramidImage< StorageType >::_rescale, BIAS::Rescale< InputStorageType, OutputStorageType >::Downsample(), and BIAS::Rescale< InputStorageType, OutputStorageType >::GetPositionOffset().

template<class StorageType>
void PyramidImage::Dump ( std::ostream &  os = std::cout  )  const [inline, virtual]

template<class StorageType>
bool BIAS::PyramidImageInterface< StorageType >::empty (  )  const [inline, inherited]

template<class StorageType>
int PyramidImage::GetAnisotropicImageValue ( const double &  xsource,
const double &  ysource,
const Matrix2x2< double > &  Cov,
double &  T,
unsigned int  channel = 0 
) const [inline]

int BIAS::Debug::GetDebugLevel (  )  const [inline, inherited]

void BIAS::Debug::GetDebugStream ( std::ostream &  os  )  const [inline, inherited]

Definition at line 415 of file Debug.hh.

std::ostream& BIAS::Debug::GetDebugStream (  )  const [inline, inherited]

template<class StorageType>
std::vector<double> BIAS::PyramidImage< StorageType >::GetFactors (  )  [inline]

Definition at line 205 of file PyramidImage.hh.

template<class StorageType>
const std::vector<double>& BIAS::PyramidImage< StorageType >::GetFactors (  )  const [inline]

static long int BIAS::Debug::GetGlobalDebugLevel (  )  [inline, static, inherited]

template<class StorageType>
double PyramidImage::GetImageValue ( const double &  x,
const double &  y,
unsigned int  scale,
int  channel = 0 
) const [inline, virtual]

bilinear value from scale space: (x,y) is position in pyramid[0], 0<=scale<=size()-1 is pyramid level

Slow, but correct implementation, with boundary checking, takes care of PositionOffset

Author:
koeser 1/2008

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 534 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::_Images, BIAS::PyramidImage< StorageType >::_RescaleFactor, and BIAS::PyramidImage< StorageType >::GetPositionOffset().

Referenced by BIAS::ImageAlignment::Align(), and BIAS::PyramidImage< StorageType >::GetAnisotropicImageValue().

template<class StorageType>
double BIAS::PyramidImage< StorageType >::GetPositionOffset (  )  const [inline, virtual]

template<class StorageType>
unsigned BIAS::PyramidImageInterface< StorageType >::GetPyramidSize (  )  const [inline, inherited]

deprecated interface

Definition at line 110 of file PyramidImageInterface.hh.

template<class StorageType>
double BIAS::PyramidImage< StorageType >::GetRescaleFactor (  )  const [inline, virtual]

template<class StorageType>
void PyramidImage::GetSingleImage ( Image< StorageType > &  im  )  const [inline, virtual]

template<class StorageType>
int PyramidImage::GetTrilinearImageValue ( const double &  x,
const double &  y,
const double &  scale,
double &  T,
int  channel = 0 
) const [inline, virtual]

trilinear value from scale space: (x,y) is position in pyramid[0], 0<=scale<=size()-1 is pyramid level

Slow, but correct implementation, with boundary checking, takes care of PositionOffset

Author:
koeser 10/2007

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 565 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::_Images, BIAS::PyramidImage< StorageType >::_RescaleFactor, and BIAS::PyramidImage< StorageType >::GetPositionOffset().

Referenced by BIAS::ImageAlignment::Align(), and BIAS::PyramidImage< StorageType >::GetAnisotropicImageValue().

template<class StorageType>
void PyramidImage::Init ( const unsigned  pyramid_size  )  [inline, virtual]

template<class StorageType>
void BIAS::PyramidImage< StorageType >::Init ( const unsigned int  width,
const unsigned int  height,
const unsigned int  channelcount,
const unsigned  py_size 
) [virtual]

Author:
woelk 09/2004

Implements BIAS::PyramidImageInterface< StorageType >.

template<class StorageType>
void PyramidImage::Init ( const Image< StorageType > &  image,
const unsigned  py_size = 0 
) [inline, virtual]

template<class StorageType>
void PyramidImage::InitFromImageBase ( const ImageBase image,
const unsigned  py_size = 0 
) [inline, virtual]

template<class StorageType>
bool BIAS::PyramidImage< StorageType >::IsEmpty (  )  const [inline, virtual]

template<class StorageType>
bool PyramidImage::IsInROI ( double  x,
double  y,
int  layer 
) const [inline]

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name  )  const [inline, inherited]

looks up a debuglevel in the internal map, returns 0 if not found

Author:
woelk 09/2006

Definition at line 455 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name  )  [inline, inherited]

template<class StorageType>
PyramidImage< StorageType > & PyramidImage::operator= ( const PyramidImage< StorageType > &  pim  )  [inline]

template<class StorageType>
SharedPtr<const Image<StorageType> > BIAS::PyramidImage< StorageType >::operator[] ( const unsigned  index  )  const [inline, virtual]

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 107 of file PyramidImage.hh.

template<class StorageType>
SharedPtr<Image<StorageType> >& BIAS::PyramidImage< StorageType >::operator[] ( const unsigned  index  )  [inline, virtual]

element access

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 103 of file PyramidImage.hh.

void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout  )  const [inline, inherited]

Examples:
ExampleDebug.cpp.

Definition at line 384 of file Debug.hh.

template<class StorageType>
virtual void BIAS::PyramidImage< StorageType >::push_back ( SharedPtr< Image< StorageType > >  img  )  [inline, protected, virtual]

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name  )  [inline, inherited]

Definition at line 377 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv  )  [inline, inherited]

Definition at line 370 of file Debug.hh.

template<class StorageType>
void PyramidImage::resize ( const unsigned  size  )  [inline, virtual]

void BIAS::Debug::SetDebugLevel ( const std::string &  name  )  [inline, inherited]

Definition at line 326 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv  )  [inline, inherited]

void BIAS::Debug::SetDebugStream ( const std::ostream &  os  )  [inline, inherited]

Examples:
DebugMyMain.cpp.

Definition at line 399 of file Debug.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev  )  [inline, static, inherited]

Examples:
DebugMyMain.cpp.

Definition at line 425 of file Debug.hh.

template<class StorageType>
void BIAS::PyramidImage< StorageType >::SetLowPassFilter ( const FilterNToN< StorageType, StorageType > &  filter  )  [inline]

Definition at line 197 of file PyramidImage.hh.

template<class StorageType>
void BIAS::PyramidImage< StorageType >::SetLowPassType ( int  lpt  )  [inline]

Definition at line 199 of file PyramidImage.hh.

template<class StorageType>
void BIAS::PyramidImage< StorageType >::SetRescaleFactor ( const double  factor  )  [inline]

Definition at line 193 of file PyramidImage.hh.

template<class StorageType>
int PyramidImage::SetROI ( const ROI roi  )  [inline]

template<class StorageType>
int PyramidImage::SetROI ( unsigned  minx,
unsigned  miny,
unsigned  maxx,
unsigned  maxy 
) [inline, virtual]

template<class StorageType>
void PyramidImage::SetUID ( BIAS::UUID  uid  )  [inline, virtual]

template<class StorageType>
void PyramidImage::SetZero (  )  [inline, virtual]

sets all pixels in all images to zero

Author:
woelk 10/2004

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 362 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::_Images.

template<class StorageType>
PyramidImageInterface< StorageType > * PyramidImage::ShallowClone (  )  const [inline, virtual]

create a shallow clone

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 251 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::ShallowCopy().

template<class StorageType>
PyramidImage< StorageType > & PyramidImage::ShallowCopy ( const PyramidImage< StorageType > &  pim  )  [inline]

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout  )  const [inline, inherited]

prints all internally known debuglevels

Author:
woelk 09/2006
Examples:
ExampleDebug.cpp.

Definition at line 497 of file Debug.hh.

template<class StorageType>
unsigned BIAS::PyramidImageInterface< StorageType >::size (  )  const [inline, inherited]

template<class StorageType>
unsigned BIAS::PyramidImage< StorageType >::Size (  )  const [inline, virtual]

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 179 of file PyramidImage.hh.

template<class StorageType>
int PyramidImage::WriteImages ( const std::string &  prefix  )  const [inline, virtual]

writes a file in mip format per pyramid level using prefix

Author:
woelk 10/2004

Implements BIAS::PyramidImageInterface< StorageType >.

Definition at line 515 of file PyramidImage.cpp.

References BIAS::PyramidImage< StorageType >::_Images, and BIAS::ImageIO::Save().


Member Data Documentation

template<class StorageType>
std::vector<SharedPtr<Image<StorageType> > > BIAS::PyramidImage< StorageType >::_Images [protected]

long int BIAS::Debug::_liDebugLevel [protected, inherited]

long int BIAS::Debug::_liNextDebugLevel [protected, inherited]

new concept, debuglevel are managed here in the debug class

Definition at line 517 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

template<class StorageType>
double BIAS::PyramidImage< StorageType >::_PositionOffset [protected]

Offset which needs to be used when transferring point locations between pyramid levels:.

(2*xs+offset, 2*ys+offset) = (xb, yb) or (xs, ys) = ((xb-offset)/2.0, (yb-offset)/2.0)

where (xs, ys) is the pixel position in pixel coo. the smaller destination image and (xb, yb) is the position in pixel coo. in the bigger source image.

see Rescale::DowsampleBy2 for details

Author:
woelk 05/2005

Definition at line 243 of file PyramidImage.hh.

Referenced by BIAS::PyramidImage< StorageType >::_CreateLevels(), BIAS::PyramidImage< StorageType >::Clear(), BIAS::PyramidImage< StorageType >::Downsample(), BIAS::PyramidImage< StorageType >::IsInROI(), BIAS::PyramidImage< StorageType >::operator=(), BIAS::PyramidImage< StorageType >::PyramidImage(), and BIAS::PyramidImage< StorageType >::ShallowCopy().

template<class StorageType>
Rescale<StorageType, StorageType> BIAS::PyramidImage< StorageType >::_rescale [protected]

template<class StorageType>
double BIAS::PyramidImage< StorageType >::_RescaleFactor [protected]

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel [protected, inherited]

Definition at line 518 of file Debug.hh.

Referenced by BIAS::Debug::operator=().

template<class StorageType>
std::vector<double> BIAS::PyramidImage< StorageType >::_vFactor [protected]

std::ostream BIAS::Debug::_zDebugStream [static, protected, inherited]

long int BIAS::Debug::GlobalDebugLevel = 0 [static, protected, inherited]

Definition at line 514 of file Debug.hh.


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

Generated on Mon Mar 15 01:14:55 2010 for Basic Image AlgorithmS Library by  doxygen 1.5.6