ImageTransforms.h File Reference

Contains functions to transform whole images. More...

#include <fstream>
#include <vigra/basicimage.hxx>
#include <vigra_ext/ROIImage.h>
#include <vigra_ext/Interpolators.h>
#include <vigra/impex.hxx>
#include <vigra_ext/impexalpha.hxx>
#include <hugin_math/hugin_math.h>
#include <hugin_utils/utils.h>
#include <appbase/ProgressDisplayOld.h>
#include "MultiThreadOperations.h"
#include <boost/thread/thread.hpp>
#include <boost/bind.hpp>
#include <boost/function.hpp>

Include dependency graph for ImageTransforms.h:

Include dependency graph

This graph shows which files directly or indirectly include this file:

Included by dependency graph

Go to the source code of this file.

Namespaces

namespace  vigra_ext

Classes

struct  vigra_ext::TransformImageIntern< SrcImageIterator, SrcAccessor, DestImageIterator, DestAccessor, TRANSFORM, PixelTransform, AlphaImageIterator, AlphaAccessor, Interpolator >
 functor version (for threaded remapping) More...
struct  vigra_ext::TransformImageAlphaIntern< SrcImageIterator, SrcAccessor, SrcAlphaIterator, SrcAlphaAccessor, DestImageIterator, DestAccessor, TRANSFORM, PixelTransform, AlphaImageIterator, AlphaAccessor, Interpolator >
 functor version (for threaded remapping) More...

Functions

template<class T>
zeroNegative (T p)
 Set negative elements of a pixel to zero.
template<class T>
vigra::RGBValue< T > zeroNegative (vigra::RGBValue< T > p)
 Set negative elements of a pixel to zero.
template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageIntern (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, TRANSFORM &transform, PixelTransform &pixelTransform, vigra::Diff2D destUL, Interpolator interp, bool warparound, AppBase::MultiProgressDisplay &prog)
 Transform an image into the panorama.
template<class SrcImageIterator, class SrcAccessor, class SrcAlphaIterator, class SrcAlphaAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageAlphaIntern (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, std::pair< SrcAlphaIterator, SrcAlphaAccessor > srcAlpha, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, TRANSFORM &transform, PixelTransform &pixelTransform, vigra::Diff2D destUL, Interpolator interp, bool warparound, AppBase::MultiProgressDisplay &prog)
 transform input images with alpha channel
template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class DistImageIterator, class DistAccessor, class Interpolator>
void transformImageDist (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, vigra::Diff2D destUL, TRANSFORM &transform, vigra::triple< DistImageIterator, DistImageIterator, DistAccessor > centerDist, Interpolator &interp, AppBase::MultiProgressDisplay &prog)
 Transform an image into the panorama.
template<class SrcImageIterator, class SrcAccessor, class SrcAlphaIterator, class SrcAlphaAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageAlphaInternMT (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, std::pair< SrcAlphaIterator, SrcAlphaAccessor > srcAlpha, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, TRANSFORM &transform, PixelTransform &pixelTransform, vigra::Diff2D destUL, Interpolator interp, bool warparound, AppBase::MultiProgressDisplay &prog)
 multithreaded image transformation. multithreaded image transformation.
template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageInternMT (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, TRANSFORM &transform, PixelTransform &pixelTransform, vigra::Diff2D destUL, Interpolator interp, bool warparound, AppBase::MultiProgressDisplay &prog)
template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class AlphaImageIterator, class AlphaAccessor, class TRANSFORM, class PixelTransform>
void transformImage (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, vigra::Diff2D destUL, TRANSFORM &transform, PixelTransform &pixelTransform, bool warparound, Interpolator interpol, AppBase::MultiProgressDisplay &progress)
 Transform an image into the panorama.
template<class SrcImageIterator, class SrcAccessor, class SrcAlphaIterator, class SrcAlphaAccessor, class DestImageIterator, class DestAccessor, class AlphaImageIterator, class AlphaAccessor, class TRANSFORM, class PixelTransform>
void transformImageAlpha (vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor > src, std::pair< SrcAlphaIterator, SrcAlphaAccessor > srcAlpha, vigra::triple< DestImageIterator, DestImageIterator, DestAccessor > dest, std::pair< AlphaImageIterator, AlphaAccessor > alpha, vigra::Diff2D destUL, TRANSFORM &transform, PixelTransform &pixelTransform, bool warparound, Interpolator interpol, AppBase::MultiProgressDisplay &progress)
 Transform image, and respect a possible alpha channel.
