Basic Image AlgorithmS Library
2.8.0
|
maps images into a common camera and blends them seamlessly More...
#include <Image/ImageBlender.hh>
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::UUID > | imageIDs_ |
std::map< BIAS::UUID, BIAS::Camera< float > > | inputImages_ |
bool | writeVrml_ |
Static Protected Attributes | |
static std::ostream | _zDebugStream |
static long int | GlobalDebugLevel = 0 |
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.
Definition at line 63 of file ImageBlender.hh.
ImageBlender::ImageBlender | ( | ) |
int ImageBlender::AddCamera | ( | const BIAS::Camera< unsigned char > & | camera, |
unsigned int | weightType = WEIGHT_TYPE_RECTANGULAR |
||
) |
Adds an image to the database.
The image must contain a valid projection and a valid UUID.
Definition at line 28 of file ImageBlender.cpp.
References BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::Camera< StorageType >::GetProj(), BIAS::ImageBase::GetUID(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::Camera< StorageType >::IsProjValid(), BIAS::UUID::IsValid(), and BIAS::Camera< StorageType >::SetProj().
|
inlineinherited |
Definition at line 355 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::ShowCamWxVideoSourceFactory::OpenDevice(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
|
inlineinherited |
|
inline |
compute cylindrical geometry from added images and blend all added images
wrapper function only, calls other BlendImages
destination | result image |
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 |
||
) |
Blends all added images into destination with ppOut projection.
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 |
Definition at line 79 of file ImageBlender.cpp.
References BIAS::ThreeDOut::AddTriangleMesh(), BIAS::Image< StorageType >::Clear(), BIAS::ProjectionParametersBase::DoesPointProjectIntoImage(), BIAS::TriangleMesh::GenerateTexturedCamera(), BIAS::ImageBase::GetChannelCount(), BIAS::ProjectionParametersBase::GetFirstBorderPixel(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageData(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ProjectionParametersBase::GetNextBorderPixel(), BIAS::Projection::GetParameters(), BIAS::ImageBase::GetWidth(), BIAS::Image< StorageType >::Init(), BIAS::BackwardMapping< InputStorageType, OutputStorageType >::Map(), BIAS::MapTrilinear, BIAS::Image< StorageType >::Release(), BIAS::Image< StorageType >::SetPixel(), BIAS::Camera< StorageType >::SetProj(), BIAS::ProjectionMapping< InputStorageType, OutputStorageType >::SetSinkCam(), BIAS::ProjectionMapping< InputStorageType, OutputStorageType >::SetSourceCam(), BIAS::ProjectionParametersBase::UnProjectToRay(), BIAS::Camera< StorageType >::UpdateMetaData(), BIAS::ThreeDOut::VRMLOut(), BIAS::PixelIterator::x, and BIAS::PixelIterator::y.
|
inlineprotected |
Definition at line 780 of file ImageBlender.cpp.
References BIAS::Vector2< T >::NormL2(), and BIAS::Vector2< T >::ScalarProduct().
|
inlineprotected |
Definition at line 812 of file ImageBlender.cpp.
References BIAS::Vector2< T >::NormL2(), and BIAS::Vector2< T >::ScalarProduct().
|
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.
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.
|
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().
|
protected |
Definition at line 434 of file ImageBlender.cpp.
References BIAS::Vector3< T >::CrossProduct(), BIAS::SVD::GetVT(), BIAS::SVD::Invert(), BIAS::Matrix2x2< T >::Mult(), BIAS::Vector3< T >::Mult(), BIAS::Matrix< T >::Mult(), BIAS::Vector3< T >::Normalize(), BIAS::Vector< T >::NormL2(), BIAS::Vector2< T >::NormL2(), TNT::Matrix< T >::num_rows(), BIAS::Vector3< T >::ScalarProduct(), BIAS::ProjectionParametersBase::SetC(), BIAS::ProjectionParametersBase::SetR(), BIAS::Vector3< T >::Size(), and BIAS::Vector3< T >::Sub().
|
inlineprotectedinherited |
|
inlineprotected |
Definition at line 1111 of file ImageBlender.cpp.
References BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetUID(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::SetUID().
|
inlineinherited |
Definition at line 341 of file Debug.hh.
Referenced by BIAS::GenSynthMatches::_AddUniformDistributedOutliers(), BIAS::GenSynthMatches::_CreateCamMovement(), BIAS::GenSynthMatches::_CreateStatic2DPoints(), BIAS::UnscentedTransform::ComputeSigmaPoints_(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::GenSynthMatches::GetGTNormalizedF(), BIAS::MonteCarloTransform::GetSamples_(), and BIAS::MonteCarloTransform::Transform().
|
inlineinherited |
|
inlineinherited |
Definition at line 332 of file Debug.hh.
Referenced by BIAS::listenthread(), BIAS::Image< StorageType >::operator=(), and BIAS::ImageBase::operator=().
|
inlineinherited |
|
inlineinherited |
|
inlinestaticinherited |
|
inline |
Definition at line 132 of file ImageBlender.hh.
|
inlineinherited |
|
inlineinherited |
creates a new debuglevel
Definition at line 474 of file Debug.hh.
Referenced by BIAS::COSAC< SolutionType >::COSAC(), BIAS::ProjectionParametersPerspectiveDepth::Init(), BIAS::MonteCarloTransform::MonteCarloTransform(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::RotationAveraging::RotationAveraging(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
|
inlineinherited |
Definition at line 318 of file Debug.hh.
Referenced by BIAS::ShowCamWxVideoSourceFactory::CreateBumbleBee(), BIAS::ShowCamWxVideoSourceFactory::CreateDCAM(), BIAS::VideoSource_MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
|
inlineinherited |
|
inlineinherited |
|
inline |
Definition at line 139 of file ImageBlender.hh.
|
inlinestaticinherited |
|
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
Definition at line 151 of file ImageBlender.hh.
|
inline |
Definition at line 122 of file ImageBlender.hh.
|
inline |
Definition at line 137 of file ImageBlender.hh.
|
inlineinherited |
|
protectedinherited |
Definition at line 510 of file Debug.hh.
Referenced by BIAS::Debug::operator=(), and BIAS::ImageBase::operator=().
|
protectedinherited |
new concept, debuglevel are managed here in the debug class
Definition at line 516 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protectedinherited |
Definition at line 517 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
staticprotectedinherited |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::Debug::operator=().
|
protected |
Definition at line 182 of file ImageBlender.hh.
|
protected |
Definition at line 184 of file ImageBlender.hh.
|
protected |
Definition at line 183 of file ImageBlender.hh.
|
protected |
Definition at line 193 of file ImageBlender.hh.
|
protected |
Definition at line 190 of file ImageBlender.hh.
|
staticprotectedinherited |
|
protected |
Definition at line 185 of file ImageBlender.hh.
|
protected |
Definition at line 187 of file ImageBlender.hh.
|
protected |
Definition at line 188 of file ImageBlender.hh.
|
protected |
Definition at line 192 of file ImageBlender.hh.