tca_correct.cpp File Reference

program to align a set of well overlapping images (~90%) More...

#include <hugin_config.h>
#include <fstream>
#include <sstream>
#include <iostream>
#include <vigra/error.hxx>
#include <vigra_ext/impexalpha.hxx>
#include <vigra/cornerdetection.hxx>
#include <vigra/localminmax.hxx>
#include <hugin_utils/utils.h>
#include <hugin_math/hugin_math.h>
#include "vigra/stdimage.hxx"
#include "vigra/stdimagefunctions.hxx"
#include "vigra/functorexpression.hxx"
#include "vigra/transformimage.hxx"
#include <vigra_ext/Pyramid.h>
#include <vigra_ext/Correlation.h>
#include <vigra_ext/InterestPoints.h>
#include <vigra_ext/utils.h>
#include <panodata/Panorama.h>
#include <panodata/StandardImageVariableGroups.h>
#include <panotools/PanoToolsOptimizerWrapper.h>
#include <algorithms/optimizer/PTOptimizer.h>
#include <nona/Stitcher.h>
#include <foreign/levmar/levmar.h>
#include <hugin_utils/openmp_lock.h>
#include <lensdb/LensDB.h>
#include <getopt.h>
#include <unistd.h>
#include <tiff.h>

Include dependency graph for tca_correct.cpp:

Go to the source code of this file.

Classes

struct  Parameters
struct  OptimData

Defines

#define DEFAULT_OPTIMISATION_PARAMETER   "abcvde"

Typedefs

typedef std::multimap< double,
vigra::Diff2D > 
MapPoints

Functions

void get_optvars (OptimizeVector &_retval)
static int ptProgress (int command, char *argument)
static int ptinfoDlg (int command, char *argument)
int optimize_old (Panorama &pano)
double weightHuber (double x, double sigma)
void optGetError (double *p, double *x, int m, int n, void *data)
int optVis (double *p, double *x, int m, int n, int iter, double sqerror, void *data)
void optimize_new (PanoramaData &pano)
static void usage (const char *name)
template<class ImageType>
void createCtrlPoints (Panorama &pano, const ImageType &img, int imgRedNr, int imgGreenNr, int imgBlueNr, double scale, int nPoints, unsigned grid)
int main2 (Panorama &pano)
template<class PixelType>
int processImg (const char *filename)
int processPTO (const char *filename)
void resetValues (Panorama &pano)
void print_result (Panorama &pano)
int main (int argc, char *argv[])

Variables

Parameters g_param
static hugin_omp::Lock lock


Detailed Description

program to align a set of well overlapping images (~90%)

Author:
Pablo d'Angelo <pablo.dangelo@web.de>
Id
align_image_stack.cpp 2493 2007-10-24 20:26:26Z dangelo

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this software. If not, see <http://www.gnu.org/licenses/>.

Definition in file tca_correct.cpp.


Define Documentation

#define DEFAULT_OPTIMISATION_PARAMETER   "abcvde"

Definition at line 74 of file tca_correct.cpp.

Referenced by main().


Typedef Documentation

typedef std::multimap<double, vigra::Diff2D> MapPoints

Definition at line 462 of file tca_correct.cpp.


Function Documentation

template<class ImageType>
void createCtrlPoints ( Panorama pano,
const ImageType img,
int  imgRedNr,
int  imgGreenNr,
int  imgBlueNr,
double  scale,
int  nPoints,
unsigned  grid 
)

Definition at line 465 of file tca_correct.cpp.

References HuginBase::Panorama::addCtrlPoint(), cout, vigra_ext::destImage(), HuginBase::ControlPoint::error, vigra_ext::findInterestPointsPartial(), g_param, lock, celeste::max(), vigra_ext::CorrelationResult::maxi, vigra_ext::CorrelationResult::maxpos, vigra_ext::PointFineTune(), hugin_utils::roundi(), vigra_ext::srcImageRange(), vigra_ext::transformImage(), Parameters::verbose, hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::x1, HuginBase::ControlPoint::x2, hugin_utils::TDiff2D< T >::y, HuginBase::ControlPoint::y1, and HuginBase::ControlPoint::y2.

void get_optvars ( OptimizeVector _retval  ) 

Definition at line 218 of file tca_correct.cpp.

References g_param, and Parameters::optvars.

Referenced by optimize_new(), and optimize_old().

int main ( int  argc,
char *  argv[] 
)

Definition at line 927 of file tca_correct.cpp.

References Parameters::basename, Parameters::blue_name, cerr, Parameters::cpErrorThreshold, DEFAULT_OPTIMISATION_PARAMETER, g_param, Parameters::green_name, Parameters::grid, Parameters::load, Parameters::nPoints, Parameters::optMethod, Parameters::optvars, processPTO(), Parameters::ptoOutputFile, Parameters::red_name, Parameters::reset, Parameters::saveDB, Parameters::scale, hugin_utils::stripPath(), usage(), and Parameters::verbose.

int main2 ( Panorama pano  ) 

Definition at line 866 of file tca_correct.cpp.

References g_param, optimize_new(), optimize_old(), Parameters::optMethod, Parameters::reset, and resetValues().