template<class T, int nr>
void fillVector (T vec[3], T &val, int len)


Detailed Description

Contains functions to transform whole images.

Can use PTools::Transform or PT::SpaceTransform for the calculations

Author:
Pablo d'Angelo <pablo.dangelo@web.de>
$Id$

This 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 Lesser General Public License for more details.

You should have received a copy of the GNU General Public License along with this software; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

Definition in file ImageTransforms.h.


Function Documentation

template<class T, int nr>
void fillVector vec[3],
T &  val,
int  len
 

Definition at line 778 of file ImageTransforms.h.

template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class AlphaImageIterator, class AlphaAccessor, class TRANSFORM, class PixelTransform>
void transformImage vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
vigra::triple< DestImageIterator, DestImageIterator, DestAccessor >  dest,
std::pair< AlphaImageIterator, AlphaAccessor >  alpha,
vigra::Diff2D  destUL,
TRANSFORM &  transform,
PixelTransform &  pixelTransform,
bool  warparound,
Interpolator  interpol,
AppBase::MultiProgressDisplay progress
 

Transform an image into the panorama.

It can be used for partial transformations as well, if the boundig box of a remapped image is known.

Usage: create an output image that should contain the remapped src image. if dest doesn't cover the whole output panorama, use destUL to specify the offset of dest from the output panorama.

Parameters:
src source image
dest (partial) panorama image. the image size needed to hold the complete remapped image can be calculated using calcBorderPoints().
destUL upper left point of dest in final panorama. set to (0,0) if dest has the same size as the complete panorama.
transform function used to remap the picture.
centerDist image, with the same size as dest, that will contain the distance of the corrosponding pixel from the center of src. This is useful to calculate nice seams. Use a null image if this information is not needed.
interpol Interpolation algorithm that should be used.

Definition at line 652 of file ImageTransforms.h.

References DEBUG_DEBUG, vigra_ext::INTERP_BILINEAR, vigra_ext::INTERP_CUBIC, vigra_ext::INTERP_NEAREST_NEIGHBOUR, vigra_ext::INTERP_SINC_1024, vigra_ext::INTERP_SINC_256, vigra_ext::INTERP_SPLINE_16, vigra_ext::INTERP_SPLINE_36, vigra_ext::INTERP_SPLINE_64, and vigra_ext::transformImageInternMT().

Referenced by PanoDetector::AnalyzeImage(), vigra_ext::applyBrightnessCorrection(), vigra_ext::applyGammaAndBrightCorrection(), vigra_ext::applyGammaCorrection(), vigra_ext::applyMapping(), convertGrayToUInt8(), deghosting::Khan< PixelType >::convertImage(), celeste::convertToUInt16(), convertToUInt8(), correctImage(), createCtrlPoints(), createCtrlPointsOld(), deghosting::Khan< PixelType >::createWeightMasks(), CPImageCtrl::generateMagBitmap(), PanoOperation::CelesteOperation::GetInternalCommand(), HuginBase::Nona::FileRemapper< ImageType, AlphaType >::getRemapped(), HuginBase::ImageCache::importAndConvertAlphaImage(), HuginBase::ImageCache::importAndConvertImage(), deghosting::Khan< PixelType >::importRGBImage(), loadImagesPyr(), PT::loadImagesPyr(), main(), CPEditorPanel::OnCelesteButton(), vigra_ext::PointFineTuneRotSearch(), celeste::prepareCelesteImage(), deghosting::Khan< PixelType >::preprocessImage(), PT::wxAddCtrlPointGridCmd::processPanorama(), HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage(), OptimizePhotometricPanel::runOptimizer(), LensCalImageCtrl::SetEdgeImage(), threshold(), and PreviewPanel::updatePreview().

