BIAS::ImageBlender Class Reference

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

#include <Image/ImageBlender.hh>

Inheritance diagram for BIAS::ImageBlender:

Inheritance graph
[legend]
Collaboration diagram for BIAS::ImageBlender:

Collaboration graph
[legend]

List of all members.

Public Member Functions

int AddCamera (const BIAS::Camera< unsigned char > &camera, unsigned int weightType=WEIGHT_TYPE_RECTANGULAR)
 Adds an image to the database.
void AddDebugLevel (const std::string &name)
void AddDebugLevel (const long int lv)
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.
bool BlendImages (BIAS::Camera< unsigned char > &destination, double gaussSigma=1.2)
 compute cylindrical geometry from added images and blend all added images
bool DebugLevelIsSet (const std::string &name) const
bool DebugLevelIsSet (const long int lv) const
int GetDebugLevel () const
void GetDebugStream (std::ostream &os) const
std::ostream & GetDebugStream () const
unsigned int GetOuputImageSize ()
 ImageBlender ()
 constructor
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
void PrintDebugLevel (std::ostream &os=std::cout) const
void RemoveDebugLevel (const std::string &name)
void RemoveDebugLevel (const long int lv)
void SetDebugLevel (const std::string &name)
void SetDebugLevel (const long int lv)
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
void SetOuputImageSize (const unsigned int &newSize)
void SetWriteVrml (bool flag)
void ShowDebugLevel (std::ostream &os=std::cout) const
 prints all internally known debuglevels

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.
void ComputeAlphaChannelWeight (BIAS::Image< float > &image, unsigned int weightType=WEIGHT_TYPE_RECTANGULAR)
 adds an alpha channel to RGB image, alpha can be e.g.
void ComputeCylCamGeometry (BIAS::ProjectionParametersCylindric &ppc)
long ConsumeNextFreeDebuglevel_ ()
 returns the next available debuglevel
void ConvertImageToRGBA (BIAS::Image< float > &image)

Protected Attributes

long int _liDebugLevel
long int _liNextDebugLevel
 new concept, debuglevel are managed here in the debug class
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 19 of file ImageBlender.cpp.

References cylinderHeight_, drawImageBorders_, horizonAlignment_, SetOuputImageSize(), and writeVrml_.


Member Function Documentation

int ImageBlender::AddCamera ( const BIAS::Camera< unsigned char > &  camera,
unsigned int  weightType = WEIGHT_TYPE_RECTANGULAR 
)

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]

bool ImageBlender::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.

Parameters:
destination output image
ppOut desired projection for output
depthmap of destination, needed if input cameras do not have the same center as output camera, ignored if NULL
Returns:
true iff blending succeeded or false otherwise
Author:
Robert Wulff
Date:
07/2007

Definition at line 83 of file ImageBlender.cpp.

