HuginBase::CalculateOptimalROI Class Reference

#include <CalculateOptimalROI.h>

Inheritance diagram for HuginBase::CalculateOptimalROI:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CalculateOptimalROI (PanoramaData &panorama, AppBase::ProgressDisplay *progress, bool intersect=false)
 constructor
 CalculateOptimalROI (PanoramaData &panorama, AppBase::ProgressDisplay *progress, std::vector< UIntSet > hdr_stacks)
virtual ~CalculateOptimalROI ()
 destructor
virtual bool modifiesPanoramaData () const
 returns true if the algorithm changes the PanoramaData.
virtual bool runAlgorithm ()
 implementation of the algorithm.
virtual vigra::Rect2D getResultOptimalROI ()
 return the ROI structure?, for now area
void setStacks (std::vector< UIntSet > hdr_stacks)
 sets the stack vector

Private Member Functions

bool calcOptimalROI (PanoramaData &panorama)
bool imgPixel (int i, int j)
bool stackPixel (int i, int j, UIntSet &stack)
bool autocrop ()
void nonreccheck (const vigra::Rect2D &rect, int acc, int searchStrategy, long &maxvalue)
bool CheckRectCoversPano (const vigra::Rect2D &rect)
 check if given rect covers the whole pano
void AddCheckingRects (std::list< vigra::Rect2D > &testingRects, const vigra::Rect2D &rect, const long maxvalue)
 add new rect to list of rects to be check, do some checks before
void CleanUp ()

Private Attributes

vigra::Size2D o_optimalSize
bool intersection
std::vector< UIntSetstacks
UIntSet activeImages
std::map< unsigned int, PTools::Transform * > transfMap
std::vector< bool > testedPixels
std::vector< bool > pixels
vigra::Rect2D m_bestRect

Detailed Description

Definition at line 37 of file CalculateOptimalROI.h.


Constructor & Destructor Documentation

HuginBase::CalculateOptimalROI::CalculateOptimalROI ( PanoramaData panorama,
AppBase::ProgressDisplay progress,
bool  intersect = false 
) [inline]

constructor

Definition at line 41 of file CalculateOptimalROI.h.

HuginBase::CalculateOptimalROI::CalculateOptimalROI ( PanoramaData panorama,
AppBase::ProgressDisplay progress,
std::vector< UIntSet hdr_stacks 
) [inline]

Definition at line 48 of file CalculateOptimalROI.h.

virtual HuginBase::CalculateOptimalROI::~CalculateOptimalROI (  )  [inline, virtual]

destructor

Definition at line 57 of file CalculateOptimalROI.h.


Member Function Documentation

void HuginBase::CalculateOptimalROI::AddCheckingRects ( std::list< vigra::Rect2D > &  testingRects,
const vigra::Rect2D &  rect,
const long  maxvalue 
) [private]

add new rect to list of rects to be check, do some checks before

Definition at line 161 of file CalculateOptimalROI.cpp.

References o_optimalSize.

Referenced by nonreccheck().

bool HuginBase::CalculateOptimalROI::autocrop (  )  [private]

Definition at line 293 of file CalculateOptimalROI.cpp.

References HuginBase::TimeConsumingPanoramaAlgorithm::getProgressDisplay(), log2(), m_bestRect, celeste::min(), nonreccheck(), o_optimalSize, and vigra_ext::pow().

Referenced by calcOptimalROI().

bool HuginBase::CalculateOptimalROI::calcOptimalROI ( PanoramaData panorama  )  [private]

Definition at line 33 of file CalculateOptimalROI.cpp.

References activeImages, autocrop(), CleanUp(), HuginBase::PTools::Transform::createTransform(), HuginBase::PanoramaData::getActiveImages(), HuginBase::PanoramaData::getImage(), HuginBase::PanoramaData::getOptions(), HuginBase::TimeConsumingPanoramaAlgorithm::getProgressDisplay(), HuginBase::PanoramaOptions::getSize(), m_bestRect, o_optimalSize, pixels, testedPixels, and transfMap.

bool HuginBase::CalculateOptimalROI::CheckRectCoversPano ( const vigra::Rect2D &  rect  )  [private]

check if given rect covers the whole pano

Definition at line 185 of file CalculateOptimalROI.cpp.

References imgPixel().

Referenced by nonreccheck().

void HuginBase::CalculateOptimalROI::CleanUp (  )  [private]