template<class SrcImageIterator, class SrcAccessor, class SrcAlphaIterator, class SrcAlphaAccessor, class DestImageIterator, class DestAccessor, class AlphaImageIterator, class AlphaAccessor, class TRANSFORM, class PixelTransform>
void transformImageAlpha vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
std::pair< SrcAlphaIterator, SrcAlphaAccessor >  srcAlpha,
vigra::triple< DestImageIterator, DestImageIterator, DestAccessor >  dest,
std::pair< AlphaImageIterator, AlphaAccessor >  alpha,
vigra::Diff2D  destUL,
TRANSFORM &  transform,
PixelTransform &  pixelTransform,
bool  warparound,
Interpolator  interpol,
AppBase::MultiProgressDisplay progress
 

Transform image, and respect a possible alpha channel.

Definition at line 717 of file ImageTransforms.h.

References DEBUG_DEBUG, vigra_ext::INTERP_BILINEAR, vigra_ext::INTERP_CUBIC, vigra_ext::INTERP_NEAREST_NEIGHBOUR, vigra_ext::INTERP_SINC_1024, vigra_ext::INTERP_SINC_256, vigra_ext::INTERP_SPLINE_16, vigra_ext::INTERP_SPLINE_36, vigra_ext::INTERP_SPLINE_64, and vigra_ext::transformImageAlphaInternMT().

Referenced by HuginBase::Nona::RemappedPanoImage< RemapImage, AlphaImage >::remapImage().

template<class SrcImageIterator, class SrcAccessor, class SrcAlphaIterator, class SrcAlphaAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageAlphaIntern vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
std::pair< SrcAlphaIterator, SrcAlphaAccessor >  srcAlpha,
vigra::triple< DestImageIterator, DestImageIterator, DestAccessor >  dest,
std::pair< AlphaImageIterator, AlphaAccessor >  alpha,
TRANSFORM &  transform,
PixelTransform &  pixelTransform,
vigra::Diff2D  destUL,
Interpolator  interp,
bool  warparound,
AppBase::MultiProgressDisplay prog
 

transform input images with alpha channel

Definition at line 214 of file ImageTransforms.h.

References hugin_utils::FDiff2D, vigra_ext::Interpolator, AppBase::MultiProgressDisplay::popTask(), AppBase::MultiProgressDisplay::pushTask(), AppBase::MultiProgressDisplay::setProgress(), and vigra_ext::zeroNegative().

Referenced by vigra_ext::TransformImageAlphaIntern< SrcImageIterator, SrcAccessor, SrcAlphaIterator, SrcAlphaAccessor, DestImageIterator, DestAccessor, TRANSFORM, PixelTransform, AlphaImageIterator, AlphaAccessor, Interpolator >::operator()(), and vigra_ext::transformImageAlphaInternMT().

template<class SrcImageIterator, class SrcAccessor, class SrcAlphaIterator, class SrcAlphaAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageAlphaInternMT vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
std::pair< SrcAlphaIterator, SrcAlphaAccessor >  srcAlpha,
vigra::triple< DestImageIterator, DestImageIterator, DestAccessor >  dest,
std::pair< AlphaImageIterator, AlphaAccessor >  alpha,
TRANSFORM &  transform,
PixelTransform &  pixelTransform,
vigra::Diff2D  destUL,
Interpolator  interp,
bool  warparound,
AppBase::MultiProgressDisplay prog
 

multithreaded image transformation. multithreaded image transformation.

Definition at line 461 of file ImageTransforms.h.

References DEBUG_DEBUG, vigra_ext::Interpolator, and vigra_ext::transformImageAlphaIntern().

Referenced by vigra_ext::transformImageAlpha().

template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class DistImageIterator, class DistAccessor, class Interpolator>
void transformImageDist vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
vigra::triple< DestImageIterator, DestImageIterator, DestAccessor >  dest,
vigra::Diff2D  destUL,
TRANSFORM &  transform,
vigra::triple< DistImageIterator, DistImageIterator, DistAccessor >  centerDist,
Interpolator interp,
AppBase::MultiProgressDisplay prog
 

Transform an image into the panorama.

It can be used for partial transformations as well, if the boundig box of a remapped image is known.

