Basic Image AlgorithmS Library  2.8.0
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
BIAS::ImageBlender Class Reference

maps images into a common camera and blends them seamlessly More...

#include <Image/ImageBlender.hh>

+ Inheritance diagram for BIAS::ImageBlender:
+ Collaboration diagram for BIAS::ImageBlender:

Public Member Functions

int AddCamera (const BIAS::Camera< unsigned char > &camera, unsigned int weightType=WEIGHT_TYPE_RECTANGULAR)
 Adds an image to the database. More...
 
void AddDebugLevel (const long int lv)
 
void AddDebugLevel (const std::string &name)
 
bool BlendImages (BIAS::Camera< unsigned char > &destination, double gaussSigma=1.2)
 compute cylindrical geometry from added images and blend all added images More...
 
bool BlendImages (BIAS::Camera< unsigned char > &destination, const ProjectionParametersBase &ppOut, const BIAS::Image< float > *depthmap=NULL, double gaussSigma=1.2)
 Blends all added images into destination with ppOut projection. More...
 
bool DebugLevelIsSet (const long int lv) const
 
bool DebugLevelIsSet (const std::string &name) const
 
int GetDebugLevel () const
 
std::ostream & GetDebugStream () const
 
void GetDebugStream (std::ostream &os) const
 
unsigned int GetOuputImageSize ()
 
 ImageBlender ()
 constructor More...
 
long int Name2DebugLevel (const std::string &name) const
 looks up a debuglevel in the internal map, returns 0 if not found More...
 
long int NewDebugLevel (const std::string &name)
 creates a new debuglevel More...
 
void PrintDebugLevel (std::ostream &os=std::cout) const
 
void RemoveDebugLevel (const long int lv)
 
void RemoveDebugLevel (const std::string &name)
 
void SetDebugLevel (const long int lv)
 
void SetDebugLevel (const std::string &name)
 
void SetDebugStream (const std::ostream &os)
 
void SetDrawImageBorders (bool flag)
 
void SetHorizonAlignment (unsigned int val)
 determines the alignment of the horizon possible values are: HORIZON_ALIGNMENT_X - horizon is in x direction (default value) HORIZON_ALIGNMENT_X - horizon is in y direction HORIZON_ALIGNMENT_UNKNOWN - horizon alignment is unknown or mixed More...
 
void SetOuputImageSize (const unsigned int &newSize)
 
void SetWriteVrml (bool flag)
 
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels More...
 

Static Public Member Functions

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

Protected Member Functions

double CalcAngleToXAxis (const BIAS::Vector2< double > &v, bool wantDegrees=false)
 
double CalcAngleToYAxis (const BIAS::Vector2< double > &v, bool wantDegrees=false)
 
void CheckFov (BIAS::ProjectionParametersCylindric &ppc)
 Checks FOV of each cam and computes the cylinder's FOV If mapper tries to access pixel outside of image, nasty distortion effects occur. More...
 
void ComputeAlphaChannelWeight (BIAS::Image< float > &image, unsigned int weightType=WEIGHT_TYPE_RECTANGULAR)
 adds an alpha channel to RGB image, alpha can be e.g. More...
 
void ComputeCylCamGeometry (BIAS::ProjectionParametersCylindric &ppc)
 
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel More...
 
void ConvertImageToRGBA (BIAS::Image< float > &image)
 

Protected Attributes

long int _liDebugLevel
 
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class More...
 
std::map< std::string, long int > _String2Debuglevel
 
double cylinderHeight_
 
unsigned int cylindricImageHeight_
 
unsigned int cylindricImageWidth_
 
bool drawImageBorders_
 
BIAS::Gauss< float, float > gaussFilter_
 
unsigned int horizonAlignment_
 
std::vector< BIAS::UUIDimageIDs_
 
std::map< BIAS::UUID,
BIAS::Camera< float > > 
inputImages_
 
bool writeVrml_
 

Static Protected Attributes

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

Detailed Description

maps images into a common camera and blends them seamlessly

Blends a bunch of images seamlessly. You can add as many images as you like to the database using AddCamera(). The projection of each camera is needed, so ensure that the camera you're adding contains a valid projection. To blend the images you've added to the database call BlendImages(). Originally this class was written for panoramic image stitiching and computes a cylindrical geometry automatically from the different images. However, you can specify any projection you want as an output. In case your input images do not have the same camera center as your output image and you want this to be considered, you have to provide an output depth map, which can be used for the mapping in 3D.

