Hugintrunk  0.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ComputeImageROI.h
Go to the documentation of this file.
1 // -*- c-basic-offset: 4 -*-
26 #ifndef _COMPUTE_IMAGE_ROI_H
27 #define _COMPUTE_IMAGE_ROI_H
28 
29 #include <hugin_shared.h>
30 #include <vigra/diff2d.hxx>
32 #include <panodata/Panorama.h>
34 
35 
36 
37 namespace HuginBase {
38 
39 IMPEX vigra::Rect2D estimateOutputROI(const PanoramaData & pano, const PanoramaOptions & opts, unsigned i, const double maxLength = 180.0);
40 
42 {
43 
44  public:
46  ComputeImageROI(PanoramaData& panorama, const UIntSet & images)
47  : PanoramaAlgorithm(panorama), m_images(images)
48  {};
49 
51  virtual ~ComputeImageROI() {};
52 
53  public:
55  virtual bool modifiesPanoramaData() const
56  { return false; }
58  virtual bool runAlgorithm()
59  {
60  m_rois = computeROIS(o_panorama, o_panorama.getOptions(), m_images);
61  return true; // let's hope so.
62  }
63 
64  virtual std::vector<vigra::Rect2D> getROIS()
65  {
66  return m_rois;
67  }
68 
69  public:
71  static std::vector<vigra::Rect2D> computeROIS(const PanoramaData& panorama,
72  const PanoramaOptions & opts,
73  const UIntSet & images);
74 
75  protected:
77  std::vector<vigra::Rect2D> m_rois;
78 };
79 
80 
81 } // namespace
82 #endif // _COMPUTE_IMAGE_ROI_H
virtual bool runAlgorithm()
implementation of the algorithm.
vigra::Rect2D estimateOutputROI(const PanoramaData &pano, const PanoramaOptions &opts, unsigned i, const double maxLength)
std::set< unsigned int > UIntSet
Definition: PanoramaData.h:51
ComputeImageROI(PanoramaData &panorama, const UIntSet &images)
Model for a panorama.
Definition: PanoramaData.h:81
#define IMPEX
Definition: hugin_shared.h:39
virtual bool modifiesPanoramaData() const
returns true if the algorithm changes the PanoramaData.
virtual std::vector< vigra::Rect2D > getROIS()
std::vector< vigra::Rect2D > m_rois
Panorama image options.