#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. | |
| 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::UUID > | imageIDs_ |
| std::map< BIAS::UUID, BIAS::Camera< float > > | inputImages_ |
| bool | writeVrml_ |
Static Protected Attributes | |
| static std::ostream | _zDebugStream |
| static long int | GlobalDebugLevel = 0 |
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 | ( | ) |
constructor
Definition at line 19 of file ImageBlender.cpp.
References cylinderHeight_, drawImageBorders_, horizonAlignment_, SetOuputImageSize(), and writeVrml_.
| 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 32 of file ImageBlender.cpp.
References ComputeAlphaChannelWeight(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::Camera< StorageType >::GetProj(), BIAS::ImageBase::GetUID(), BIAS::ImageBase::GetWidth(), imageIDs_, BIAS::Image< StorageType >::Init(), inputImages_, BIAS::Camera< StorageType >::IsProjValid(), BIAS::UUID::IsValid(), BIAS::Camera< StorageType >::SetProj(), and BIAS::ImageConvert::ToRGB().
| void BIAS::Debug::AddDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::AddDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
Reimplemented in BIAS::GLProjectionParametersBase.
Definition at line 356 of file Debug.hh.
Referenced by BIAS::GLProjectionParametersBase::AddDebugLevel(), BIAS::Triangulation::CorrectCorrespondences(), BIAS::FilterBase< InputStorageType, OutputStorageType >::FilterBase(), BIAS::RANSAC< SolutionType >::RANSAC(), and BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph().
| 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 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
| destination | result image |
Definition at line 91 of file ImageBlender.hh.
| double ImageBlender::CalcAngleToXAxis | ( | const BIAS::Vector2< double > & | v, | |
| bool | wantDegrees = false | |||
| ) | [inline, protected] |
Definition at line 783 of file ImageBlender.cpp.
References BIAS::Vector2< T >::NormL2(), and BIAS::Vector2< T >::ScalarProduct().
Referenced by ComputeCylCamGeometry().
| double ImageBlender::CalcAngleToYAxis | ( | const BIAS::Vector2< double > & | v, | |
| bool | wantDegrees = false | |||
| ) | [inline, protected] |
Definition at line 815 of file ImageBlender.cpp.
References BIAS::Vector2< T >::NormL2(), and BIAS::Vector2< T >::ScalarProduct().
| 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.
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] |
Definition at line 437 of file ImageBlender.cpp.
References CalcAngleToXAxis(), CheckFov(), BIAS::SVD::GetVT(), horizonAlignment_, imageIDs_, inputImages_, BIAS::SVD::Invert(), BIAS::Matrix2x2< T >::Mult(), BIAS::Matrix< T >::Mult(), BIAS::Vector3< 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().
| long BIAS::Debug::ConsumeNextFreeDebuglevel_ | ( | ) | [inline, protected, inherited] |
| void ImageBlender::ConvertImageToRGBA | ( | BIAS::Image< float > & | image | ) | [inline, protected] |
Definition at line 1110 of file ImageBlender.cpp.
References BIAS::ImageBase::CM_RGB, BIAS::ImageBase::CM_RGBA, BIAS::ImageConvert::Convert(), BIAS::ImageBase::GetColorModel(), BIAS::ImageBase::GetHeight(), BIAS::Image< StorageType >::GetImageDataArray(), BIAS::ImageBase::GetUID(), BIAS::ImageBase::GetWidth(), and BIAS::ImageBase::SetUID().
Referenced by ComputeAlphaChannelWeight().
| bool BIAS::Debug::DebugLevelIsSet | ( | const std::string & | name | ) | const [inline, inherited] |
| bool BIAS::Debug::DebugLevelIsSet | ( | const long int | lv | ) | const [inline, inherited] |
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] |
Definition at line 333 of file Debug.hh.
Referenced by BIAS::MSAC< SolutionType >::_GenerateSamplesRandom(), BIAS::ImageAlignment::Align(), BIAS::ExampleDebug::func(), BIAS::FMatrix::GetEpipoles(), BIAS::GuiGTK::MouseMotionCallback_(), BIAS::Image< StorageType >::operator=(), BIAS::ImageBase::operator=(), BIAS::ExampleDebug::ResetDebugLevelFromGlobal(), BIAS::TrackerBaseAffine2< StorageType >::TrackAffine_(), and BIAS::TrackerBaseAffine< StorageType >::TrackAffine_().
| void BIAS::Debug::GetDebugStream | ( | std::ostream & | os | ) | const [inline, inherited] |
| std::ostream& BIAS::Debug::GetDebugStream | ( | ) | const [inline, inherited] |
Definition at line 406 of file Debug.hh.
Referenced by BIAS::MSAC< SolutionType >::_GenerateSamplesRandom(), BIAS::RANSAC< SolutionType >::GenerateSamplesRandom(), and BIAS::GuiGTK::MouseMotionCallback_().
| static long int BIAS::Debug::GetGlobalDebugLevel | ( | ) | [inline, static, inherited] |
Definition at line 432 of file Debug.hh.
Referenced by BIAS::ExampleDebug::func(), and BIAS::ExampleDebug::ResetDebugLevelFromGlobal().
| unsigned int BIAS::ImageBlender::GetOuputImageSize | ( | ) | [inline] |
| long int BIAS::Debug::Name2DebugLevel | ( | const std::string & | name | ) | const [inline, inherited] |
| long int BIAS::Debug::NewDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
creates a new debuglevel
Definition at line 475 of file Debug.hh.
Referenced by BIAS::Condensation::Condensation(), BIAS::COSAC< SolutionType >::COSAC(), BIAS::Histogram::Histogram(), BIAS::MonteCarloTransform::MonteCarloTransform(), myclass::myclass(), BIAS::PMatrixEstimation::PMatrixEstimation(), BIAS::PMatrixLinear::PMatrixLinear(), BIAS::PreemptiveRANSAC< SolutionType >::PreemptiveRANSAC(), BIAS::RANSAC< SolutionType >::RANSAC(), BIAS::RANSACPreKnowledge< SolutionType >::RANSACPreKnowledge(), BIAS::ROI::ROI(), BIAS::SceneOpenSceneGraph::SceneOpenSceneGraph(), BIAS::ThreeDOutOpenSceneGraph::ThreeDOutOpenSceneGraph(), BIAS::Triangulation::Triangulation(), and BIAS::UnscentedTransform::UnscentedTransform().
| void BIAS::Debug::PrintDebugLevel | ( | std::ostream & | os = std::cout |
) | const [inline, inherited] |
| void BIAS::Debug::RemoveDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::RemoveDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
| void BIAS::Debug::SetDebugLevel | ( | const std::string & | name | ) | [inline, inherited] |
| void BIAS::Debug::SetDebugLevel | ( | const long int | lv | ) | [inline, inherited] |
Reimplemented in BIAS::GLProjectionParametersBase.
Definition at line 319 of file Debug.hh.
Referenced by BIAS::Interpolator::Interpolator(), BIAS::ExampleDebug::ResetDebugLevelFromGlobal(), BIAS::MDcam::ScanBus(), BIAS::GLProjectionParametersBase::SetDebugLevel(), BIAS::MDcam::SetDebugLevelDcam(), BIAS::VideoSource_Disk::VideoSource_Disk(), BIAS::VideoSource_DV2::VideoSource_DV2(), BIAS::VideoSource_DV::VideoSource_DV_Internal_Init_(), and BIAS::VideoSource_V4L::VideoSource_V4L().
| void BIAS::Debug::SetDebugStream | ( | const std::ostream & | os | ) | [inline, inherited] |
| 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] |
| 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
Definition at line 151 of file ImageBlender.hh.
| void BIAS::ImageBlender::SetOuputImageSize | ( | const unsigned int & | newSize | ) | [inline] |
| 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] |
long int BIAS::Debug::_liDebugLevel [protected, inherited] |
Definition at line 511 of file Debug.hh.
Referenced by BIAS::GuiGTK::DeleteEvent_(), BIAS::GuiGTK::Destroy_(), BIAS::GuiGTK::DrawingAreaExposeCallback_(), BIAS::GuiGTK::GtkMain(), BIAS::GuiGTK::KeyPressEventCallback_(), BIAS::GuiGTK::LabelExposeCallback_(), BIAS::GuiGTK::MouseButtonPressCallback_(), BIAS::GuiGTK::MouseButtonReleaseCallback_(), BIAS::GuiGTK::MouseMotionCallback_(), BIAS::Image< StorageType >::operator=(), BIAS::ImageBase::operator=(), and BIAS::Debug::operator=().
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] |
std::ostream BIAS::Debug::_zDebugStream [static, protected, inherited] |
Definition at line 512 of file Debug.hh.
Referenced by BIAS::GuiGTK::DeleteEvent_(), BIAS::GuiGTK::Destroy_(), BIAS::GuiGTK::DrawingAreaExposeCallback_(), BIAS::GuiGTK::GtkMain(), BIAS::GuiGTK::KeyPressEventCallback_(), BIAS::GuiGTK::LabelExposeCallback_(), BIAS::GuiGTK::MouseButtonPressCallback_(), BIAS::GuiGTK::MouseButtonReleaseCallback_(), BIAS::GuiGTK::MouseMotionCallback_(), and BIAS::Debug::operator=().
double BIAS::ImageBlender::cylinderHeight_ [protected] |
unsigned int BIAS::ImageBlender::cylindricImageHeight_ [protected] |
unsigned int BIAS::ImageBlender::cylindricImageWidth_ [protected] |
bool BIAS::ImageBlender::drawImageBorders_ [protected] |
BIAS::Gauss<float, float> BIAS::ImageBlender::gaussFilter_ [protected] |
long int BIAS::Debug::GlobalDebugLevel = 0 [static, protected, inherited] |
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().
std::map<BIAS::UUID, BIAS::Camera<float> > BIAS::ImageBlender::inputImages_ [protected] |
Definition at line 188 of file ImageBlender.hh.
Referenced by AddCamera(), BlendImages(), CheckFov(), and ComputeCylCamGeometry().
bool BIAS::ImageBlender::writeVrml_ [protected] |
1.5.6