Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
HuginBase::CalculateOptimalROI Class Reference

#include <CalculateOptimalROI.h>

Inheritance diagram for HuginBase::CalculateOptimalROI:
Inheritance graph

Public Member Functions

 CalculateOptimalROI (PanoramaData &panorama, AppBase::ProgressDisplay *progress, bool intersect=false)
 constructor More...
 
 CalculateOptimalROI (PanoramaData &panorama, AppBase::ProgressDisplay *progress, std::vector< UIntSet > hdr_stacks)
 
virtual ~CalculateOptimalROI ()
 destructor More...
 
virtual bool modifiesPanoramaData () const
 returns true if the algorithm changes the PanoramaData. More...
 
virtual bool runAlgorithm ()
 implementation of the algorithm. More...
 
virtual vigra::Rect2D getResultOptimalROI ()
 return the ROI structure?, for now area More...
 
void setStacks (std::vector< UIntSet > hdr_stacks)
 sets the stack vector More...
 
- Public Member Functions inherited from HuginBase::TimeConsumingPanoramaAlgorithm
virtual ~TimeConsumingPanoramaAlgorithm ()
 
virtual bool wasCancelled () const
 
- Public Member Functions inherited from HuginBase::PanoramaAlgorithm
virtual ~PanoramaAlgorithm ()
 
virtual bool hasRunSuccessfully ()
 
virtual void run ()
 runs the algorithm. More...
 

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 More...
 
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 More...
 
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
 

Additional Inherited Members

- Protected Member Functions inherited from HuginBase::TimeConsumingPanoramaAlgorithm
 TimeConsumingPanoramaAlgorithm (PanoramaData &panorama, AppBase::ProgressDisplay *progressDisplay=NULL)
 [Warning! it keeps the reference to the panorama data!] More...
 
virtual AppBase::ProgressDisplaygetProgressDisplay () const
 
virtual bool hasProgressDisplay () const
 
virtual void cancelAlgorithm ()
 Call this when the algorithm is cancelled. More...
 
virtual void algorithmCancelled ()
 Called when the algorithm got cancelled; override with cleaning up process etc. More...
 
- Protected Member Functions inherited from HuginBase::PanoramaAlgorithm
 PanoramaAlgorithm (PanoramaData &panorama)
 
- Protected Attributes inherited from HuginBase::PanoramaAlgorithm
PanoramaDatao_panorama
 
bool o_successful
 

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 ( )
inlinevirtual

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 176 of file CalculateOptimalROI.cpp.

References o_optimalSize.

Referenced by nonreccheck().

bool HuginBase::CalculateOptimalROI::autocrop ( )
private
bool HuginBase::CalculateOptimalROI::calcOptimalROI ( PanoramaData panorama)
private
bool HuginBase::CalculateOptimalROI::CheckRectCoversPano ( const vigra::Rect2D &  rect)
private

check if given rect covers the whole pano

Definition at line 200 of file CalculateOptimalROI.cpp.

References imgPixel().

Referenced by nonreccheck().

void HuginBase::CalculateOptimalROI::CleanUp ( )
private

Definition at line 98 of file CalculateOptimalROI.cpp.

References transfMap.

Referenced by calcOptimalROI().

virtual vigra::Rect2D HuginBase::CalculateOptimalROI::getResultOptimalROI ( )
inlinevirtual

return the ROI structure?, for now area

Definition at line 70 of file CalculateOptimalROI.h.

Referenced by autoCrop(), PanoPanel::DoCalcOptimalROI(), main(), GLPreviewFrame::OnAutocrop(), and SetCrop().

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

Definition at line 137 of file CalculateOptimalROI.cpp.

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

Referenced by CheckRectCoversPano().

virtual bool HuginBase::CalculateOptimalROI::modifiesPanoramaData ( ) const
inlinevirtual

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
virtual bool HuginBase::CalculateOptimalROI::runAlgorithm ( )
inlinevirtual

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 375 of file CalculateOptimalROI.cpp.

References intersection, and stacks.

Referenced by main(), and SetCrop().

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

Member Data Documentation

UIntSet HuginBase::CalculateOptimalROI::activeImages
private

Definition at line 92 of file CalculateOptimalROI.h.

Referenced by calcOptimalROI(), and imgPixel().

bool HuginBase::CalculateOptimalROI::intersection
private

Definition at line 90 of file CalculateOptimalROI.h.

Referenced by setStacks(), and stackPixel().

vigra::Rect2D HuginBase::CalculateOptimalROI::m_bestRect
private

Definition at line 97 of file CalculateOptimalROI.h.

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

vigra::Size2D HuginBase::CalculateOptimalROI::o_optimalSize
private

Definition at line 89 of file CalculateOptimalROI.h.

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

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

Definition at line 96 of file CalculateOptimalROI.h.

Referenced by calcOptimalROI(), and imgPixel().

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

Definition at line 91 of file CalculateOptimalROI.h.

Referenced by imgPixel(), and setStacks().

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

Definition at line 95 of file CalculateOptimalROI.h.

Referenced by calcOptimalROI(), and imgPixel().

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

Definition at line 93 of file CalculateOptimalROI.h.

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


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