Correlation.h File Reference

#include <hugin_shared.h>
#include <vigra/stdimage.hxx>
#include <vigra/inspectimage.hxx>
#include <vigra/copyimage.hxx>
#include <vigra/resizeimage.hxx>
#include <vigra/transformimage.hxx>
#include <vigra/impex.hxx>
#include "hugin_utils/utils.h"
#include "hugin_math/hugin_math.h"
#include "vigra_ext/Pyramid.h"
#include "vigra_ext/FitPolynom.h"
#include "vigra_ext/utils.h"
#include "vigra_ext/ImageTransforms.h"

Include dependency graph for Correlation.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::CorrelationResult
 Maximum of correlation, position and value. More...
class  vigra_ext::RotateTransform
 clockwise rotation around a origin point, and a translation afterwards. More...

Defines

#define VIGRA_EXT_USE_FAST_CORR

Functions

template<class SrcImage, class DestImage, class KernelImage>
CorrelationResult correlateImageFast (SrcImage &src, DestImage &dest, KernelImage &kernel, vigra::Diff2D kul, vigra::Diff2D klr, double threshold=0.7)
 correlate a template with an image.
template<class Iterator, class Accessor>
CorrelationResult subpixelMaxima (vigra::triple< Iterator, Iterator, Accessor > img, vigra::Diff2D max)
 find the subpixel maxima by fitting 2nd order polynoms to x and y.
template<class IMAGET, class IMAGES>
CorrelationResult PointFineTune (const IMAGET &templImg, vigra::Diff2D templPos, int templSize, const IMAGES &searchImg, vigra::Diff2D searchPos, int sWidth)
 fine tune a point with normalized cross correlation
template<class IMAGET, class IMAGES>
CorrelationResult PointFineTuneRotSearch (const IMAGET &templImg, vigra::Diff2D templPos, int templSize, const IMAGES &searchImg, vigra::Diff2D searchPos, int sWidth, double startAngle, double stopAngle, int angleSteps)
 fine tune a point with normalized cross correlation, searches x,y and phi (rotation around z)
template<class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor, class KernelIterator, class KernelAccessor>
CorrelationResult correlateImage (SrcIterator sul, SrcIterator slr, SrcAccessor as, DestIterator dul, DestAccessor ad, KernelIterator ki, KernelAccessor ak, vigra::Diff2D kul, vigra::Diff2D klr, double threshold=0.7)
 correlate a template with an image.


Detailed Description

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 Correlation.h.


Define Documentation

#define VIGRA_EXT_USE_FAST_CORR
 

Definition at line 45 of file Correlation.h.


Function Documentation

template<class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor, class KernelIterator, class KernelAccessor>
CorrelationResult correlateImage SrcIterator  sul,
SrcIterator  slr,
SrcAccessor  as,
DestIterator  dul,
DestAccessor  ad,
KernelIterator  ki,
KernelAccessor  ak,
vigra::Diff2D  kul,
vigra::Diff2D  klr,
double  threshold = 0.7
 

correlate a template with an image.

most code is taken from vigra::convoluteImage. See its documentation for further information.

Correlation result already contains the maximum position and its correlation value. it should be possible to set a threshold here.

Definition at line 679 of file Correlation.h.

References vigra_ext::CorrelationResult::maxi, vigra_ext::CorrelationResult::maxpos, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by vigra_ext::PointFineTune(), PointFineTune2(), and vigra_ext::PointFineTuneRotSearch().

template<class SrcImage, class DestImage, class KernelImage>
CorrelationResult correlateImageFast SrcImage &  src,
DestImage &  dest,
KernelImage &  kernel,
vigra::Diff2D  kul,
vigra::Diff2D  klr,
double  threshold = 0.7
 

correlate a template with an image.

This tries to be faster than the other version, because it uses the image data directly.

most code is taken from vigra::convoluteImage. See its documentation for further information.

