align_image_stack.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/cornerdetection.hxx>
#include <vigra/localminmax.hxx>
#include <hugin_utils/utils.h>
#include <vigra_ext/Pyramid.h>
#include <vigra_ext/Correlation.h>
#include <vigra_ext/InterestPoints.h>
#include <vigra_ext/impexalpha.hxx>
#include <panodata/Panorama.h>
#include <panotools/PanoToolsOptimizerWrapper.h>
#include <panodata/StandardImageVariableGroups.h>
#include <algorithms/optimizer/PTOptimizer.h>
#include <nona/Stitcher.h>
#include <algorithms/basic/CalculateOptimalROI.h>
#include <lensdb/LensDB.h>
#include <getopt.h>
#include <unistd.h>
#include <hugin_utils/openmp_lock.h>
#include <tiff.h>

Include dependency graph for align_image_stack.cpp:

Go to the source code of this file.

Namespaces

namespace  detail

Classes

struct  Parameters
struct  SortImageVectorEV

Typedefs

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

Functions

static void usage (const char *name)
template<class ImageType>
vigra_ext::CorrelationResult detail::FineTunePoint (const ImageType &leftImg, const vigra::Diff2D templPos, const int templSize, const ImageType &rightImg, const vigra::Diff2D searchPos, const int searchWidth, vigra::VigraTrueType)
template<class ImageType>
vigra_ext::CorrelationResult detail::FineTunePoint (const ImageType &leftImg, const vigra::Diff2D templPos, const int templSize, const ImageType &rightImg, const vigra::Diff2D searchPos, const int searchWidth, vigra::VigraFalseType)
template<class ImageType>
void FineTuneInterestPoints (HuginBase::Panorama &pano, int img1, const ImageType &leftImg, const ImageType &leftImgOrig, int img2, const ImageType &rightImg, const ImageType &rightImgOrig, const MapPoints &points, unsigned nPoints, int pyrLevel, int templWidth, int sWidth, double scaleFactor, double corrThresh, bool stereo)
template<class ImageType>
void detail::FindInterestPointsPartial (const ImageType &image, const vigra::Rect2D &rect, double scale, unsigned nPoints, std::multimap< double, vigra::Diff2D > &points, vigra::VigraTrueType)
template<class ImageType>
void detail::FindInterestPointsPartial (const ImageType &image, const vigra::Rect2D &rect, double scale, unsigned nPoints, std::multimap< double, vigra::Diff2D > &points, vigra::VigraFalseType)
template<class ImageType>
void createCtrlPoints (HuginBase::Panorama &pano, int img1, const ImageType &leftImg, const ImageType &leftImgOrig, int img2, const ImageType &rightImg, const ImageType &rightImgOrig, int pyrLevel, double scale, unsigned nPoints, unsigned grid, double corrThresh=0.9, bool stereo=false)
void alignStereoWindow (HuginBase::Panorama &pano, bool pop_out)
void autoCrop (HuginBase::Panorama &pano)
static int ptProgress (int command, char *argument)
static int ptinfoDlg (int command, char *argument)
template<class PixelType>
int main2 (std::vector< std::string > files, Parameters param)
int main (int argc, char *argv[])

Variables

int g_verbose = 0
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 align_image_stack.cpp.


Typedef Documentation

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

Definition at line 115 of file align_image_stack.cpp.


Function Documentation

void alignStereoWindow ( HuginBase::Panorama pano,
bool  pop_out 
)

Definition at line 333 of file align_image_stack.cpp.

References HuginBase::Panorama::getCtrlPoints(), HuginBase::Panorama::getImage(), HuginBase::Panorama::getNrOfImages(), HuginBase::Panorama::getOptions(), HuginBase::Panorama::setCtrlPoints(), HuginBase::ControlPoint::X, and HuginBase::ControlPoint::X_Y.

Referenced by main2().

void autoCrop ( HuginBase::Panorama pano  ) 

Definition at line 435 of file align_image_stack.cpp.

References cout, HuginBase::Panorama::getOptions(), HuginBase::CalculateOptimalROI::getResultOptimalROI(), HuginBase::PanoramaAlgorithm::run(), and HuginBase::Panorama::setOptions().

Referenced by main2().

template<class ImageType>
void createCtrlPoints ( HuginBase::Panorama pano,
int  img1,
const ImageType leftImg,
const ImageType leftImgOrig,
int  img2,
const ImageType rightImg,
const ImageType rightImgOrig,
int  pyrLevel,
double  scale,
unsigned  nPoints,
unsigned  grid,
double  corrThresh = 0.9,
bool  stereo = false 
)

Definition at line 236 of file align_image_stack.cpp.

References HuginBase::Panorama::addCtrlPoint(), cout, detail::FindInterestPointsPartial(), FineTuneInterestPoints(), g_verbose, and HuginBase::ControlPoint::X.

Referenced by main2(), and processImg().

template<class ImageType>
void FineTuneInterestPoints ( HuginBase::Panorama pano,
int  img1,
const ImageType leftImg,
const ImageType leftImgOrig,
int  img2,
const ImageType rightImg,
const ImageType rightImgOrig,
const MapPoints points,
unsigned  nPoints,
int  pyrLevel,
int  templWidth,
int  sWidth,
double  scaleFactor,
double  corrThresh,
bool  stereo 
)

Definition at line 142 of file align_image_stack.cpp.

References HuginBase::Panorama::addCtrlPoint(), cout, vigra_ext::CorrelationResult::curv, DEBUG_DEBUG, detail::FineTunePoint(), g_verbose, lock, vigra_ext::CorrelationResult::maxi, vigra_ext::CorrelationResult::maxpos, hugin_utils::TDiff2D< T >::x, HuginBase::ControlPoint::X_Y, HuginBase::ControlPoint::Y, and hugin_utils::TDiff2D< T >::y.

