42 for(
unsigned int i=0;i<
m_nrImg;i++)
51 for (
unsigned int i = 0; i <
m_nrImg; i++)
60 for(
unsigned int i=0;i<
m_nrImg;i++)
73 #pragma omp parallel for schedule(dynamic)
78 vigra::Rect2D c=vigra::Rect2D(img.getSize());
83 unsigned int frequency=std::min<unsigned int>(steps,std::min<unsigned int>(c.width(),c.height()));
86 std::vector<unsigned int> overlapCounter;
87 overlapCounter.resize(
m_nrImg,0);
88 unsigned int pointCounter=0;
89 for (
unsigned int x=0; x<frequency; x++)
91 for (
unsigned int y=0; y<frequency; y++)
95 double xc = double (x) / double (frequency) * double(c.width()) + c.left();
96 double yc = double (y) / double (frequency) * double(c.height()) + c.top();
97 vigra::Point2D p(xc,yc);
107 for(
unsigned int j=0;j<
m_nrImg;j++)
131 for(
unsigned int k=0;k<
m_nrImg;k++)
137 m_overlap[imgNr][k] = (double)overlapCounter[k] / (
double)pointCounter;
151 return std::max<double>(
m_overlap[i][j],m_overlap[j][i]);
158 for(
unsigned int j=0;j<
m_nrImg;j++)
164 overlapImgs.insert(j);
174 for (UIntSet::const_iterator it = img.begin(); it != img.end(); ++it)
double getOverlap(unsigned int i, unsigned int j) const
returns the overlap for 2 images with number i and j
std::vector< PTools::Transform * > m_invTransform
void calculate(unsigned int steps)
does the calculation, for each image steps*steps points are extracted and tested with all other image...
bool isInside(vigra::Point2D p, bool ignoreMasks=false) const
check if a coordinate is inside the source image
std::vector< PTools::Transform * > m_transform
std::set< unsigned int > UIntSet
std::vector< unsigned int > m_testImages
UIntSet getOverlapForImage(unsigned int i) const
returns a set of images which overlap with given image number
std::vector< std::vector< double > > m_overlap
virtual const PanoramaOptions & getOptions() const =0
returns the options for this panorama
virtual const SrcPanoImage & getImage(std::size_t nr) const =0
get a panorama image, counting starts with 0
definitions of classes to calculate overlap between different images
virtual ~CalculateImageOverlap()
destructor
virtual std::size_t getNrOfImages() const =0
number of images.
All variables of a source image.
const PanoramaData * m_pano
CalculateImageOverlap(const PanoramaData *pano)
constructor
void limitToImages(UIntSet img)
limits the calculation of the overlap to given image numbers