36#ifndef VIGRA_SYMMETRY_HXX
37#define VIGRA_SYMMETRY_HXX
40#include "numerictraits.hxx"
41#include "stdimage.hxx"
42#include "convolution.hxx"
43#include "multi_shape.hxx"
185 vigra_precondition(scale > 0.0,
186 "radialSymmetryTransform(): Scale must be > 0");
191 if(w <= 0 ||
h <= 0)
return;
194 NumericTraits<typename SrcAccessor::value_type>::RealPromote
TmpType;
205 destImage(
gx), destImage(
gy),
214 for(y=0; y<
h; ++y, ++
gxi.y, ++
gyi.y)
216 typename TmpIterator::row_iterator
gxr =
gxi.rowIterator();
217 typename TmpIterator::row_iterator
gyr =
gyi.rowIterator();
219 for(
int x = 0; x<w; ++x, ++
gxr, ++
gyr)
222 double magnitude = VIGRA_CSTD::sqrt(*
gxr * *
gxr + *
gyr * *
gyr);
224 if(magnitude < NumericTraits<TmpType>::epsilon()*10.0)
227 int dx = NumericTraits<int>::fromRealPromote(scale * VIGRA_CSTD::cos(
angle));
228 int dy = NumericTraits<int>::fromRealPromote(scale * VIGRA_CSTD::sin(
angle));
255 for(
int x = 0; x<w; ++x)
271 for(
int x = 0; x<w; ++x)
281template <
class SrcIterator,
class SrcAccessor,
282 class DestIterator,
class DestAccessor>
285 pair<DestIterator, DestAccessor> dest,
289 dest.first, dest.second,
293template <
class T1,
class S1,
297 MultiArrayView<2, T2, S2> dest,
300 vigra_precondition(src.shape() == dest.shape(),
301 "radialSymmetryTransform(): shape mismatch between input and output.");
Class for a single RGB value.
Definition rgbvalue.hxx:128
void init(Iterator i, Iterator end)
Definition tinyvector.hxx:708
void gaussianSmoothing(...)
Perform isotropic Gaussian convolution.
void radialSymmetryTransform(...)
Find centers of radial symmetry in an image.
void gaussianGradient(...)
Calculate the gradient vector by means of a 1st derivatives of Gaussian filter.