Referenced by createCtrlPoints().

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

Definition at line 940 of file align_image_stack.cpp.

References Parameters::alignedPrefix, cerr, HuginBase::LensDB::LensDB::Clean(), Parameters::corrThresh, cout, Parameters::cpErrorThreshold, Parameters::crop, Parameters::fisheye, g_verbose, Parameters::gpu, Parameters::grid, Parameters::hdrFile, Parameters::hfov, hugin_utils::initGPU(), Parameters::linear, Parameters::loadDistortion, Parameters::nPoints, Parameters::optCenter, Parameters::optDistortion, Parameters::optHFOV, Parameters::optX, Parameters::optY, Parameters::optZ, Parameters::pop_out, Parameters::ptoFile, Parameters::pyrLevel, Parameters::sortImagesByEv, Parameters::stereo, Parameters::stereo_window, hugin_utils::stripPath(), usage(), and hugin_utils::wrapupGPU().

template<class PixelType>
int main2 ( std::vector< std::string files,
Parameters  param 
)

Definition at line 533 of file align_image_stack.cpp.

References HuginBase::Panorama::addImage(), Parameters::alignedPrefix, alignStereoWindow(), HuginBase::SrcPanoImage::applyEXIFValues(), autoCrop(), HuginBase::SrcPanoImage::calcExifExposureValue(), cerr, Parameters::corrThresh, cout, Parameters::cpErrorThreshold, createCtrlPoints(), Parameters::crop, vigra_ext::destImage(), Parameters::fisheye, HuginBase::PanoramaOptions::FULL_FRAME_FISHEYE, HuginBase::BaseSrcPanoImage::FULL_FRAME_FISHEYE, g_verbose, HuginBase::Panorama::getActiveImages(), HuginBase::Panorama::getCtrlPoints(), HuginBase::StandardImageVariableGroups::getLenses(), HuginBase::Panorama::getOptions(), HuginBase::Panorama::getSrcImage(), Parameters::gpu, Parameters::grid, HuginBase::PanoramaOptions::HDR, Parameters::hdrFile, Parameters::hfov, HuginBase::PanoramaOptions::huberSigma, vigra::importImageAlpha(), Parameters::linear, HuginBase::Panorama::linkImageVariableStack(), Parameters::loadDistortion, Parameters::nPoints, Parameters::optCenter, Parameters::optDistortion, Parameters::optHFOV, HuginBase::PTools::optimize(), Parameters::optX, Parameters::optY, Parameters::optZ, HuginBase::PanoramaOptions::outfile, HuginBase::PanoramaOptions::OUTPUT_HDR, HuginBase::PanoramaOptions::OUTPUT_LDR, HuginBase::PanoramaOptions::outputExposureValue, HuginBase::PanoramaOptions::outputFormat, HuginBase::PanoramaOptions::outputMode, HuginBase::PanoramaOptions::outputPixelType, Parameters::pop_out, HuginBase::Panorama::printPanoramaScript(), ptinfoDlg(), Parameters::ptoFile, ptProgress(), Parameters::pyrLevel, HuginBase::SrcPanoImage::readDistortionFromDB(), HuginBase::SrcPanoImage::readEXIF(), HuginBase::PanoramaOptions::RECTILINEAR, vigra_ext::reduceNTimes(), HuginBase::PanoramaOptions::remapUsingGPU, HuginBase::BaseSrcPanoImage::RESPONSE_LINEAR, HuginBase::Nona::SetAdvancedOption(), HuginBase::Panorama::setCtrlPoints(), HuginBase::BaseSrcPanoImage::setExposureValue(), HuginBase::BaseSrcPanoImage::setFilename(), HuginBase::PanoramaOptions::setHeight(), HuginBase::PanoramaOptions::setHFOV(), HuginBase::BaseSrcPanoImage::setHFOV(), HuginBase::Panorama::setOptimizeVector(), HuginBase::Panorama::setOptions(), HuginBase::PanoramaOptions::setProjection(), HuginBase::BaseSrcPanoImage::setProjection(), HuginBase::BaseSrcPanoImage::setResponseType(), HuginBase::BaseSrcPanoImage::setRoll(), HuginBase::Panorama::setSrcImage(), HuginBase::PanoramaOptions::setWidth(), Parameters::sortImagesByEv, Parameters::stereo, Parameters::stereo_window, HuginBase::Nona::stitchPanorama(), HuginBase::PanoramaOptions::TIFF_m, HuginBase::PanoramaOptions::tiff_saveROI, HuginBase::Panorama::unlinkImageVariableExposureValue(), HuginBase::Panorama::unlinkImageVariableHFOV(), HuginBase::Panorama::unlinkImageVariableRadialDistortion(), HuginBase::Panorama::unlinkImageVariableRadialDistortionCenterShift(), HuginBase::StandardImageVariableGroups::update(), and HuginBase::ControlPoint::X.

Referenced by processImg(), and processPTO().

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

Definition at line 515 of file align_image_stack.cpp.

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

Definition at line 511 of file align_image_stack.cpp.

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

Definition at line 67 of file align_image_stack.cpp.

References cerr, and hugin_utils::GetHuginVersion().


Variable Documentation

int g_verbose = 0

Definition at line 65 of file align_image_stack.cpp.

Referenced by createCtrlPoints(), FineTuneInterestPoints(), main(), main2(), mergeWeightedAverage(), and weightedAverageOfImageFiles().

hugin_omp::Lock lock [static]

Definition at line 116 of file align_image_stack.cpp.

Referenced by createCtrlPoints(), FineTuneInterestPoints(), and main().


Generated on 3 Aug 2015 for Hugintrunk by  doxygen 1.4.7