Blending is done by separating the image into high-pass and low-pass parts, where each part is blended over one wavelength, i.e. sharp edges are blended within 2 pixels, while the image mean is blended over the whole image size.

Author
Robert Wulff
Date
07/2007

Definition at line 63 of file ImageBlender.hh.

Constructor & Destructor Documentation

ImageBlender::ImageBlender ( )

constructor

Author
Robert Wulff
Date
07/2007

Definition at line 15 of file ImageBlender.cpp.

Member Function Documentation

int ImageBlender::AddCamera ( const BIAS::Camera< unsigned char > &  camera,
unsigned int  weightType = WEIGHT_TYPE_RECTANGULAR 
)
void BIAS::Debug::AddDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::AddDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 362 of file Debug.hh.

bool BIAS::ImageBlender::BlendImages ( BIAS::Camera< unsigned char > &  destination,
double  gaussSigma = 1.2 
)
inline

compute cylindrical geometry from added images and blend all added images

wrapper function only, calls other BlendImages

Parameters
destinationresult image
Returns
true iff blending succeeded or false otherwise
Author
Robert Wulff
Date
07/2007

Definition at line 91 of file ImageBlender.hh.

bool ImageBlender::BlendImages ( BIAS::Camera< unsigned char > &  destination,
const ProjectionParametersBase ppOut,
const BIAS::Image< float > *  depthmap = NULL,
double  gaussSigma = 1.2 
)
double ImageBlender::CalcAngleToXAxis ( const BIAS::Vector2< double > &  v,
bool  wantDegrees = false 
)
inlineprotected
double ImageBlender::CalcAngleToYAxis ( const BIAS::Vector2< double > &  v,
bool  wantDegrees = false 
)
inlineprotected
void ImageBlender::CheckFov ( BIAS::ProjectionParametersCylindric ppc)
inlineprotected

Checks FOV of each cam and computes the cylinder's FOV If mapper tries to access pixel outside of image, nasty distortion effects occur.

This method checks the FOV of each cam and blocks access to pixels that are out of scope.

Author
Robert Wulff
Date
11/07

Definition at line 844 of file ImageBlender.cpp.

References BIAS::ProjectionParametersBase::DoesPointProjectIntoImage(), BIAS::Equal(), BIAS::ProjectionParametersBase::GetFirstBorderPixel(), BIAS::ProjectionParametersBase::GetNextBorderPixel(), BIAS::Projection::GetParameters(), BIAS::Vector3< T >::NormL2(), BIAS::ProjectionParametersPerspective::SetMinZLocal(), BIAS::ProjectionParametersPerspective::UnProjectLocal(), BIAS::ProjectionParametersBase::UnProjectToRay(), BIAS::PixelIterator::x, and BIAS::PixelIterator::y.

void ImageBlender::ComputeAlphaChannelWeight ( BIAS::Image< float > &  image,
unsigned int  weightType = WEIGHT_TYPE_RECTANGULAR 
)
inlineprotected

adds an alpha channel to RGB image, alpha can be e.g.

radial symmetric from image center

Definition at line 1024 of file ImageBlender.cpp.

References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), and BIAS::ImageBase::GetWidth().

void ImageBlender::ComputeCylCamGeometry ( BIAS::ProjectionParametersCylindric ppc)
protected
long BIAS::Debug::ConsumeNextFreeDebuglevel_ ( )
inlineprotectedinherited

returns the next available debuglevel

Author
woelk 09/2006

Definition at line 521 of file Debug.hh.

void ImageBlender::ConvertImageToRGBA ( BIAS::Image< float > &  image)
inlineprotected
bool BIAS::Debug::DebugLevelIsSet ( const long int  lv) const
inlineinherited
bool BIAS::Debug::DebugLevelIsSet ( const std::string &  name) const
inlineinherited

Definition at line 350 of file Debug.hh.

int BIAS::Debug::GetDebugLevel ( ) const
inlineinherited
std::ostream& BIAS::Debug::GetDebugStream ( ) const
inlineinherited

Definition at line 405 of file Debug.hh.

void BIAS::Debug::GetDebugStream ( std::ostream &  os) const
inlineinherited

Definition at line 414 of file Debug.hh.