Correlation result already contains the maximum position and its correlation value. it should be possible to set a threshold here.

Definition at line 78 of file Correlation.h.

References DEBUG_DEBUG, vigra_ext::CorrelationResult::maxi, vigra_ext::CorrelationResult::maxpos, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by vigra_ext::PointFineTune(), PointFineTune2(), and vigra_ext::PointFineTuneRotSearch().

template<class IMAGET, class IMAGES>
CorrelationResult PointFineTune const IMAGET &  templImg,
vigra::Diff2D  templPos,
int  templSize,
const IMAGES &  searchImg,
vigra::Diff2D  searchPos,
int  sWidth
 

fine tune a point with normalized cross correlation

takes a patch of templSize by templSize from templImg images at tmplPos and searches it on the searchImg, at searchPos, in a neighbourhood of sWidth by sWidth.

The result in returned in tunedPos

Returns:
correlation value

Definition at line 344 of file Correlation.h.

References vigra_ext::correlateImage(), vigra_ext::correlateImageFast(), DEBUG_DEBUG, vigra_ext::destImage(), vigra_ext::CorrelationResult::maxi, vigra_ext::CorrelationResult::maxpos, hugin_utils::simpleClipPoint(), vigra_ext::srcImage(), vigra_ext::subpixelMaxima(), hugin_utils::TDiff2D< T >::toDiff2D(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by createCtrlPoints(), MainFrame::OnFineTuneAll(), and CPEditorPanel::PointFineTune().

template<class IMAGET, class IMAGES>
CorrelationResult PointFineTuneRotSearch const IMAGET &  templImg,
vigra::Diff2D  templPos,
int  templSize,
const IMAGES &  searchImg,
vigra::Diff2D  searchPos,
int  sWidth,
double  startAngle,
double  stopAngle,
int  angleSteps
 

fine tune a point with normalized cross correlation, searches x,y and phi (rotation around z)

takes a patch of templSize by templSize from templImg images at tmplPos and searches it on the searchImg, at searchPos, in a neighbourhood of sWidth by sWidth.

The result in returned in tunedPos

Returns:
correlation value

Definition at line 478 of file Correlation.h.

References vigra_ext::correlateImage(), vigra_ext::correlateImageFast(), DEBUG_DEBUG, DEBUG_ERROR, DEBUG_TRACE, vigra_ext::destImage(), vigra_ext::destImageRange(), hugin_utils::FDiff2D, M_PI, vigra_ext::CorrelationResult::maxAngle, vigra_ext::CorrelationResult::maxi, vigra_ext::CorrelationResult::maxpos, RAD_TO_DEG, vigra_ext::srcImage(), vigra_ext::srcImageRange(), vigra_ext::subpixelMaxima(), hugin_utils::TDiff2D< T >::toDiff2D(), vigra_ext::transformImage(), hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by MainFrame::OnFineTuneAll(), and CPEditorPanel::PointFineTune().

template<class Iterator, class Accessor>
CorrelationResult subpixelMaxima vigra::triple< Iterator, Iterator, Accessor >  img,
vigra::Diff2D  max
 

find the subpixel maxima by fitting 2nd order polynoms to x and y.

this estimates the x and y values separately. Don't know if this is the best way, but it works well

Definition at line 222 of file Correlation.h.

References vigra_ext::CorrelationResult::curv, DEBUG_DEBUG, DEBUG_ERROR, DEBUG_NOTICE, vigra_ext::FitPolynom(), hugin_utils::isnan(), vigra_ext::CorrelationResult::maxi, vigra_ext::CorrelationResult::maxpos, hugin_utils::TDiff2D< T >::x, and hugin_utils::TDiff2D< T >::y.

Referenced by vigra_ext::PointFineTune(), PointFineTune2(), and vigra_ext::PointFineTuneRotSearch().


Generated on Sat Apr 19 01:25:45 2014 for Hugintrunk by  doxygen 1.3.9.1