Hugin trunk 0.1
Loading...
Searching...
No Matches
CalculateOptimalScale.h
Go to the documentation of this file.
1// -*- c-basic-offset: 4 -*-
27#ifndef _BASICALGORITHMS_CALCULATEOPTIMALSCALE_H
28#define _BASICALGORITHMS_CALCULATEOPTIMALSCALE_H
29
30#include <hugin_shared.h>
32
34
35
36
37namespace HuginBase {
38
39
41{
42
43 public:
46 : PanoramaAlgorithm(panorama), o_optimalScale(0)
47 {}
48
51 {}
52
53
54 public:
56 virtual bool modifiesPanoramaData() const
57 { return false; }
58
60 virtual bool runAlgorithm()
61 {
62 o_optimalScale = calcOptimalScale(o_panorama);
63 return true; // let's hope so.
64 }
65
66 public:
68 static double calcOptimalScale(PanoramaData& panorama);
69
73 static double calcOptimalPanoScale(const SrcPanoImage & src,
74 const PanoramaOptions & dest);
75
77 virtual double getResultOptimalScale()
78 {
79 // [TODO] if(!hasRunSuccessfully()) DEBUG;
80 return o_optimalScale;
81 }
82
84 virtual unsigned getResultOptimalWidth()
85 {
86 // [TODO] if(!hasRunSuccessfully()) DEBUG;
87 return hugin_utils::roundi(getResultOptimalScale() * o_panorama.getOptions().getWidth());
88 }
89
90 protected:
92
93};
94
95
97{
98 public:
103
106 {}
107
108
109 public:
111 virtual bool modifiesPanoramaData() const
112 { return true; }
113
115 virtual bool runAlgorithm()
116 {
118 if(success)
119 {
123 }
124 return success;
125 }
126};
127
128
129} //namespace
130#endif
virtual bool runAlgorithm()
implementation of the algorithm.
virtual bool modifiesPanoramaData() const
returns true if the algorithm changes the PanoramaData.
CalculateOptimalScale(PanoramaData &panorama)
Model for a panorama.
virtual void setOptions(const PanoramaOptions &opt)=0
set new output settings This is not used directly for optimizing/stiching, but it can be feed into ru...
virtual const PanoramaOptions & getOptions() const =0
returns the options for this panorama
Panorama image options.
void setWidth(unsigned int w, bool keepView=true)
set panorama width keep the HFOV, if keepView=true
SetWidthOptimal(PanoramaData &panorama)
virtual bool runAlgorithm()
implementation of the algorithm.
virtual bool modifiesPanoramaData() const
returns true if the algorithm changes the PanoramaData.
All variables of a source image.
#define IMPEX
mainly consists of wrapper around the pano tools library, to assist in ressource management and to pr...
Definition wxcms.cpp:39
int roundi(T x)
Definition hugin_math.h:73
std::vector< deghosting::BImagePtr > threshold(const std::vector< deghosting::FImagePtr > &inputImages, const double threshold, const uint16_t flags)
Threshold function used for creating alpha masks for images.
Definition threshold.h:41