void optGetError ( double *  p,
double *  x,
int  m,
int  n,
void *  data 
)

Definition at line 269 of file tca_correct.cpp.

References HuginBase::ControlPoint::error, OptimData::FromX(), HuginBase::PanoramaData::getCtrlPoint(), HuginBase::PanoramaData::getNrOfCtrlPoints(), OptimData::huberSigma, OptimData::m_center, OptimData::m_dist, OptimData::m_hfov, OptimData::m_pano, OptimData::m_shift, celeste::min(), vigra_ext::pow(), HuginBase::PanoramaData::updateCtrlPointErrors(), and HuginBase::weightHuber().

Referenced by optimize_new().

void optimize_new ( PanoramaData pano  ) 

Definition at line 353 of file tca_correct.cpp.

References g_param, get_optvars(), HuginBase::PanoramaData::getNrOfCtrlPoints(), OptimData::huberSigma, celeste::info(), OptimData::m_mapping, optGetError(), optVis(), OptimData::SaveToImgs(), OptimData::ToX(), and Parameters::verbose.

Referenced by main2().

int optimize_old ( Panorama pano  ) 

Definition at line 244 of file tca_correct.cpp.

References g_param, get_optvars(), HuginBase::PTools::optimize(), ptinfoDlg(), ptProgress(), HuginBase::Panorama::setOptimizeVector(), and Parameters::verbose.

Referenced by main2().

int optVis ( double *  p,
double *  x,
int  m,
int  n,
int  iter,
double  sqerror,
void *  data 
)

Definition at line 339 of file tca_correct.cpp.

Referenced by optimize_new().

void print_result ( Panorama pano  ) 

Definition at line 749 of file tca_correct.cpp.

References Parameters::basename, HuginBase::LensDB::LensDB::Clean(), cout, g_param, HuginBase::SrcPanoImage::getDBLensName(), HuginBase::LensDB::LensDB::GetSingleton(), HuginBase::Panorama::getSrcImage(), vigra_ext::pow(), HuginBase::SrcPanoImage::readEXIF(), hugin_utils::roundi(), Parameters::saveDB, HuginBase::LensDB::LensDB::SaveTCA(), HuginBase::BaseSrcPanoImage::setFilename(), shift, and hugin_utils::StrTrim().

template<class PixelType>
int processImg ( const char *  filename  ) 

Definition at line 591 of file tca_correct.cpp.

References HuginBase::Panorama::addImage(), Parameters::blue_name, cerr, createCtrlPoints(), vigra_ext::destImage(), g_param, HuginBase::StandardImageVariableGroups::getLenses(), Parameters::green_name, Parameters::grid, HuginBase::PanoramaOptions::huberSigma, vigra::importImageAlpha(), main2(), Parameters::nPoints, HuginBase::PanoramaOptions::outputFormat, Parameters::red_name, Parameters::scale, HuginBase::BaseSrcPanoImage::setCropFactor(), HuginBase::BaseSrcPanoImage::setFilename(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::BaseSrcPanoImage::setHFOV(), HuginBase::Panorama::setOptions(), HuginBase::PanoramaOptions::setProjection(), HuginBase::BaseSrcPanoImage::setProjection(), HuginBase::SrcPanoImage::setSize(), HuginBase::PanoramaOptions::setWidth(), HuginBase::ImageVariableGroup::switchParts(), HuginBase::PanoramaOptions::tiff_saveROI, HuginBase::ImageVariableGroup::unlinkVariablePart(), and HuginBase::ConstImageVariableGroup::updatePartNumbers().

int processPTO ( const char *  filename  ) 

Definition at line 707 of file tca_correct.cpp.

References cerr, hugin_utils::getPathPrefix(), main2(), HuginBase::Panorama::readData(), HuginBase::Panorama::setFilePrefix(), and AppBase::DocumentData::SUCCESSFUL.

Referenced by main().

static int ptinfoDlg ( int  command,
char *  argument 
) [static]

Definition at line 237 of file tca_correct.cpp.

static int ptProgress ( int  command,
char *  argument 
) [static]

Definition at line 233 of file tca_correct.cpp.

void resetValues ( Panorama pano  ) 

Definition at line 728 of file tca_correct.cpp.

References HuginBase::Panorama::getSrcImage(), HuginBase::BaseSrcPanoImage::setHFOV(), and HuginBase::Panorama::setSrcImage().

Referenced by main2().

static void usage ( const char *  name  )  [static]

Definition at line 425 of file tca_correct.cpp.

References cerr, and hugin_utils::GetHuginVersion().

double weightHuber ( double  x,
double  sigma 
) [inline]

Definition at line 260 of file tca_correct.cpp.


Variable Documentation

Parameters g_param

Definition at line 113 of file tca_correct.cpp.

Referenced by createCtrlPoints(), get_optvars(), main(), main2(), optimize_new(), optimize_old(), print_result(), and processImg().

hugin_omp::Lock lock [static]

Definition at line 461 of file tca_correct.cpp.


Generated on 29 Aug 2015 for Hugintrunk by  doxygen 1.4.7