References BIAS::ThreeDOut::AddTriangleMesh(), BIAS::Image< StorageType >::Clear(), BIAS::ImageBase::CM_RGB, BIAS::ImageBase::CM_RGBA, BIAS::ImageConvert::Convert(), BIAS::ImageConvert::ConvertST(), cylindricImageHeight_, cylindricImageWidth_, BIAS::Debug::DebugLevelIsSet(), BIAS::ProjectionParametersBase::DoesPointProjectIntoImage(), drawImageBorders_, BIAS::Gauss< InputStorageType, OutputStorageType >::Filter(), gaussFilter_, BIAS::TriangleMesh::GenerateTexturedCamera(), BIAS::ImageBase::GetChannelCount(), BIAS::ProjectionParametersBase::GetFirstBorderPixel(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ProjectionParametersBase::GetNextBorderPixel(), BIAS::ImageBase::GetWidth(), imageIDs_, BIAS::Image< StorageType >::Init(), inputImages_, BIAS::ImageIO::Load(), BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map(), BIAS::Image< StorageType >::Release(), BIAS::ImageIO::Save(), BIAS::Image< StorageType >::SetPixel(), BIAS::Camera< StorageType >::SetProj(), BIAS::Gauss< InputStorageType, OutputStorageType >::SetSigma(), BIAS::ProjectionMapping< InputStorageType, OutputStorageType >::SetSinkCam(), BIAS::ProjectionMapping< InputStorageType, OutputStorageType >::SetSourceCam(), BIAS::FileHandling::toString(), BIAS::ProjectionParametersBase::UnProjectToRay(), BIAS::Camera< StorageType >::UpdateMetaData(), BIAS::ThreeDOut::VRMLOut(), writeVrml_, BIAS::PixelIterator::x, and BIAS::PixelIterator::y.

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:
destination result image
Returns:
true iff blending succeeded or false otherwise
Author:
Robert Wulff
Date:
07/2007

Definition at line 91 of file ImageBlender.hh.

double ImageBlender::CalcAngleToXAxis ( const BIAS::Vector2< double > &  v,
bool  wantDegrees = false 
) [inline, protected]

double ImageBlender::CalcAngleToYAxis ( const BIAS::Vector2< double > &  v,
bool  wantDegrees = false 
) [inline, protected]

void ImageBlender::CheckFov ( BIAS::ProjectionParametersCylindric ppc  )  [inline, protected]

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 847 of file ImageBlender.cpp.

References cylindricImageHeight_, cylindricImageWidth_, BIAS::ProjectionParametersBase::DoesPointProjectIntoImage(), BIAS::ProjectionParametersBase::GetFirstBorderPixel(), BIAS::ProjectionParametersBase::GetNextBorderPixel(), imageIDs_, inputImages_, BIAS::Vector3< T >::NormL2(), BIAS::ProjectionParametersPerspective::SetMinZLocal(), BIAS::ProjectionParametersPerspective::UnProjectLocal(), BIAS::ProjectionParametersBase::UnProjectToRay(), BIAS::PixelIterator::x, and BIAS::PixelIterator::y.

Referenced by ComputeCylCamGeometry().

void ImageBlender::ComputeAlphaChannelWeight ( BIAS::Image< float > &  image,
unsigned int  weightType = WEIGHT_TYPE_RECTANGULAR 
) [inline, protected]

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

radial symmetric from image center

Definition at line 1023 of file ImageBlender.cpp.

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

Referenced by AddCamera().

void ImageBlender::ComputeCylCamGeometry ( BIAS::ProjectionParametersCylindric ppc  )  [protected]

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

returns the next available debuglevel

Author:
woelk 09/2006

Definition at line 522 of file Debug.hh.

void ImageBlender::ConvertImageToRGBA ( BIAS::Image< float > &  image  )  [inline, protected]

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(), 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().

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]

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

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 [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]

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

Examples:
ExampleDebug.cpp.

Definition at line 384 of file Debug.hh.

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.

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.

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

Definition at line 139 of file ImageBlender.hh.

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

Examples:
DebugMyMain.cpp.

Definition at line 425 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.

Referenced by ImageBlender().

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 [inline, inherited]

prints all internally known debuglevels

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

Definition at line 497 of file Debug.hh.


Member Data Documentation

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=().

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

Definition at line 518 of file Debug.hh.

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

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

Definition at line 182 of file ImageBlender.hh.

Referenced by ImageBlender().

Definition at line 184 of file ImageBlender.hh.

Referenced by BlendImages(), and CheckFov().

unsigned int BIAS::ImageBlender::cylindricImageWidth_ [protected]

Definition at line 183 of file ImageBlender.hh.

Referenced by BlendImages(), and CheckFov().

Definition at line 193 of file ImageBlender.hh.

Referenced by BlendImages(), and ImageBlender().

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

Definition at line 190 of file ImageBlender.hh.

Referenced by BlendImages().

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

Definition at line 514 of file Debug.hh.

unsigned int BIAS::ImageBlender::horizonAlignment_ [protected]

Definition at line 185 of file ImageBlender.hh.

Referenced by ComputeCylCamGeometry(), and ImageBlender().

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

Definition at line 187 of file ImageBlender.hh.

Referenced by AddCamera(), BlendImages(), CheckFov(), and ComputeCylCamGeometry().

Definition at line 188 of file ImageBlender.hh.

Referenced by AddCamera(), BlendImages(), CheckFov(), and ComputeCylCamGeometry().

Definition at line 192 of file ImageBlender.hh.

Referenced by BlendImages(), and ImageBlender().


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

Generated on Thu Mar 18 01:11:10 2010 for Basic Image AlgorithmS Library by  doxygen 1.5.6