Hugintrunk
0.1
|
#include <CalculateOptimalROI.h>
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< UIntSet > | stacks |
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::ProgressDisplay * | getProgressDisplay () 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 | |
PanoramaData & | o_panorama |
bool | o_successful |
Definition at line 37 of file CalculateOptimalROI.h.
|
inline |
constructor
Definition at line 41 of file CalculateOptimalROI.h.
|
inline |
Definition at line 48 of file CalculateOptimalROI.h.
|
inlinevirtual |
destructor
Definition at line 57 of file CalculateOptimalROI.h.
|
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().
|
private |
Definition at line 308 of file CalculateOptimalROI.cpp.
References HuginBase::TimeConsumingPanoramaAlgorithm::getProgressDisplay(), m_bestRect, celeste::min(), nonreccheck(), o_optimalSize, and vigra_ext::pow().
Referenced by calcOptimalROI().
|
private |
Definition at line 35 of file CalculateOptimalROI.cpp.
References activeImages, autocrop(), CleanUp(), HuginBase::PTools::Transform::createTransform(), HuginBase::PanoramaData::getActiveImages(), HuginBase::PanoramaData::getImage(), HuginBase::getImagesinROI(), HuginBase::PanoramaData::getOptions(), HuginBase::TimeConsumingPanoramaAlgorithm::getProgressDisplay(), HuginBase::PanoramaOptions::getSize(), m_bestRect, o_optimalSize, pixels, testedPixels, and transfMap.
|
private |
check if given rect covers the whole pano
Definition at line 200 of file CalculateOptimalROI.cpp.
References imgPixel().
Referenced by nonreccheck().
|
private |
Definition at line 98 of file CalculateOptimalROI.cpp.
References transfMap.
Referenced by calcOptimalROI().
|
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().
|
private |
Definition at line 137 of file CalculateOptimalROI.cpp.
References activeImages, o_optimalSize, pixels, stackPixel(), stacks, and testedPixels.
Referenced by CheckRectCoversPano().
|
inlinevirtual |
returns true if the algorithm changes the PanoramaData.
Implements HuginBase::PanoramaAlgorithm.
Definition at line 60 of file CalculateOptimalROI.h.
|
private |
Definition at line 228 of file CalculateOptimalROI.cpp.
References AddCheckingRects(), CheckRectCoversPano(), m_bestRect, and HuginBase::ModifyRect().
Referenced by autocrop().
|
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.
|
private |
Definition at line 107 of file CalculateOptimalROI.cpp.
References HuginBase::PanoramaData::getImage(), intersection, HuginBase::SrcPanoImage::isInside(), HuginBase::PanoramaAlgorithm::o_panorama, and transfMap.
Referenced by imgPixel().
|
private |
Definition at line 92 of file CalculateOptimalROI.h.
Referenced by calcOptimalROI(), and imgPixel().
|
private |
Definition at line 90 of file CalculateOptimalROI.h.
Referenced by setStacks(), and stackPixel().
|
private |
Definition at line 97 of file CalculateOptimalROI.h.
Referenced by autocrop(), calcOptimalROI(), and nonreccheck().
|
private |
Definition at line 89 of file CalculateOptimalROI.h.
Referenced by AddCheckingRects(), autocrop(), calcOptimalROI(), and imgPixel().
|
private |
Definition at line 96 of file CalculateOptimalROI.h.
Referenced by calcOptimalROI(), and imgPixel().
|
private |
Definition at line 91 of file CalculateOptimalROI.h.
Referenced by imgPixel(), and setStacks().
|
private |
Definition at line 95 of file CalculateOptimalROI.h.
Referenced by calcOptimalROI(), and imgPixel().
|
private |
Definition at line 93 of file CalculateOptimalROI.h.
Referenced by calcOptimalROI(), CleanUp(), and stackPixel().