Usage: create an output image that should contain the remapped src image. if dest doesn't cover the whole output panorama, use destUL to specify the offset of dest from the output panorama.

Parameters:
src source image
dest (partial) panorama image. the image size needed to hold the complete remapped image can be calculated using calcBorderPoints().
destUL upper left point of dest in final panorama. set to (0,0) if dest has the same size as the complete panorama.
transform function used to remap the picture.
centerDist image, with the same size as dest, that will contain the distance of the corrosponding pixel from the center of src. This is useful to calculate nice seams. Use a null image if this information is not needed.
interp Interpolator class (calculates weights for interpolation)

Definition at line 356 of file ImageTransforms.h.

References DEBUG_ASSERT, vigra_ext::Interpolator, AppBase::MultiProgressDisplay::popTask(), AppBase::MultiProgressDisplay::pushTask(), and AppBase::MultiProgressDisplay::setProgress().

template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageIntern vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
vigra::triple< DestImageIterator, DestImageIterator, DestAccessor >  dest,
std::pair< AlphaImageIterator, AlphaAccessor >  alpha,
TRANSFORM &  transform,
PixelTransform &  pixelTransform,
vigra::Diff2D  destUL,
Interpolator  interp,
bool  warparound,
AppBase::MultiProgressDisplay prog
 

Transform an image into the panorama.

It can be used for partial transformations as well, if the bounding box of a remapped image is known.

Usage: create an output image that should contain the remapped src image. if dest doesn't cover the whole output panorama, use destUL to specify the offset of dest from the output panorama.

Parameters:
src source image
dest (partial) panorama image. the image size needed to hold the complete remapped image can be calculated using calcBorderPoints().
destUL upper left point of dest in final panorama. set to (0,0) if dest has the same size as the complete panorama.
transform function used to remap the picture.
centerDist image, with the same size as dest, that will contain the distance of the corrosponding pixel from the center of src. This is useful to calculate nice seams. Use a null image if this information is not needed.
interp Interpolator class (calculates weights for interpolation)

Definition at line 103 of file ImageTransforms.h.

References hugin_utils::FDiff2D, AppBase::MultiProgressDisplay::popTask(), AppBase::MultiProgressDisplay::pushTask(), AppBase::MultiProgressDisplay::setProgress(), and vigra_ext::zeroNegative().

Referenced by CPImageCtrl::generateMagBitmap(), vigra_ext::TransformImageIntern< SrcImageIterator, SrcAccessor, DestImageIterator, DestAccessor, TRANSFORM, PixelTransform, AlphaImageIterator, AlphaAccessor, Interpolator >::operator()(), and vigra_ext::transformImageInternMT().

template<class SrcImageIterator, class SrcAccessor, class DestImageIterator, class DestAccessor, class TRANSFORM, class PixelTransform, class AlphaImageIterator, class AlphaAccessor, class Interpolator>
void transformImageInternMT vigra::triple< SrcImageIterator, SrcImageIterator, SrcAccessor >  src,
vigra::triple< DestImageIterator, DestImageIterator, DestAccessor >  dest,
std::pair< AlphaImageIterator, AlphaAccessor >  alpha,
TRANSFORM &  transform,
PixelTransform &  pixelTransform,
vigra::Diff2D  destUL,
Interpolator  interp,
bool  warparound,
AppBase::MultiProgressDisplay prog
 

Definition at line 545 of file ImageTransforms.h.

References DEBUG_DEBUG, vigra_ext::Interpolator, and vigra_ext::transformImageIntern().

Referenced by vigra_ext::transformImage().

template<class T>
vigra::RGBValue<T> zeroNegative vigra::RGBValue< T >  p  ) 
 

Set negative elements of a pixel to zero.

Definition at line 64 of file ImageTransforms.h.

Referenced by vigra_ext::transformImageAlphaIntern(), and vigra_ext::transformImageIntern().

template<class T>
T zeroNegative p  ) 
 

Set negative elements of a pixel to zero.

Definition at line 53 of file ImageTransforms.h.


Generated on Wed Apr 16 01:25:43 2014 for Hugintrunk by  doxygen 1.3.9.1