Definition at line 83 of file CalculateOptimalROI.cpp.

References transfMap.

Referenced by calcOptimalROI().

virtual vigra::Rect2D HuginBase::CalculateOptimalROI::getResultOptimalROI (  )  [inline, virtual]

return the ROI structure?, for now area

Definition at line 71 of file CalculateOptimalROI.h.

Referenced by autoCrop(), PT::Panorama::calcOptimalROI(), PT::Panorama::calcOptimalStackROI(), PanoPanel::DoCalcOptimalROI(), main(), and GLPreviewFrame::OnAutocrop().

bool HuginBase::CalculateOptimalROI::imgPixel ( int  i,
int  j 
) [private]

Definition at line 122 of file CalculateOptimalROI.cpp.

References activeImages, o_optimalSize, pixels, stackPixel(), stacks, and testedPixels.

Referenced by CheckRectCoversPano().

virtual bool HuginBase::CalculateOptimalROI::modifiesPanoramaData (  )  const [inline, virtual]

returns true if the algorithm changes the PanoramaData.

Implements HuginBase::PanoramaAlgorithm.

Definition at line 60 of file CalculateOptimalROI.h.

void HuginBase::CalculateOptimalROI::nonreccheck ( const vigra::Rect2D &  rect,
int  acc,
int  searchStrategy,
long &  maxvalue 
) [private]

Definition at line 213 of file CalculateOptimalROI.cpp.

References AddCheckingRects(), CheckRectCoversPano(), m_bestRect, and HuginBase::ModifyRect().

Referenced by autocrop().

virtual bool HuginBase::CalculateOptimalROI::runAlgorithm (  )  [inline, virtual]

implementation of the algorithm.

You should override with your algorithm's implementiation.

Implements HuginBase::PanoramaAlgorithm.

Definition at line 64 of file CalculateOptimalROI.h.

void HuginBase::CalculateOptimalROI::setStacks ( std::vector< UIntSet hdr_stacks  ) 

sets the stack vector

Definition at line 354 of file CalculateOptimalROI.cpp.

References intersection, and stacks.

Referenced by PT::Panorama::calcOptimalStackROI(), and main().

bool HuginBase::CalculateOptimalROI::stackPixel ( int  i,
int  j,
UIntSet stack 
) [private]

Definition at line 92 of file CalculateOptimalROI.cpp.

References HuginBase::PanoramaData::getImage(), intersection, HuginBase::SrcPanoImage::isInside(), HuginBase::PanoramaAlgorithm::o_panorama, and transfMap.

Referenced by imgPixel().


Member Data Documentation

UIntSet HuginBase::CalculateOptimalROI::activeImages [private]

Definition at line 93 of file CalculateOptimalROI.h.

Referenced by calcOptimalROI(), and imgPixel().

bool HuginBase::CalculateOptimalROI::intersection [private]

Definition at line 91 of file CalculateOptimalROI.h.

Referenced by setStacks(), and stackPixel().

vigra::Rect2D HuginBase::CalculateOptimalROI::m_bestRect [private]

Definition at line 98 of file CalculateOptimalROI.h.

Referenced by autocrop(), calcOptimalROI(), and nonreccheck().

vigra::Size2D HuginBase::CalculateOptimalROI::o_optimalSize [private]

Definition at line 90 of file CalculateOptimalROI.h.

Referenced by AddCheckingRects(), autocrop(), calcOptimalROI(), and imgPixel().

std::vector<bool> HuginBase::CalculateOptimalROI::pixels [private]

Definition at line 97 of file CalculateOptimalROI.h.

Referenced by calcOptimalROI(), and imgPixel().

std::vector<UIntSet> HuginBase::CalculateOptimalROI::stacks [private]

Definition at line 92 of file CalculateOptimalROI.h.

Referenced by imgPixel(), and setStacks().

std::vector<bool> HuginBase::CalculateOptimalROI::testedPixels [private]

Definition at line 96 of file CalculateOptimalROI.h.

Referenced by calcOptimalROI(), and imgPixel().

std::map<unsigned int,PTools::Transform*> HuginBase::CalculateOptimalROI::transfMap [private]

Definition at line 94 of file CalculateOptimalROI.h.

Referenced by calcOptimalROI(), CleanUp(), and stackPixel().


The documentation for this class was generated from the following files:
Generated on 2 Sep 2015 for Hugintrunk by  doxygen 1.4.7