static long int BIAS::Debug::GetGlobalDebugLevel ( )
inlinestaticinherited

Definition at line 431 of file Debug.hh.

unsigned int BIAS::ImageBlender::GetOuputImageSize ( )
inline
Author
Robert Wulff
Date
10/2007

Definition at line 132 of file ImageBlender.hh.

long int BIAS::Debug::Name2DebugLevel ( const std::string &  name) const
inlineinherited

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

Author
woelk 09/2006

Definition at line 454 of file Debug.hh.

long int BIAS::Debug::NewDebugLevel ( const std::string &  name)
inlineinherited
void BIAS::Debug::PrintDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

Definition at line 383 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const long int  lv)
inlineinherited

Definition at line 369 of file Debug.hh.

void BIAS::Debug::RemoveDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 376 of file Debug.hh.

void BIAS::Debug::SetDebugLevel ( const long int  lv)
inlineinherited
void BIAS::Debug::SetDebugLevel ( const std::string &  name)
inlineinherited

Definition at line 325 of file Debug.hh.

void BIAS::Debug::SetDebugStream ( const std::ostream &  os)
inlineinherited

Definition at line 398 of file Debug.hh.

void BIAS::ImageBlender::SetDrawImageBorders ( bool  flag)
inline

Definition at line 139 of file ImageBlender.hh.

static void BIAS::Debug::SetGlobalDebugLevel ( long int  lev)
inlinestaticinherited

Definition at line 424 of file Debug.hh.

void BIAS::ImageBlender::SetHorizonAlignment ( unsigned int  val)
inline

determines the alignment of the horizon possible values are: HORIZON_ALIGNMENT_X - horizon is in x direction (default value) HORIZON_ALIGNMENT_X - horizon is in y direction HORIZON_ALIGNMENT_UNKNOWN - horizon alignment is unknown or mixed

Date
12/07

Definition at line 151 of file ImageBlender.hh.

void BIAS::ImageBlender::SetOuputImageSize ( const unsigned int &  newSize)
inline
Author
Robert Wulff
Date
10/2007

Definition at line 122 of file ImageBlender.hh.

void BIAS::ImageBlender::SetWriteVrml ( bool  flag)
inline

Definition at line 137 of file ImageBlender.hh.

void BIAS::Debug::ShowDebugLevel ( std::ostream &  os = std::cout) const
inlineinherited

prints all internally known debuglevels

Author
woelk 09/2006

Definition at line 496 of file Debug.hh.

Member Data Documentation

long int BIAS::Debug::_liDebugLevel
protectedinherited

Definition at line 510 of file Debug.hh.

Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().

long int BIAS::Debug::_liNextDebugLevel
protectedinherited

new concept, debuglevel are managed here in the debug class

Definition at line 516 of file Debug.hh.

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

std::map<std::string, long int> BIAS::Debug::_String2Debuglevel
protectedinherited

Definition at line 517 of file Debug.hh.

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

std::ostream BIAS::Debug::_zDebugStream
staticprotectedinherited

Definition at line 511 of file Debug.hh.

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

double BIAS::ImageBlender::cylinderHeight_
protected

Definition at line 182 of file ImageBlender.hh.

unsigned int BIAS::ImageBlender::cylindricImageHeight_
protected

Definition at line 184 of file ImageBlender.hh.

unsigned int BIAS::ImageBlender::cylindricImageWidth_
protected

Definition at line 183 of file ImageBlender.hh.

bool BIAS::ImageBlender::drawImageBorders_
protected

Definition at line 193 of file ImageBlender.hh.

BIAS::Gauss<float, float> BIAS::ImageBlender::gaussFilter_
protected

Definition at line 190 of file ImageBlender.hh.

long int BIAS::Debug::GlobalDebugLevel = 0
staticprotectedinherited

Definition at line 513 of file Debug.hh.

unsigned int BIAS::ImageBlender::horizonAlignment_
protected

Definition at line 185 of file ImageBlender.hh.

std::vector<BIAS::UUID> BIAS::ImageBlender::imageIDs_
protected

Definition at line 187 of file ImageBlender.hh.

std::map<BIAS::UUID, BIAS::Camera<float> > BIAS::ImageBlender::inputImages_
protected

Definition at line 188 of file ImageBlender.hh.

bool BIAS::ImageBlender::writeVrml_
protected

Definition at line 192 of file ImageBlender.hh.


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