[ VIGRA Homepage | Function Index | Class Index | Namespaces | File List | Main Page ]

vigra Namespace Reference

Namespaces

namespace  acc
 Efficient computation of object statistics.
 
namespace  EightNeighborhood
 
namespace  FourNeighborhood
 
namespace  linalg
 Linear algebra functions.
 
namespace  metrics
 Define functors for various common metrics.
 
namespace  multi_math
 
namespace  Neighborhood3DSix
 
namespace  Neighborhood3DTwentySix
 
namespace  rf3
 Random forest version 3.
 

Classes

class  AdjacencyListGraph
 undirected adjacency list graph in the LEMON API More...
 
class  AffineMotionEstimationOptions
 Option object for affine registration functions. More...
 
class  Any
 Typesafe storage of arbitrary values. More...
 
class  ArrayOfRegionStatistics
 Calculate statistics for all regions of a labeled image. More...
 
class  ArrayVector
 
class  ArrayVectorView
 
class  BasicImage
 Fundamental class template for images. More...
 
class  BasicImageIterator
 
class  BasicImageIteratorBase
 
class  BasicImageView
 BasicImage using foreign memory. More...
 
class  BestGiniOfColumn
 
class  BilinearInterpolatingAccessor
 Bilinear interpolation at non-integer positions. More...
 
class  BinaryForest
 BinaryForest stores a collection of rooted binary trees. More...
 
class  BlockwiseConvolutionOptions
 
class  BlockwiseLabelOptions
 
class  BlockwiseOptions
 
class  BlueAccessor
 
class  Box
 Represent an n-dimensional box as a (begin, end) pair. Depending on the value type, end() is considered to be outside the box (as in the STL, for integer types), or inside (for floating point types). size() will always be end() - begin(). More...
 
class  BrightnessContrastFunctor
 Adjust brightness and contrast of an image. More...
 
class  BSpline
 
class  BSplineBase
 
class  BucketQueue
 Priority queue implemented using bucket sort. More...
 
class  CatmullRomSpline
 
class  ChangeablePriorityQueue
 Heap-based changable priority queue with a maximum number of elemements. More...
 
class  ChunkedArray
 Interface and base class for chunked arrays. More...
 
class  ChunkedArrayCompressed
 
class  ChunkedArrayFull
 
class  ChunkedArrayHDF5
 
class  ChunkedArrayLazy
 
class  ChunkedArrayOptions
 Option object for ChunkedArray construction. More...
 
struct  ChunkedArrayTag
 
class  ChunkedArrayTmpFile
 
class  ClusteringOptions
 Options object for hierarchical clustering. More...
 
class  ColumnIterator
 Iterator adapter to linearly access columns. More...
 
class  ConstBasicImageIterator
 
class  ConstImageIterator
 Standard 2D random access const iterator for images that store the data as a linear array. More...
 
class  ConstStridedImageIterator
 Const iterator to be used when pixels are to be skipped. More...
 
class  ConstValueIterator
 Iterator that always returns the constant specified in the constructor. More...
 
class  ConvexPolytope
 
class  ConvolutionOptions
 Options class template for convolutions. More...
 
class  CoordinateConstValueAccessor
 Forward accessor to the value() part of the values an iterator points to. More...
 
class  CoscotFunction
 
class  CountingIterator
 Iterator that counts upwards or downwards with a given step size. More...
 
struct  CoupledArrays
 
class  CoupledHandle
 
struct  CoupledIteratorType
 
class  CoupledScanOrderIterator
 Iterate over multiple images simultaneously in scan order. More...
 
class  CrackContourCirculator
 Circulator that walks around a given region. More...
 
class  Diff2D
 Two dimensional difference vector. More...
 
class  DiffusivityFunctor
 Diffusivity functor for non-linear diffusion. More...
 
class  Dist2D
 
struct  DistancePowerFunctor
 
class  DT_StackEntry
 
class  EarlyStoppStd
 Standard early stopping criterion. More...
 
class  Edgel
 
class  EnhancedFrostFunctor
 This function tries to reduce the speckle noise of an image by applying the Enhanced Frost filter. More...
 
class  EnhancedLeeFunctor
 This function tries to reduce the speckle noise of an image by applying the Enhanced Lee filter. More...
 
class  EntropyCriterion
 
class  FFTWComplex
 Wrapper class for the FFTW complex types 'fftw_complex'. More...
 
class  FFTWConvolvePlan
 
class  FFTWCorrelatePlan
 
class  FFTWImaginaryAccessor
 
class  FFTWLogMagnitudeAccessor
 
class  FFTWMagnitudeAccessor
 
class  FFTWPhaseAccessor
 
class  FFTWPlan
 
class  FFTWRealAccessor
 
class  FFTWSquaredMagnitudeAccessor
 
class  FFTWWriteRealAccessor
 
class  FilterIterator
 This iterator creates a view of another iterator and skips elements that do not fulfill a given predicate. More...
 
class  FindAverage
 Find the average pixel value in an image or ROI. More...
 
class  FindAverageAndVariance
 Find the average pixel value and its variance in an image or ROI. More...
 
class  FindBoundingRectangle
 Calculate the bounding rectangle of an ROI in an image. More...
 
class  FindMinMax
 Find the minimum and maximum pixel value in an image or ROI. More...
 
class  FindROISize
 Calculate the size of an ROI in an image. More...
 
class  FindSum
 Find the sum of the pixel values in an image or ROI. More...
 
class  FixedPoint
 
class  FixedPoint16
 
class  FunctorTraits
 Export associated information for a functor. More...
 
class  GaborFilterFamily
 Family of gabor filters of different scale and direction. More...
 
class  GammaFunctor
 Perform gamma correction of an image. More...
 
class  GammaMAPFunctor
 This function tries to reduce the speckle noise of an image by applying the Gamma Maximum A Posteriori (MAP) filter. More...
 
class  Gaussian
 
class  GiniCriterion
 
class  GrayToRGBAccessor
 
class  GreenAccessor
 
class  GridGraph
 Define a grid graph in arbitrary dimensions. More...
 
class  HDF5DisableErrorOutput
 Temporarily disable HDF5's native error output. More...
 
class  HDF5File
 Access to HDF5 files. More...
 
class  HDF5Handle
 Wrapper for unique hid_t objects. More...
 
class  HDF5HandleShared
 Wrapper for shared hid_t objects. More...
 
class  HDF5ImportInfo
 Argument object for the function readHDF5(). More...
 
struct  HierarchicalIteratorType
 
class  HistogramOptions
 Set histogram options. More...
 
class  ImageArray
 Fundamental class template for arrays of equal-sized images. More...
 
class  ImageExportInfo
 Argument object for the function exportImage(). More...
 
class  ImageImportInfo
 Argument object for the function importImage(). More...
 
class  ImageIterator
 Standard 2D random access iterator for images that store the data in a linear array. More...
 
class  ImageIteratorBase
 Base class for 2D random access iterators. More...
 
class  ImagePyramid
 Class template for logarithmically tapering image pyramids. More...
 
class  IteratorAdaptor
 Quickly create 1-dimensional iterator adapters. More...
 
struct  IteratorTraits
 Export associated information for each image iterator. More...
 
class  Kernel1D
 Generic 1 dimensional convolution kernel. More...
 
class  Kernel2D
 Generic 2 dimensional convolution kernel. More...
 
class  KuanFunctor
 This function tries to reduce the speckle noise of an image by applying the Kuan filter. More...
 
class  Lab2RGBFunctor
 Convert perceptual uniform CIE L*a*b* into linear (raw) RGB. More...
 
class  Lab2RGBPrimeFunctor
 Convert perceptual uniform CIE L*a*b* into non-linear (gamma corrected) R'G'B'. More...
 
class  Lab2XYZFunctor
 Convert perceptual uniform CIE L*a*b* into standardized tri-stimulus XYZ. More...
 
class  LabelOptions
 Option object for labelMultiArray(). More...
 
class  LastValueFunctor
 Stores and returns the last value it has seen. More...
 
class  LeeFunctor
 This function tries to reduce the speckle noise of an image by applying the basic Lee filter. More...
 
class  LineIterator
 Iterator adapter to iterate along an arbitrary line on the image. More...
 
class  LocalMinmaxOptions
 Options object for localMinima() and localMaxima(). More...
 
class  Luv2RGBFunctor
 Convert perceptual uniform CIE L*u*v* into linear (raw) RGB. More...
 
class  Luv2RGBPrimeFunctor
 Convert perceptual uniform CIE L*u*v* into non-linear (gamma corrected) R'G'B'. More...
 
class  Luv2XYZFunctor
 Convert perceptual uniform CIE L*u*v* into standardized tri-stimulus XYZ. More...
 
class  MagnitudeFunctor
 
class  MappedBucketQueue
 Priority queue implemented using bucket sort (STL compatible). More...
 
class  MergeGraphAdaptor
 undirected graph adaptor for edge contraction and feature merging More...
 
struct  MeshGridAccessor
 
class  MultiArray
 Main MultiArray class containing the memory management. More...
 
class  MultiArrayNavigator
 A navigator that provides access to the 1D subranges of an n-dimensional range given by a vigra::MultiIterator and an nD shape. More...
 
class  MultiArrayShape
 
class  MultiArrayView
 Base class for, and view to, vigra::MultiArray. More...
 
class  MultiBlocking
 
class  MultiCoordinateIterator
 Iterate over a virtual array where each element contains its coordinate. More...
 
class  MultiCoordinateNavigator
 A navigator that provides access to the 1D subranges of an n-dimensional range given by an nD shape. More...
 
class  MultiImageAccessor2
 Access two images simultaneously. More...
 
class  MultiIterator
 A multi-dimensional hierarchical iterator to be used with vigra::MultiArrayView if it is not strided. More...
 
class  NeighborhoodCirculator
 Circulator that walks around a given location in a given image. More...
 
class  NeighborOffsetCirculator
 Circulator that walks around a given location. More...
 
class  Node< e_ConstProbNode >
 
class  NodeBase
 
class  NoiseNormalizationOptions
 Pass options to one of the noise normalization functions. More...
 
class  NonlinearLSQOptions
 Pass options to nonlinearLeastSquares(). More...
 
class  NormalRandomFunctor
 
class  NumpyAnyArray
 
class  NumpyArray
 
class  ParallelOptions
 Option base class for parallel algorithms. More...
 
class  PLSAOptions
 Option object for the pLSA algorithm. More...
 
class  Point2D
 Two dimensional point or position. More...
 
class  Polygon
 
class  Polynomial
 
class  PolynomialView
 
class  Polytope
 Represent an n-dimensional polytope. More...
 
class  PriorityQueue
 Heap-based priority queue compatible to BucketQueue. More...
 
class  ProblemSpec
 problem specification class for the random forest. More...
 
class  Processor
 
class  Processor< ClassificationTag, LabelType, T1, C1, T2, C2 >
 
class  Processor< RegressionTag, LabelType, T1, C1, T2, C2 >
 
class  PropertyMap
 The PropertyMap is used to store Node or Arc information of graphs. More...
 
class  PropertyMap< KEYTYPE, MAPPEDTYPE, IndexVectorTag >
 Specialization of PropertyMap that stores the elements in a vector (size = number of stored elements). An additional index vector is needed for bookkeeping (size = max node id of stored elements). More...
 
class  PropertyMap< KEYTYPE, MAPPEDTYPE, VectorTag >
 Specialization of PropertyMap that stores the elements in a vector (size = max node id of stored elements). More...
 
class  Quaternion
 
class  RandomForest
 Random forest version 2 (see also vigra::rf3::RandomForest for version 3) More...
 
class  RandomForestClassCounter
 
class  RandomForestOptions
 Options object for the random forest. More...
 
class  RandomNumberGenerator
 
class  Rational
 
class  Rect2D
 Two dimensional rectangle. More...
 
class  RedAccessor
 
class  ReduceFunctor
 Apply a functor to reduce the dimensionality of an array. More...
 
class  RestrictedNeighborhoodCirculator
 Circulator that walks around a given location in a given image, using a restricted neighborhood. More...
 
class  RGB2LabFunctor
 Convert linear (raw) RGB into perceptual uniform CIE L*a*b*. More...
 
class  RGB2LuvFunctor
 Convert linear (raw) RGB into perceptual uniform CIE L*u*v*. More...
 
class  RGB2RGBPrimeFunctor
 Convert linear (raw) RGB into non-linear (gamma corrected) R'G'B'. More...
 
class  RGB2sRGBFunctor
 Convert linear (raw) RGB into standardized sRGB. More...
 
class  RGB2XYZFunctor
 Convert linear (raw) RGB into standardized tri-stimulus XYZ. More...
 
class  RGBAccessor
 
class  RGBGradientMagnitudeFunctor
 
class  RGBPrime2LabFunctor
 Convert non-linear (gamma corrected) R'G'B' into perceptual uniform CIE L*a*b*. More...
 
class  RGBPrime2LuvFunctor
 Convert non-linear (gamma corrected) R'G'B' into perceptual uniform CIE L*u*v*. More...
 
class  RGBPrime2RGBFunctor
 Convert non-linear (gamma corrected) R'G'B' into non-linear (raw) RGB. More...
 
class  RGBPrime2XYZFunctor
 Convert non-linear (gamma corrected) R'G'B' into standardized tri-stimulus XYZ. More...
 
class  RGBPrime2YPrimeCbCrFunctor
 Convert non-linear (gamma corrected) R'G'B' into Y'CbCr color difference components. More...
 
class  RGBPrime2YPrimeIQFunctor
 Convert non-linear (gamma corrected) R'G'B' into Y'IQ components. More...
 
class  RGBPrime2YPrimePbPrFunctor
 Convert non-linear (gamma corrected) R'G'B' into Y'PbPr color difference components. More...
 
class  RGBPrime2YPrimeUVFunctor
 Convert non-linear (gamma corrected) R'G'B' into Y'UV components. More...
 
class  RGBToGrayAccessor
 
class  RGBValue
 Class for a single RGB value. More...
 
class  RowIterator
 Iterator adapter to linearly access row. More...
 
class  Sampler
 Create random samples from a sequence of indices. More...
 
class  SamplerOptions
 Options object for the Sampler class. More...
 
class  SeedOptions
 Options object for generateWatershedSeeds(). More...
 
class  SeedRgDirectValueFunctor
 Statistics functor to be used for seeded region growing. More...
 
class  SequenceAccessor
 Accessor for items that are STL compatible sequences. More...
 
class  ShortestPathDijkstra
 shortest path computer More...
 
class  SIFImportInfo
 Extracts image properties from an Andor SIF file header. More...
 
class  Size2D
 Two dimensional size object. More...
 
struct  SkeletonOptions
 Option object for skeletonizeImage() More...
 
class  SlantedEdgeMTFOptions
 Pass options to one of the slantedEdgeMTF() functions. More...
 
struct  SlicOptions
 Options object for slicSuperpixels(). More...
 
class  SortSamplesByDimensions
 
class  Splice
 
class  SplineImageView
 Create a continuous view onto a discrete image using splines. More...
 
class  SplineImageView0
 Create an image view for nearest-neighbor interpolation. More...
 
class  SplineImageView1
 Create an image view for bi-linear interpolation. More...
 
class  SplitBase
 
class  sRGB2RGBFunctor
 Convert standardized sRGB into non-linear (raw) RGB. More...
 
class  StandardAccessor
 Encapsulate access to the values an iterator points to. More...
 
class  StandardConstAccessor
 Encapsulate read access to the values an iterator points to. More...
 
class  StandardConstValueAccessor
 Encapsulate access to the values an iterator points to. More...
 
class  StandardValueAccessor
 Encapsulate access to the values an iterator points to. More...
 
class  StarPolytope
 Specialization of the polytope to polytopes which forms a star domain. More...
 
class  StaticPolynomial
 
class  StopAfterTree
 
class  StopAfterVoteCount
 
class  StopBase
 
class  StopIfBinTest
 
class  StopIfConverging
 
class  StopIfMargin
 
class  StopIfProb
 
struct  StridedArrayTag
 
class  StridedImageIterator
 Iterator to be used when pixels are to be skipped. More...
 
class  StridedMultiIterator
 A multi-dimensional hierarchical iterator to be used with vigra::MultiArrayView if it is not strided. More...
 
class  StridedScanOrderIterator
 Sequential iterator for MultiArrayView. More...
 
struct  ThinPlateSplineFunctor
 
class  ThreadPool
 Thread pool class to manage a set of parallel workers. More...
 
class  Threshold
 Threshold an image. More...
 
class  ThresholdSplit
 
class  TinyVector
 Class for fixed size vectors. More...
 
class  TinyVectorBase
 Base class for fixed size vectors. More...
 
class  TinyVectorView
 Wrapper for fixed size vectors. More...
 
class  UniformIntRandomFunctor
 
class  UniformRandomFunctor
 
struct  UnstridedArrayTag
 
class  VectorAccessor
 Accessor for items that are STL compatible vectors. More...
 
class  VectorComponentAccessor
 Accessor for one component of a vector. More...
 
class  VectorComponentValueAccessor
 Accessor for one component of a vector. More...
 
class  VectorElementAccessor
 Accessor for one component of a vector. More...
 
class  VectorNormFunctor
 A functor for computing the vector norm. More...
 
class  VectorNormSqFunctor
 A functor for computing the squared vector norm. More...
 
class  VolumeExportInfo
 Argument object for the function exportVolume(). More...
 
class  VolumeImportInfo
 Argument object for the function importVolume(). More...
 
class  WatershedOptions
 Options object for watershed algorithms. More...
 
class  WignerMatrix
 computation of Wigner D matrix + rotation functions in SH,VH and R³ More...
 
class  XYZ2LabFunctor
 Convert standardized tri-stimulus XYZ into perceptual uniform CIE L*a*b*. More...
 
class  XYZ2LuvFunctor
 Convert standardized tri-stimulus XYZ into perceptual uniform CIE L*u*v*. More...
 
class  XYZ2RGBFunctor
 Convert standardized tri-stimulus XYZ into linear (raw) RGB. More...
 
class  XYZ2RGBPrimeFunctor
 Convert standardized tri-stimulus XYZ into non-linear (gamma corrected) R'G'B'. More...
 
class  YPrimeCbCr2RGBPrimeFunctor
 Convert Y'CbCr color difference components into non-linear (gamma corrected) R'G'B'. More...
 
class  YPrimeIQ2RGBPrimeFunctor
 Convert Y'IQ color components into non-linear (gamma corrected) R'G'B'. More...
 
class  YPrimePbPr2RGBPrimeFunctor
 Convert Y'PbPr color difference components into non-linear (gamma corrected) R'G'B'. More...
 
class  YPrimeUV2RGBPrimeFunctor
 Convert Y'UV color components into non-linear (gamma corrected) R'G'B'. More...
 

Typedefs

typedef AtImageBorder AtVolumeBorder
 Encode whether a voxel is near the volume border.
 
typedef BasicImage< UInt8BImage
 
typedef BasicImage< RGBValue< UInt8 > > BRGBImage
 
typedef Diff2D CoordinateIterator
 Simulate an image where each pixel contains its coordinate.
 
typedef vigra::TinyVector< int, 3 > Diff3D
 3-dimensional difference vector
 
typedef BasicImage< doubleDImage
 
typedef BasicImage< RGBValue< double > > DRGBImage
 
typedef BasicImage< TinyVector< double, 2 > > DVector2Image
 
typedef BasicImage< TinyVector< double, 3 > > DVector3Image
 
typedef BasicImage< TinyVector< double, 4 > > DVector4Image
 
typedef EightNeighborhood::NeighborCode EightNeighborCode
 
typedef NeighborOffsetCirculator< EightNeighborCodeEightNeighborOffsetCirculator
 
typedef BasicImage< FFTWComplex<> > FFTWComplexImage
 
typedef BasicImage< fftw_realFFTWRealImage
 
typedef BasicImage< floatFImage
 
typedef FourNeighborhood::NeighborCode FourNeighborCode
 
typedef NeighborOffsetCirculator< FourNeighborCodeFourNeighborOffsetCirculator
 
typedef BasicImage< RGBValue< float > > FRGBImage
 
typedef BasicImage< TinyVector< float, 2 > > FVector2Image
 
typedef BasicImage< TinyVector< float, 3 > > FVector3Image
 
typedef BasicImage< TinyVector< float, 4 > > FVector4Image
 
typedef RidgeSplit< BestGiniOfColumn< GiniCriterion > > GiniRidgeSplit
 
typedef BasicImage< Int32IImage
 
typedef detail::SelectIntegerType< 16, detail::SignedIntTypes >::type Int16
 16-bit signed int
 
typedef BasicImage< Int16Int16Image
 
typedef BasicImage< RGBValue< Int16 > > Int16RGBImage
 
typedef detail::SelectIntegerType< 32, detail::SignedIntTypes >::type Int32
 32-bit signed int
 
typedef BasicImage< Int32Int32Image
 
typedef BasicImage< RGBValue< Int32 > > Int32RGBImage
 
typedef detail::SelectIntegerType< 64, detail::SignedIntTypes >::type Int64
 64-bit signed int
 
typedef detail::SelectIntegerType< 8, detail::SignedIntTypes >::type Int8
 8-bit signed int
 
typedef BasicImage< Int8Int8Image
 
typedef BasicImage< RGBValue< Int8 > > Int8RGBImage
 
typedef detail::SelectBiggestIntegerType< detail::SignedIntTypes >::type IntBiggest
 the biggest signed integer type of the system
 
typedef BasicImage< RGBValue< Int32 > > IRGBImage
 
typedef RandomNumberGenerator< detail::RandomState< detail::MT19937 > > MersenneTwister
 
typedef std::ptrdiff_t MultiArrayIndex
 
typedef Neighborhood3DSix::NeighborCode3D NeighborCode3DSix
 
typedef Neighborhood3DTwentySix::NeighborCode3D NeighborCode3DTwentySix
 
typedef RandomNumberGenerator< detail::RandomState< detail::MT19937 > > RandomMT19937
 
typedef RandomNumberGenerator< detail::RandomState< detail::TT800 > > RandomTT800
 
typedef BasicImage< Int16SImage
 
typedef BasicImage< RGBValue< Int16 > > SRGBImage
 
typedef RandomNumberGenerator< detail::RandomState< detail::TT800 > > TemperedTwister
 
typedef detail::SelectIntegerType< 16, detail::UnsignedIntTypes >::type UInt16
 16-bit unsigned int
 
typedef BasicImage< UInt16UInt16Image
 
typedef BasicImage< RGBValue< UInt16 > > UInt16RGBImage
 
typedef detail::SelectIntegerType< 32, detail::UnsignedIntTypes >::type UInt32
 32-bit unsigned int
 
typedef BasicImage< UInt32UInt32Image
 
typedef BasicImage< RGBValue< UInt32 > > UInt32RGBImage
 
typedef detail::SelectIntegerType< 64, detail::UnsignedIntTypes >::type UInt64
 64-bit unsigned int
 
typedef detail::SelectIntegerType< 8, detail::UnsignedIntTypes >::type UInt8
 8-bit unsigned int
 
typedef BasicImage< UInt8UInt8Image
 
typedef BasicImage< RGBValue< UInt8 > > UInt8RGBImage
 
typedef detail::SelectBiggestIntegerType< detail::UnsignedIntTypes >::type UIntBiggest
 the biggest unsigned integer type of the system
 

Enumerations

enum  AtImageBorder {
  NotAtBorder = 0 , RightBorder = 1 , LeftBorder = 2 , TopBorder = 4 ,
  BottomBorder = 8 , FrontBorder = 16 , RearBorder = 32 , TopRightBorder = TopBorder | RightBorder ,
  TopLeftBorder = TopBorder | LeftBorder , TopFrontBorder = TopBorder | FrontBorder , TopRearBorder = TopBorder | RearBorder , BottomLeftBorder = BottomBorder | LeftBorder ,
  BottomRightBorder = BottomBorder | RightBorder , BottomFrontBorder = BottomBorder | FrontBorder , BottomRearBorder = BottomBorder | RearBorder , FrontLeftBorder = FrontBorder | LeftBorder ,
  FrontRightBorder = FrontBorder | RightBorder , RearLeftBorder = RearBorder | LeftBorder , RearRightBorder = RearBorder | RightBorder , TopRightFrontBorder = TopBorder | RightBorder | FrontBorder ,
  TopLeftFrontBorder = TopBorder | LeftBorder | FrontBorder , BottomLeftFrontBorder = BottomBorder | LeftBorder | FrontBorder , BottomRightFrontBorder = BottomBorder | RightBorder | FrontBorder , TopRightRearBorder = TopBorder | RightBorder | RearBorder ,
  TopLeftRearBorder = TopBorder | LeftBorder | RearBorder , BottomLeftRearBorder = BottomBorder | LeftBorder | RearBorder , BottomRightRearBorder = BottomBorder | RightBorder | RearBorder
}
 Encode whether a point is near the image border. More...
 
enum  BoundaryDistanceTag { OuterBoundary , InterpixelBoundary , InnerBoundary }
 Specify which boundary is used for boundaryMultiDistance(). More...
 
enum  MultiArrayInitializationTag { LinearSequence }
 Initialize a MultiArray in a standard way.
More...
 
enum  NeighborhoodType { DirectNeighborhood =0 , IndirectNeighborhood =1 }
 Choose the neighborhood system in a dimension-independent way.
More...
 
enum  RF_OptionTag
 
enum  SRGType
 

Functions

template<class R >
FFTWComplex< R >::NormType abs (const FFTWComplex< R > &a)
 absolute value (= magnitude)
 
template<typename IntType >
Rational< IntTypeabs (const Rational< IntType > &r)
 absolute value
 
template<int IntBits, FPOverflowHandling OverflowHandling>
FixedPoint16< IntBits, OverflowHandlingabs (FixedPoint16< IntBits, OverflowHandling > v)
 absolute value.
 
template<unsigned IntBits, unsigned FracBits>
FixedPoint< IntBits, FracBitsabs (FixedPoint< IntBits, FracBits > v)
 absolute value.
 
template<typename Type >
Quaternion< Type >::NormType abs (Quaternion< Type > const &q)
 norm
 
template<class T , unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
RGBValue< T, RIDX, GIDX, BIDXabs (RGBValue< T, RIDX, GIDX, BIDX > const &v)
 component-wise absolute value
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZEabs (TinyVectorBase< V, SIZE, D1, D2 > const &v)
 component-wise absolute value
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2, int IntBits3>
FixedPoint16< IntBits3, OverflowHandling > & add (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r, FixedPoint16< IntBits3, OverflowHandling > &result)
 addition with enforced result type.
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2, unsigned IntBits3, unsigned FracBits3>
void add (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
 addition with enforced result type.
 
template<class SrcIterator , class DestIterator >
linalg::TemporaryMatrix< doubleaffineMatrix2DFromCorrespondingPoints (SrcIterator s, SrcIterator send, DestIterator d)
 Create homogeneous matrix that maps corresponding points onto each other.
 
template<... >
void affineWarpImage (...)
 Warp an image according to an affine transformation.
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool allGreater (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 pointwise greater-than
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool allGreaterEqual (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 pointwise greater-equal
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool allLess (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 pointwise less-than
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool allLessEqual (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 pointwise less-equal
 
double angularGaborSigma (int directionCount, double centerFrequency)
 Calculate sensible angular sigma for given parameters.
 
template<... >
void anisotropicTotalVariationFilter (...)
 Performs Anisotropic Total Variation Regularization.
 
template<... >
void applyFourierFilter (...)
 Apply a filter (defined in the frequency domain) to an image.
 
template<... >
void applyFourierFilterFamily (...)
 Apply an array of filters (defined in the frequency domain) to an image.
 
template<class IndexIterator , class InIterator , class OutIterator >
void applyPermutation (IndexIterator index_first, IndexIterator index_last, InIterator in, OutIterator out)
 Sort an array according to the given index permutation.
 
template<... >
void applyWindowFunction (...)
 Apply a window function to each pixels of a given image.
 
template<class R >
arg (const FFTWComplex< R > &a)
 phase
 
template<class Iterator >
Iterator argMax (Iterator first, Iterator last)
 Find the maximum element in a sequence.
 
template<class Iterator , class UnaryFunctor >
Iterator argMaxIf (Iterator first, Iterator last, UnaryFunctor condition)
 Find the maximum element in a sequence conforming to a condition.
 
template<class Iterator >
Iterator argMin (Iterator first, Iterator last)
 Find the minimum element in a sequence.
 
template<class Iterator , class UnaryFunctor >
Iterator argMinIf (Iterator first, Iterator last, UnaryFunctor condition)
 Find the minimum element in a sequence conforming to a condition.
 
template<class T >
std::string asString (T t)(...)
 
template<int IntBits, FPOverflowHandling OverflowHandling>
FixedPoint16< 2, OverflowHandlingatan2 (FixedPoint16< IntBits, OverflowHandling > y, FixedPoint16< IntBits, OverflowHandling > x)
 Arctangent. Accuracy better than 1/3 degree (9 significant bits).
 
template<... >
void beaudetCornerDetector (...)
 Find corners in an image (4).
 
template<... >
void beautifyCrackEdgeImage (...)
 Beautify crack edge image for visualization.
 
double besselJ (int n, double x)
 Bessel function of the first kind.
 
double besselY (int n, double x)
 Bessel function of the second kind.
 
template<... >
void boundaryMultiDistance (...)
 Euclidean distance to the implicit boundaries of a multi-dimensional label array.
 
template<... >
void boundaryTensor (...)
 Calculate the boundary tensor for a scalar valued image.
 
template<... >
void boundaryTensor1 (...)
 Boundary tensor variant.
 
template<... >
void boundaryVectorDistance (...)
 Compute the vector distance transform to the implicit boundaries of a multi-dimensional label array.
 
template<... >
void cannyEdgeImage (...)
 Detect and mark edges in an edge image using Canny's algorithm.
 
template<... >
void cannyEdgeImageFromGradWithThinning (...)
 Detect and mark edges in an edge image using Canny's algorithm.
 
template<... >
void cannyEdgeImageWithThinning (...)
 Detect and mark edges in an edge image using Canny's algorithm.
 
template<... >
void cannyEdgelList (...)
 Simple implementation of Canny's edge detector.
 
template<... >
void cannyEdgelList3x3 (...)
 Improved implementation of Canny's edge detector.
 
template<... >
void cannyEdgelList3x3Threshold (...)
 Improved implementation of Canny's edge detector with thresholding.
 
template<... >
void cannyEdgelListThreshold (...)
 Canny's edge detector with thresholding.
 
template<class GRAPH , class EDGE_WEIGHTS , class SEEDS , class LABELS >
void carvingSegmentation (const GRAPH &g, const EDGE_WEIGHTS &edgeWeights, const SEEDS &seeds, const typename LABELS::Value backgroundLabel, const typename EDGE_WEIGHTS::Value backgroundBias, const typename EDGE_WEIGHTS::Value noPriorBelow, LABELS &labels)
 edge weighted watersheds Segmentataion
 
template<typename IntType >
Rational< IntTypeceil (const Rational< IntType > &r)
 smallest integer not smaller than r
 
template<int IntBits, FPOverflowHandling OverflowHandling>
Int32 ceil (FixedPoint16< IntBits, OverflowHandling > v)
 rounding up.
 
template<unsigned IntBits, unsigned FracBits>
int ceil (FixedPoint< IntBits, FracBits > v)
 rounding up.
 
template<class V , unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
RGBValue< V, RIDX, GIDX, BIDXceil (RGBValue< V, RIDX, GIDX, BIDX > const &r)
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZEceil (TinyVectorBase< V, SIZE, D1, D2 > const &v)
 
UInt32 ceilPower2 (UInt32 x)
 Round up to the nearest power of 2.
 
template<int SIZE>
TinyVector< UInt32, SIZEceilPower2 (vigra::TinyVector< UInt32, SIZE > const &t)
 Round up values to the nearest power of 2. Implemented only for UInt32.
 
UInt32 checksum (const char *data, unsigned int size)
 Compute the CRC-32 checksum of a byte array.
 
double chi2 (unsigned int degreesOfFreedom, double arg, double accuracy=1e-7)
 Chi square distribution.
 
double chi2CDF (unsigned int degreesOfFreedom, double arg, double accuracy=1e-7)
 Cumulative chi square distribution.
 
template<class V , int SIZE>
TinyVector< V, SIZEclip (TinyVector< V, SIZE > const &t, const V valLower, const V valUpper)
 Clip values to an interval.
 
template<class V , int SIZE>
TinyVector< V, SIZEclip (TinyVector< V, SIZE > const &t, TinyVector< V, SIZE > const &valLower, TinyVector< V, SIZE > const &valUpper)
 Clip values to a vector of intervals.
 
template<class V , int SIZE>
TinyVector< V, SIZEclipLower (TinyVector< V, SIZE > const &t)
 Clip negative values.
 
template<class V , int SIZE>
TinyVector< V, SIZEclipLower (TinyVector< V, SIZE > const &t, const V val)
 Clip values below a threshold.
 
template<class V , int SIZE>
TinyVector< V, SIZEclipUpper (TinyVector< V, SIZE > const &t, const V val)
 Clip values above a threshold.
 
template<class T1 , class T2 >
bool closeAtTolerance (T1 l, T2 r, typename PromoteTraits< T1, T2 >::Promote epsilon)
 Tolerance based floating-point equality.
 
template<... >
void closeGapsInCrackEdgeImage (...)
 Close one-pixel wide gaps in a cell grid edge image.
 
template<... >
void combineThreeImages (...)
 Combine three source images into destination image.
 
template<... >
void combineThreeMultiArrays (...)
 Combine three multi-dimensional arrays into one using a ternary function or functor.
 
template<... >
void combineTwoImages (...)
 Combine two source images into destination image.
 
template<... >
void combineTwoImagesIf (...)
 Combine ROI of two source images into destination image.
 
template<... >
void combineTwoMultiArrays (...)
 Combine two multi-dimensional arrays into one using a binary function or functor.
 
void compress (char const *source, std::size_t size, ArrayVector< char > &dest, CompressionMethod method)
 
UInt32 concatenateChecksum (UInt32 checksum, const char *data, unsigned int size)
 
template<class R >
FFTWComplex< R > conj (const FFTWComplex< R > &a)
 complex conjugate
 
template<class ValueType >
Quaternion< ValueType > conj (Quaternion< ValueType > const &q)
 Create conjugate quaternion.
 
template<class PointArray1 , class PointArray2 >
void convexHull (const PointArray1 &points, PointArray2 &convex_hull)
 Compute convex hull of a 2D polygon.
 
template<... >
void convolveFFT (...)
 Convolve an array with a kernel by means of the Fourier transform.
 
template<... >
void convolveFFTComplex (...)
 Convolve a complex-valued array by means of the Fourier transform.
 
template<... >
void convolveFFTComplexMany (...)
 Convolve a complex-valued array with a sequence of kernels by means of the Fourier transform.
 
template<... >
void convolveFFTMany (...)
 Convolve a real-valued array with a sequence of kernels by means of the Fourier transform.
 
template<... >
void convolveImage (...)
 Convolve an image with the given kernel(s).
 
template<... >
void convolveImageWithMask (...)
 Deprecated name of 2-dimensional normalized convolution, i.e. convolution with a mask image.
 
template<... >
void convolveLine (...)
 Performs a 1-dimensional convolution of the source signal using the given kernel.
 
template<... >
void convolveMultiArrayOneDimension (...)
 Convolution along a single dimension of a multi-dimensional arrays.
 
template<class G , class A , class B >
void copyEdgeMap (const G &g, const A &a, B &b)
 copy a lemon edge map
 
template<... >
void copyImage (...)
 Copy source image into destination image.
 
template<... >
void copyImageIf (...)
 Copy source ROI into destination image.
 
template<... >
void copyMultiArray (...)
 Copy a multi-dimensional array.
 
template<class G , class A , class B >
void copyNodeMap (const G &g, const A &a, B &b)
 copy a lemon node map
 
template<... >
void cornerResponseFunction (...)
 Find corners in an image (1).
 
template<... >
void correlateFFT (...)
 Correlate an array with a kernel by means of the Fourier transform.
 
template<class REAL >
REAL cos_pi (REAL x)
 cos(pi*x).
 
template<unsigned int N, class T >
ChunkedArray< N, T >::iterator createCoupledIterator (ChunkedArray< N, T > &m)
 
template<unsigned int N1, class T1 , class S1 >
CoupledIteratorType< N1, T1 >::type createCoupledIterator (MultiArrayView< N1, T1, S1 > const &m1)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 >
CoupledIteratorType< N1, T1, T2 >::type createCoupledIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 >
CoupledIteratorType< N1, T1, T2, T3 >::type createCoupledIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2, MultiArrayView< N3, T3, S3 > const &m3)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 , unsigned int N4, class T4 , class S4 >
CoupledIteratorType< N1, T1, T2, T3, T4 >::type createCoupledIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2, MultiArrayView< N3, T3, S3 > const &m3, MultiArrayView< N4, T4, S4 > const &m4)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 , unsigned int N4, class T4 , class S4 , unsigned int N5, class T5 , class S5 >
CoupledIteratorType< N1, T1, T2, T3, T4, T5 >::type createCoupledIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2, MultiArrayView< N3, T3, S3 > const &m3, MultiArrayView< N4, T4, S4 > const &m4, MultiArrayView< N5, T5, S5 > const &m5)
 
template<int N>
CoupledIteratorType< N >::type createCoupledIterator (TinyVector< MultiArrayIndex, N > const &shape)
 
template<... >
void createGaborFilter (...)
 Create a gabor filter in frequency space.
 
template<unsigned int N1, class T1 , class S1 >
HierarchicalIteratorType< N1, T1 >::type createHierarchicalIterator (MultiArrayView< N1, T1, S1 > const &m1)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 >
HierarchicalIteratorType< N1, T1, T2 >::type createHierarchicalIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 >
HierarchicalIteratorType< N1, T1, T2, T3 >::type createHierarchicalIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2, MultiArrayView< N3, T3, S3 > const &m3)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 , unsigned int N4, class T4 , class S4 >
HierarchicalIteratorType< N1, T1, T2, T3, T4 >::type createHierarchicalIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2, MultiArrayView< N3, T3, S3 > const &m3, MultiArrayView< N4, T4, S4 > const &m4)
 
template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 , unsigned int N4, class T4 , class S4 , unsigned int N5, class T5 , class S5 >
HierarchicalIteratorType< N1, T1, T2, T3, T4, T5 >::type createHierarchicalIterator (MultiArrayView< N1, T1, S1 > const &m1, MultiArrayView< N2, T2, S2 > const &m2, MultiArrayView< N3, T3, S3 > const &m3, MultiArrayView< N4, T4, S4 > const &m4, MultiArrayView< N5, T5, S5 > const &m5)
 
template<int N>
HierarchicalIteratorType< N >::type createHierarchicalIterator (TinyVector< MultiArrayIndex, N > const &shape)
 
template<... >
void createRGBTiffImage (...)
 Create a 3-band TiffImage from the given RGB image.
 
template<... >
void createScalarTiffImage (...)
 Create a single-band TiffImage from the given scalar image.
 
template<... >
void createTiffImage (...)
 Create a TiffImage from the given iterator range.
 
template<class V1 , unsigned int R, unsigned int G, unsigned int B, class V2 >
PromoteTraits< RGBValue< V1, R, G, B >, RGBValue< V2, R, G, B > >::Promote cross (RGBValue< V1, R, G, B > const &r1, RGBValue< V2, R, G, B > const &r2)
 cross product
 
template<class V1 , class D1 , class D2 , class V2 , class D3 , class D4 >
TinyVector< typename PromoteTraits< V1, V2 >::Promote, 3 > cross (TinyVectorBase< V1, 3, D1, D2 > const &r1, TinyVectorBase< V2, 3, D3, D4 > const &r2)
 cross product
 
template<... >
void crossCorrelation (...)
 This function performes a (slow) cross-correlation.
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< typename NumericTraits< V >::Promote, SIZEcumprod (TinyVectorBase< V, SIZE, D1, D2 > const &l)
 cumulative product of the vector's elements
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< typename NumericTraits< V >::Promote, SIZEcumsum (TinyVectorBase< V, SIZE, D1, D2 > const &l)
 cumulative sum of the vector's elements
 
template<... >
void differenceOfExponentialCrackEdgeImage (...)
 Detect and mark edges in a crack edge image using the Shen/Castan zero-crossing detector.
 
template<... >
void differenceOfExponentialEdgeImage (...)
 Detect and mark edges in an edge image using the Shen/Castan zero-crossing detector.
 
template<... >
void discDilation (...)
 Apply dilation (maximum) filter with disc of given radius to image.
 
template<... >
void discDilationWithMask (...)
 Apply dilation (maximum) filter with disc of given radius to image using a mask.
 
template<... >
void discErosion (...)
 Apply erosion (minimum) filter with disc of given radius to image.
 
template<... >
void discErosionWithMask (...)
 Apply erosion (minimum) filter with disc of given radius to image using a mask.
 
template<... >
void discMedian (...)
 Apply median filter with disc of given radius to image.
 
template<... >
void discMedianWithMask (...)
 Apply median filter with disc of given radius to image using a mask.
 
template<... >
void discRankOrderFilter (...)
 Apply rank order filter with disc structuring function to the image.
 
template<... >
void discRankOrderFilterWithMask (...)
 Apply rank order filter with disc structuring function to the image using a mask.
 
template<... >
void distanceTransform (...)
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2, int IntBits3>
FixedPoint16< IntBits3, OverflowHandling > & div (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r, FixedPoint16< IntBits3, OverflowHandling > &result)
 division with enforced result type.
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZEdiv (TinyVectorBase< V, SIZE, D1, D2 > const &l, V v)
 component-wise scalar division without type promotion
 
template<class V1 , unsigned int RIDX1, unsigned int GIDX1, unsigned int BIDX1, class V2 , unsigned int RIDX2, unsigned int GIDX2, unsigned int BIDX2>
PromoteTraits< V1, V2 >::Promote dot (RGBValue< V1, RIDX1, GIDX1, BIDX1 > const &r1, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r2)
 dot product
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< V1, V2 >::Promote dot (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 dot product
 
 doxygen_overloaded_function (template<... > void separableConvolveBlockwise) template< unsigned int N
 Separated convolution on ChunkedArrays.
 
template<int IntBits, FPOverflowHandling OverflowHandling>
FixedPoint16< IntBits, OverflowHandlingdual_frac (FixedPoint16< IntBits, OverflowHandling > v)
 dual fractional part. (1 - frac(v))
 
template<unsigned IntBits, unsigned FracBits>
FixedPoint< 0, FracBitsdual_frac (FixedPoint< IntBits, FracBits > v)
 dual fractional part: 1 - frac(v).
 
template<unsigned int N, class T , class S , class Array >
void eccentricityCenters (const MultiArrayView< N, T, S > &src, Array &centers)
 Find the (approximate) eccentricity center in each region of a labeled image.
 
template<unsigned int N, class T , class S , class Array >
void eccentricityTransformOnLabels (MultiArrayView< N, T > const &src, MultiArrayView< N, S > dest, Array &centers)
 Computes the (approximate) eccentricity transform on each region of a labeled image.
 
template<class GRAPH , class WEIGHTS , class COMPERATOR >
void edgeSort (const GRAPH &g, const WEIGHTS &weights, const COMPERATOR &comperator, std::vector< typename GRAPH::Edge > &sortedEdges)
 get a vector of Edge descriptors
 
template<class GRAPH , class EDGE_WEIGHTS , class SEEDS , class LABELS >
void edgeWeightedWatershedsSegmentation (const GRAPH &g, const EDGE_WEIGHTS &edgeWeights, const SEEDS &seeds, LABELS &labels)
 edge weighted watersheds Segmentataion
 
template<unsigned int N, class DirectedTag , class T , class EDGEMAP >
void edgeWeightsFromInterpolatedImage (const GridGraph< N, DirectedTag > &g, const MultiArrayView< N, T > &interpolatedImage, EDGEMAP &edgeWeights, bool euclidean=false)
 create edge weights from an interpolated image
 
template<unsigned int N, class DirectedTag , class NODEMAP , class EDGEMAP , class FUNCTOR >
void edgeWeightsFromNodeWeights (const GridGraph< N, DirectedTag > &g, const NODEMAP &nodeWeights, EDGEMAP &edgeWeights, bool euclidean, FUNCTOR const &func)
 create edge weights from node weights
 
double ellipticIntegralE (double x, double k)
 The incomplete elliptic integral of the second kind.
 
double ellipticIntegralF (double x, double k)
 The incomplete elliptic integral of the first kind.
 
template<... >
void estimateAffineTransform (...)
 Estimate the optical flow between two images according to an affine transform model (e.g. translation, rotation, non-uniform scaling, and shearing).
 
template<... >
void estimateGlobalRotation (...)
 Estimate the rotation between two images by means of a normalized cross correlation matching of the FFT spectra.
 
template<... >
void estimateGlobalRotationTranslation (...)
 Estimate the (global) rotation and translation between two images by means a normalized cross correlation matching.
 
template<... >
void estimateGlobalTranslation (...)
 Estimate the translation between two images by means of a normalized cross correlation matching.
 
template<... >
void estimateSimilarityTransform (...)
 Estimate the optical flow between two images according to a similarity transform model (e.g. translation, rotation, and uniform scaling).
 
template<... >
void estimateTranslation (...)
 Estimate the optical flow between two images according to a translation model.
 
bool even (int t)
 Check if an integer is even.
 
template<... >
void exportImage (...)
 Write an image to a file.
 
template<... >
void exportImageAlpha (...)
 Write the image and its alpha channel to a file.
 
template<... >
void exportVolume (...)
 Function for exporting a 3D volume.
 
template<... >
void extendedLocalMaxima (...)
 Find local maximal regions in an array.
 
template<... >
void extendedLocalMaxima3D (...)
 Find local maximal regions in 3D multi array.
 
template<... >
void extendedLocalMinima (...)
 Find local minimal regions (plateaus) in an array.
 
template<... >
void extendedLocalMinima3D (...)
 Find local minimal regions in a volume.
 
template<class T , class S , class PointArray >
void extractContour (MultiArrayView< 2, T, S > const &label_image, Shape2 const &anchor_point, PointArray &contour_points)
 Create a polygon from the interpixel contour of a labeled region.
 
template<... >
void fastCrossCorrelation (...)
 This function performes a fast cross-correlation.
 
template<... >
void fastNormalizedCrossCorrelation (...)
 This function performes a fast normalized cross-correlation.
 
template<class GRAPH , class EDGE_WEIGHTS , class NODE_SIZE , class NODE_LABEL_MAP >
void felzenszwalbSegmentation (const GRAPH &graph, const EDGE_WEIGHTS &edgeWeights, const NODE_SIZE &nodeSizes, float k, NODE_LABEL_MAP &nodeLabeling, const int nodeNumStopCond=-1)
 edge weighted watersheds Segmentataion
 
template<class T , int N>
TinyVector< T, N > fftwCorrespondingShapeR2C (TinyVector< T, N > shape)
 Find frequency domain shape for a R2C Fourier transform.
 
template<class G , class A , class T >
void fillEdgeMap (const G &g, A &a, const T &value)
 fill a lemon edge map
 
template<class G , class A , class T >
void fillNodeMap (const G &g, A &a, const T &value)
 fill a lemon node map
 
template<class Point , class T , class S , class Value >
void fillPolygon (Polygon< Point > const &p, MultiArrayView< 2, T, S > &output_image, Value value)
 Render closed polygon p into the image output_image.
 
template<class TARGET , int IntBits, FPOverflowHandling OverflowHandling>
TARGET fixed_point_cast (FixedPoint16< IntBits, OverflowHandling > v)
 
template<class TARGET , unsigned IntBits, unsigned FracBits>
TARGET fixed_point_cast (FixedPoint< IntBits, FracBits > v)
 
template<typename IntType >
Rational< IntTypefloor (const Rational< IntType > &r)
 largest integer not larger than r
 
template<int IntBits, FPOverflowHandling OverflowHandling>
Int32 floor (FixedPoint16< IntBits, OverflowHandling > v)
 rounding down.
 
template<unsigned IntBits, unsigned FracBits>
int floor (FixedPoint< IntBits, FracBits > v)
 rounding down.
 
template<class V , unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
RGBValue< V, RIDX, GIDX, BIDXfloor (RGBValue< V, RIDX, GIDX, BIDX > const &r)
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZEfloor (TinyVectorBase< V, SIZE, D1, D2 > const &v)
 
UInt32 floorPower2 (UInt32 x)
 Round down to the nearest power of 2.
 
template<int SIZE>
TinyVector< UInt32, SIZEfloorPower2 (vigra::TinyVector< UInt32, SIZE > const &t)
 Round down values to the nearest power of 2. Implemented only for UInt32.
 
template<... >
void foerstnerCornerDetector (...)
 Find corners in an image (2).
 
template<typename TPL , typename FUNCTOR >
void for_each_in_tuple (TPL &&t, FUNCTOR &&f)
 
template<... >
void fourierTransform (...)
 Compute forward and inverse Fourier transforms.
 
template<... >
void fourierTransformInverse (...)
 Compute inverse Fourier transforms.
 
template<... >
void fourierTransformReal (...)
 Real Fourier transforms for even and odd boundary conditions (aka. cosine and sine transforms).
 
template<int IntBits, FPOverflowHandling OverflowHandling>
FixedPoint16< IntBits, OverflowHandlingfrac (FixedPoint16< IntBits, OverflowHandling > v)
 fractional part. (difference between v and its floor)
 
template<unsigned IntBits, unsigned FracBits>
FixedPoint< 0, FracBitsfrac (FixedPoint< IntBits, FracBits > v)
 fractional part.
 
template<... >
void frostFilter (...)
 This function tries to reduce the speckle noise of an image by applying the basic Frost filter.
 
double gamma (double x)
 The gamma function.
 
template<... >
void gaussianDivergenceMultiArray (...)
 Calculate the divergence of a vector field using Gaussian derivative filters.
 
template<... >
void gaussianGradient (...)
 Calculate the gradient vector by means of a 1st derivatives of Gaussian filter.
 
template<... >
void gaussianGradientMagnitude (...)
 Calculate the gradient magnitude by means of a 1st derivatives of Gaussian filter.
 
template<... >
void gaussianGradientMultiArray (...)
 Calculate Gaussian gradient of a multi-dimensional arrays.
 
template<... >
void gaussianSharpening (...)
 Perform sharpening function with gaussian filter.
 
template<... >
void gaussianSmoothing (...)
 Perform isotropic Gaussian convolution.
 
template<... >
void gaussianSmoothMultiArray (...)
 Isotropic Gaussian smoothing of a multi-dimensional arrays.
 
template<typename IntType >
IntType gcd (IntType n, IntType m)
 
template<... >
unsigned int generateSlicSeeds (...)
 Generate seeds for SLIC superpixel computation in arbitrary dimensions.
 
template<... >
unsigned int generateWatershedSeeds (...)
 Generate seeds for watershed computation and seeded region growing.
 
template<unsigned int TARGET_INDEX, class Handle >
CoupledHandleCast< TARGET_INDEX, Handle >::reference get (Handle &handle)
 
template<unsigned int TARGET_INDEX, class Handle >
CoupledHandleCast< TARGET_INDEX, Handle >::const_reference get (Handle const &handle)
 
template<... >
void getAnisotropy (...)
 Sets up directional data for anisotropic regularization.
 
template<... >
void gradientBasedTransform (...)
 Calculate a function of the image gradient.
 
template<... >
void gradientEnergyTensor (...)
 Calculate the gradient energy tensor for a scalar valued image.
 
template<class GRAPH , class NODE_FEATURES_IN , class EDGE_INDICATOR , class NODE_FEATURES_OUT >
void graphSmoothing (const GRAPH &g, const NODE_FEATURES_IN &nodeFeaturesIn, const EDGE_INDICATOR &edgeIndicator, const float lambda, const float edgeThreshold, const float scale, NODE_FEATURES_OUT &nodeFeaturesOut)
 smooth node features of a graph
 
template<class T1 , class T2 >
bool greaterEqualAtTolerance (T1 l, T2 r, typename PromoteTraits< T1, T2 >::Promote epsilon)
 Tolerance based floating-point greater-or-equal.
 
template<... >
void hessianMatrixOfGaussian (...)
 Filter image with the 2nd derivatives of the Gaussian at the given scale to get the Hessian matrix.
 
template<... >
void hessianOfGaussianMultiArray (...)
 Calculate Hessian matrix of a N-dimensional arrays using Gaussian derivative filters.
 
template<... >
void hierarchicalClustering (...)
 Reduce the number of nodes in a graph by iteratively contracting the cheapest edge.
 
template<... >
void hourGlassFilter (...)
 Anisotropic tensor smoothing with the hourglass filter.
 
template<int IntBits, FPOverflowHandling OverflowHandling>
FixedPoint16< IntBits, OverflowHandlinghypot (FixedPoint16< IntBits, OverflowHandling > v1, FixedPoint16< IntBits, OverflowHandling > v2)
 Length of hypotenuse.
 
template<class R >
imag (const FFTWComplex< R > &a)
 imaginary part
 
std::string impexListExtensions ()
 List the file extension VIGRA understands.
 
std::string impexListFormats ()
 List the image formats VIGRA can read and write.
 
template<... >
void importImage (...)
 Read an image from a file.
 
template<... >
void importImageAlpha (...)
 Read the image specified by the given vigra::ImageImportInfo object including its alpha channel.
 
template<... >
void importTiffImage (...)
 Read a given TIFF image.
 
template<... >
void importVolume (...)
 Function for importing a 3D volume.
 
template<class Iterator , class IndexIterator , class Compare >
void indexSort (Iterator first, Iterator last, IndexIterator index_first, Compare c)
 Return the index permutation that would sort the input array.
 
template<... >
void initImage (...)
 Write a value to every pixel in an image or rectangular ROI.
 
template<... >
void initImageBorder (...)
 Write value to the specified border pixels in the image.
 
template<... >
void initImageIf (...)
 Write value to pixel in the image if mask is true.
 
template<... >
void initImageWithFunctor (...)
 Write the result of a functor call to every pixel in an image or rectangular ROI.
 
template<... >
void initMultiArray (...)
 Write a value to every element in a multi-dimensional array.
 
template<... >
void initMultiArrayBorder (...)
 Write values to the specified border values in the array.
 
template<... >
void inspectImage (...)
 Apply read-only functor to every pixel in the image.
 
template<... >
void inspectImageIf (...)
 Apply read-only functor to every pixel in the ROI.
 
template<... >
void inspectMultiArray (...)
 Call an analyzing functor at every element of a multi-dimensional array.
 
template<... >
void inspectSequence (...)
 Call an analyzing functor at every element of a sequence.
 
template<... >
void inspectTwoImages (...)
 Apply read-only functor to every pixel of both images.
 
template<... >
void inspectTwoImagesIf (...)
 Apply read-only functor to those pixels of both images where the mask image is non-zero.
 
template<... >
void inspectTwoMultiArrays (...)
 Call an analyzing functor at all corresponding elements of two multi-dimensional arrays.
 
template<class InIterator , class OutIterator >
void inversePermutation (InIterator first, InIterator last, OutIterator out)
 Compute the inverse of a given permutation.
 
AtImageBorder isAtImageBorder (int x, int y, int width, int height)
 Find out whether a point is at the image border.
 
AtVolumeBorder isAtVolumeBorder (int x, int y, int z, int width, int height, int depth)
 Find out whether a voxel is at the volume border.
 
AtVolumeBorder isAtVolumeBorderAntiCausal (int x, int y, int z, int width, int height, int depth)
 Find out whether a voxel is at a scan-order relevant volume border. This function checks if x == 0 or y == 0 or z == 0 and returns the appropriate value of vigra::AtVolumeBorder, or zero when the voxel is not at te volume border. The behavior of the function is undefined if (x,y,z) is not inside the volume.
 
AtVolumeBorder isAtVolumeBorderCausal (int x, int y, int z, int width, int height, int)
 Find out whether a voxel is at a scan-order relevant volume border. This function checks if x == 0 or y == 0 or z == 0 and returns the appropriate value of vigra::AtVolumeBorder, or zero when the voxel is not at te volume border. The behavior of the function is undefined if (x,y,z) is not inside the volume.
 
bool isHDF5 (char const *filename)
 Check if given filename refers to a HDF5 file.
 
bool isImage (char const *filename)
 Test whether a file is an image format known to VIGRA.
 
bool isPower2 (UInt32 x)
 Determine whether x is a power of 2 Bit twiddle from https://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2.
 
template<class V >
TinyVector< float, 3 > lab2Polar (V const &lab)
 Create polar representation form L*a*b*.
 
template<... >
unsigned int labelImage (...)
 Find the connected components of a segmented image.
 
template<... >
unsigned int labelImageWithBackground (...)
 Find the connected components of a segmented image, excluding the background from labeling.
 
template<... >
unsigned int labelMultiArray (...)
 Find the connected components of a MultiArray with arbitrary many dimensions.
 
template<... >
unsigned int labelMultiArrayBlockwise (...)
 Connected components labeling for MultiArrays and ChunkedArrays.
 
template<... >
unsigned int labelMultiArrayWithBackground (...)
 Find the connected components of a MultiArray with arbitrary many dimensions, excluding the background from labeling.
 
template<... >
unsigned int labelVolume (...)
 Find the connected components of a segmented volume.
 
template<class SrcIterator , class SrcAccessor , class SrcShape , class DestIterator , class DestAccessor >
unsigned int labelVolumeSix (triple< SrcIterator, SrcShape, SrcAccessor > src, pair< DestIterator, DestAccessor > dest)
 Find the connected components of a segmented volume using the 6-neighborhood.
 
template<... >
unsigned int labelVolumeWithBackground (...)
 Find the connected components of a segmented volume, excluding the background from labeling.
 
template<... >
void laplacianOfGaussian (...)
 Filter image with the Laplacian of Gaussian operator at the given scale.
 
template<... >
void laplacianOfGaussianMultiArray (...)
 Calculate Laplacian of a N-dimensional arrays using Gaussian derivative filters.
 
template<typename IntType >
IntType lcm (IntType n, IntType m)
 
template<class REAL >
REAL legendre (unsigned int l, int m, REAL x)
 Associated Legendre polynomial.
 
template<class REAL >
REAL legendre (unsigned int l, REAL x)
 Legendre polynomial.
 
template<class T1 , class T2 >
bool lessEqualAtTolerance (T1 l, T2 r, typename PromoteTraits< T1, T2 >::Promote epsilon)
 Tolerance based floating-point less-or-equal.
 
template<class Multiplier , class DestValueType >
LinearIntensityTransform< DestValueType, MultiplierlinearIntensityTransform (Multiplier scale, DestValueType offset)
 Apply a linear transform to the source pixel values.
 
template<... >
bool linearNoiseNormalization (...)
 Noise normalization by means of an estimated or given linear noise model.
 
template<class SrcValueType , class DestValueType >
LinearIntensityTransform< DestValueType, typename NumericTraits< DestValueType >::RealPromote > linearRangeMapping (SrcValueType src_min, SrcValueType src_max, DestValueType dest_min, DestValueType dest_max)
 Map a source intensity range linearly to a destination range.
 
template<class Iterator , class Value >
void linearSequence (Iterator first, Iterator last, Value start, Value step)
 Fill an array with a sequence of numbers.
 
template<... >
void localMaxima (...)
 Find local maxima in an image or multi-dimensional array.
 
template<... >
void localMaxima3D (...)
 Find local maxima in a 3D multi array.
 
template<... >
void localMinima (...)
 Find local minima in an image or multi-dimensional array.
 
template<... >
void localMinima3D (...)
 Find local minima in a 3D multi array.
 
Int32 log2i (UInt32 x)
 Compute the base-2 logarithm of an integer.
 
double loggamma (double x)
 The natural logarithm of the gamma function.
 
template<class V >
TinyVector< float, 3 > luv2Polar (V const &luv)
 Create polar representation form L*u*v*.
 
template<class T >
BasicImageView< T > makeBasicImageView (MultiArray< 3, T > const &array)
 
template<class T , class Stride >
BasicImageView< T > makeBasicImageView (MultiArrayView< 2, T, Stride > const &array)
 
template<class ArrayLike , class Compare >
detail::IndexCompare< ArrayLike, Compare > makeIndexComparator (ArrayLike a, Compare c)
 Create a compare functor for indirect sort.
 
template<class GRAPH_IN , class GRAPH_IN_NODE_LABEL_MAP >
void makeRegionAdjacencyGraph (GRAPH_IN graphIn, GRAPH_IN_NODE_LABEL_MAP labels, AdjacencyListGraph &rag, typename AdjacencyListGraph::template EdgeMap< std::vector< typename GRAPH_IN::Edge > > &affiliatedEdges, const Int64 ignoreLabel=-1)
 make a region adjacency graph from a graph and labels w.r.t. that graph
 
template<class T , class Stride >
BasicImageView< RGBValue< T > > makeRGBImageView (MultiArrayView< 3, T, Stride > const &array)
 
template<class V , int SIZE, class D1 , class D2 >
V constmax (TinyVectorBase< V, SIZE, D1, D2 > const &l)
 maximum element
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
TinyVector< typename PromoteTraits< V1, V2 >::Promote, SIZEmax (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 element-wise maximum
 
template<... >
void medianFilter (...)
 This function calculates the median of a window of given size for the complete image.
 
triple< Diff2D, Diff2D, MeshGridAccessormeshGrid (Diff2D upperLeft, Diff2D lowerRight)
 
template<class V , int SIZE, class D1 , class D2 >
V constmin (TinyVectorBase< V, SIZE, D1, D2 > const &l)
 minimum element
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
TinyVector< typename PromoteTraits< V1, V2 >::Promote, SIZEmin (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 element-wise minimum
 
template<... >
void moveDCToCenter (...)
 Rearrange the quadrants of a Fourier image so that the origin is in the image center.
 
template<... >
void moveDCToUpperLeft (...)
 Rearrange the quadrants of a Fourier image so that the origin is in the image's upper left.
 
template<class Vector >
double mtfFitGaussian (Vector const &mtf)
 Fit a Gaussian function to a given MTF.
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2, int IntBits3>
FixedPoint16< IntBits3, OverflowHandling > & mul (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r, FixedPoint16< IntBits3, OverflowHandling > &result)
 multiplication with enforced result type.
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2, unsigned IntBits3, unsigned FracBits3>
void mul (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
 multiplication with enforced result type.
 
template<... >
void multiBinaryDilation (...)
 Binary dilation on multi-dimensional arrays.
 
template<... >
void multiBinaryErosion (...)
 Binary erosion on multi-dimensional arrays.
 
template<... >
void multiGrayscaleDilation (...)
 Parabolic grayscale dilation on multi-dimensional arrays.
 
template<... >
void multiGrayscaleErosion (...)
 Parabolic grayscale erosion on multi-dimensional arrays.
 
template<... >
void noiseVarianceClustering (...)
 Determine the noise variance as a function of the image intensity and cluster the results.
 
template<... >
void noiseVarianceEstimation (...)
 Determine the noise variance as a function of the image intensity.
 
double noncentralChi2 (unsigned int degreesOfFreedom, double noncentrality, double arg, double accuracy=1e-7)
 Non-central chi square distribution.
 
double noncentralChi2CDF (unsigned int degreesOfFreedom, double noncentrality, double arg, double accuracy=1e-7)
 Cumulative non-central chi square distribution.
 
double noncentralChi2CDFApprox (unsigned int degreesOfFreedom, double noncentrality, double arg)
 Cumulative non-central chi square distribution (approximate).
 
template<... >
void nonlinearDiffusion (...)
 Perform edge-preserving smoothing at the given scale.
 
template<... >
void nonlinearDiffusionExplicit (...)
 Perform edge-preserving smoothing at the given scale using an explicit scheme.
 
template<... >
void nonlinearLeastSquares (...)
 Fit a non-linear model to given data by minimizing least squares loss.
 
template<... >
bool nonparametricNoiseNormalization (...)
 Noise normalization by means of an estimated non-parametric noise model.
 
template<class R >
FFTWComplex< R >::NormType norm (const FFTWComplex< R > &a)
 norm (= magnitude)
 
template<typename IntType >
Rational< IntTypenorm (const Rational< IntType > &r)
 norm (same as abs(r))
 
template<int IntBits, FPOverflowHandling OverflowHandling>
NormTraits< FixedPoint16< IntBits, OverflowHandling > >::NormType norm (FixedPoint16< IntBits, OverflowHandling > const &v)
 norm (same as abs).
 
template<unsigned IntBits, unsigned FracBits>
FixedPoint< IntBits, FracBitsnorm (FixedPoint< IntBits, FracBits > const &v)
 norm (same as abs).
 
template<class T >
NormTraits< T >::NormType norm (T const &t)
 The norm of a numerical object.
 
template<... >
void normalizedConvolveImage (...)
 Performs a 2-dimensional normalized convolution, i.e. convolution with a mask image.
 
template<... >
void normalizedCrossCorrelation (...)
 This function performes a (slow) normalized cross-correlation.
 
std::string normalizeString (std::string const &s)
 
bool odd (int t)
 Check if an integer is odd.
 
template<typename IntType1 , typename IntType2 >
bool operator!= (const Rational< IntType1 > &l, IntType2 const &i)
 inequality with right-hand IntType2 argument
 
template<class R >
bool operator!= (double a, const FFTWComplex< R > &b)
 not equal
 
template<class R >
bool operator!= (FFTWComplex< R > const &a, const FFTWComplex< R > &b)
 not equal
 
template<class R >
bool operator!= (FFTWComplex< R > const &a, double b)
 not equal
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
bool operator!= (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 not equal
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool operator!= (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 not equal
 
template<typename IntType1 , typename IntType2 >
bool operator!= (IntType1 const &l, Rational< IntType2 > const &r)
 inequality with left-hand IntType1 argument
 
template<typename IntType1 , typename IntType2 >
bool operator!= (Rational< IntType1 > const &l, Rational< IntType2 > const &r)
 inequality
 
template<class V1 , unsigned int RIDX1, unsigned int GIDX1, unsigned int BIDX1, class V2 , unsigned int RIDX2, unsigned int GIDX2, unsigned int BIDX2>
bool operator!= (RGBValue< V1, RIDX1, GIDX1, BIDX1 > const &l, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r)
 component-wise not equal
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool operator!= (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 component-wise not equal
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote operator% (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 component-wise modulo
 
template<typename Type >
Quaternion< Type > operator* (const Quaternion< Type > &t1, const Quaternion< Type > &t2)
 Multiplication.
 
template<typename Type >
Quaternion< Type > operator* (const Quaternion< Type > &t1, double t2)
 Multiplication with a scalar on the right.
 
template<class R >
FFTWComplex< R > operator* (double a, FFTWComplex< R > b)
 left multiplication with scalar double
 
template<typename Type >
Quaternion< Type > operator* (double t1, const Quaternion< Type > &t2)
 Multiplication with a scalar on the left.
 
template<class V , unsigned int R, unsigned int G, unsigned int B>
NumericTraits< RGBValue< V, R, G, B > >::RealPromote operator* (double v, RGBValue< V, R, G, B > const &r)
 component-wise left scalar multiplication
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator* (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
 component-wise left scalar multiplication
 
template<class R >
FFTWComplex< R > operator* (FFTWComplex< R > a, const FFTWComplex< R > &b)
 multiplication
 
template<class R >
FFTWComplex< R > operator* (FFTWComplex< R > a, double b)
 right multiplication with scalar double
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
PromoteTraits< FixedPoint16< IntBits1, OverflowHandling >, FixedPoint16< IntBits2, OverflowHandling > >::Promote operator* (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 multiplication with automatic determination of the appropriate result type.
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
FixedPointTraits< FixedPoint< IntBits1, FracBits1 >, FixedPoint< IntBits2, FracBits2 > >::MultipliesType operator* (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 multiplication with automatic determination of the appropriate result type.
 
template<typename IntType >
Rational< IntTypeoperator* (Rational< IntType > l, Rational< IntType > const &r)
 multiplication
 
template<typename IntType >
Rational< IntTypeoperator* (Rational< IntType > l, typename Rational< IntType >::param_type r)
 multiplication with right-hand IntType argument
 
template<class V , unsigned int R, unsigned int G, unsigned int B>
NumericTraits< RGBValue< V, R, G, B > >::RealPromote operator* (RGBValue< V, R, G, B > const &r, double v)
 component-wise right scalar multiplication
 
template<class V1 , unsigned int R, unsigned int G, unsigned int B, class V2 >
PromoteTraits< RGBValue< V1, R, G, B >, RGBValue< V2, R, G, B > >::Promote operator* (RGBValue< V1, R, G, B > const &r1, RGBValue< V2, R, G, B > const &r2)
 component-wise multiplication
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator* (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
 component-wise right scalar multiplication
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote operator* (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 component-wise multiplication
 
template<typename IntType >
Rational< IntTypeoperator* (typename Rational< IntType >::param_type l, Rational< IntType > r)
 multiplication with left-hand IntType argument
 
template<class R >
FFTWComplex< R > & operator*= (FFTWComplex< R > &a, const FFTWComplex< R > &b)
 multiply-assignment
 
template<class R >
FFTWComplex< R > & operator*= (FFTWComplex< R > &a, double b)
 multiply-assignment with scalar double
 
template<class V , unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
RGBValue< V, RIDX, GIDX, BIDX > & operator*= (RGBValue< V, RIDX, GIDX, BIDX > &l, double r)
 componentwise scalar multiply-assignment
 
template<class V1 , unsigned int RIDX1, unsigned int GIDX1, unsigned int BIDX1, class V2 , unsigned int RIDX2, unsigned int GIDX2, unsigned int BIDX2>
RGBValue< V1, RIDX1, GIDX1, BIDX1 > & operator*= (RGBValue< V1, RIDX1, GIDX1, BIDX1 > &l, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r)
 componentwise multiply-assignment
 
template<typename Type >
Quaternion< Type > operator+ (const Quaternion< Type > &t1, const Quaternion< Type > &t2)
 Addition.
 
template<typename Type >
Quaternion< Type > operator+ (const Quaternion< Type > &t1, const Type &t2)
 Addition of a scalar on the right.
 
template<typename IntType >
Rational< IntTypeoperator+ (const Rational< IntType > &r)
 unary plus
 
template<typename Type >
Quaternion< Type > operator+ (const Type &t1, const Quaternion< Type > &t2)
 Addition of a scalar on the left.
 
Diff2D operator+ (Diff2D const &a, Diff2D const &b)
 
template<class R >
FFTWComplex< R > operator+ (double a, FFTWComplex< R > b)
 left addition with scalar double
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator+ (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
 component-wise left scalar addition
 
template<class R >
FFTWComplex< R > operator+ (FFTWComplex< R > a, const FFTWComplex< R > &b)
 addition
 
template<class R >
FFTWComplex< R > operator+ (FFTWComplex< R > a, double b)
 right addition with scalar double
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
PromoteTraits< FixedPoint16< IntBits1, OverflowHandling >, FixedPoint16< IntBits2, OverflowHandling > >::Promote operator+ (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 addition with automatic determination of the appropriate result type.
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
FixedPointTraits< FixedPoint< IntBits1, FracBits1 >, FixedPoint< IntBits2, FracBits2 > >::PlusType operator+ (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 addition with automatic determination of the appropriate result type.
 
Point2D operator+ (Point2D const &a, Diff2D const &b)
 
template<typename IntType >
Rational< IntTypeoperator+ (Rational< IntType > l, Rational< IntType > const &r)
 addition
 
template<typename IntType >
Rational< IntTypeoperator+ (Rational< IntType > l, typename Rational< IntType >::param_type r)
 addition of right-hand IntType argument
 
template<class V1 , unsigned int R, unsigned int G, unsigned int B, class V2 >
PromoteTraits< RGBValue< V1, R, G, B >, RGBValue< V2, R, G, B > >::Promote operator+ (RGBValue< V1, R, G, B > const &r1, RGBValue< V2, R, G, B > const &r2)
 component-wise addition
 
Size2D operator+ (Size2D const &a, Diff2D const &b)
 
Point2D operator+ (Size2D const &s, Point2D const &p)
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator+ (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
 component-wise right scalar addition
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote operator+ (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 component-wise addition
 
template<typename IntType >
Rational< IntTypeoperator+ (typename Rational< IntType >::param_type l, Rational< IntType > r)
 addition of left-hand IntType argument
 
template<class R >
FFTWComplex< R > & operator+= (FFTWComplex< R > &a, const FFTWComplex< R > &b)
 add-assignment
 
template<class R >
FFTWComplex< R > & operator+= (FFTWComplex< R > &a, double b)
 add-assignment with scalar double
 
template<class V1 , unsigned int RIDX1, unsigned int GIDX1, unsigned int BIDX1, class V2 , unsigned int RIDX2, unsigned int GIDX2, unsigned int BIDX2>
RGBValue< V1, RIDX1, GIDX1, BIDX1 > & operator+= (RGBValue< V1, RIDX1, GIDX1, BIDX1 > &l, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r)
 componentwise add-assignment
 
template<typename Type >
Quaternion< Type > operator- (const Quaternion< Type > &t1, const Quaternion< Type > &t2)
 Subtraction.
 
template<typename Type >
Quaternion< Type > operator- (const Quaternion< Type > &t1, const Type &t2)
 Subtraction of a scalar on the right.
 
template<typename IntType >
Rational< IntTypeoperator- (const Rational< IntType > &r)
 unary minus (negation)
 
template<typename Type >
Quaternion< Type > operator- (const Type &t1, const Quaternion< Type > &t2)
 Subtraction of a scalar on the left.
 
Diff2D operator- (Diff2D const &a, Diff2D const &b)
 
template<class R >
FFTWComplex< R > operator- (double a, FFTWComplex< R > const &b)
 left subtraction with scalar double
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator- (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
 component-wise left scalar subtraction
 
template<class R >
FFTWComplex< R > operator- (FFTWComplex< R > a, const FFTWComplex< R > &b)
 subtraction
 
template<class R >
FFTWComplex< R > operator- (FFTWComplex< R > a, double b)
 right subtraction with scalar double
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
PromoteTraits< FixedPoint16< IntBits1, OverflowHandling >, FixedPoint16< IntBits2, OverflowHandling > >::Promote operator- (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 subtraction with automatic determination of the appropriate result type.
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
FixedPointTraits< FixedPoint< IntBits1, FracBits1 >, FixedPoint< IntBits2, FracBits2 > >::MinusType operator- (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 subtraction with automatic determination of the appropriate result type.
 
Point2D operator- (Point2D const &s, Diff2D const &offset)
 
Size2D operator- (Point2D const &s, Point2D const &p)
 
template<typename IntType >
Rational< IntTypeoperator- (Rational< IntType > l, Rational< IntType > const &r)
 subtraction
 
template<typename IntType >
Rational< IntTypeoperator- (Rational< IntType > l, typename Rational< IntType >::param_type r)
 subtraction of right-hand IntType argument
 
template<class V1 , unsigned int R, unsigned int G, unsigned int B, class V2 >
PromoteTraits< RGBValue< V1, R, G, B >, RGBValue< V2, R, G, B > >::Promote operator- (RGBValue< V1, R, G, B > const &r1, RGBValue< V2, R, G, B > const &r2)
 component-wise subtraction
 
Size2D operator- (Size2D const &s, Diff2D const &offset)
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator- (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
 component-wise right scalar subtraction
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZEoperator- (TinyVectorBase< V, SIZE, D1, D2 > const &v)
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote operator- (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 component-wise subtraction
 
template<typename IntType >
Rational< IntTypeoperator- (typename Rational< IntType >::param_type l, Rational< IntType > const &r)
 subtraction from left-hand IntType argument
 
template<class R >
FFTWComplex< R > & operator-= (FFTWComplex< R > &a, const FFTWComplex< R > &b)
 subtract-assignment
 
template<class R >
FFTWComplex< R > & operator-= (FFTWComplex< R > &a, double b)
 subtract-assignment with scalar double
 
template<class V1 , unsigned int RIDX1, unsigned int GIDX1, unsigned int BIDX1, class V2 , unsigned int RIDX2, unsigned int GIDX2, unsigned int BIDX2>
RGBValue< V1, RIDX1, GIDX1, BIDX1 > & operator-= (RGBValue< V1, RIDX1, GIDX1, BIDX1 > &l, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r)
 componentwise subtract-assignment
 
template<typename Type >
Quaternion< Type > operator/ (const Quaternion< Type > &t1, const Quaternion< Type > &t2)
 Division.
 
template<typename Type >
Quaternion< Type > operator/ (const Quaternion< Type > &t1, double t2)
 Division by a scalar.
 
template<typename Type >
Quaternion< Type > operator/ (double t1, const Quaternion< Type > &t2)
 Division of a scalar by a Quaternion.
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator/ (double v, TinyVectorBase< V, SIZE, D1, D2 > const &r)
 component-wise left scalar division
 
template<class R >
FFTWComplex< R > operator/ (FFTWComplex< R > a, const FFTWComplex< R > &b)
 division
 
template<class R >
FFTWComplex< R > operator/ (FFTWComplex< R > a, double b)
 right division with scalar double
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
PromoteTraits< FixedPoint16< IntBits1, OverflowHandling >, FixedPoint16< IntBits2, OverflowHandling > >::Promote operator/ (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 division with automatic determination of the appropriate result type.
 
template<typename IntType >
Rational< IntTypeoperator/ (Rational< IntType > l, Rational< IntType > const &r)
 division
 
template<typename IntType >
Rational< IntTypeoperator/ (Rational< IntType > l, typename Rational< IntType >::param_type r)
 division by right-hand IntType argument
 
template<class V , unsigned int R, unsigned int G, unsigned int B>
NumericTraits< RGBValue< V, R, G, B > >::RealPromote operator/ (RGBValue< V, R, G, B > const &r, double v)
 component-wise scalar division
 
template<class V1 , unsigned int R, unsigned int G, unsigned int B, class V2 >
PromoteTraits< RGBValue< V1, R, G, B >, RGBValue< V2, R, G, B > >::Promote operator/ (RGBValue< V1, R, G, B > const &r1, RGBValue< V2, R, G, B > const &r2)
 component-wise division
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< TinyVector< V, SIZE > >::RealPromote operator/ (TinyVectorBase< V, SIZE, D1, D2 > const &l, double v)
 component-wise right scalar division
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
PromoteTraits< TinyVector< V1, SIZE >, TinyVector< V2, SIZE > >::Promote operator/ (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 component-wise division
 
template<typename IntType >
Rational< IntTypeoperator/ (typename Rational< IntType >::param_type l, Rational< IntType > const &r)
 division of left-hand IntType argument
 
template<class R >
FFTWComplex< R > & operator/= (FFTWComplex< R > &a, const FFTWComplex< R > &b)
 divide-assignment
 
template<class R >
FFTWComplex< R > & operator/= (FFTWComplex< R > &a, double b)
 divide-assignment with scalar double
 
template<class V , unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
RGBValue< V, RIDX, GIDX, BIDX > & operator/= (RGBValue< V, RIDX, GIDX, BIDX > &l, double r)
 componentwise scalar divide-assignment
 
template<class V1 , unsigned int RIDX1, unsigned int GIDX1, unsigned int BIDX1, class V2 , unsigned int RIDX2, unsigned int GIDX2, unsigned int BIDX2>
RGBValue< V1, RIDX1, GIDX1, BIDX1 > & operator/= (RGBValue< V1, RIDX1, GIDX1, BIDX1 > &l, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r)
 componentwise divide-assignment
 
template<typename IntType1 , typename IntType2 >
bool operator< (const Rational< IntType1 > &l, const Rational< IntType2 > &r)
 less-than
 
template<typename IntType1 , typename IntType2 >
bool operator< (const Rational< IntType1 > &l, IntType2 const &i)
 less-than with right-hand IntType2 argument
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
bool operator< (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 less than
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool operator< (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 less than
 
template<typename IntType1 , typename IntType2 >
bool operator< (IntType1 const &l, Rational< IntType2 > const &r)
 less-than with left-hand IntType1 argument
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool operator< (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 lexicographical comparison
 
std::ostream & operator<< (std::ostream &os, const SIFImportInfo &info)
 
template<class V1 , int SIZE, class DATA , class DERIVED >
std::ostream & operator<< (std::ostream &out, TinyVectorBase< V1, SIZE, DATA, DERIVED > const &l)
 stream output
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
bool operator<= (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 less or equal
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool operator<= (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 less or equal
 
template<typename IntType1 , typename IntType2 >
bool operator<= (IntType1 const &l, Rational< IntType2 > const &r)
 less-equal with left-hand IntType1 argument
 
template<typename IntType1 , typename IntType2 >
bool operator<= (Rational< IntType1 > const &l, IntType2 const &r)
 less-equal with right-hand IntType2 argument
 
template<typename IntType1 , typename IntType2 >
bool operator<= (Rational< IntType1 > const &l, Rational< IntType2 > const &r)
 less-equal
 
template<typename IntType1 , typename IntType2 >
bool operator== (const Rational< IntType1 > &l, const Rational< IntType2 > &r)
 equality
 
template<typename IntType1 , typename IntType2 >
bool operator== (const Rational< IntType1 > &l, IntType2 const &i)
 equality with right-hand IntType2 argument
 
template<class R >
bool operator== (FFTWComplex< R > const &a, const FFTWComplex< R > &b)
 equal
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
bool operator== (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 equal
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool operator== (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 equal
 
template<typename IntType1 , typename IntType2 >
bool operator== (IntType1 const &l, Rational< IntType2 > const &r)
 equality with left-hand IntType1 argument
 
template<class V1 , unsigned int RIDX1, unsigned int GIDX1, unsigned int BIDX1, class V2 , unsigned int RIDX2, unsigned int GIDX2, unsigned int BIDX2>
bool operator== (RGBValue< V1, RIDX1, GIDX1, BIDX1 > const &l, RGBValue< V2, RIDX2, GIDX2, BIDX2 > const &r)
 component-wise equal
 
template<class V1 , int SIZE, class D1 , class D2 , class V2 , class D3 , class D4 >
bool operator== (TinyVectorBase< V1, SIZE, D1, D2 > const &l, TinyVectorBase< V2, SIZE, D3, D4 > const &r)
 component-wise equal
 
template<typename IntType1 , typename IntType2 >
bool operator> (const Rational< IntType1 > &l, IntType2 const &i)
 greater-than with right-hand IntType2 argument
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
bool operator> (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 greater
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool operator> (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 greater
 
template<typename IntType1 , typename IntType2 >
bool operator> (IntType1 const &l, Rational< IntType2 > const &r)
 greater-than with left-hand IntType1 argument
 
template<typename IntType1 , typename IntType2 >
bool operator> (Rational< IntType1 > const &l, Rational< IntType2 > const &r)
 greater-than
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2>
bool operator>= (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r)
 greater or equal
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2>
bool operator>= (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r)
 greater or equal
 
template<typename IntType1 , typename IntType2 >
bool operator>= (IntType1 const &l, Rational< IntType2 > const &r)
 greater-equal with left-hand IntType1 argument
 
template<typename IntType1 , typename IntType2 >
bool operator>= (Rational< IntType1 > const &l, IntType2 const &r)
 greater-equal with right-hand IntType2 argument
 
template<typename IntType1 , typename IntType2 >
bool operator>= (Rational< IntType1 > const &l, Rational< IntType2 > const &r)
 greater-equal
 
template<... >
void parallel_foreach (...)
 Apply a functor to all items in a range in parallel.
 
template<class NODE , class PREDECESSORS >
size_t pathLength (const NODE source, const NODE target, const PREDECESSORS &predecessors)
 get the length in node units of a path
 
template<... >
void pLSA (...)
 Decompose a matrix according to the pLSA algorithm.
 
TinyVector< float, 3 > polar2Lab (double color, double brightness, double saturation)
 Init L*a*b* color triple from polar representation.
 
TinyVector< float, 3 > polar2Luv (double color, double brightness, double saturation)
 Init L*u*v* color triple from polar representation.
 
TinyVector< float, 3 > polar2YPrimeCbCr (double color, double brightness, double saturation)
 Init Y'CbCr color triple from polar representation.
 
TinyVector< float, 3 > polar2YPrimeIQ (double color, double brightness, double saturation)
 Init Y'IQ color triple from polar representation.
 
TinyVector< float, 3 > polar2YPrimePbPr (double color, double brightness, double saturation)
 Init Y'PbPr color triple from polar representation.
 
TinyVector< float, 3 > polar2YPrimeUV (double color, double brightness, double saturation)
 Init Y'UV color triple from polar representation.
 
template<int PolynomOrder, class SrcPointIterator , class DestPointIterator >
linalg::TemporaryMatrix< doublepolynomialMatrix2DFromCorrespondingPoints (SrcPointIterator s, SrcPointIterator s_end, DestPointIterator d)
 Create polynomial matrix of a certain degree that maps corresponding points onto each other.
 
template<class POLYNOMIAL , class VECTOR >
bool polynomialRealRoots (POLYNOMIAL const &p, VECTOR &roots, bool polishRoots)
 
template<class POLYNOMIAL , class VECTOR >
bool polynomialRoots (POLYNOMIAL const &poriginal, VECTOR &roots, bool polishRoots)
 
template<... >
void polynomialWarpImage (...)
 Warp an image according to an polynomial transformation.
 
std::vector< doublepolynomialWarpWeights (double x, double y, unsigned int polynom_order)
 
template<typename IntType >
Rational< IntTypepow (const Rational< IntType > &r, int n)
 
template<class V , int SIZE, class D1 , class D2 , class E >
TinyVector< V, SIZEpow (TinyVectorBase< V, SIZE, D1, D2 > const &v, E exponent)
 
template<unsigned n, class V >
power (const V &x)
 Exponentiation to a positive integer power by squaring.
 
template<class T , class C1 , class C2 , class C3 >
void principalComponents (MultiArrayView< 2, T, C1 > const &features, MultiArrayView< 2, T, C2 > fz, MultiArrayView< 2, T, C3 > zv)
 Decompose a matrix according to the PCA algorithm.
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< V >::Promote prod (TinyVectorBase< V, SIZE, D1, D2 > const &l)
 product of the vector's elements
 
template<class BASE_GRAPH , class BASE_GRAPH_LABELS , class RAG_FEATURES , class BASE_GRAPH_FEATURES >
void projectBack (const AdjacencyListGraph &rag, const BASE_GRAPH &bg, const Int64 ignoreLabel, const BASE_GRAPH_LABELS bgLabels, const RAG_FEATURES &ragFeatures, BASE_GRAPH_FEATURES &bgFeatures)
 
template<class RAG , class BASE_GRAPH , class BASE_GRAPH_RAG_LABELS , class BASE_GRAPH_GT , class RAG_GT , class RAG_GT_QT >
void projectGroundTruth (const RAG &rag, const BASE_GRAPH &baseGraph, const BASE_GRAPH_RAG_LABELS &baseGraphRagLabels, const BASE_GRAPH_GT &baseGraphGt, RAG_GT &ragGt, RAG_GT_QT &)
 
template<class SrcPointIterator , class DestPointIterator >
linalg::TemporaryMatrix< doubleprojectiveMatrix2DFromCorrespondingPoints (SrcPointIterator s, SrcPointIterator send, DestPointIterator d)
 Create homogeneous matrix that maps corresponding points onto each other.
 
template<... >
void projectiveWarpImage (...)
 Warp an image according to an projective transformation.
 
template<... >
void pyramidExpandBurtFilter (...)
 Two-fold up-sampling for image pyramid reconstruction.
 
template<class Image , class Alloc >
void pyramidExpandBurtLaplacian (ImagePyramid< Image, Alloc > &pyramid, int fromLevel, int toLevel, double centerValue=0.4)
 Reconstruct a Laplacian pyramid.
 
template<... >
void pyramidReduceBurtFilter (...)
 Two-fold down-sampling for image pyramid construction.
 
template<class Image , class Alloc >
void pyramidReduceBurtLaplacian (ImagePyramid< Image, Alloc > &pyramid, int fromLevel, int toLevel, double centerValue=0.4)
 Create a Laplacian pyramid.
 
template<... >
bool quadraticNoiseNormalization (...)
 Noise normalization by means of an estimated or given quadratic noise model.
 
template<... >
unsigned int quadraticProgramming (...)
 
double radialGaborSigma (double centerFrequency)
 Calculate sensible radial sigma for given parameters.
 
template<... >
void radialSymmetryTransform (...)
 Find centers of radial symmetry in an image.
 
template<class RAGGRAPH , class GRAPH , class RAGEDGES , unsigned int N, class T >
MultiArray< 2, MultiArrayIndexragFindEdges (const RAGGRAPH &rag, const GRAPH &graph, const RAGEDGES &affiliatedEdges, MultiArrayView< N, T > labelsArray, const typename RAGGRAPH::Node &node)
 Find indices of points on the edges.
 
RandomMT19937randomMT19937 ()
 
RandomTT800randomTT800 ()
 
template<typename T , typename IntType >
rational_cast (const Rational< IntType > &src)
 
template<class RadialBasisFunctor , class SrcPointIterator , class DestPointIterator >
linalg::TemporaryMatrix< doublerbfMatrix2DFromCorrespondingPoints (SrcPointIterator s, SrcPointIterator s_end, DestPointIterator d, RadialBasisFunctor const &rbf)
 Create a matrix that maps corresponding points onto each other using a given RBF.
 
template<int ORDER, class T , class DestIterator , class DestAccessor , class DestPointIterator , class C , class RadialBasisFunctor >
void rbfWarpImage (SplineImageView< ORDER, T > const &src, DestIterator dul, DestIterator dlr, DestAccessor dest, DestPointIterator d, DestPointIterator d_end, MultiArrayView< 2, double, C > const &W, RadialBasisFunctor rbf)
 Warp an image according to an radial basis function based transformation.
 
template<... >
void readHDF5 (...)
 Read the data specified by the given vigra::HDF5ImportInfo object and write the into the given 'array'.
 
void readSIF (const SIFImportInfo &info, MultiArrayView< 3, float > array)
 Read the image data specified by the given vigra::SIFImportInfo object and write them into the given 'array'.
 
void readSIFBlock (const SIFImportInfo &info, Shape3 offset, Shape3 shape, MultiArrayView< 3, float > array)
 Read parts of the image data from an Andor SIF file specified with an SIFImportInfo object and write them into the MultiArray array.
 
template<class R >
real (const FFTWComplex< R > &a)
 real part
 
template<... >
void recursiveFilterLine (...)
 Performs a 1-dimensional recursive convolution of the source signal.
 
template<... >
void recursiveFilterX (...)
 Performs 1 dimensional recursive filtering (1st and 2nd order) in x direction.
 
template<... >
void recursiveFilterY (...)
 Performs 1 dimensional recursive filtering (1st and 2nd order) in y direction.
 
template<... >
void recursiveFirstDerivativeLine (...)
 Performs a 1 dimensional recursive convolution of the source signal.
 
template<... >
void recursiveFirstDerivativeX (...)
 Recursively calculates the 1 dimensional first derivative in x direction.
 
template<... >
void recursiveFirstDerivativeY (...)
 Recursively calculates the 1 dimensional first derivative in y direction.
 
template<... >
void recursiveGaussianFilterLine (...)
 Compute a 1-dimensional recursive approximation of Gaussian smoothing.
 
template<... >
void recursiveGaussianFilterX (...)
 Compute 1 dimensional recursive approximation of Gaussian smoothing in y direction.
 
template<... >
void recursiveGaussianFilterY (...)
 Compute 1 dimensional recursive approximation of Gaussian smoothing in y direction.
 
template<class GRAPH , class NODE_FEATURES_IN , class EDGE_INDICATOR , class NODE_FEATURES_OUT >
void recursiveGraphSmoothing (const GRAPH &g, const NODE_FEATURES_IN &nodeFeaturesIn, const EDGE_INDICATOR &edgeIndicator, const float lambda, const float edgeThreshold, const float scale, size_t iterations, NODE_FEATURES_OUT &nodeFeaturesBuffer, NODE_FEATURES_OUT &nodeFeaturesOut)
 smooth node features of a graph
 
template<... >
void recursiveSecondDerivativeLine (...)
 Performs a 1 dimensional recursive convolution of the source signal.
 
template<... >
void recursiveSecondDerivativeX (...)
 Recursively calculates the 1 dimensional second derivative in x direction.
 
template<... >
void recursiveSecondDerivativeY (...)
 Recursively calculates the 1 dimensional second derivative in y direction.
 
template<... >
void recursiveSmoothLine (...)
 Convolves the image with a 1-dimensional exponential filter.
 
template<... >
void recursiveSmoothX (...)
 Performs 1 dimensional recursive smoothing in x direction.
 
template<... >
void recursiveSmoothY (...)
 Performs 1 dimensional recursive smoothing in y direction.
 
template<... >
void reflectImage (...)
 Reflect image horizontally or vertically.
 
template<... >
void regionImageToCrackEdgeImage (...)
 Transform a labeled image into a crack edge (interpixel edge) image.
 
template<... >
void regionImageToEdgeImage (...)
 Transform a labeled image into an edge image.
 
template<... >
void removeShortEdges (...)
 Remove short edges from an edge image.
 
template<... >
void resampleImage (...)
 Resample image by a given factor.
 
template<... >
void resamplingConvolveImage (...)
 Apply two separable resampling filters successively, the first in x-direction, the second in y-direction.
 
template<... >
void resamplingConvolveLine (...)
 Performs a 1-dimensional resampling convolution of the source signal using the given set of kernels.
 
template<... >
void resamplingConvolveX (...)
 Apply a resampling filter in the x-direction.
 
template<... >
void resamplingConvolveY (...)
 Apply a resampling filter in the y-direction.
 
template<... >
void resizeImageCatmullRomInterpolation (...)
 Resize image using the Catmull/Rom interpolation function.
 
template<... >
void resizeImageCoscotInterpolation (...)
 Resize image using the Coscot interpolation function.
 
template<... >
void resizeImageLinearInterpolation (...)
 Resize image using linear interpolation.
 
template<... >
void resizeImageNoInterpolation (...)
 Resize image by repeating the nearest pixel values.
 
template<... >
void resizeImageSplineInterpolation (...)
 Resize image using B-spline interpolation.
 
template<... >
void resizeMultiArraySplineInterpolation (...)
 Resize MultiArray using B-spline interpolation.
 
template<class V , int SIZE>
TinyVector< V, SIZEreverse (TinyVector< V, SIZE > const &t)
 reversed copy
 
detail::RF_DEFAULT & rf_default ()
 factory function to return a RF_DEFAULT tag
 
template<class T , class Tag >
void rf_export_HDF5 (const RandomForest< T, Tag > &rf, const std::string &filename, const std::string &pathname="")
 Save a random forest to a named HDF5 file into a specified HDF5 group.
 
template<class T , class Tag >
void rf_export_HDF5 (const RandomForest< T, Tag > &rf, HDF5File &h5context, const std::string &pathname="")
 Save a random forest to an HDF5File object into a specified HDF5 group.
 
template<class T , class Tag >
void rf_export_HDF5 (const RandomForest< T, Tag > &rf, hid_t outf_id, const std::string &pathname="")
 Save a random forest to an HDF5 file specified by its id.
 
template<class T , class Tag >
bool rf_import_HDF5 (RandomForest< T, Tag > &rf, const std::string &filename, const std::string &pathname="")
 Read a random forest from a named HDF5 file's specified group.
 
template<class T , class Tag >
bool rf_import_HDF5 (RandomForest< T, Tag > &rf, HDF5File &h5context, const std::string &pathname="")
 Read a random forest from an HDF5File object's specified group.
 
template<class T , class Tag >
bool rf_import_HDF5 (RandomForest< T, Tag > &rf, hid_t inf_id, const std::string &pathname="")
 Read a random forest from an HDF5 file specified by its id.
 
template<... >
void rieszTransformOfLOG (...)
 Calculate Riesz transforms of the Laplacian of Gaussian.
 
template<... >
void rohrCornerDetector (...)
 Find corners in an image (3).
 
template<... >
void rotateImage (...)
 Rotate an image by a multiple of 90 degrees or by an arbitrary angle.
 
linalg::TemporaryMatrix< doublerotationMatrix2DDegrees (double angle)
 Create homogeneous matrix representing a 2D rotation about the coordinate origin.
 
linalg::TemporaryMatrix< doublerotationMatrix2DDegrees (double angle, TinyVector< double, 2 > const &center)
 Create homogeneous matrix representing a 2D rotation about the given point.
 
linalg::TemporaryMatrix< doublerotationMatrix2DRadians (double angle)
 Create homogeneous matrix representing a 2D rotation about the coordinate origin.
 
linalg::TemporaryMatrix< doublerotationMatrix2DRadians (double angle, TinyVector< double, 2 > const &center)
 Create homogeneous matrix representing a 2D rotation about the given point.
 
template<int IntBits, FPOverflowHandling OverflowHandling>
Int32 round (FixedPoint16< IntBits, OverflowHandling > v)
 rounding to the nearest integer.
 
template<unsigned IntBits, unsigned FracBits>
int round (FixedPoint< IntBits, FracBits > v)
 rounding to the nearest integer.
 
REAL round (REAL v)
 The rounding function.
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZEround (TinyVectorBase< V, SIZE, D1, D2 > const &v)
 
long long roundi (double t)
 Round and cast to integer.
 
template<int IntBits, FPOverflowHandling OverflowHandling>
Int32 roundi (FixedPoint16< IntBits, OverflowHandling > v)
 rounding to the nearest integer.
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< std::ptrdiff_t, SIZEroundi (TinyVectorBase< V, SIZE, D1, D2 > const &v)
 
linalg::TemporaryMatrix< doublescalingMatrix2D (double scalingFactor)
 Create homogeneous matrix representing a 2D uniform scaling about the coordinate origin.
 
linalg::TemporaryMatrix< doublescalingMatrix2D (double sx, double sy)
 Create homogeneous matrix representing a 2D non-uniform scaling about the coordinate origin.
 
template<... >
void secondOrderTotalVariationFilter (...)
 Performs Anisotropic Total Variation Regularization.
 
template<... >
void seededRegionGrowing (...)
 Region Segmentation by means of Seeded Region Growing.
 
template<... >
void seededRegionGrowing3D (...)
 Three-dimensional Region Segmentation by means of Seeded Region Growing.
 
template<... >
void separableConvolveMultiArray (...)
 Separated convolution on multi-dimensional arrays.
 
template<... >
void separableConvolveX (...)
 Performs a 1 dimensional convolution in x direction.
 
template<... >
void separableConvolveY (...)
 Performs a 1 dimensional convolution in y direction.
 
template<... >
void separableMultiDistance (...)
 Euclidean distance on multi-dimensional arrays.
 
template<... >
void separableMultiDistSquared (...)
 Euclidean distance squared on multi-dimensional arrays.
 
template<... >
void separableVectorDistance (...)
 Compute the vector distance transform of a N-dimensional binary array.
 
linalg::TemporaryMatrix< doubleshearMatrix2D (double s01, double s10)
 Create homogeneous matrix representing a 2D shearing.
 
template<class GRAPH , class WEIGHTS , class PREDECESSORS , class DISTANCE , class HEURSTIC >
void shortestPathAStar (const GRAPH &graph, const typename GRAPH::Node &source, const typename GRAPH::Node &target, const WEIGHTS &weights, PREDECESSORS &predecessors, DISTANCE &distance, const HEURSTIC &heuristic)
 Astar Shortest path search.
 
template<class T >
sign (T t)
 The sign function.
 
template<class T1 , class T2 >
T1 sign (T1 t1, T2 t2)
 The binary sign function.
 
template<class T >
int signi (T t)
 The integer sign function.
 
template<... >
void simpleSharpening (...)
 Perform simple sharpening function.
 
template<class REAL >
REAL sin_pi (REAL x)
 sin(pi*x).
 
template<... >
void skeletonizeImage (...)
 Skeletonization of all regions in a labeled 2D image.
 
template<... >
void slantedEdgeMTF (...)
 Determine the magnitude transfer function of the camera.
 
template<... >
unsigned int slicSuperpixels (...)
 Compute SLIC superpixels in arbitrary dimensions.
 
template<class T >
NumericTraits< T >::Promote sq (T t)
 The square function.
 
template<int IntBits, FPOverflowHandling OverflowHandling>
SquareRootTraits< FixedPoint16< IntBits, OverflowHandling > >::SquareRootResult sqrt (FixedPoint16< IntBits, OverflowHandling > v)
 square root.
 
template<unsigned IntBits, unsigned FracBits>
SquareRootTraits< FixedPoint< IntBits, FracBits > >::SquareRootResult sqrt (FixedPoint< IntBits, FracBits > v)
 square root.
 
template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZEsqrt (TinyVectorBase< V, SIZE, D1, D2 > const &v)
 
Int32 sqrti (Int32 v)
 Signed integer square root.
 
template<class R >
FFTWComplex< R >::SquaredNormType squaredNorm (const FFTWComplex< R > &a)
 squared norm (= squared magnitude)
 
template<typename IntType >
NormTraits< Rational< IntType > >::SquaredNormType squaredNorm (const Rational< IntType > &r)
 squared norm
 
template<int IntBits, FPOverflowHandling OverflowHandling>
NormTraits< FixedPoint16< IntBits, OverflowHandling > >::SquaredNormType squaredNorm (FixedPoint16< IntBits, OverflowHandling > v)
 squared norm (same as v*v).
 
template<unsigned IntBits, unsigned FracBits>
FixedPointTraits< FixedPoint< IntBits, FracBits >, FixedPoint< IntBits, FracBits > >::MultipliesType squaredNorm (FixedPoint< IntBits, FracBits > v)
 squared norm (same as v*v).
 
template<typename Type >
Quaternion< Type >::SquaredNormType squaredNorm (Quaternion< Type > const &q)
 squared norm
 
NormTraits< T >::SquaredNormType squaredNorm (T const &t)
 The squared norm of a numerical object.
 
template<class V , int SIZE>
TinyVector< V, SIZE >::SquaredNormType squaredNorm (TinyVector< V, SIZE > const &t)
 squared norm
 
template<class V1 , int SIZE, class D1 , class D2 >
TinyVectorBase< V1, SIZE, D1, D2 >::SquaredNormType squaredNorm (TinyVectorBase< V1, SIZE, D1, D2 > const &t)
 squared norm
 
template<... >
void structureTensor (...)
 Calculate the Structure Tensor for each pixel of and image, using Gaussian (derivative) filters.
 
template<... >
void structureTensorMultiArray (...)
 Calculate the structure tensor of a multi-dimensional arrays.
 
template<int IntBits1, FPOverflowHandling OverflowHandling, int IntBits2, int IntBits3>
FixedPoint16< IntBits3, OverflowHandling > & sub (FixedPoint16< IntBits1, OverflowHandling > l, FixedPoint16< IntBits2, OverflowHandling > r, FixedPoint16< IntBits3, OverflowHandling > &result)
 subtraction with enforced result type.
 
template<unsigned IntBits1, unsigned FracBits1, unsigned IntBits2, unsigned FracBits2, unsigned IntBits3, unsigned FracBits3>
void sub (FixedPoint< IntBits1, FracBits1 > l, FixedPoint< IntBits2, FracBits2 > r, FixedPoint< IntBits3, FracBits3 > &result)
 subtraction with enforced result type.
 
template<class V , int SIZE, class D1 , class D2 >
NumericTraits< V >::Promote sum (TinyVectorBase< V, SIZE, D1, D2 > const &l)
 sum of the vector's elements
 
template<class T >
void symmetric2x2Eigenvalues (T a00, T a01, T a11, T *r0, T *r1)
 Compute the eigenvalues of a 2x2 real symmetric matrix.
 
template<class T >
void symmetric3x3Eigenvalues (T a00, T a01, T a02, T a11, T a12, T a22, T *r0, T *r1, T *r2)
 Compute the eigenvalues of a 3x3 real symmetric matrix.
 
template<... >
void symmetricGradientMultiArray (...)
 Calculate gradient of a multi-dimensional arrays using symmetric difference filters.
 
template<... >
void tensorDeterminantMultiArray (...)
 Calculate the tensor determinant for every element of a ND tensor array.
 
template<... >
void tensorEigenRepresentation (...)
 Calculate eigen representation of a symmetric 2x2 tensor.
 
template<... >
void tensorEigenvaluesMultiArray (...)
 Calculate the tensor eigenvalues for every element of a N-D tensor array.
 
template<... >
void tensorToEdgeCorner (...)
 Decompose a symmetric 2x2 tensor into its edge and corner parts.
 
template<... >
void tensorTrace (...)
 Calculate the trace of a 2x2 tensor.
 
template<... >
void tensorTraceMultiArray (...)
 Calculate the tensor trace for every element of a N-D tensor array.
 
template<... >
void tiffToRGBImage (...)
 Import a RGB (3-band or color-mapped) TiffImage into a RGB image.
 
template<... >
void tiffToScalarImage (...)
 Convert single-band TiffImage to scalar image.
 
std::string tolower (std::string s)
 
template<... >
void totalVariationFilter (...)
 Performs standard Total Variation Regularization.
 
template<... >
void transformImage (...)
 Apply unary point transformation to each pixel.
 
template<... >
void transformImageIf (...)
 Apply unary point transformation to each pixel within the ROI (i.e., where the mask is non-zero).
 
template<... >
void transformMultiArray (...)
 Transform a multi-dimensional array with a unary function or functor.
 
template<class SplineImage , class DestIterator , class DestAccessor >
void transformToPolarCoordinates (SplineImage const &src, DestIterator d_ul, DestIterator d_lr, DestAccessor d_acc)
 Transforms a given image to its (image-centered) polar coordinates representation.
 
linalg::TemporaryMatrix< doubletranslationMatrix2D (TinyVector< double, 2 > const &shift)
 Create homogeneous matrix representing a 2D translation.
 
template<class V , int SIZE, class T >
TinyVector< V, SIZEtranspose (TinyVector< V, SIZE > const &t, TinyVector< T, SIZE > const &permutation)
 transposed copy
 
template<... >
void transposeImage (...)
 Transpose an image over the major or minor diagonal.
 
void uncompress (char const *source, std::size_t srcSize, char *dest, std::size_t destSize, CompressionMethod method)
 
template<... >
unsigned int unionFindWatershedsBlockwise (...)
 Blockwise union-find watersheds transform for MultiArrays and ChunkedArrays.
 
template<... >
void upwindImage (...)
 This function calculates discrete upwinding scheme proposed by J. Weickert (2002) in Coherence-Enhancing Show Filters.
 
template<... >
void vectorToTensor (...)
 Calculate the tensor (outer) product of a 2D vector with itself.
 
template<... >
void vectorToTensorMultiArray (...)
 Calculate the tensor (outer) product of a N-D vector with itself.
 
template<... >
unsigned int watersheds3D (...)
 Region Segmentation by means of the watershed algorithm.
 
template<... >
Label watershedsMultiArray (...)
 Watershed segmentation of an arbitrary-dimensional array.
 
template<... >
unsigned int watershedsRegionGrowing (...)
 Region segmentation by means of a flooding-based watershed algorithm.
 
template<... >
unsigned int watershedsUnionFind (...)
 Region segmentation by means of the union-find watershed algorithm.
 
template<... >
void writeHDF5 (...)
 Store array data in an HDF5 file.
 
template<class T >
void writeHDF5Attr (hid_t loc, const char *name, ArrayVectorView< T > &array)
 
template<size_t N, class C >
void writeHDF5Attr (hid_t loc, const char *name, MultiArrayView< N, std::string, C > const &array)
 
template<size_t N, class T , class C >
void writeHDF5Attr (hid_t loc, const char *name, MultiArrayView< N, T, C > const &array)
 
template<class Arr >
void writeHDF5Attr (std::string filePath, std::string pathInFile, Arr &ar)
 
template<class V >
TinyVector< float, 3 > yPrimeCbCr2Polar (V const &ycbcr)
 Create polar representation form Y'CbCr.
 
template<class V >
TinyVector< float, 3 > yPrimeIQ2Polar (V const &yiq)
 Create polar representation form Y'IQ.
 
template<class V >
TinyVector< float, 3 > yPrimePbPr2Polar (V const &ypbpr)
 Create polar representation form Y'PbPr.
 
template<class V >
TinyVector< float, 3 > yPrimeUV2Polar (V const &yuv)
 Create polar representation form Y'UV.
 

Detailed Description

all VIGRA functionality is located in namespace vigra

This header provides definitions of graph-related algorithms

This header provides definitions of graph-related types and optionally provides a gateway to popular graph libraries (for now, BGL is supported).

Typedef Documentation

◆ FFTWRealImage

Float (fftw_real) image.

The type fftw_real is defined as double (in FFTW 2 it used to be either float or double, as specified during compilation of FFTW). FFTWRealImage uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/fftw3.hxx> (for FFTW 3) or
#include <vigra/fftw.hxx> (for deprecated FFTW 2)
Namespace: vigra

◆ FFTWComplexImage

Complex (FFTWComplex) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/fftw3.hxx> (for FFTW 3) or
#include <vigra/fftw.hxx> (for deprecated FFTW 2)
Namespace: vigra

◆ CoordinateIterator

Simulate an image where each pixel contains its coordinate.

CoordinateIterator used to be a separate class, but has now become an alias for vigra::Diff2D. This is possible because Diff2D now provides all the necessary functionality.

CoordinateIterator behaves like a read-only vigra::ImageIterator for an image in which each pixel contains its coordinate. This is useful for algorithms that need access to the current pixel's location. For example, you can use CoordinateIterator/Diff2D to find the center of mass of an image region. To implement this, we first need a functor for center-of-mass calculations:

{
: x(0.0), y(0.0), size(0)
{}
void operator()(Diff2d const& diff)
{
++size;
x += diff.x;
y += diff.y;
}
float xCenter() const
{ return x / size; }
float yCenter() const
{ return y / size; }
float x;
float y;
int size;
};
Class for a single RGB value.
Definition rgbvalue.hxx:128
RGBValue()
Definition rgbvalue.hxx:209
size_type size() const
Definition tinyvector.hxx:913

Using this functor, we find the center of mass like so:

... // mark a region in the image with '1', background with '0'
srcIterRange(Diff2D(), Diff2D() + img.size()),
srcImage(img),
center);
std::cout << "Center of mass: " << center.xCenter() <<
", " << center.yCenter() << std::endl;
Two dimensional difference vector.
Definition diff2d.hxx:186
void inspectImageIf(...)
Apply read-only functor to every pixel in the ROI.

#include <vigra/imageiterator.hxx>
Namespace: vigra

◆ MultiArrayIndex

typedef std::ptrdiff_t MultiArrayIndex

Index type for a single dimension of a MultiArrayView or MultiArray.

◆ FourNeighborCode

Export vigra::FourNeighborhood::NeighborCode into the scope of namespace vigra.

◆ EightNeighborCode

Export vigra::EightNeighborhood::NeighborCode into the scope of namespace vigra.

◆ EightNeighborOffsetCirculator

Specialization of NeighborOffsetCirculator for 8-neighborhood.

◆ FourNeighborOffsetCirculator

Specialization of NeighborOffsetCirculator for 4-neighborhood.

◆ RandomTT800

typedef RandomNumberGenerator<detail::RandomState<detail::TT800> > RandomTT800

Shorthand for the TT800 random number generator class.

◆ TemperedTwister

typedef RandomNumberGenerator<detail::RandomState<detail::TT800> > TemperedTwister

Shorthand for the TT800 random number generator class (same as RandomTT800).

◆ RandomMT19937

typedef RandomNumberGenerator<detail::RandomState<detail::MT19937> > RandomMT19937

Shorthand for the MT19937 random number generator class.

◆ MersenneTwister

typedef RandomNumberGenerator<detail::RandomState<detail::MT19937> > MersenneTwister

Shorthand for the MT19937 random number generator class (same as RandomMT19937).

◆ GiniRidgeSplit

Standard ridge regression split

◆ BImage

Byte (8-bit unsigned) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ UInt8Image

Byte (8-bit unsigned) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ Int8Image

Signed byte (8-bit signed) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ SImage

Short integer (16-bit signed) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ UInt16Image

Short integer (16-bit unsigned) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ Int16Image

Short integer (16-bit signed) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ IImage

Integer (32-bit signed) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ UInt32Image

Integer (32-bit unsigned) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ Int32Image

Integer (32-bit signed) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ FImage

Float (float) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ DImage

Double (double) image. It uses vigra::BasicImageIterator and vigra::StandardAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ BRGBImage

Byte (3x 8-bit unsigned) RGB image. The pixel type is vigra::RGBValue<vigra::UInt8>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ UInt8RGBImage

Byte (3x 8-bit unsigned) RGB image. The pixel type is vigra::RGBValue<vigra::UInt8>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ Int8RGBImage

Byte (3x 8-bit signed) RGB image. The pixel type is vigra::RGBValue<vigra::UInt8>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ SRGBImage

Short (3x 16-bit signed) RGB image. The pixel type is vigra::RGBValue<vigra::Int16>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ UInt16RGBImage

Short (3x 16-bit unsigned) RGB image. The pixel type is vigra::RGBValue<vigra::Int16>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ Int16RGBImage

Short (3x 16-bit signed) RGB image. The pixel type is vigra::RGBValue<vigra::Int16>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ IRGBImage

Integer (3x 32-bit signed) RGB image. The pixel type is vigra::RGBValue<vigra::Int32>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ UInt32RGBImage

Integer (3x 32-bit unsigned) RGB image. The pixel type is vigra::RGBValue<vigra::Int32>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ Int32RGBImage

Integer (3x 32-bit signed) RGB image. The pixel type is vigra::RGBValue<vigra::Int32>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ FRGBImage

Floating-point (3x float) RGB image. The pixel type is vigra::RGBValue<float>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ DRGBImage

Double-precision floating-point (3x double) RGB image. The pixel type is vigra::RGBValue<double>. It uses vigra::BasicImageIterator and vigra::RGBAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ FVector2Image

Floating-point TinyVector image. The pixel type is vigra::TinyVector<float, 2>. It uses vigra::BasicImageIterator and vigra::VectorAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ FVector3Image

Floating-point TinyVector image. The pixel type is vigra::TinyVector<float, 3>. It uses vigra::BasicImageIterator and vigra::VectorAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ FVector4Image

Floating-point TinyVector image. The pixel type is vigra::TinyVector<float, 4>. It uses vigra::BasicImageIterator and vigra::VectorAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ DVector2Image

Floating-point TinyVector image. The pixel type is vigra::TinyVector<double, 2>. It uses vigra::BasicImageIterator and vigra::VectorAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ DVector3Image

Floating-point TinyVector image. The pixel type is vigra::TinyVector<double, 3>. It uses vigra::BasicImageIterator and vigra::VectorAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ DVector4Image

Floating-point TinyVector image. The pixel type is vigra::TinyVector<double, 4>. It uses vigra::BasicImageIterator and vigra::VectorAccessor and their const counterparts to access the data.

#include <vigra/stdimage.hxx>
Namespace: vigra

◆ AtVolumeBorder

Encode whether a voxel is near the volume border.

This enum is used with isAtVolumeBorder() and vigra::RestrictedNeighborhoodCirculator.

#include <vigra/voxelneighborhood.hxx>
Namespace: vigra

◆ NeighborCode3DSix

Export vigra::Neighborhood3DSix::NeighborCode3D into the scope of namespace vigra.

◆ NeighborCode3DTwentySix

Export vigra::Neighborhood3DTwentySix::NeighborCode3D into the scope of namespace vigra.

Enumeration Type Documentation

◆ BoundaryDistanceTag

Specify which boundary is used for boundaryMultiDistance().

Enumerator
OuterBoundary 

Pixels just outside of each region.

InterpixelBoundary 

Half-integer points between pixels of different labels.

InnerBoundary 

Pixels just inside of each region.

◆ MultiArrayInitializationTag

Initialize a MultiArray in a standard way.

Enumerator
LinearSequence 

Initialize array by a linear sequence in scan order.

◆ NeighborhoodType

Choose the neighborhood system in a dimension-independent way.

DirectNeighborhood corresponds to 4-neighborhood in 2D and 6-neighborhood in 3D, whereas IndirectNeighborhood means 8-neighborhood in 2D and 26-neighborhood in 3D. The general formula for N dimensions are 2*N for direct neighborhood and 3^N-1 for indirect neighborhood.

Enumerator
DirectNeighborhood 

use only direct neighbors

IndirectNeighborhood 

use direct and indirect neighbors

◆ AtImageBorder

Encode whether a point is near the image border.

This enum is used with isAtImageBorder() and vigra::RestrictedNeighborhoodCirculator.

#include <vigra/pixelneighborhood.hxx>
Namespace: vigra

Enumerator
NotAtBorder 

 

RightBorder 

 

LeftBorder 

 

TopBorder 

 

BottomBorder 

 

FrontBorder 

 

◆ RF_OptionTag

tags used with the RandomForestOptions class

See also
RF_Traits::Option_t

◆ SRGType

Choose between different types of Region Growing

Function Documentation

◆ affineMatrix2DFromCorrespondingPoints()

linalg::TemporaryMatrix< double > affineMatrix2DFromCorrespondingPoints ( SrcIterator  s,
SrcIterator  send,
DestIterator  d 
)

Create homogeneous matrix that maps corresponding points onto each other.

For use with affineWarpImage(). When only two corresponding points are given, the matrix will only represent a similarity transform (translation, rotation, and uniform scaling). When only one point pair is given, the result will be a pure translation.

◆ estimateTranslation()

template<... >
void estimateTranslation (   ...)

Estimate the optical flow between two images according to a translation model.

This function applies the same algorithm as estimateAffineTransform() with the additional constraint that the motion model must be a translation rather than affine.

Declarations:

#include <vigra/affine_registration.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
void
}
void estimateTranslation(...)
Estimate the optical flow between two images according to a translation model.

show deprecated declarations

◆ estimateSimilarityTransform()

template<... >
void estimateSimilarityTransform (   ...)

Estimate the optical flow between two images according to a similarity transform model (e.g. translation, rotation, and uniform scaling).

This function applies the same algorithm as estimateAffineTransform() with the additional constraint that the motion model must be a similarity transform rather than affine.

Declarations:

#include <vigra/affine_registration.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
void
}
void estimateSimilarityTransform(...)
Estimate the optical flow between two images according to a similarity transform model (e....

show deprecated declarations

◆ estimateAffineTransform()

template<... >
void estimateAffineTransform (   ...)

Estimate the optical flow between two images according to an affine transform model (e.g. translation, rotation, non-uniform scaling, and shearing).

This function implements the algorithm described in

J.R. Bergen, P. Anandan, K.J. Hanna, R. Hingorani: "Hierarchical model-based motion estimation", ECCV 1992

Specifically, it minimizes the squared loss between the images I at two consecutive time points t-1 and t:

\[ \min_{\theta} \sum_{\mathbf{x}} \left(I(\mathbf{x}, t) - I(\mathbf{x} - \mathbf{u}_{\theta}(\mathbf{x}), t-1)\right)^2
\]

where $\mathbf{x}$ are the pixel coordinates and $\mathbf{u}_{\theta}(\mathbf{x})$ is an affine motion model parameterized by $\theta$. Since the objective is non-linear, it is linearized by first-order Taylor expansion w.r.t. $\theta$, and a local optimum is determined iteratively by the Gauss-Newton method. To handle larger displacements, the algorithm employs a coarse-to-fine strategy, where the motion is first estimated on downsampled versions of the images and then refined at consecutively higher resolutions.

The algorithm's parameters can be controlled by the option object vigra::AffineMotionEstimationOptions. In particular, one can determine if

  • I in the objective refers to the original images (default) or their second derivatives (options.useLaplacianPyramid() – makes motion estimation invariant against additive intensity offsets);
  • the highest pyramid level to be used (options.highestPyramidLevel(h) – images are downsampled to 2-h times their original size, default: h=4);
  • the number of Gauss-Newton iterations per resolution level (options.iterationsPerLevel(i), default: i=4);
  • the interpolation order to compute subpixel intensities $I(\mathbf{x} - \mathbf{u}_{\theta}(\mathbf{x}), t-1)$ (default: 2)

The resulting affine model is stored in parameter affineMatrix, which can be used by affineWarpImage() to apply the transformation to time frame t-1. See documentation there for the precise meaning of the matrix elements.

Declarations:

#include <vigra/affine_registration.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
void
}
void estimateAffineTransform(...)
Estimate the optical flow between two images according to an affine transform model (e....

show deprecated declarations

◆ transformToPolarCoordinates()

void transformToPolarCoordinates ( SplineImage const src,
DestIterator  d_ul,
DestIterator  d_lr,
DestAccessor  d_acc 
)

Transforms a given image to its (image-centered) polar coordinates representation.

This algorithm transforms a given image (by means of an spline image view) to its image-centered polar coordinates reprensentation. The sampling of the polar coordinate system is determined by the shape of the dest. image.

Declarations:

#include <vigra/affine_registration_fft.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class SplineImage,
class T1, class S1>
void
}
void transformToPolarCoordinates(SplineImage const &src, DestIterator d_ul, DestIterator d_lr, DestAccessor d_acc)
Transforms a given image to its (image-centered) polar coordinates representation.
Definition affine_registration_fft.hxx:112

show deprecated declarations

◆ estimateGlobalRotation()

template<... >
void estimateGlobalRotation (   ...)

Estimate the rotation between two images by means of a normalized cross correlation matching of the FFT spectra.

This algorithm uses the fast normalized cross correlation to determine a global rotation between two images (from image2 to image1). To derive the rotation, the algorithm performs the following steps:

  1. Transforming both images to the frequency domain using FFTW
  2. Create LogAbs PolarCoordinate representations for each spectrum.
  3. Determining the final Rotation by performing a fast normalized cross correlation based on the polar representations.

The images are cropped to the corresponding images center-squared before the estimation takes place.

Declarations:

#include <vigra/affine_registration_fft.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void estimateGlobalRotation(...)
Estimate the rotation between two images by means of a normalized cross correlation matching of the F...

show deprecated declarations

◆ estimateGlobalTranslation()

template<... >
void estimateGlobalTranslation (   ...)

Estimate the translation between two images by means of a normalized cross correlation matching.

This algorithm uses the fast normalized cross correlation to determine a global translation between two images (from image2 to image1). To derive the translation, the algorithm consists of differents steps:

  1. Separation of the second image
    The second image (the one, for which the translation shall be determined) is cut into five subregions: UpperLeft, UpperRight, Center, LowerLeft and LowerRight, each of 1/4 the size of the original image. Using a border > 0 results in (all) overlapping regions.
  2. Cross-Correlation of the subimages to the first image
    The subimages are normalized cross-correlated to the (complete) first image. The resulting maximum-likelihood translations and the correlation coefficients are stored for the next step.
  3. Determining the final Translation by voting
    Each correlation vector gets one vote at the beginning. For each equality of derived motion vectors, the voting to these vectors is incremented. If the maximum number of votes is larger than 1, the vector with the most votes is chosen. If the maximum number of votes is 1, the vector with the maximum likelihood is choosen.

Declarations:

#include <vigra/affine_registration_fft.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
Diff2D border = Diff2D(0,0));
}
void estimateGlobalTranslation(...)
Estimate the translation between two images by means of a normalized cross correlation matching.

show deprecated declarations

◆ estimateGlobalRotationTranslation()

template<... >
void estimateGlobalRotationTranslation (   ...)

Estimate the (global) rotation and translation between two images by means a normalized cross correlation matching.

This algorithm use the functions estimateGlobalRotation() and estimateGlobalTranslation() to estimate a matrix which describes the global rotation and translation from the second to the first image.

Declarations:

#include <vigra/affine_registration_fft.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
Diff2D border = Diff2D(0,0));
}
void estimateGlobalRotationTranslation(...)
Estimate the (global) rotation and translation between two images by means a normalized cross correla...

show deprecated declarations

◆ translationMatrix2D()

linalg::TemporaryMatrix< double > translationMatrix2D ( TinyVector< double, 2 > const shift)

Create homogeneous matrix representing a 2D translation.

For use with affineWarpImage().

◆ scalingMatrix2D() [1/2]

linalg::TemporaryMatrix< double > scalingMatrix2D ( double  scalingFactor)

Create homogeneous matrix representing a 2D uniform scaling about the coordinate origin.

For use with affineWarpImage().

◆ scalingMatrix2D() [2/2]

linalg::TemporaryMatrix< double > scalingMatrix2D ( double  sx,
double  sy 
)

Create homogeneous matrix representing a 2D non-uniform scaling about the coordinate origin.

For use with affineWarpImage().

◆ shearMatrix2D()

linalg::TemporaryMatrix< double > shearMatrix2D ( double  s01,
double  s10 
)

Create homogeneous matrix representing a 2D shearing.

For use with affineWarpImage().

◆ rotationMatrix2DRadians() [1/2]

linalg::TemporaryMatrix< double > rotationMatrix2DRadians ( double  angle)

Create homogeneous matrix representing a 2D rotation about the coordinate origin.

For use with affineWarpImage(). Angle must be in radians.

◆ rotationMatrix2DDegrees() [1/2]

linalg::TemporaryMatrix< double > rotationMatrix2DDegrees ( double  angle)

Create homogeneous matrix representing a 2D rotation about the coordinate origin.

For use with affineWarpImage(). Angle must be in degrees.

◆ rotationMatrix2DRadians() [2/2]

linalg::TemporaryMatrix< double > rotationMatrix2DRadians ( double  angle,
TinyVector< double, 2 > const center 
)

Create homogeneous matrix representing a 2D rotation about the given point.

For use with affineWarpImage(). Angle must be in radians.

◆ rotationMatrix2DDegrees() [2/2]

linalg::TemporaryMatrix< double > rotationMatrix2DDegrees ( double  angle,
TinyVector< double, 2 > const center 
)

Create homogeneous matrix representing a 2D rotation about the given point.

For use with affineWarpImage(). Angle must be in degrees.

◆ affineWarpImage()

template<... >
void affineWarpImage (   ...)

Warp an image according to an affine transformation.

Declarations:

pass 2D array views:

namespace vigra {
template <int ORDER, class T,
class T2, class S2,
class C>
void
}
void affineWarpImage(...)
Warp an image according to an affine transformation.

show deprecated declarations

The algorithm applies the given affineMatrix to the destination coordinates and copies the image value from the resulting source coordinates, using the given SplineImageView src for interpolation. If the resulting coordinate is outside the source image, nothing will be written at that destination point.

The matrix represents a 2-dimensional affine transform by means of homogeneous coordinates, i.e. it must be a 3x3 matrix whose last row is (0,0,1).

Usage:

#include <vigra/affinegeometry.hxx>
Namespace: vigra

MultiArray<2, float> src(width, height);
// equivalent (up to round-off errors) to
// rotateImage(spline, dest1, 45.0);
TinyVector<double, 2> center((width-1.0)/2.0, (height-1.0)/2.0);
MultiArray<2, float> dest2(2*width-1, 2*height-1);
// equivalent (up to round-off errors) to
// resizeImageSplineInterpolation(img, dest2);
// note that scaleFactor = 0.5, because we must pass the transformation from destination to source
linalg::TemporaryMatrix< double > scalingMatrix2D(double scalingFactor)
Create homogeneous matrix representing a 2D uniform scaling about the coordinate origin.
Definition affinegeometry.hxx:77
linalg::TemporaryMatrix< double > rotationMatrix2DDegrees(double angle)
Create homogeneous matrix representing a 2D rotation about the coordinate origin.
Definition affinegeometry.hxx:133

show deprecated examples

See also: Functions to specify affine transformation: translationMatrix2D(), scalingMatrix2D(), shearMatrix2D(), rotationMatrix2DRadians(), rotationMatrix2DDegrees()

◆ argMin()

template<class Iterator >
Iterator argMin ( Iterator  first,
Iterator  last 
)

Find the minimum element in a sequence.

The function returns the iterator referring to the minimum element. This is identical to the function std::min_element().

Required Interface:

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ argMax()

template<class Iterator >
Iterator argMax ( Iterator  first,
Iterator  last 
)

Find the maximum element in a sequence.

The function returns the iterator referring to the maximum element. This is identical to the function std::max_element().

Required Interface:

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ argMinIf()

template<class Iterator , class UnaryFunctor >
Iterator argMinIf ( Iterator  first,
Iterator  last,
UnaryFunctor  condition 
)

Find the minimum element in a sequence conforming to a condition.

The function returns the iterator referring to the minimum element, where only elements conforming to the condition (i.e. where condition(*iterator) evaluates to true) are considered. If no element conforms to the condition, or the sequence is empty, the end iterator last is returned.

Required Interface:

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ argMaxIf()

template<class Iterator , class UnaryFunctor >
Iterator argMaxIf ( Iterator  first,
Iterator  last,
UnaryFunctor  condition 
)

Find the maximum element in a sequence conforming to a condition.

The function returns the iterator referring to the maximum element, where only elements conforming to the condition (i.e. where condition(*iterator) evaluates to true) are considered. If no element conforms to the condition, or the sequence is empty, the end iterator last is returned.

Required Interface:

Iterator is a standard forward iterator.
bool c = condition(*first);

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ linearSequence()

template<class Iterator , class Value >
void linearSequence ( Iterator  first,
Iterator  last,
Value  start,
Value  step 
)

Fill an array with a sequence of numbers.

The sequence starts at start and is incremented with step. Default start and stepsize are 0 and 1 respectively. This is a generalization of function std::iota() in C++11.

Declaration:

namespace vigra {
template <class Iterator, class Value>
void linearSequence(Iterator first, Iterator last,
Value const & start = 0, Value const & step = 1);
}
void linearSequence(Iterator first, Iterator last, Value start, Value step)
Fill an array with a sequence of numbers.
Definition algorithm.hxx:208

Required Interface:

Iterator is a standard forward iterator.
*first = start;
start += step;

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ inspectSequence()

template<... >
void inspectSequence (   ...)

Call an analyzing functor at every element of a sequence.

This function can be used to collect statistics of the sequence [first, last) defined by these two input interators. The results must be stored in the functor, which serves as a return value.

Declarations:

namespace vigra {
template <class InputIterator, class Functor>
void
inspectSequence(InputIterator first, InputIterator last, Functor & f);
}
void inspectSequence(...)
Call an analyzing functor at every element of a sequence.

Usage:

#include <vigra/algorithm.hxx>
Namespace: vigra

std::vector array(100);
// init functor
vigra::inspectSequence(array.begin(), array.end(), minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;

◆ makeIndexComparator()

template<class ArrayLike , class Compare >
detail::IndexCompare< ArrayLike, Compare > makeIndexComparator ( ArrayLike  a,
Compare  c 
)

Create a compare functor for indirect sort.

Indirect sorting refers to the situation where you have an array holding data and another array holding indices referencing the first array, and you want to sort the index array according to some property of the data array without changing the data array itself. The factory function makeIndexComparator() creates a sorting predicate for this task, given a sorting predicate for the data array.

See also
vigra::indexSort(), vigra::applyPermutation()

Usage:

#include <vigra/algorithm.hxx>
Namespace: vigra

const std:vector<double> data(...); // data is immutable
std::vector<int> index(data.size());
std::iota(index.begin(), index.end());
// sort the indices such that data[index[k]] is an ascending sequence in k
std::sort(index.begin(), index.end(), makeIndexComparator(data));
detail::IndexCompare< ArrayLike, Compare > makeIndexComparator(ArrayLike a, Compare c)
Create a compare functor for indirect sort.
Definition algorithm.hxx:356

Declarations:

namespace vigra {
// compare using std::less
template <class ArrayLike>
// compare using functor Compare
template <class ArrayLike, class Compare>
auto makeIndexComparator(ArrayLike a, Compare c);
}

◆ indexSort()

template<class Iterator , class IndexIterator , class Compare >
void indexSort ( Iterator  first,
Iterator  last,
IndexIterator  index_first,
Compare  c 
)

Return the index permutation that would sort the input array.

To actually sort an array according to the ordering thus determined, use applyPermutation().

Usage:

#include <vigra/algorithm.hxx>
Namespace: vigra

const std:vector<double> data(...); // data is immutable
std::vector<int> index(data.size());
// arrange indices such that data[index[k]] is an ascending sequence in k
indexSort(data.begin(), data.end(), index.begin());
void indexSort(Iterator first, Iterator last, IndexIterator index_first, Compare c)
Return the index permutation that would sort the input array.
Definition algorithm.hxx:414

Declarations:

namespace vigra {
// compare using std::less
template <class Iterator, class IndexIterator>
void indexSort(Iterator first, Iterator last, IndexIterator index_first);
// compare using functor Compare
template <class Iterator, class IndexIterator, class Compare>
void indexSort(Iterator first, Iterator last, IndexIterator index_first, Compare compare);
}

Required Interface:

bool res = compare(first[*index_first], first[*index_first]);

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ applyPermutation()

template<class IndexIterator , class InIterator , class OutIterator >
void applyPermutation ( IndexIterator  index_first,
IndexIterator  index_last,
InIterator  in,
OutIterator  out 
)

Sort an array according to the given index permutation.

The iterators in and out may not refer to the same array, as this would overwrite the input prematurely.

Declaration:

namespace vigra {
template <class IndexIterator, class InIterator, class OutIterator>
void applyPermutation(IndexIterator index_first, IndexIterator index_last,
}
void applyPermutation(IndexIterator index_first, IndexIterator index_last, InIterator in, OutIterator out)
Sort an array according to the given index permutation.
Definition algorithm.hxx:456

Required Interface:

InIterator is a random access iterator.

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ inversePermutation()

void inversePermutation ( InIterator  first,
InIterator  last,
OutIterator  out 
)

Compute the inverse of a given permutation.

This is just another name for indexSort(), referring to another semantics.

Declaration:

namespace vigra {
template <class InIterator, class OutIterator>
}
void inversePermutation(InIterator first, InIterator last, OutIterator out)
Compute the inverse of a given permutation.
Definition algorithm.hxx:491

Required Interface:

#include <vigra/algorithm.hxx>
Namespace: vigra

◆ checksum()

UInt32 checksum ( const char data,
unsigned int  size 
)

Compute the CRC-32 checksum of a byte array.

Implementation note: This function is slower on big-endian machines because the "4 bytes at a time" optimization is only implemented for little-endian.

◆ concatenateChecksum()

UInt32 concatenateChecksum ( UInt32  checksum,
const char data,
unsigned int  size 
)

Concatenate a byte array to an existing CRC-32 checksum.

◆ applyWindowFunction()

template<... >
void applyWindowFunction (   ...)

Apply a window function to each pixels of a given image.

This function calculates the results for a window function (given as a functor) when applied to the complete image. Also allows a correct border handling! See medianFilter() for an example of a quite basic window function and its application.

If you pass a functor to this function, which implements the two functions:

  1. Diff2D windowShape() const
    to return the filter window size, which has to be odd in each dimension and
  2. void operator()(SrcIterator s, SrcAccessor s_acc, DestIterator d, DestAccessor d_acc)
    to compute the results of the current window,

this function calculates the results for the complete image.

All border treatment modes (except BORDER_TREATMENT_CLIP) are supported.

The input pixel type T1 must be a linear space over the window functions' value_type T, i.e. addition of source values, multiplication with functions' values, and NumericTraits must be defined. The filters' value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
void
BorderTreatmentMode border = BORDER_TREATMENT_REPEAT);
}
void applyWindowFunction(...)
Apply a window function to each pixels of a given image.

show deprecated declarations

Usage:

#include <vigra/applywindowfunction.hxx>
Namespace: vigra

unsigned int w=1000, h=1000;
...
template<class VALUETYPE>
{
public:
MedianFunctor(Diff2D window_shape)
: m_window_shape(window_shape)
{
}
template <class SrcIterator, class SrcAccessor, class DestIterator, class DestAccessor>
{
SrcIterator s_ul = s - m_window_shape/2,
s_lr = s_ul + m_window_shape;
VALUETYPE result = NumericTraits<float>::zero();
for( ; ys.y != s_lr.y; ys.y++)
{
for(xs = ys; xs.x != s_lr.x; xs.x++, iter++)
{
res += s_acc(xs);
}
}
d_acc.set(res/(m_window_shape.x*m_window_shape.y),d);
}
Diff2D windowShape() const
{
return m_window_shape;
}
private:
Diff2D m_window_shape;
};
// create an AverageFilter function for a 5x5 filter
AvgFunctor func(Diff2D(5,5));
// apply the filter function to the input image
applyWindowFunction(src, dest, func);

Preconditions:

The image must be larger than the window size.

◆ rotateImage()

template<... >
void rotateImage (   ...)

Rotate an image by a multiple of 90 degrees or by an arbitrary angle.

If you specify the angle as an integer which is a multiple of 90 degrees, rotateImage() just copies the pixels in the appropriate new order. It expects the destination image to have the correct shape for the desired rotation. That is, when the rotation is a multiple of 180 degrees, source and destination must have the same shape, otherwise destination must have the transposed shape of the source.

If you want to rotate by an arbitrary angle and around an arbitrary center point, you must specify the source image as a vigra::SplineImageView, which is used for interpolation at the required subpixel positions. If no center point is provided, the image center is used by default. The destination image must have the same size as the source SplineImageView.

Positive angles refer to counter-clockwise rotation, negative ones to clockwise rotation. All angles must be given in degrees.

Declarations:

pass 2D array views:

namespace vigra {
// rotate by a multiple of 90 degrees
template <class T1, class S1,
class T2, class S2>
void
rotateImage(MultiArrayView<2, T1, S1> const & src,
int rotation);
// rotate by an arbitrary angle around the given center point
template <int ORDER, class T,
class T2, class S2>
void
rotateImage(SplineImageView<ORDER, T> const & src,
double angleInDegree,
TinyVector<double, 2> const & center = (src.shape() - Shape2(1)) / 2.0);
}

show deprecated declarations

Usage:

#include <vigra/basicgeometry.hxx>
Namespace: vigra

// rotate counter-clockwise by 90 degrees (no interpolation required)
MultiArray<2, float> src(width, height),
dest(height, width); // note that width and height are exchanged
... // fill src
rotateImage(src, dest, 90);
// rotate clockwise by 38.5 degrees, using a SplieImageView for cubic interpolation
vigra::rotateImage(spline, dest2, -38.5);

show deprecated examples

Preconditions:

src.shape(0) > 1 && src.shape(1) > 1

◆ reflectImage()

template<... >
void reflectImage (   ...)

Reflect image horizontally or vertically.

The reflection direction refers to the reflection axis, i.e. horizontal reflection turns the image upside down, vertical reflection changes left for right. The directions are selected by the enum values vigra::horizontal and vigra::vertical. The two directions can also be "or"ed together to perform both reflections simultaneously (see example below) – this is the same as a 180 degree rotation.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void reflectImage(...)
Reflect image horizontally or vertically.

show deprecated declarations

Usage:

#include <vigra/basicgeometry.hxx>
Namespace: vigra

MultiArray<2, float> src(width, height),
dest(width, height);
... // fill src
// reflect about both dimensions
vigra::reflectImage(src, dest, vigra::horizontal | vigra::vertical);

show deprecated examples

Preconditions:

src.shape(0) > 1 && src.shape(1) > 1

◆ transposeImage()

template<... >
void transposeImage (   ...)

Transpose an image over the major or minor diagonal.

The transposition direction refers to the axis, i.e. major transposition turns the upper right corner into the lower left one, whereas minor transposition changes the upper left corner into the lower right one. The directions are selected by the enum values vigra::major and vigra::minor. The two directions can also be "or"ed together to perform both reflections simultaneously (see example below) – this is the same as a 180 degree rotation. (Caution: When doing multi-platform development, you should be aware that some <sys/types.h> define major/minor, too. Do not omit the vigra namespace prefix.)

Note that a similar effect can be chieved by MultiArrayView::transpose(). However, the latter can only transpose about the major diagonal, and it doesn't rearrange the data

  • it just creates a view with transposed axis ordering. It depends on the context which function is more appropriate.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void transposeImage(...)
Transpose an image over the major or minor diagonal.

show deprecated declarations

Usage:

#include <vigra/basicgeometry.hxx>
Namespace: vigra

MultiArray<2, float> src(width, height),
dest(height, width); // note that dimensions are transposed
... // fill src
// transpose about the major diagonal
vigra::transposeImage(src, dest, vigra::major);
// this produces the same data as transposing the view
assert(dest == src.transpose());
// transposition about the minor diagonal has no correspondence in MultiArrayView
vigra::transposeImage(src, dest, vigra::minor);

show deprecated examples

Preconditions:

src.shape(0) > 1 && src.shape(1) > 1

◆ resampleImage()

template<... >
void resampleImage (   ...)

Resample image by a given factor.

This algorithm is very fast and does not require any arithmetic on the pixel types. The input image must have a size of at least 2x2. Destiniation pixels are directly copied from the appropriate source pixels. The size of the result image is the product of factor and the original size, where we round up if factor < 1.0 and down otherwise. This size calculation is the main difference to the convention used in the similar function resizeImageNoInterpolation(): there, the result size is calculated as n*(old_width-1)+1 and n*(old_height-1)+1. This is because resizeImageNoInterpolation() does not replicate the last pixel of every row/column in order to make it compatible with the other functions of the resizeImage... family.

The function can be called with different resampling factors for x and y, or with a single factor to be used for both directions.

It should also be noted that resampleImage() is implemented so that an enlargement followed by the corresponding shrinking reproduces the original image.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
template <class T1, class S1,
class T2, class S2>
void
}
void resampleImage(...)
Resample image by a given factor.

show deprecated declarations

Usage:

#include <vigra/basicgeometry.hxx>
Namespace: vigra

double factor = 2.0;
MultiArray<2, float> src(width, height),
dest((int)(factor*width), (int)(factor*height)); // enlarge image by factor
... // fill src

show deprecated examples

Preconditions:

src.shape(0) > 1 && src.shape(1) > 1

◆ besselJ()

double besselJ ( int  n,
double  x 
)

Bessel function of the first kind.

Computes the value of BesselJ of integer order n and argument x. Negative x are unsupported and will result in a std::domain_error.

This function wraps a number of existing implementations and falls back to a rather slow algorithm if none of them is available. In particular, it uses boost::math when HasBoostMath is #defined, or native implementations on gcc and MSVC otherwise.

#include <vigra/bessel.hxx>
Namespace: vigra

◆ besselY()

double besselY ( int  n,
double  x 
)

Bessel function of the second kind.

Computes the value of BesselY of integer order n and argument x. Negative x are unsupported and will result in a std::domain_error.

This function wraps a number of existing implementations and falls back to a rather slow algorithm if none of them is available. In particular, it uses boost::math when HasBoostMath is #defined, or native implementations on gcc and MSVC otherwise.

#include <vigra/bessel.hxx>
Namespace: vigra

◆ doxygen_overloaded_function()

doxygen_overloaded_function ( template<... > void  separableConvolveBlockwise)

Separated convolution on ChunkedArrays.

Declarations:

namespace vigra {
// apply each kernel from the sequence 'kernels' in turn
template <unsigned int N, class T1, class T2, class KernelIterator>
void separableConvolveBlockwise(const ChunkedArra<N, T1>& source, ChunkedArray<N, T2>& destination, KernelIterator kernels);
// apply the same kernel to all dimensions
template <unsigned int N, class T1, class T2, class T3>
void separableConvolveBlockwise(const ChunkedArra<N, T1>& source, ChunkedArray<N, T2>& destination, Kernel1D<T3> const & kernel);
}

This function computes a separated convolution for a given ChunkedArray. For infinite precision T1, this is equivalent to separableConvolveMultiArray. In practice, floating point inaccuracies will make the result differ slightly.

◆ labelMultiArrayBlockwise()

template<... >
unsigned int labelMultiArrayBlockwise (   ...)

Connected components labeling for MultiArrays and ChunkedArrays.

Declarations:

namespace vigra {
// assign local labels and generate mapping (local labels) -> (global labels) for each chunk
template <unsigned int N, class Data, class S1,
class Label, class S2,
class Equal, class S3>
const BlockwiseLabelOptions& options,
Equal equal,
MultiArrayView<N, std::vector<Label>, S3>& mapping);
// assign local labels and generate mapping (local labels) -> (global labels) for each chunk
template <unsigned int N, class T, class S1,
class Label, class S2,
const BlockwiseLabelOptions& options,
Equal equal,
MultiArrayView<N, std::vector<Label>, S3>& mapping);
// assign global labels
template <unsigned int N, class Data, class S1,
class Label, class S2,
class Equal>
const BlockwiseLabelOptions& options,
Equal equal);
// assign global labels
template <unsigned int N, class T, class S1,
class Label, class S2,
class EqualityFunctor = std::equal_to<T> >
Equal equal = std::equal_to<T>());
}
Definition blockwise_labeling.hxx:69
Base class for, and view to, vigra::MultiArray.
Definition multi_array.hxx:705
unsigned int labelMultiArrayBlockwise(...)
Connected components labeling for MultiArrays and ChunkedArrays.

The resulting labeling is equivalent to a labeling by labelMultiArray, that is, the connected components are the same but may have different ids. NeighborhoodType and background value (if any) can be specified with the LabelOptions object. If the mapping parameter is provided, each chunk is labeled seperately and contiguously (starting at one, zero for background), with mapping containing a mapping of local labels to global labels for each chunk. Thus, the shape of 'mapping' has to be large enough to hold each chunk coordinate.

Return: the number of regions found (=largest global region label)

Usage:

#include <vigra/blockwise_labeling.hxx>
Namespace: vigra

Shape3 shape = Shape3(10);
Shape3 chunk_shape = Shape3(4);
ChunkedArrayLazy<3, int> data(shape, chunk_shape);
// fill data ...
ChunkedArrayLazy<3, size_t> labels(shape, chunk_shape);
MultiArray<3, std::vector<size_t> > mapping(Shape3(3)); // there are 3 chunks in each dimension
std::equal_to<int>(), mapping);
// check out chunk in the middle
labels.checkoutSubarray(Shape3(4), middle_chunk);
// print number of non-background labels assigned in middle_chunk
cout << mapping[Shape3(1)].size() << endl;
// get local label for voxel
// this may be the same value assigned to different component in another chunk
// get global label for voxel
// if another voxel has the same label, they are in the same connected component albeit they may be in different chunks
Option object for labelMultiArray().
Definition multi_labeling.hxx:310
Class for fixed size vectors.
Definition tinyvector.hxx:1008
@ DirectNeighborhood
use only direct neighbors
Definition multi_fwd.hxx:187

◆ unionFindWatershedsBlockwise()

template<... >
unsigned int unionFindWatershedsBlockwise (   ...)

Blockwise union-find watersheds transform for MultiArrays and ChunkedArrays.

Declaration:

namespace vigra { namespace blockwise {
template <unsigned int N, class Data, class S1,
class Label, class S2>
BlockwiseLabelOptions const & options);
template <unsigned int N, class Data, class Label>
// provide temporary directions storage
template <unsigned int N, class Data, class Label>
BlockwiseLabelOptions const & options,
}}
unsigned int unionFindWatershedsBlockwise(...)
Blockwise union-find watersheds transform for MultiArrays and ChunkedArrays.

The resulting labeling is equivalent to a labeling by watershedsUnionFind, that is, the components are the same but may have different ids. If temporary_storage is provided, this array is used for intermediate result storage. Otherwise, a newly created vigra::ChunkedArrayLazy is used.

Return: the number of labels assigned (=largest label, because labels start at one)

Usage:

#include <vigra/blockwise_watersheds.hxx>
Namespace: vigra

Shape3 shape = Shape3(10);
Shape3 chunk_shape = Shape3(4);
ChunkedArrayLazy<3, int> data(shape, chunk_shape);
// fill data ...
ChunkedArrayLazy<3, size_t> labels(shape, chunk_shape);
@ IndirectNeighborhood
use direct and indirect neighbors
Definition multi_fwd.hxx:188

◆ rieszTransformOfLOG()

template<... >
void rieszTransformOfLOG (   ...)

Calculate Riesz transforms of the Laplacian of Gaussian.

The Riesz transforms of the Laplacian of Gaussian have the following transfer functions (defined in a polar coordinate representation of the frequency domain):

\[
    F_{\sigma}(r, \phi)=(i \cos \phi)^n (i \sin \phi)^m r^2 e^{-r^2 \sigma^2 / 2}
\]

where n = xorder and m = yorder determine th e order of the transform, and sigma > 0 is the scale of the Laplacian of Gaussian. This function computes a good spatial domain approximation of these transforms for xorder + yorder <= 2. The filter responses may be used to calculate the monogenic signal or the boundary tensor.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale, unsigned int xorder, unsigned int yorder);
}
void rieszTransformOfLOG(...)
Calculate Riesz transforms of the Laplacian of Gaussian.

show deprecated declarations

Usage:

#include <vigra/boundarytensor.hxx>
Namespace: vigra

MultiArrayView<2, double> impulse(17,17), res(17, 17);
impulse(8,8) = 1.0;
// calculate the impulse response of the first order Riesz transform in x-direction
rieszTransformOfLOG(impulse, res, 2.0, 1, 0);

◆ boundaryTensor()

template<... >
void boundaryTensor (   ...)

Calculate the boundary tensor for a scalar valued image.

These functions calculate a spatial domain approximation of the boundary tensor as described in

U. Köthe: "Integrated Edge and Junction Detection with the Boundary Tensor", in: ICCV 03, Proc. of 9th Intl. Conf. on Computer Vision, Nice 2003, vol. 1, pp. 424-431, Los Alamitos: IEEE Computer Society, 2003

with the Laplacian of Gaussian as the underlying bandpass filter (see rieszTransformOfLOG()). The output image must have 3 bands which will hold the tensor components in the order t11, t12 (== t21), t22. The function boundaryTensor1() with the same interface implements a variant of the boundary tensor where the 0th-order Riesz transform has been dropped, so that the tensor is no longer sensitive to blobs.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void boundaryTensor(...)
Calculate the boundary tensor for a scalar valued image.

show deprecated declarations

Usage:

#include <vigra/boundarytensor.hxx>
Namespace: vigra

◆ boundaryTensor1()

template<... >
void boundaryTensor1 (   ...)

Boundary tensor variant.

This function implements a variant of the boundary tensor where the 0th-order Riesz transform has been dropped, so that the tensor is no longer sensitive to blobs. See boundaryTensor() for more detailed documentation.

Declarations:

#include <vigra/boundarytensor.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void boundaryTensor1(...)
Boundary tensor variant.

show deprecated declarations

◆ polar2Lab()

TinyVector< float, 3 > polar2Lab ( double  color,
double  brightness,
double  saturation 
)

Init L*a*b* color triple from polar representation.

#include <vigra/colorconversions.hxx>
Namespace: vigra

Declarations:

polar2Lab(double color, double brightness, double saturation);
TinyVector< float, 3 > polar2Lab(double color, double brightness, double saturation)
Init L*a*b* color triple from polar representation.
Definition colorconversions.hxx:2937
  • color - the color angle in degrees
  • brightness - between 0 and 1
  • saturation - between 0 and 1

L*a*b* polar coordinates of some important colors:

black = [*, 0, 0] * - arbitrary
white = [*, 1, 0] * - arbitrary
red = [ 0, 0.532406, 0.781353]
yellow = [62.8531, 0.971395, 0.724189]
green = [96.0184, 0.877351, 0.895108]
cyan = [156.378, 0.911133, 0.374577]
blue = [266.287, 0.322957, 0.999997]
magenta = [288.237, 0.603235, 0.863482]

◆ lab2Polar()

template<class V >
TinyVector< float, 3 > lab2Polar ( V const lab)

Create polar representation form L*a*b*.

Declaration:

namespace vigra {
}
TinyVector< float, 3 > lab2Polar(V const &lab)
Create polar representation form L*a*b*.
Definition colorconversions.hxx:2975

#include <vigra/colorconversions.hxx>
Namespace: vigra

This realizes the inverse of the transformation described in polar2Lab().

◆ polar2Luv()

TinyVector< float, 3 > polar2Luv ( double  color,
double  brightness,
double  saturation 
)

Init L*u*v* color triple from polar representation.

#include <vigra/colorconversions.hxx>
Namespace: vigra

Declarations:

polar2Luv(double color, double brightness, double saturation);
TinyVector< float, 3 > polar2Luv(double color, double brightness, double saturation)
Init L*u*v* color triple from polar representation.
Definition colorconversions.hxx:3023
  • color - the color angle in degrees
  • brightness - between 0 and 1
  • saturation - between 0 and 1

L*u*v* polar coordinates of some important colors:

black = [*, 0, 0] * - arbitrary
white = [*, 1, 0] * - arbitrary
red = [ 0, 0.532406, 1]
yellow = [ 73.7, 0.971395, 0.597953]
green = [115.552, 0.877351, 0.758352]
cyan = [ 180.0, 0.911133, 0.402694]
blue = [ 253.7, 0.322957, 0.729883]
magenta = [295.553, 0.603235, 0.767457]

◆ luv2Polar()

template<class V >
TinyVector< float, 3 > luv2Polar ( V const luv)

Create polar representation form L*u*v*.

Declaration:

namespace vigra {
}
TinyVector< float, 3 > luv2Polar(V const &luv)
Create polar representation form L*u*v*.
Definition colorconversions.hxx:3060

#include <vigra/colorconversions.hxx>
Namespace: vigra

This realizes the inverse of the transformation described in polar2Luv().

◆ polar2YPrimePbPr()

TinyVector< float, 3 > polar2YPrimePbPr ( double  color,
double  brightness,
double  saturation 
)

Init Y'PbPr color triple from polar representation.

#include <vigra/colorconversions.hxx>
Namespace: vigra

Declarations:

polar2YPrimePbPr(double color, double brightness, double saturation);
TinyVector< float, 3 > polar2YPrimePbPr(double color, double brightness, double saturation)
Init Y'PbPr color triple from polar representation.
Definition colorconversions.hxx:3108
  • color - the color angle in degrees
  • brightness - between 0 and 1
  • saturation - between 0 and 1

Y'PbPr polar coordinates of some important colors:

black = [*, 0, 0] * - arbitrary
white = [*, 1, 0] * - arbitrary
red = [ 0, 0.299, 0.988419]
yellow = [62.1151, 0.886, 0.948831]
green = [123.001, 0.587, 1]
cyan = [ 180.0, 0.701, 0.988419]
blue = [242.115, 0.114, 0.948831]
magenta = [303.001, 0.413, 1]

◆ yPrimePbPr2Polar()

template<class V >
TinyVector< float, 3 > yPrimePbPr2Polar ( V const ypbpr)

Create polar representation form Y'PbPr.

Declaration:

namespace vigra {
}
TinyVector< float, 3 > yPrimePbPr2Polar(V const &ypbpr)
Create polar representation form Y'PbPr.
Definition colorconversions.hxx:3145

#include <vigra/colorconversions.hxx>
Namespace: vigra

This realizes the inverse of the transformation described in polar2YPrimePbPr().

◆ polar2YPrimeCbCr()

TinyVector< float, 3 > polar2YPrimeCbCr ( double  color,
double  brightness,
double  saturation 
)

Init Y'CbCr color triple from polar representation.

#include <vigra/colorconversions.hxx>
Namespace: vigra

Declarations:

polar2YPrimeCbCr(double color, double brightness, double saturation);
TinyVector< float, 3 > polar2YPrimeCbCr(double color, double brightness, double saturation)
Init Y'CbCr color triple from polar representation.
Definition colorconversions.hxx:3193
  • color - the color angle in degrees
  • brightness - between 0 and 1
  • saturation - between 0 and 1

Y'CbCr polar coordinates of some important colors:

black = [*, 0, 0] * - arbitrary
white = [*, 1, 0] * - arbitrary
red = [ 0, 0.299, 0.988419]
yellow = [62.1151, 0.886, 0.948831]
green = [123.001, 0.587, 1]
cyan = [ 180.0, 0.701, 0.988419]
blue = [242.115, 0.114, 0.948831]
magenta = [303.001, 0.413, 1]

◆ yPrimeCbCr2Polar()

template<class V >
TinyVector< float, 3 > yPrimeCbCr2Polar ( V const ycbcr)

Create polar representation form Y'CbCr.

Declaration:

namespace vigra {
}
TinyVector< float, 3 > yPrimeCbCr2Polar(V const &ycbcr)
Create polar representation form Y'CbCr.
Definition colorconversions.hxx:3230

#include <vigra/colorconversions.hxx>
Namespace: vigra

This realizes the inverse of the transformation described in polar2YPrimeCbCr().

◆ polar2YPrimeIQ()

TinyVector< float, 3 > polar2YPrimeIQ ( double  color,
double  brightness,
double  saturation 
)

Init Y'IQ color triple from polar representation.

#include <vigra/colorconversions.hxx>
Namespace: vigra

Declarations:

polar2YPrimeIQ(double color, double brightness, double saturation);
TinyVector< float, 3 > polar2YPrimeIQ(double color, double brightness, double saturation)
Init Y'IQ color triple from polar representation.
Definition colorconversions.hxx:3280
  • color - the color angle in degrees
  • brightness - between 0 and 1
  • saturation - between 0 and 1

Y'IQ polar coordinates of some important colors:

black = [*, 0, 0] * - arbitrary
white = [*, 1, 0] * - arbitrary
red = [ 0, 0.299, 1]
yellow = [63.5851, 0.886, 0.707681]
green = [137.231, 0.587, 0.933362]
cyan = [ 180.0, 0.701, 1]
blue = [243.585, 0.114, 0.707681]
magenta = [317.231, 0.413, 0.933362]

◆ yPrimeIQ2Polar()

template<class V >
TinyVector< float, 3 > yPrimeIQ2Polar ( V const yiq)

Create polar representation form Y'IQ.

Declaration:

namespace vigra {
}
TinyVector< float, 3 > yPrimeIQ2Polar(V const &yiq)
Create polar representation form Y'IQ.
Definition colorconversions.hxx:3317

#include <vigra/colorconversions.hxx>
Namespace: vigra

This realizes the inverse of the transformation described in polar2YPrimeIQ().

◆ polar2YPrimeUV()

TinyVector< float, 3 > polar2YPrimeUV ( double  color,
double  brightness,
double  saturation 
)

Init Y'UV color triple from polar representation.

#include <vigra/colorconversions.hxx>
Namespace: vigra

Declarations:

polar2YPrimeUV(double color, double brightness, double saturation);
TinyVector< float, 3 > polar2YPrimeUV(double color, double brightness, double saturation)
Init Y'UV color triple from polar representation.
Definition colorconversions.hxx:3365
  • color - the color angle in degrees
  • brightness - between 0 and 1
  • saturation - between 0 and 1

Y'UV polar coordinates of some important colors:

black = [*, 0, 0] * - arbitrary
white = [*, 1, 0] * - arbitrary
red = [ 0, 0.299, 1]
yellow = [63.5851, 0.886, 0.707681]
green = [137.231, 0.587, 0.933362]
cyan = [ 180.0, 0.701, 1]
blue = [243.585, 0.114, 0.707681]
magenta = [317.231, 0.413, 0.933362]

◆ yPrimeUV2Polar()

template<class V >
TinyVector< float, 3 > yPrimeUV2Polar ( V const yuv)

Create polar representation form Y'UV.

Declaration:

namespace vigra {
}
TinyVector< float, 3 > yPrimeUV2Polar(V const &yuv)
Create polar representation form Y'UV.
Definition colorconversions.hxx:3402

#include <vigra/colorconversions.hxx>
Namespace: vigra

This realizes the inverse of the transformation described in polar2YPrimeUV().

◆ combineTwoImages()

template<... >
void combineTwoImages (   ...)

Combine two source images into destination image.

After the introduction of arithmetic and algebraic array expressions, this function is rarely needed. Moreover, combineTwoMultiArrays() provides the same functionality for arbitrary dimensional arrays.

The transformation given by the functor is applied to the source pixels and the result written into the corresponding destination pixel. This is typically used for operations like add and subtract. Note that the binary functors of the STL can be used in addition to the functors specifically defined in Functors to Combine Images. Creation of new functors is easiest by using Functor Expressions
.

Declarations:

pass 2D array views:

namespace vigra {
template <class T11, class S11,
class T12, class S12,
class T2, class S2,
class Functor>
void
Functor const & f);
}
void combineTwoImages(...)
Combine two source images into destination image.

show deprecated declarations

Usage:

#include <vigra/combineimages.hxx>
Namespace: vigra

#include <functional> // for plus
MultiArray<2, float> src1(width, height), src2(width, height),
dest(width, height);
... // fill source images
std::plus<float>());

show deprecated examples

See also
Functors to Transform Images, vigra::multi_math, Functor Expressions

◆ combineTwoImagesIf()

template<... >
void combineTwoImagesIf (   ...)

Combine ROI of two source images into destination image.

The transformation given by the functor is applied to all source pixels in the ROI (i.e. whenever the corresponding value of the mask array is non-zero) and the result written into the corresponding destination pixel. This is typically used for operations like add and subtract. Note that the binary functors of the STL can be used in addition to the functors specifically defined in Functors to Combine Images. Creation of new functors is easiest by using Functor Expressions
.

Declarations:

pass 2D array views:

namespace vigra {
template <class T11, class S11,
class T12, class S12,
class TM, class SM,
class T2, class S2,
class Functor>
void
Functor const & f);
}
void combineTwoImagesIf(...)
Combine ROI of two source images into destination image.

show deprecated declarations

Usage:

#include <vigra/combineimages.hxx>
Namespace: vigra

#include <functional> // for plus
MultiArray<2, float> src1(width, height), src2(width, height), mask(width, height),
dest(width, height);
... // fill source and mask images
std::plus<float>());

show deprecated examples

See also
Functors to Transform Images, vigra::multi_math, Functor Expressions

◆ combineThreeImages()

template<... >
void combineThreeImages (   ...)

Combine three source images into destination image.

After the introduction of arithmetic and algebraic array expressions, this function is rarely needed. Moreover, combineThreeMultiArrays() provides the same functionality for arbitrary dimensional arrays.

The transformation given by the functor is applied to the source pixels and the result written into the corresponding destination pixel. Creation of new functors is easiest by using Functor Expressions
.

Declarations:

pass 2D array views:

namespace vigra {
template <class T11, class S11,
class T12, class S12,
class T13, class S13,
class T2, class S2,
class Functor>
void
Functor const & f);
}
void combineThreeImages(...)
Combine three source images into destination image.

show deprecated declarations

Usage:

#include <vigra/combineimages.hxx>
Namespace: vigra

#include <vigra/functorexpression.hxx>
MultiArray<2, float> src1(width, height), src2(width, height), src3(width, height),
dest(width, height);
... // fill source images
using namespace vigra::functor; // activate VIGRA's lambda library
Arg1()*exp(-abs(Arg2()-Arg3())));

show deprecated examples

See also
Functors to Transform Images, vigra::multi_math, Functor Expressions

◆ compress()

void compress ( char const source,
std::size_t  size,
ArrayVector< char > &  dest,
CompressionMethod  method 
)

Compress the source buffer.

The destination array will be resized as required.

◆ uncompress()

void uncompress ( char const source,
std::size_t  srcSize,
char dest,
std::size_t  destSize,
CompressionMethod  method 
)

Uncompress the source buffer when the uncompressed size is known.

The destination buffer must be allocated to the correct size.

◆ convolveImage()

template<... >
void convolveImage (   ...)

Convolve an image with the given kernel(s).

If you pass vigra::Kernel2D to this function, it will perform an explicit 2-dimensional convolution. If you pass a single vigra::Kernel1D, it performs a separable convolution, i.e. it concatenates two 1D convolutions (along the x-axis and along the y-axis) with the same kernel via internal calls to separableConvolveX() and separableConvolveY(). If two 1D kernels are specified, separable convolution uses different kernels for the x- and y-axis.

All border treatment modes are supported.

The input pixel type T1 must be a linear space over the kernel's value_type T, i.e. addition of source values, multiplication with kernel values, and NumericTraits must be defined. The kernel's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined. Typically, you will use double for the kernel type.

Declarations:

pass 2D array views:

namespace vigra {
// use the same 1D kernel for all axes
template <class T1, class S1,
class T2, class S2,
class T>
void
Kernel1D<T> const & k);
// use a different kernel for each axis
template <class T1, class S1,
class T2, class S2,
class T>
void
Kernel1D<T> const & kx, Kernel1D<T> const & ky);
// use a non-separable 2D kernel
template <class T1, class S1,
class T2, class S2,
class T3>
void
Kernel2D<T3> const & kernel);
}
void convolveImage(...)
Convolve an image with the given kernel(s).

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

...
// create horizontal sobel filter (symmetric difference in x-direction, smoothing in y direction)
Kernel1D<double> kx, ky;
kx.initSymmetricDifference();
ky.initBinomial(1);
// calls separable convolution with the two 1D kernels
// create a 3x3 Laplacian filter
laplace.initExplicitly(Diff2D(-1,-1), Diff2D(1,1)) =
0.375, 0.25, 0.375,
0.25, -2.5, 0.25,
0.375, 0.25, 0.375;
// calls 2D convolution

show deprecated examples

Preconditions:

The image must be larger than the kernel radius.

  • For 1D kernels, w > std::max(xkernel.right(), -xkernel.keft()) and h > std::max(ykernel.right(), -ykernel.left()) are required.
  • For 2D kernels, w > std::max(kernel.lowerRight().x, -kernel.upperLeft().x) and h > std::max(kernel.lowerRight().y, -kernel.upperLeft().y) are required.

If BORDER_TREATMENT_CLIP is requested: the sum of kernel elements must be != 0.

◆ simpleSharpening()

template<... >
void simpleSharpening (   ...)

Perform simple sharpening function.

This function uses convolveImage() with the following 3x3 filter:

and uses BORDER_TREATMENT_REFLECT as border treatment mode.

Preconditions:

2. scale >= 0

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void simpleSharpening(...)
Perform simple sharpening function.

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

...
// sharpening with sharpening_factor = 0.1
vigra::simpleSharpening(src, dest, 0.1);

show deprecated examples

◆ gaussianSharpening()

template<... >
void gaussianSharpening (   ...)

Perform sharpening function with gaussian filter.

This function uses gaussianSmoothing() at the given scale to create a temporary image 'smooth' and than blends the original and smoothed image according to the formula

Preconditions:

2. scale >= 0

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void gaussianSharpening(...)
Perform sharpening function with gaussian filter.

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

...
// sharpening with sharpening_factor = 3.0
// smoothing with scale = 0.5
gaussianSharpening(src, dest, 3.0, 0.5);

show deprecated examples

◆ gaussianSmoothing()

template<... >
void gaussianSmoothing (   ...)

Perform isotropic Gaussian convolution.

This function is a shorthand for the concatenation of a call to separableConvolveX() and separableConvolveY() with a Gaussian kernel of the given scale. If two scales are provided, smoothing in x and y direction will have different strength. The function uses BORDER_TREATMENT_REFLECT.

Function gaussianSmoothMultiArray() performs the same filter operation on arbitrary dimensional arrays.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale_x, double scale_y = scale_x);
}
void gaussianSmoothing(...)
Perform isotropic Gaussian convolution.

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

...
// smooth with scale = 3.0
gaussianSmoothing(src, dest, 3.0);

show deprecated examples

◆ gaussianGradient()

template<... >
void gaussianGradient (   ...)

Calculate the gradient vector by means of a 1st derivatives of Gaussian filter.

This function is a shorthand for the concatenation of a call to separableConvolveX() and separableConvolveY() with the appropriate kernels at the given scale. Note that this function can either produce two separate result images for the x- and y-components of the gradient, or write into a vector valued image (with at least two components).

Function gaussianGradientMultiArray() performs the same filter operation on arbitrary dimensional arrays.

Declarations:

pass 2D array views:

namespace vigra {
// write x and y component of the gradient into separate images
template <class T1, class S1,
class T2X, class S2X,
class T2Y, class S2Y>
void
double scale);
// write x and y component of the gradient into a vector-valued image
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void gaussianGradient(...)
Calculate the gradient vector by means of a 1st derivatives of Gaussian filter.

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

...
// calculate gradient vector at scale = 3.0
gaussianGradient(src, gradx, grady, 3.0);
// likewise, but use a vector image to store the gradient

show deprecated examples

◆ gaussianGradientMagnitude()

template<... >
void gaussianGradientMagnitude (   ...)

Calculate the gradient magnitude by means of a 1st derivatives of Gaussian filter.

This function calls gaussianGradient() and returns the pixel-wise magnitude of the resulting gradient vectors. If the original image has multiple bands, the squared gradient magnitude is computed for each band separately, and the return value is the square root of the sum of these squared magnitudes.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameter sigma is omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
// pass filter scale explicitly
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double sigma,
// likewise, but sum the contributions of each band
template <unsigned int N, class MT, class S1,
class T2, class S2>
void
double sigma,
// pass filter scale(s) in option object
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
// likewise, but execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
// pass filter scale(s) in option object and sum the contributions of each band
template <unsigned int N, class MT, class S1,
class T2, class S2>
void
}
void gaussianGradientMagnitude(...)
Calculate the gradient magnitude by means of a 1st derivatives of Gaussian filter.

Here, the input element types T1 and MT can be arbitrary scalar types, and T1 may also be TinyVector or RGBValue. The output element type T2 should be the corresponding norm type (see NormTraits). In the Multiband<MT>-version, the input array's right-most dimension is interpreted as a channel axis, therefore it must have one dimension more than the output array.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
#include <vigra/convolution.hxx> (deprecated API version)
Namespace: vigra

// example 1
{
// use a 3-dimensional float array
MultiArray<3, float> volume(Shape3(w, h, d)), grad(volume.shape());
...
// calculate gradient magnitude at scale = 3.0
gaussianGradientMagnitude(volume, grad, 3.0);
}
// example 2
{
// use a 2-dimensional RGB array
MultiArray<2, RGBValue<float> > rgb(Shape2(w, h));
MultiArray<2, float> grad(rgb.shape());
...
// calculate the color gradient magnitude at scale = 3.0
gaussianGradientMagnitude(rgb, grad, 3.0);
}
// example 3
{
// use a 3-dimensional array whose right-most axis is interpreted as
// a multi-spectral axis with arbitrary many channels
MultiArray<3, Multiband<float> > spectral(Shape3(w, h, channelCount));
MultiArray<2, float> grad(Shape2(w, h));
...
// calculate the multi-channel gradient magnitude at scale = 3.0
// (note that the template parameter N (number of spatial dimensions)
// must be provided explicitly as gaussianGradientMagnitude<2>(...) )
MultiArrayView<3, Multiband<float> > view(spectral);
gaussianGradientMagnitude<2>(view, grad, 3.0);
}

show deprecated examples

◆ laplacianOfGaussian()

template<... >
void laplacianOfGaussian (   ...)

Filter image with the Laplacian of Gaussian operator at the given scale.

This function calls separableConvolveX() and separableConvolveY() with the appropriate 2nd derivative of Gaussian kernels in x- and y-direction and then sums the results to get the Laplacian.

Function laplacianOfGaussianMultiArray() performs the same filter operation on arbitrary dimensional arrays.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void laplacianOfGaussian(...)
Filter image with the Laplacian of Gaussian operator at the given scale.

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

...
// calculate Laplacian of Gaussian at scale = 3.0
laplacianOfGaussian(src, dest, 3.0);

show deprecated examples

◆ hessianMatrixOfGaussian()

template<... >
void hessianMatrixOfGaussian (   ...)

Filter image with the 2nd derivatives of the Gaussian at the given scale to get the Hessian matrix.

The Hessian matrix is a symmetric matrix defined as:

\[
    \mbox{\rm Hessian}(I) = \left(
    \begin{array}{cc}
    G_{xx} \ast I & G_{xy} \ast I \\
    G_{xy} \ast I & G_{yy} \ast I
    \end{array} \right)
\]

where $G_{xx}, G_{xy}, G_{yy}$ denote 2nd derivatives of Gaussians at the given scale, and $\ast$ is the convolution symbol. This function calls separableConvolveX() and separableConvolveY() with the appropriate 2nd derivative of Gaussian kernels and puts the results in the three destination images. The first destination image will contain the second derivative in x-direction, the second one the mixed derivative, and the third one holds the derivative in y-direction.

Function hessianOfGaussianMultiArray() performs the same filter operation on arbitrary dimensional arrays.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void hessianMatrixOfGaussian(...)
Filter image with the 2nd derivatives of the Gaussian at the given scale to get the Hessian matrix.

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

MultiArray<2, TinyVector<float, 3> > hessian(w,h); // will hold the three components of the Hessian
...
// calculate Hessian of Gaussian at scale = 3.0, use a 3-band output image
hessianMatrixOfGaussian(src, hessian, 3.0);

show deprecated examples

◆ structureTensor()

template<... >
void structureTensor (   ...)

Calculate the Structure Tensor for each pixel of and image, using Gaussian (derivative) filters.

The Structure Tensor is is a smoothed version of the Euclidean product of the gradient vector with itself. I.e. it's a symmetric matrix defined as:

\[
       \mbox{\rm StructurTensor}(I) = \left(
       \begin{array}{cc}
       G \ast (I_x I_x) & G \ast (I_x I_y) \\
       G \ast (I_x I_y) & G \ast (I_y I_y)
       \end{array} \right) = \left(
       \begin{array}{cc}
       A & C \\
       C & B
       \end{array} \right)
   \]

where $G$ denotes Gaussian smoothing at the outer scale, $I_x, I_y$ are the gradient components taken at the inner scale, $\ast$ is the convolution symbol, and $I_x I_x$ etc. are pixelwise products of the 1st derivative images. This function calls separableConvolveX() and separableConvolveY() with the appropriate Gaussian kernels and puts the results in the three separate destination images (where the first one will contain $G \ast (I_x I_x)$, the second one $G \ast (I_x I_y)$, and the third one holds $G \ast (I_y I_y)$), or into a single 3-band image (where the bands hold the result in the same order as above). The latter form is also applicable when the source image is a multi-band image (e.g. RGB). In this case, tensors are first computed for each band separately, and then summed up to get a single result tensor.

Function structureTensorMultiArray() performs the same filter operation on arbitrary dimensional arrays.

Declarations:

pass 2D array views:

namespace vigra {
// create three separate destination images
template <class T, class S,
class TX, class SX,
class TXY, class SXY,
class TY, class SY>
void
double inner_scale, double outer_scale);
// create a single 3-band destination image
template <class T1, class S1,
class T2, class S2>
void
double inner_scale, double outer_scale);
}
void structureTensor(...)
Calculate the Structure Tensor for each pixel of and image, using Gaussian (derivative) filters.

show deprecated declarations

Usage:

#include <vigra/convolution.hxx>
Namespace: vigra

stxx(w,h), stxy(w,h), styy(w,h); // use a separate image for each component
...
// calculate Structure Tensor at inner scale = 1.0 and outer scale = 3.0
structureTensor(src, stxx, stxy, styy, 1.0, 3.0);
// likwise with a single 3-band destination image
structureTensor(src, st, 1.0, 3.0);

show deprecated examples

◆ copyImage()

template<... >
void copyImage (   ...)

Copy source image into destination image.

If necessary, type conversion takes place. Some variants of this function use accessors to access the pixel data.

See copyMultiArray() for a dimension-independent version of this algorithm.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void copyImage(...)
Copy source image into destination image.

pass Image Iterators and Data Accessors :

use argument objects in conjunction with Argument Object Factories :

Usage:

#include <vigra/copyimage.hxx>
Namespace: vigra

Use MultiArrayView API:

MultiArray<2, int> src(Shape2(100, 200)),
dest(Shape2(100, 200));
...
copyImage(src, dest);
// equivalent to

Use iterator-based API with accessor:

MultiArray<2, float> dest(Shape2(100, 200));
// convert RGB to gray values in the fly
destImage(dest));
Definition rgbvalue.hxx:1270

Required Interface:

SrcImageIterator::row_iterator sx = src_upperleft.rowIterator();
DestImageIterator::row_iterator dx = dest_upperleft.rowIterator();

◆ copyImageIf()

template<... >
void copyImageIf (   ...)

Copy source ROI into destination image.

Pixel values are copied whenever the return value of the mask's accessor is not zero. If necessary, type conversion takes place. Some variants of this function use accessors to access the pixel data.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
}
void copyImageIf(...)
Copy source ROI into destination image.

pass Image Iterators and Data Accessors :

use argument objects in conjunction with Argument Object Factories :

Usage:

#include <vigra/copyimage.hxx>
Namespace: vigra

Use MultiArrayView API:

MultiArray<2, int> src(Shape2(100, 200)),
mask(Shape2(100, 200)),
dest(Shape2(100, 200));
...
copyImageIf(src, mask, dest);

Use iterator-based API with accessor:

MultiArray<2, unsigned char> mask(Shape2(100, 200));
MultiArray<2, float> dest(Shape2(100, 200));
// convert RGB to gray values in the fly
maskImage(mask), destImage(dest));

Required Interface:

MaskImageIterator mask_upperleft;
SrcImageIterator::row_iterator sx = src_upperleft.rowIterator();
MaskImageIterator::row_iterator mx = mask_upperleft.rowIterator();
DestImageIterator::row_iterator dx = dest_upperleft.rowIterator();
Functor functor;

◆ cornerResponseFunction()

template<... >
void cornerResponseFunction (   ...)

Find corners in an image (1).

This algorithm implements the so called 'corner response function' to measure the 'cornerness' of each pixel in the image, according to [C.G. Harris and M.J. Stevens: "A Combined Corner and Edge Detector", Proc. of 4th Alvey Vision Conference, 1988]. Several studies have found this to be a very robust corner detector, although it moves the corners somewhat into one region, depending on the scale.

The algorithm first determines the structure tensor at each pixel by calling structureTensor(). Then the entries of the structure tensor are combined as

\[
    \mbox{\rm CornerResponse} = \mbox{\rm det(StructureTensor)} - 0.04 \mbox{\rm tr(StructureTensor)}^2
    = A B - C^2 - 0.04 (A + B)^2
\]

The local maxima of the corner response denote the corners in the gray level image.

The source value type must be a linear algebra, i.e. addition, subtraction, and multiplication with itself, multiplication with doubles and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void cornerResponseFunction(...)
Find corners in an image (1).

show deprecated declarations

Usage:

#include <vigra/cornerdetection.hxx>
Namespace: vigra

...
// find corner response at scale 1.0
cornerResponseFunction(src, corner_response, 1.0);
// find local maxima of corner response, mark with 1
// threshold corner response to keep only strong corners (above 400.0)
Threshold<double, double>(400.0, std::numeric_limits<double>::max(), 0.0, 1.0));
// combine thresholding and local maxima
corners, std::multiplies<float>());
void transformImage(...)
Apply unary point transformation to each pixel.
void localMaxima(...)
Find local maxima in an image or multi-dimensional array.

show deprecated examples

◆ foerstnerCornerDetector()

template<... >
void foerstnerCornerDetector (   ...)

Find corners in an image (2).

This algorithm implements the so called 'Foerstner Corner Detector' to measure the 'cornerness' of each pixel in the image, according to [W. Förstner: "A feature based correspondence algorithms for image matching", Intl. Arch. Photogrammetry and Remote Sensing, vol. 24, pp 160-166, 1986]. It is also known as the "Plessey Detector" by Harris. However, it should not be confused with the "\link cornerResponseFunction Corner Response Function\endlink ", another detector invented by Harris.

The algorithm first determines the structure tensor at each pixel by calling structureTensor(), where the given scale is used for both the inner and outer scales. Then the entries of the structure tensor are combined as

\[
    \mbox{\rm FoerstnerCornerStrength} = \frac{\mbox{\rm det(StructureTensor)}}{\mbox{\rm tr(StructureTensor)}} = 
    \frac{A B - C^2}{A + B}
\]

The local maxima of the corner strength denote the corners in the gray level image. Its performance is similar to the cornerResponseFunction().

The source value type must be a division algebra, i.e. addition, subtraction, multiplication, and division with itself, multiplication with doubles and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void foerstnerCornerDetector(...)
Find corners in an image (2).

show deprecated declarations

Usage:

#include <vigra/cornerdetection.hxx>
Namespace: vigra

...
// find corner response at scale 1.0
foerstnerCornerDetector(src, foerstner_corner_strength, 1.0);
// find local maxima of corner response, mark with 1

show deprecated examples

◆ rohrCornerDetector()

template<... >
void rohrCornerDetector (   ...)

Find corners in an image (3).

This algorithm implements yet another structure tensor-based corner detector, according to [K. Rohr: "Untersuchung von grauwertabh&auml;ngigen Transformationen zur Ermittlung der optischen Flusses in Bildfolgen", Diploma thesis, Inst. für Nachrichtensysteme, Univ. Karlsruhe, 1987, see also K. Rohr: "Modelling and Identification of Characteristic Intensity Variations", Image and Vision Computing 10:2 (1992) 66-76 and K. Rohr: "Localization Properties of Direct Corner Detectors", J. of Mathematical Imaging and Vision 4:2 (1994) 139-150].

The algorithm first determines the structure tensor at each pixel by calling structureTensor(), where the given scale is used for both the inner and outer scales. Then the entries of the structure tensor are combined as

\[
    \mbox{\rm RohrCornerStrength} = \mbox{\rm det(StructureTensor)} = A B - C^2
\]

The local maxima of the corner strength denote the corners in the gray level image. Its performance is similar to the cornerResponseFunction().

The source value type must be a linear algebra, i.e. addition, subtraction, and multiplication with itself, multiplication with doubles and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void rohrCornerDetector(...)
Find corners in an image (3).

show deprecated declarations

Usage:

#include <vigra/cornerdetection.hxx>
Namespace: vigra

...
// find corner response at scale 1.0
rohrCornerDetector(src, rohr_corner_strength, 1.0);
// find local maxima of corner response, mark with 1

show deprecated examples

◆ beaudetCornerDetector()

template<... >
void beaudetCornerDetector (   ...)

Find corners in an image (4).

This algorithm implements a corner detector
according to [P.R. Beaudet: "Rotationally Invariant Image Operators", Proc. Intl. Joint Conf. on Pattern Recognition, Kyoto, Japan, 1978, pp. 579-583].

The algorithm calculates the corner strength as the negative determinant of the Hessian Matrix. The local maxima of the corner strength denote the corners in the gray level image.

The source value type must be a linear algebra, i.e. addition, subtraction, and multiplication with itself, multiplication with doubles and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void beaudetCornerDetector(...)
Find corners in an image (4).

show deprecated declarations

Usage:

#include <vigra/cornerdetection.hxx>
Namespace: vigra

...
// find corner response at scale 1.0
beaudetCornerDetector(src, beaudet_corner_strength, 1.0);
// find local maxima of corner response, mark with 1

show deprecated examples

◆ fastCrossCorrelation()

template<... >
void fastCrossCorrelation (   ...)

This function performes a fast cross-correlation.

This function performes a fast cross-correlation using the Fast Fourier Transform and the dependency of the convolution and the correlation in Fourier space.

The input pixel type T1 must be a linear space over the window functions' value_type T, i.e. addition of source values, multiplication with functions' values, and NumericTraits must be defined. The mask's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.

By default, the borders are filled with zeros. Use the clearBorders switch to change that behavior if you need to.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class T3, class S3,
unsigned int N>
void
bool clearBorders=true);
}
void fastCrossCorrelation(...)
This function performes a fast cross-correlation.

Usage:

#include <vigra/correlation.hxx>
Namespace: vigra

unsigned int m_w=51, m_h=51;
unsigned int w=1000, h=1000;
...
//compute fast cross correlation of mask and image -> dest
fastCrossCorrelation(mask, src, dest);

Preconditions:

The image must be larger than the size of the mask.

◆ fastNormalizedCrossCorrelation()

template<... >
void fastNormalizedCrossCorrelation (   ...)

This function performes a fast normalized cross-correlation.

To compute the normalized cross correlation in a fast way, it is using the Fast Fourier Transform and sum-image look-up-tables as it is suggested by J.P.Lewis (1995): "Fast Normalized Cross-Correlation".

The input pixel type T1 must be a linear space over the window functions' value_type T, i.e. addition of source values, multiplication with functions' values, and NumericTraits must be defined. The mask's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.

By default, the borders are filled with zeros. Use the clearBorders switch to change that behavior if you need to.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class T3, class S3>
void
bool clearBorders=true);
}
void fastNormalizedCrossCorrelation(...)
This function performes a fast normalized cross-correlation.

Usage:

#include <vigra/correlation.hxx>
Namespace: vigra

unsigned int m_w=51, m_h=51;
unsigned int w=1000, h=1000;
...
//compute normalized cross correlation of mask and image -> dest
fastNormalizedCrossCorrelation(mask, src, dest);

Preconditions:

The image must be larger than the size of the mask.

◆ crossCorrelation()

template<... >
void crossCorrelation (   ...)

This function performes a (slow) cross-correlation.

This function performes a (slow) cross-correlation using the window function environment and comparison of the mask with the underlying image part for each pixel. This may however be faster for very few comparisons.

The input pixel type T1 must be a linear space over the window functions' value_type T, i.e. addition of source values, multiplication with functions' values, and NumericTraits must be defined. The mask's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class T3, class S3>
void
}
void crossCorrelation(...)
This function performes a (slow) cross-correlation.

show deprecated declarations

Usage:

#include <vigra/correlation.hxx>
Namespace: vigra

unsigned int m_w=51, m_h=51;
unsigned int w=1000, h=1000;
...
//compute (slow) cross correlation of mask and image -> dest
crossCorrelation(mask, src, dest);

Preconditions:

The image must be larger than the size of the mask.

◆ normalizedCrossCorrelation()

template<... >
void normalizedCrossCorrelation (   ...)

This function performes a (slow) normalized cross-correlation.

This function performes a (slow) normalized cross-correlation using the window function environment and comparison of the mask with the underlying image part for each pixel. This may however be faster for very few comparisons.

The input pixel type T1 must be a linear space over the window functions' value_type T, i.e. addition of source values, multiplication with functions' values, and NumericTraits must be defined. The mask's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class T3, class S3>
void
}
void normalizedCrossCorrelation(...)
This function performes a (slow) normalized cross-correlation.

show deprecated declarations

Usage:

#include <vigra/correlation.hxx>
Namespace: vigra

unsigned int m_w=51, m_h=51;
unsigned int w=1000, h=1000;
...
//compute (slow) normalized cross correlation of mask and image -> dest
normalizedCrossCorrelation(mask, src, dest);

Preconditions:

The image must be larger than the size of the mask.

◆ operator-() [1/5]

Diff2D operator- ( Diff2D const a,
Diff2D const b 
)

Create vector by subtracting specified offset.

◆ operator-() [2/5]

Size2D operator- ( Size2D const s,
Diff2D const offset 
)

Create size by subtracting specified offset.

◆ operator-() [3/5]

Point2D operator- ( Point2D const s,
Diff2D const offset 
)

Calculate size of rect between two points.

◆ operator-() [4/5]

Size2D operator- ( Point2D const s,
Point2D const p 
)

The difference of two points is a size

◆ operator+() [1/4]

Diff2D operator+ ( Diff2D const a,
Diff2D const b 
)

Create vector by adding specified offset.

◆ operator+() [2/4]

Size2D operator+ ( Size2D const a,
Diff2D const b 
)

Create size by adding specified offset.

◆ operator+() [3/4]

Point2D operator+ ( Point2D const a,
Diff2D const b 
)

Create point by adding specified offset.

◆ operator+() [4/4]

Point2D operator+ ( Size2D const s,
Point2D const p 
)

Add size and point

◆ distanceTransform()

template<... >
void distanceTransform (   ...)

For all background pixels, calculate the distance to the nearest object or contour. The label of the pixels to be considered background in the source image is passed in the parameter 'background'. Source pixels with other labels will be considered objects. In the destination image, all pixels corresponding to background will be assigned the their distance value, all pixels corresponding to objects will be assigned 0.

The parameter 'norm' gives the distance norm to be used:

  • norm == 0: use chessboard distance (L-infinity norm)
  • norm == 1: use Manhattan distance (L1 norm)
  • norm == 2: use Euclidean distance (L2 norm)

If you use the L2 norm, the destination pixels must be real valued to give correct results.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class ValueType>
void
ValueType background, int norm);
}
FFTWComplex< R >::NormType norm(const FFTWComplex< R > &a)
norm (= magnitude)
Definition fftw3.hxx:1037
void distanceTransform(...)

show deprecated declarations

Usage:

#include <vigra/distancetransform.hxx>
Namespace: vigra

MultiArray<2, float> distance(w, h);
...
// detect edges in src image (edges will be marked 1, background 0)
differenceOfExponentialEdgeImage(src, edges, 0.8, 4.0);
// find distance of all pixels from nearest edge
distanceTransform(edges, distance, 0, 2);
// ^ background label ^ norm (Euclidean)

show deprecated examples

◆ eccentricityCenters()

template<unsigned int N, class T , class S , class Array >
void eccentricityCenters ( const MultiArrayView< N, T, S > &  src,
Array &  centers 
)

Find the (approximate) eccentricity center in each region of a labeled image.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T, class S, class Array>
void
Array & centers);
}
void eccentricityCenters(const MultiArrayView< N, T, S > &src, Array &centers)
Find the (approximate) eccentricity center in each region of a labeled image.
Definition eccentricitytransform.hxx:174
Parameters
[in]src: labeled array
[out]centers: list of eccentricity centers (required interface: centers[k] = TinyVector<int, N>() must be supported)

Usage:

#include <vigra/eccentricitytransform.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
MultiArray<3, UInt32> labels(shape);
...
eccentricityCenters(labels, centers);

◆ eccentricityTransformOnLabels()

template<unsigned int N, class T , class S , class Array >
void eccentricityTransformOnLabels ( MultiArrayView< N, T > const src,
MultiArrayView< N, S dest,
Array &  centers 
)

Computes the (approximate) eccentricity transform on each region of a labeled image.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// compute only the accentricity transform
template <unsigned int N, class T, class S>
void
// also return the eccentricity center of each region
template <unsigned int N, class T, class S, class Array>
void
Array & centers);
}
void eccentricityTransformOnLabels(MultiArrayView< N, T > const &src, MultiArrayView< N, S > dest, Array &centers)
Computes the (approximate) eccentricity transform on each region of a labeled image.
Definition eccentricitytransform.hxx:236
Parameters
[in]src: labeled array
[out]dest: eccentricity transform of src
[out]centers: (optional) list of eccentricity centers (required interface: centers[k] = TinyVector<int, N>() must be supported)

Usage:

#include <vigra/eccentricitytransform.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
MultiArray<3, UInt32> labels(shape);
...
eccentricityTransformOnLabels(labels, dest, centers);

◆ differenceOfExponentialEdgeImage()

template<... >
void differenceOfExponentialEdgeImage (   ...)

Detect and mark edges in an edge image using the Shen/Castan zero-crossing detector.

This operator applies an exponential filter to the source image at the given scale and subtracts the result from the original image. Zero crossings are detected in the resulting difference image. Whenever the gradient at a zero crossing is greater than the given gradient_threshold, an edge point is marked (using edge_marker) in the destination image on the darker side of the zero crossing (note that zero crossings occur between pixels). For example:

sign of difference image resulting edge points (*)
+ - - * * .
+ + - => . * *
+ + + . . .
T sign(T t)
The sign function.
Definition mathutil.hxx:591

Non-edge pixels (.) remain untouched in the destination image. The result can be improved by the post-processing operation removeShortEdges(). A more accurate edge placement can be achieved with the function differenceOfExponentialCrackEdgeImage().

The source value type (SrcAccessor::value_type) must be a linear algebra, i.e. addition, subtraction and multiplication of the type with itself, and multiplication with double and NumericTraits must be defined. In addition, this type must be less-comparable.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class GradValue, class DestValue>
void
double scale,
DestValue edge_marker = NumericTraits<DestValue>::one());
}
void differenceOfExponentialEdgeImage(...)
Detect and mark edges in an edge image using the Shen/Castan zero-crossing detector.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

...
// find edges at scale 0.8 with gradient larger than 4.0, mark with 1
differenceOfExponentialEdgeImage(src, edges,
0.8, 4.0, 1);

show deprecated examples

Preconditions:

scale > 0

◆ differenceOfExponentialCrackEdgeImage()

template<... >
void differenceOfExponentialCrackEdgeImage (   ...)

Detect and mark edges in a crack edge image using the Shen/Castan zero-crossing detector.

This operator applies an exponential filter to the source image at the given scale and subtracts the result from the original image. Zero crossings are detected in the resulting difference image. Whenever the gradient at a zero crossing is greater than the given gradient_threshold, an edge point is marked (using edge_marker) in the destination image between the corresponding original pixels. Topologically, this means we must insert additional pixels between the original ones to represent the boundaries between the pixels (the so called zero- and one-cells, with the original pixels being two-cells). Within VIGRA, such an image is called Crack Edge Image. To allow insertion of the zero- and one-cells, the destination image must have twice the size of the original (precisely, (2*w-1) by (2*h-1) pixels). Then the algorithm proceeds as follows:

sign of difference image insert zero- and one-cells resulting edge points (*)
+ . - . - . * . . .
+ - - . . . . . . * * * .
+ + - => + . + . - => . . . * .
+ + + . . . . . . . . * *
+ . + . + . . . . .

Thus the edge points are marked where they actually are - in between the pixels. An important property of the resulting edge image is that it conforms to the notion of well-composedness as defined by Latecki et al., i.e. connected regions and edges obtained by a subsequent Connected Components Labeling do not depend on whether 4- or 8-connectivity is used. The non-edge pixels (.) in the destination image remain unchanged. The result conforms to the requirements of a Crack Edge Image. It can be further improved by the post-processing operations removeShortEdges() and closeGapsInCrackEdgeImage().

The source value type (SrcAccessor::value_type) must be a linear algebra, i.e. addition, subtraction and multiplication of the type with itself, and multiplication with double and NumericTraits must be defined. In addition, this type must be less-comparable.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class GradValue, class DestValue>
void
double scale,
DestValue edge_marker = NumericTraits<DestValue>::one());
}
void differenceOfExponentialCrackEdgeImage(...)
Detect and mark edges in a crack edge image using the Shen/Castan zero-crossing detector.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

MultiArray<2, unsigned char> src(w,h), edges(2*w-1,2*h-1);
...
// find edges at scale 0.8 with gradient larger than 4.0, mark with 1
differenceOfExponentialCrackEdgeImage(src, edges,
0.8, 4.0, 1);

show deprecated examples

Preconditions:

scale > 0

The destination image must have twice the size of the source:

w_dest = 2 * w_src - 1
h_dest = 2 * h_src - 1

◆ removeShortEdges()

template<... >
void removeShortEdges (   ...)

Remove short edges from an edge image.

This algorithm can be applied as a post-processing operation of differenceOfExponentialEdgeImage() and differenceOfExponentialCrackEdgeImage(). It removes all edges that are shorter than min_edge_length. The corresponding pixels are set to the non_edge_marker. The idea behind this algorithms is that very short edges are probably caused by noise and don't represent interesting image structure. Technically, the algorithms executes a connected components labeling, so the image's value type must be equality comparable.

If the source image fulfills the requirements of a Crack Edge Image, it will still do so after application of this algorithm.

Note that this algorithm, unlike most other algorithms in VIGRA, operates in-place, i.e. on only one image. Also, the algorithm assumes that all non-edges pixels are already marked with the given non_edge_marker value.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S, class Value>
void
unsigned int min_edge_length, Value non_edge_marker);
}
void removeShortEdges(...)
Remove short edges from an edge image.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

...
// find edges at scale 0.8 with gradient larger than 4.0, mark with 1
differenceOfExponentialEdgeImage(src, edges,
0.8, 4.0, 1);
// zero edges shorter than 10 pixels
removeShortEdges(edges, 10, 0);

show deprecated examples

◆ closeGapsInCrackEdgeImage()

template<... >
void closeGapsInCrackEdgeImage (   ...)

Close one-pixel wide gaps in a cell grid edge image.

This algorithm is typically applied as a post-processing operation of differenceOfExponentialCrackEdgeImage(). The source image must fulfill the requirements of a Crack Edge Image, and will still do so after application of this algorithm.

It closes one pixel wide gaps in the edges resulting from this algorithm. Since these gaps are usually caused by zero crossing slightly below the gradient threshold used in edge detection, this algorithms acts like a weak hysteresis thresholding. The newly found edge pixels are marked with the given edge_marker. The image's value type must be equality comparable.

Note that this algorithm, unlike most other algorithms in VIGRA, operates in-place, i.e. on only one image.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S, class Value>
void
}
void closeGapsInCrackEdgeImage(...)
Close one-pixel wide gaps in a cell grid edge image.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

MultiArray<2, unsigned char> src(w,h), edges(2*w-1, 2*h-1);
...
// find edges at scale 0.8 with gradient larger than 4.0, mark with 1
differenceOfExponentialCrackEdgeImage(src, edges,
0.8, 4.0, 1);
// close gaps, mark with 1
// zero edges shorter than 20 pixels
removeShortEdges(edges, 10, 0);

show deprecated examples

◆ beautifyCrackEdgeImage()

template<... >
void beautifyCrackEdgeImage (   ...)

Beautify crack edge image for visualization.

This algorithm is applied as a post-processing operation of differenceOfExponentialCrackEdgeImage(). The source image must fulfill the requirements of a Crack Edge Image, but will not do so after application of this algorithm. In particular, the algorithm removes zero-cells marked as edges to avoid staircase effects on diagonal lines like this:

. * . . . . * . . .
. * * * . . . * . .
. . . * . => . . . * .
. . . * * . . . . *
. . . . . . . . . .

Therefore, this algorithm should only be applied as a visualization aid, i.e. for human inspection. The algorithm assumes that edges are marked with edge_marker, and background pixels with background_marker. The image's value type must be equality comparable.

Note that this algorithm, unlike most other algorithms in VIGRA, operates in-place, i.e. on only one image.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S, class Value>
void
}
void beautifyCrackEdgeImage(...)
Beautify crack edge image for visualization.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

MultiArray<2, unsigned char> src(w,h), edges(2*w-1, 2*h-1);
...
// find edges at scale 0.8 with gradient larger than 4.0, mark with 1
differenceOfExponentialCrackEdgeImage(src, edges,
0.8, 4.0, 1);
// beautify edge image for visualization
// show to the user ('window' is an unspecified GUI widget to display VIGRA images)
window.open(edges);

show deprecated examples

◆ cannyEdgelList()

template<... >
void cannyEdgelList (   ...)

Simple implementation of Canny's edge detector.

The function can be called in two modes: If you pass a 'scale', it is assumed that the original image is scalar, and the Gaussian gradient is internally computed at the given 'scale'. If the function is called without scale parameter, it is assumed that the given image already contains the gradient (i.e. its value_type must be a vector of length 2).

On the basis of the gradient image, a simple non-maxima suppression is performed: for each 3x3 neighborhood, it is determined whether the center pixel has larger gradient magnitude than its two neighbors in gradient direction (where the direction is rounded into octants). If this is the case, a new Edgel is appended to the given vector of edgels. The subpixel edgel position is determined by fitting a parabola to the three gradient magnitude values mentioned above. The sub-pixel location of the parabola's tip and the gradient magnitude and direction (from the pixel center) are written in the newly created edgel.

Declarations:

pass 2D array views:

namespace vigra {
// compute edgels from a scalar image (determine gradient internally at 'scale')
template <class T, class S, class BackInsertable>
void
double scale);
// compute edgels from a pre-computed gradient image
template <class T, class S, class BackInsertable>
void
}
void cannyEdgelList(...)
Simple implementation of Canny's edge detector.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

// create empty edgel list
std::vector<vigra::Edgel> edgels;
...
// find edgels at scale 0.8
cannyEdgelList(src, edgels, 0.8);

show deprecated examples

Preconditions:

scale > 0

◆ cannyEdgelListThreshold()

template<... >
void cannyEdgelListThreshold (   ...)

Canny's edge detector with thresholding.

This function works exactly like cannyEdgelList(), but you also pass a threshold for the minimal gradient magnitude, so that edgels whose strength is below the threshold are not inserted into the edgel list.

Declarations:

pass 2D array views:

namespace vigra {
// compute edgels from a scalar image (determine gradient internally at 'scale')
template <class T, class S,
class BackInsertable, class GradValue>
void
double scale,
// compute edgels from a pre-computed gradient image
template <class T, class S,
class BackInsertable, class GradValue>
void
}
void cannyEdgelListThreshold(...)
Canny's edge detector with thresholding.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

// create empty edgel list
std::vector<vigra::Edgel> edgels;
...
// find edgels at scale 0.8, only considering gradient magnitudes above 2.0
cannyEdgelListThreshold(src, edgels, 0.8, 2.0);

show deprecated examples

Preconditions:

scale > 0

◆ cannyEdgeImage()

template<... >
void cannyEdgeImage (   ...)

Detect and mark edges in an edge image using Canny's algorithm.

This operator first calls cannyEdgelList() with the given scale to generate an edgel list for the given image. Then it scans this list and selects edgels whose strength is above the given gradient_threshold. For each of these edgels, the edgel's location is rounded to the nearest pixel, and that pixel marked with the given edge_marker.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class GradValue, class DestValue>
void
double scale,
}
void cannyEdgeImage(...)
Detect and mark edges in an edge image using Canny's algorithm.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

...
// find edges at scale 0.8 with gradient larger than 4.0, mark with 1
cannyEdgeImage(src, edges, 0.8, 4.0, 1);

show deprecated examples

Preconditions:

scale > 0

◆ cannyEdgeImageFromGradWithThinning()

template<... >
void cannyEdgeImageFromGradWithThinning (   ...)

Detect and mark edges in an edge image using Canny's algorithm.

The input pixels of this algorithm must be vectors of length 2 (see Required Interface below). It first searches for all pixels whose gradient magnitude is larger than the given gradient_threshold and larger than the magnitude of its two neighbors in gradient direction (where these neighbors are determined by nearest neighbor interpolation, i.e. according to the octant where the gradient points into). The resulting edge pixel candidates are then subjected to topological thinning so that the remaining edge pixels can be linked into edgel chains with a provable, non-heuristic algorithm. Thinning is performed so that the pixels with highest gradient magnitude survive. Optionally, the outermost pixels are marked as edge pixels as well when addBorder is true. The remaining pixels will be marked in the destination image with the value of edge_marker (all non-edge pixels remain untouched).

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class GradValue, class DestValue>
void
bool addBorder = true);
}
void cannyEdgeImageFromGradWithThinning(...)
Detect and mark edges in an edge image using Canny's algorithm.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

// compute the image gradient at scale 0.8
gaussianGradient(src, grad, 0.8);
// find edges with gradient larger than 4.0, mark with 1, and add border
cannyEdgeImageFromGradWithThinning(grad, edges, 4.0, 1, true);

show deprecated examples

Preconditions:

◆ cannyEdgeImageWithThinning()

template<... >
void cannyEdgeImageWithThinning (   ...)

Detect and mark edges in an edge image using Canny's algorithm.

This operator first calls gaussianGradient() to compute the gradient of the input image, ad then cannyEdgeImageFromGradWithThinning() to generate an edge image. See there for more detailed documentation.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class GradValue, class DestValue>
void
double scale,
bool addBorder = true);
}
void cannyEdgeImageWithThinning(...)
Detect and mark edges in an edge image using Canny's algorithm.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

...
// find edges at scale 0.8 with gradient larger than 4.0, mark with 1, and add border
cannyEdgeImageWithThinning(src, edges, 0.8, 4.0, 1, true);

show deprecated examples

Preconditions:

scale > 0

◆ cannyEdgelList3x3()

template<... >
void cannyEdgelList3x3 (   ...)

Improved implementation of Canny's edge detector.

This operator first computes pixels which are crossed by the edge using cannyEdgeImageWithThinning(). The gradient magnitudes in the 3x3 neighborhood of these pixels are then projected onto the normal of the edge (as determined by the gradient direction). The edgel's subpixel location is found by fitting a parabola through the 9 gradient values and determining the parabola's tip. A new Edgel is appended to the given vector of edgels. Since the parabola is fitted to 9 points rather than 3 points as in cannyEdgelList(), the accuracy is higher.

The function can be called in two modes: If you pass a 'scale', it is assumed that the original image is scalar, and the Gaussian gradient is internally computed at the given 'scale'. If the function is called without scale parameter, it is assumed that the given image already contains the gradient (i.e. its value_type must be a vector of length 2).

Declarations:

pass 2D array views:

namespace vigra {
// compute edgels from a scalar image (determine gradient internally at 'scale')
template <class T, class S, class BackInsertable>
void
double scale);
// compute edgels from a pre-computed gradient image
template <class T, class S, class BackInsertable>
void
}
void cannyEdgelList3x3(...)
Improved implementation of Canny's edge detector.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

// create empty edgel list
std::vector<vigra::Edgel> edgels;
...
// find edgels at scale 0.8
cannyEdgelList3x3(src, edgels, 0.8);

show deprecated examples

Preconditions:

scale > 0

◆ cannyEdgelList3x3Threshold()

template<... >
void cannyEdgelList3x3Threshold (   ...)

Improved implementation of Canny's edge detector with thresholding.

This function works exactly like cannyEdgelList3x3(), but you also pass a threshold for the minimal gradient magnitude, so that edgels whose strength is below the threshold are not inserted into the edgel list.

Declarations:

pass 2D array views:

namespace vigra {
// compute edgels from a gradient image
template <class SrcIterator, class SrcAccessor,
class BackInsertable, class GradValue>
void
// compute edgels from a scalar image (determine gradient internally at 'scale')
template <class SrcIterator, class SrcAccessor,
class BackInsertable, class GradValue>
void
}
void cannyEdgelList3x3Threshold(...)
Improved implementation of Canny's edge detector with thresholding.

show deprecated declarations

Usage:

#include <vigra/edgedetection.hxx>
Namespace: vigra

// create empty edgel list
std::vector<vigra::Edgel> edgels;
...
// find edgels at scale 0.8 whose gradient is at least 4.0
cannyEdgelList3x3Threshold(src, edgels, 0.8, 4.0);

show deprecated examples

Preconditions:

scale > 0

◆ moveDCToCenter()

template<... >
void moveDCToCenter (   ...)

Rearrange the quadrants of a Fourier image so that the origin is in the image center.

FFTW produces fourier images where the DC component (origin of fourier space) is located in the upper left corner of the image. The quadrants are placed like this (using a 4x4 image for example):

DC 4 3 3
4 4 3 3
1 1 2 2
1 1 2 2

After applying the function, the quadrants are at their usual places:

2 2 1 1
2 2 1 1
3 3 DC 4
3 3 4 4

This transformation can be reversed by moveDCToUpperLeft(). Note that the 2D versions of this transformation must not be executed in place - input and output images must be different. In contrast, the nD version (with MultiArrayView argument) always works in-place.

Declarations:

use MultiArrayView (this works in-place, with arbitrary dimension N):

namespace vigra {
template <unsigned int N, class T, class Stride>
}
void moveDCToCenter(...)
Rearrange the quadrants of a Fourier image so that the origin is in the image center.

pass iterators explicitly (2D only, not in-place):

use argument objects in conjunction with Argument Object Factories (2D only, not in-place):

Usage:

#include <vigra/fftw3.hxx> (for 2D variants)
#include <vigra/multi_fft.hxx> (for nD variants)
Namespace: vigra

vigra::FFTWComplexImage spatial(width,height), fourier(width,height);
... // fill image with data
// create a plan with estimated performance optimization
// calculate FFT
moveDCToCenter(srcImageRange(fourier), destImage(rearrangedFourier));
// delete the plan
iterator begin()
Definition tinyvector.hxx:861

◆ moveDCToUpperLeft()

template<... >
void moveDCToUpperLeft (   ...)

Rearrange the quadrants of a Fourier image so that the origin is in the image's upper left.

This function is the inversion of moveDCToCenter(). See there for a detailed description and usage examples.

Declarations:

use MultiArrayView (this works in-place, with arbitrary dimension N):

namespace vigra {
template <unsigned int N, class T, class Stride>
}
void moveDCToUpperLeft(...)
Rearrange the quadrants of a Fourier image so that the origin is in the image's upper left.

pass iterators explicitly (2D only, not in-place):

use argument objects in conjunction with Argument Object Factories (2D only, not in-place):

◆ fourierTransform()

template<... >
void fourierTransform (   ...)

Compute forward and inverse Fourier transforms.

The array referring to the spatial domain (i.e. the input in a forward transform, and the output in an inverse transform) may be scalar or complex. The array representing the frequency domain (i.e. output for forward transform, input for inverse transform) must always be complex.

The new implementations (those using MultiArrayView arguments) perform a normalized transform, whereas the old ones (using 2D iterators or argument objects) perform an un-normalized transform (i.e. the result of the inverse transform is scaled by the number of pixels).

In general, input and output arrays must have the same shape, with the exception of the special R2C and C2R modes defined by FFTW.

The R2C transform reduces the redundancy in the Fourier representation of a real-valued signal: Since the Fourier representation of a real signal is symmetric, about half of the Fourier coefficients can simply be dropped. By convention, this reduction is applied to the first (innermost) dimension, such that fourier.shape(0) == spatial.shape(0)/2 + 1 holds. The correct frequency domain shape can be conveniently computed by means of the function fftwCorrespondingShapeR2C().

Note that your program must always link against libfftw3. If you want to compute Fourier transforms for float or long double arrays, you must additionally link against libfftw3f and libfftw3l respectively. (Old-style functions only support double).

The Fourier transform functions internally create FFTW plans which control the algorithm details. The plans are creates with the flag FFTW_ESTIMATE, i.e. optimal settings are guessed or read from saved "wisdom" files. If you need more control over planning, you can use the class FFTWPlan.

Declarations:

use complex-valued MultiArrayView arguments (this works for arbitrary dimension N):

namespace vigra {
template <unsigned int N, class Real, class C1, class C2>
void
template <unsigned int N, class Real, class C1, class C2>
void
}
void fourierTransform(...)
Compute forward and inverse Fourier transforms.
void fourierTransformInverse(...)
Compute inverse Fourier transforms.

use real-valued MultiArrayView in the spatial domain, complex-valued MultiArrayView in the frequency domain (this works for arbitrary dimension N, and also supports the R2C and C2R transform, depending on the array shape in the frequency domain):

namespace vigra {
template <unsigned int N, class Real, class C1, class C2>
void
template <unsigned int N, class Real, class C1, class C2>
void
}

pass iterators explicitly (2D only, double only):

namespace vigra {
template <class SrcImageIterator, class SrcAccessor>
FFTWComplexImage::traverser destUpperLeft, FFTWComplexImage::Accessor dest);
void
fourierTransformInverse(FFTWComplexImage::const_traverser sul,
FFTWComplexImage::const_traverser slr, FFTWComplexImage::ConstAccessor src,
FFTWComplexImage::traverser dul, FFTWComplexImage::Accessor dest)
}

use argument objects in conjunction with Argument Object Factories (2D only, double only):

namespace vigra {
template <class SrcImageIterator, class SrcAccessor>
void
fourierTransformInverse(triple<FFTWComplexImage::const_traverser,
FFTWComplexImage::const_traverser, FFTWComplexImage::ConstAccessor> src,
}

Usage:

#include <vigra/fftw3.hxx> (old-style 2D variants)
#include <vigra/multi_fft.hxx> (new-style nD variants)
Namespace: vigra

old-style example (using FFTWComplexImage):

// compute complex Fourier transform of a real image, old-style implementation
fourierTransform(srcImageRange(src), destImage(fourier));
// compute inverse Fourier transform
// note that both source and destination image must be of type vigra::FFTWComplexImage
fourierTransformInverse(srcImageRange(fourier), destImage(inverseFourier));

new-style examples (using MultiArray):

// compute Fourier transform of a real array, using the R2C algorithm
// compute inverse Fourier transform, using the C2R algorithm
TinyVector< T, N > fftwCorrespondingShapeR2C(TinyVector< T, N > shape)
Find frequency domain shape for a R2C Fourier transform.
Definition multi_fft.hxx:802
// compute Fourier transform of a real array with standard algorithm
// compute inverse Fourier transform, using the C2R algorithm

Complex input arrays are handled in the same way.

◆ fourierTransformInverse()

template<... >
void fourierTransformInverse (   ...)

Compute inverse Fourier transforms.

See fourierTransform() for details.

◆ applyFourierFilter()

template<... >
void applyFourierFilter (   ...)

Apply a filter (defined in the frequency domain) to an image.

After transferring the image into the frequency domain, it is multiplied pixel-wise with the filter and transformed back. The result is put into the given destination image which must have the right size. The result will be normalized to compensate for the two FFTs.

If the destination image is scalar, only the real part of the result image is retained. In this case, you are responsible for choosing a filter image which ensures a zero imaginary part of the result (e.g. use a real, even symmetric filter image, or a purely imaginary, odd symmetric one).

The DC entry of the filter must be in the upper left, which is the position where FFTW expects it (see moveDCToUpperLeft()).

See also convolveFFT() for corresponding functionality on the basis of the MultiArrayView interface.

Declarations:

pass 2D array views:

pass Image Iterators and Data Accessors :

use argument objects in conjunction with Argument Object Factories :

Usage:

#include <vigra/fftw3.hxx>
Namespace: vigra

// create a Gaussian filter in Fourier space
for(int y=0; y<h; ++y)
for(int x=0; x<w; ++x)
{
xx = float(x - w / 2) / w;
yy = float(y - h / 2) / h;
gaussFilter(x,y) = std::exp(-(xx*xx + yy*yy) / 2.0 * scale);
}
// applyFourierFilter() expects the filter's DC in the upper left
moveDCToUpperLeft(srcImageRange(gaussFilter), destImage(filter));
vigra::applyFourierFilter(srcImageRange(image), srcImage(filter), result);

For inspection of the result, FFTWMagnitudeAccessor might be useful. If you want to apply the same filter repeatedly, it may be more efficient to use the FFTW functions directly with FFTW plans optimized for good performance.

◆ applyFourierFilterFamily()

template<... >
void applyFourierFilterFamily (   ...)

Apply an array of filters (defined in the frequency domain) to an image.

This provides the same functionality as applyFourierFilter(), but applying several filters at once allows to avoid repeated Fourier transforms of the source image.

Filters and result images must be stored in vigra::ImageArray data structures. In contrast to applyFourierFilter(), this function adjusts the size of the result images and the the length of the array.

Declarations:

pass 2D array views:

namespace vigra {
template <class SrcImageIterator, class SrcAccessor, class FilterType>
}
void applyFourierFilterFamily(...)
Apply an array of filters (defined in the frequency domain) to an image.

pass Image Iterators and Data Accessors :

namespace vigra {
template <class SrcImageIterator, class SrcAccessor, class FilterType>
}

use argument objects in conjunction with Argument Object Factories :

namespace vigra {
template <class SrcImageIterator, class SrcAccessor, class FilterType>
}

Usage:

#include <vigra/fftw3.hxx>
Namespace: vigra

// assuming the presence of a real-valued image named "image" to
// be filtered in this example
for (int i=0; i<filters.size(); i++)
// create some meaningful filters here

◆ fourierTransformReal()

template<... >
void fourierTransformReal (   ...)

Real Fourier transforms for even and odd boundary conditions (aka. cosine and sine transforms).

If the image is real and has even symmetry, its Fourier transform is also real and has even symmetry. The Fourier transform of a real image with odd symmetry is imaginary and has odd symmetry. In either case, only about a quarter of the pixels need to be stored because the rest can be calculated from the symmetry properties. This is especially useful, if the original image is implicitly assumed to have reflective or anti-reflective boundary conditions. Then the "negative" pixel locations are defined as

even (reflective boundary conditions): f[-x] = f[x] (x = 1,...,N-1)
f[-x] = -f[x-2] (x = 2,...,N-1)
bool even(int t)
Check if an integer is even.
bool odd(int t)
Check if an integer is odd.

end similar at the other boundary (see the FFTW documentation for details). This has the advantage that more efficient Fourier transforms that use only real numbers can be implemented. These are also known as cosine and sine transforms respectively.

If you use the odd transform it is important to note that in the Fourier domain, the DC component is always zero and is therefore dropped from the data structure. This means that index 0 in an odd symmetric Fourier domain image refers to the first harmonic. This is especially important if an image is first cosine transformed (even symmetry), then in the Fourier domain multiplied with an odd symmetric filter (e.g. a first derivative) and finally transformed back to the spatial domain with a sine transform (odd symmetric). For this to work properly the image must be shifted left or up by one pixel (depending on whether the x- or y-axis is odd symmetric) before the inverse transform can be applied. (see example below).

The real Fourier transform functions are named fourierTransformReal?? where the questions marks stand for either E or O indicating whether the x- and y-axis is to be transformed using even or odd symmetry. The same functions can be used for both the forward and inverse transforms, only the normalization changes. For signal processing, the following normalization factors are most appropriate:

forward inverse
------------------------------------------------------------
X even, Y even 1.0 4.0 * (w-1) * (h-1)
X even, Y odd -1.0 -4.0 * (w-1) * (h+1)
X odd, Y even -1.0 -4.0 * (w+1) * (h-1)
X odd, Y odd 1.0 4.0 * (w+1) * (h+1)

where w and h denote the image width and height.

Declarations:

pass 2D array views:

namespace vigra {
template <class SrcTraverser, class SrcAccessor,
void
fourierTransformRealEE(SrcTraverser sul, SrcTraverser slr, SrcAccessor src,
fourierTransformRealEO, fourierTransformRealOE, fourierTransformRealOO likewise
}

pass Image Iterators and Data Accessors :

namespace vigra {
template <class SrcTraverser, class SrcAccessor,
void
fourierTransformRealEE(SrcTraverser sul, SrcTraverser slr, SrcAccessor src,
fourierTransformRealEO, fourierTransformRealOE, fourierTransformRealOO likewise
}

use argument objects in conjunction with Argument Object Factories :

namespace vigra {
template <class SrcTraverser, class SrcAccessor,
void
fourierTransformRealEO, fourierTransformRealOE, fourierTransformRealOO likewise
}

Usage:

#include <vigra/fftw3.hxx>
Namespace: vigra

vigra::FImage spatial(width,height), fourier(width,height);
... // fill image with data
// forward cosine transform == reflective boundary conditions
fourierTransformRealEE(srcImageRange(spatial), destImage(fourier), (fftw_real)1.0);
// multiply with a first derivative of Gaussian in x-direction
for(int y = 0; y < height; ++y)
{
for(int x = 1; x < width; ++x)
{
double dx = x * M_PI / (width - 1);
double dy = y * M_PI / (height - 1);
fourier(x-1, y) = fourier(x, y) * dx * std::exp(-(dx*dx + dy*dy) * scale*scale / 2.0);
}
fourier(width-1, y) = 0.0;
}
// inverse transform -- odd symmetry in x-direction, even in y,
// due to symmetry of the filter
fourierTransformRealOE(srcImageRange(fourier), destImage(spatial),
(fftw_real)-4.0 * (width+1) * (height-1));

◆ fixed_point_cast() [1/2]

template<class TARGET , unsigned IntBits, unsigned FracBits>
TARGET fixed_point_cast ( FixedPoint< IntBits, FracBits v)

Convert a FixedPoint to a built-in type. If the target is integral, the value is rounded.
Usage:

◆ fixed_point_cast() [2/2]

template<class TARGET , int IntBits, FPOverflowHandling OverflowHandling>
TARGET fixed_point_cast ( FixedPoint16< IntBits, OverflowHandling v)

Convert a FixedPoint16 to a built-in type. If the target is integral, the value is rounded.
Usage:

◆ discRankOrderFilter()

template<... >
void discRankOrderFilter (   ...)

Apply rank order filter with disc structuring function to the image.

The pixel values of the source image must be in the range 0...255. Radius must be >= 0. Rank must be in the range 0.0 <= rank <= 1.0. The filter acts as a minimum filter if rank = 0.0, as a median if rank = 0.5, and as a maximum filter if rank = 1.0. Accessor are used to access the pixel data.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
int radius, float rank);
}
void discRankOrderFilter(...)
Apply rank order filter with disc structuring function to the image.

show deprecated declarations

Usage:

#include <vigra/flatmorphology.hxx>
Namespace: vigra

// do median filtering (because rank=0.5) in a cricle with radius 10

show deprecated examples

Preconditions:

for all source pixels: 0 <= value <= 255
(rank >= 0.0) && (rank <= 1.0)
radius >= 0

◆ discErosion()

template<... >
void discErosion (   ...)

Apply erosion (minimum) filter with disc of given radius to image.

This is an abbreviation for the rank order filter with rank = 0.0. See discRankOrderFilter() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
int radius);
}
void discErosion(...)
Apply erosion (minimum) filter with disc of given radius to image.

show deprecated declarations

◆ discDilation()

template<... >
void discDilation (   ...)

Apply dilation (maximum) filter with disc of given radius to image.

This is an abbreviation for the rank order filter with rank = 1.0. See discRankOrderFilter() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
int radius);
}
void discDilation(...)
Apply dilation (maximum) filter with disc of given radius to image.

show deprecated declarations

◆ discMedian()

template<... >
void discMedian (   ...)

Apply median filter with disc of given radius to image.

This is an abbreviation for the rank order filter with rank = 0.5. See discRankOrderFilter() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
int radius);
}
void discMedian(...)
Apply median filter with disc of given radius to image.

show deprecated declarations

◆ discRankOrderFilterWithMask()

template<... >
void discRankOrderFilterWithMask (   ...)

Apply rank order filter with disc structuring function to the image using a mask.

The pixel values of the source image must be in the range 0...255. Radius must be >= 0. Rank must be in the range 0.0 <= rank <= 1.0. The filter acts as a minimum filter if rank = 0.0, as a median if rank = 0.5, and as a maximum filter if rank = 1.0. Accessor are used to access the pixel data.

The mask is only applied to th input image, i.e. the function generates an output wherever the current disc contains at least one pixel with mask value 'true'. Source pixels with mask value 'false' are ignored during the calculation of the rank order.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
int radius, float rank);
}
void discRankOrderFilterWithMask(...)
Apply rank order filter with disc structuring function to the image using a mask.

show deprecated declarations

Usage:

#include <vigra/flatmorphology.hxx>
Namespace: vigra

...
// do median filtering (since rank=0.5) in a circle with radius 10
// but change only the pixels under the mask
discRankOrderFilterWithMask(src, mask, dest, 10, 0.5);

show deprecated examples

Preconditions:

for all source pixels: 0 <= value <= 255
(rank >= 0.0) && (rank <= 1.0)
radius >= 0

◆ discErosionWithMask()

template<... >
void discErosionWithMask (   ...)

Apply erosion (minimum) filter with disc of given radius to image using a mask.

This is an abbreviation for the masked rank order filter with rank = 0.0. See discRankOrderFilterWithMask() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
int radius);
}
void discErosionWithMask(...)
Apply erosion (minimum) filter with disc of given radius to image using a mask.

show deprecated declarations

◆ discDilationWithMask()

template<... >
void discDilationWithMask (   ...)

Apply dilation (maximum) filter with disc of given radius to image using a mask.

This is an abbreviation for the masked rank order filter with rank = 1.0. See discRankOrderFilterWithMask() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
int radius);
}
void discDilationWithMask(...)
Apply dilation (maximum) filter with disc of given radius to image using a mask.

show deprecated declarations

◆ discMedianWithMask()

template<... >
void discMedianWithMask (   ...)

Apply median filter with disc of given radius to image using a mask.

This is an abbreviation for the masked rank order filter with rank = 0.5. See discRankOrderFilterWithMask() for more information.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TM, class SM,
class T2, class S2>
void
int radius);
}
void discMedianWithMask(...)
Apply median filter with disc of given radius to image using a mask.

show deprecated declarations

◆ createGaborFilter()

template<... >
void createGaborFilter (   ...)

Create a gabor filter in frequency space.

The orientation is given in radians, the other parameters are the center frequency (for example 0.375 or smaller) and the two angular and radial sigmas of the gabor filter. (See angularGaborSigma() for an explanation of possible values.)

The energy of the filter is explicitly normalized to 1.0.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S>
void
double orientation, double centerFrequency,
double angularSigma, double radialSigma);
}
void createGaborFilter(...)
Create a gabor filter in frequency space.

show deprecated declarations

Usage:

#include <vigra/gaborfilter.hxx>
Namespace: vigra

angularGaborSigma(directionCount, freq),
double angularGaborSigma(int directionCount, double centerFrequency)
Calculate sensible angular sigma for given parameters.
Definition gaborfilter.hxx:287
double radialGaborSigma(double centerFrequency)
Calculate sensible radial sigma for given parameters.
Definition gaborfilter.hxx:244

show deprecated examples

◆ radialGaborSigma()

double radialGaborSigma ( double  centerFrequency)

Calculate sensible radial sigma for given parameters.

For a brief introduction what is meant with "sensible" sigmas, see angularGaborSigma().

Declaration:

namespace vigra {
}

◆ angularGaborSigma()

double angularGaborSigma ( int  directionCount,
double  centerFrequency 
)

Calculate sensible angular sigma for given parameters.

"Sensible" means: If you use a range of gabor filters for feature detection, you are interested in minimal redundancy. This is hard to define but one possible try is to arrange the filters in frequency space, so that the half-peak-magnitude ellipses touch each other.

To do so, you must know the number of directions (first parameter for the angular sigma function) and the center frequency of the filter you want to calculate the sigmas for.

The exact formulas are:

sigma_angular= 1/sqrt(ln(4)) * tan(pi/(directions*2))
sqrt(8/9) * centerFrequency

Declaration:

namespace vigra {
double angularGaborSigma(int directionCount, double centerFrequency)
}

◆ gradientEnergyTensor()

template<... >
void gradientEnergyTensor (   ...)

Calculate the gradient energy tensor for a scalar valued image.

These function calculates the gradient energy tensor (GET operator) as described in

M. Felsberg, U. Köthe: "GET: The Connection Between Monogenic Scale-Space and Gaussian Derivatives", in: R. Kimmel, N. Sochen, J. Weickert (Eds.): Scale Space and PDE Methods in Computer Vision, Proc. of Scale-Space 2005, Lecture Notes in Computer Science 3459, pp. 192-203, Heidelberg: Springer, 2005.

U. Köthe, M. Felsberg: "Riesz-Transforms Versus Derivatives: On the Relationship Between the Boundary Tensor and the Energy Tensor", in: ditto, pp. 179-191.

with the given filters: The derivative filter derivKernel is applied to the appropriate image dimensions in turn (see the papers above for details), and the other dimension is smoothed with smoothKernel. The kernels can be as small as 3x1, e.g. [0.5, 0, -0.5] and [3.0/16.0, 10.0/16.0, 3.0/16.0] respectively.
The output image must have 3 bands which will hold the tensor components in the order t11, t12 (== t21), t22. The signs of the output are adjusted for a right-handed coordinate system. Thus, orientations derived from the tensor will be in counter-clockwise (mathematically positive) order, with the x-axis at zero degrees (this is the standard in all VIGRA functions that deal with orientation).

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void gradientEnergyTensor(...)
Calculate the gradient energy tensor for a scalar valued image.

show deprecated declarations

Usage:

#include <vigra/gradient_energy_tensor.hxx>
Namespace: vigra

grad.initGaussianDerivative(0.7, 1);
smooth.initGaussian(0.7);
...
gradientEnergyTensor(img, get, grad, smooth);

show deprecated examples

◆ edgeSort()

template<class GRAPH , class WEIGHTS , class COMPERATOR >
void edgeSort ( const GRAPH &  g,
const WEIGHTS weights,
const COMPERATOR comperator,
std::vector< typename GRAPH::Edge > &  sortedEdges 
)

get a vector of Edge descriptors

Sort the Edge descriptors given weights and a comperator

◆ makeRegionAdjacencyGraph()

void makeRegionAdjacencyGraph ( GRAPH_IN  graphIn,
GRAPH_IN_NODE_LABEL_MAP  labels,
AdjacencyListGraph rag,
typename AdjacencyListGraph::template EdgeMap< std::vector< typename GRAPH_IN::Edge > > &  affiliatedEdges,
const Int64  ignoreLabel = -1 
)

make a region adjacency graph from a graph and labels w.r.t. that graph

Parameters
graphIn: input graph
labels: labels w.r.t. graphIn
[out]rag: region adjacency graph
[out]affiliatedEdges: a vector of edges of graphIn for each edge in rag
ignoreLabel: optional label to ignore (default: -1 means no label will be ignored)

◆ edgeWeightedWatershedsSegmentation()

template<class GRAPH , class EDGE_WEIGHTS , class SEEDS , class LABELS >
void edgeWeightedWatershedsSegmentation ( const GRAPH &  g,
const EDGE_WEIGHTS edgeWeights,
const SEEDS seeds,
LABELS labels 
)

edge weighted watersheds Segmentataion

Parameters
ginput graph
edgeWeights: edge weights / edge indicator
seeds: seed must be non empty!
[out]labels: resulting nodeLabeling (not necessarily dense)

◆ carvingSegmentation()

template<class GRAPH , class EDGE_WEIGHTS , class SEEDS , class LABELS >
void carvingSegmentation ( const GRAPH &  g,
const EDGE_WEIGHTS edgeWeights,
const SEEDS seeds,
const typename LABELS::Value  backgroundLabel,
const typename EDGE_WEIGHTS::Value  backgroundBias,
const typename EDGE_WEIGHTS::Value  noPriorBelow,
LABELS labels 
)

edge weighted watersheds Segmentataion

Parameters
ginput graph
edgeWeights: edge weights / edge indicator
seeds: seed must be non empty!
backgroundLabel: which label is background
backgroundBias: bias for background
noPriorBelow: don't bias the background if edge indicator is below this value
[out]labels: resulting nodeLabeling (not necessarily dense)

◆ felzenszwalbSegmentation()

void felzenszwalbSegmentation ( const GRAPH &  graph,
const EDGE_WEIGHTS edgeWeights,
const NODE_SIZE nodeSizes,
float  k,
NODE_LABEL_MAP nodeLabeling,
const int  nodeNumStopCond = -1 
)

edge weighted watersheds Segmentataion

Parameters
graphinput graph
edgeWeights: edge weights / edge indicator
nodeSizes: size of each node
k: free parameter of felzenszwalb algorithm
[out]nodeLabeling: nodeLabeling (not necessarily dense)
nodeNumStopCond: optional stopping condition

◆ graphSmoothing()

void graphSmoothing ( const GRAPH &  g,
const NODE_FEATURES_IN nodeFeaturesIn,
const EDGE_INDICATOR edgeIndicator,
const float  lambda,
const float  edgeThreshold,
const float  scale,
NODE_FEATURES_OUT nodeFeaturesOut 
)

smooth node features of a graph

Parameters
g: input graph
nodeFeaturesIn: input node features which should be smoothed
edgeIndicator: edge indicator to indicate over which edges one should smooth
lambda: scale edge indicator by lambda before taking negative exponent
edgeThreshold: edge threshold
scale: how much smoothing should be applied
[out]nodeFeaturesOut: smoothed node features

◆ recursiveGraphSmoothing()

void recursiveGraphSmoothing ( const GRAPH &  g,
const NODE_FEATURES_IN nodeFeaturesIn,
const EDGE_INDICATOR edgeIndicator,
const float  lambda,
const float  edgeThreshold,
const float  scale,
size_t  iterations,
NODE_FEATURES_OUT nodeFeaturesBuffer,
NODE_FEATURES_OUT nodeFeaturesOut 
)

smooth node features of a graph

Parameters
g: input graph
nodeFeaturesIn: input node features which should be smoothed
edgeIndicator: edge indicator to indicate over which edges one should smooth
lambda: scale edge indicator by lambda before taking negative exponent
edgeThreshold: edge threshold
scale: how much smoothing should be applied
iterations: how often should this algorithm be called recursively
[out]nodeFeaturesBuffer: preallocated(!) buffer to store node features temp.
[out]nodeFeaturesOut: smoothed node features

◆ projectGroundTruth()

void projectGroundTruth ( const RAG rag,
const BASE_GRAPH baseGraph,
const BASE_GRAPH_RAG_LABELS baseGraphRagLabels,
const BASE_GRAPH_GT baseGraphGt,
RAG_GT ragGt,
RAG_GT_QT  
)

project ground truth from a base graph, to a region adjacency graph.

◆ ragFindEdges()

template<class RAGGRAPH , class GRAPH , class RAGEDGES , unsigned int N, class T >
MultiArray< 2, MultiArrayIndex > ragFindEdges ( const RAGGRAPH rag,
const GRAPH &  graph,
const RAGEDGES affiliatedEdges,
MultiArrayView< N, T >  labelsArray,
const typename RAGGRAPH::Node &  node 
)

Find indices of points on the edges.

Parameters
rag: Region adjacency graph of the labels array
graph: Graph of labels array
affiliatedEdges: The affiliated edges of the region adjacency graph
labelsArray: The label image
node: The node (of the region adjacency graph), whose edges shall be found

◆ edgeWeightsFromNodeWeights()

void edgeWeightsFromNodeWeights ( const GridGraph< N, DirectedTag > &  g,
const NODEMAP nodeWeights,
EDGEMAP edgeWeights,
bool  euclidean,
FUNCTOR const func 
)

create edge weights from node weights

Parameters
g: input graph
nodeWeights: node property map holding node weights
[out]edgeWeights: resulting edge weights
euclidean: if 'true', multiply the computed weights with the Euclidean distance between the edge's end nodes (default: 'false')
func: binary function that computes the edge weight from the weights of the edge's end nodes (default: take the average)

◆ edgeWeightsFromInterpolatedImage()

void edgeWeightsFromInterpolatedImage ( const GridGraph< N, DirectedTag > &  g,
const MultiArrayView< N, T > &  interpolatedImage,
EDGEMAP edgeWeights,
bool  euclidean = false 
)

create edge weights from an interpolated image

Parameters
g: input graph
interpolatedImage: interpolated image
[out]edgeWeights: edge weights
euclidean: if 'true', multiply the weights with the Euclidean distance between the edge's end nodes (default: 'false')

For each edge, the function reads the weight from interpolatedImage[u+v], where u and v are the coordinates of the edge's end points.

◆ projectBack()

void projectBack ( const AdjacencyListGraph rag,
const BASE_GRAPH bg,
const Int64  ignoreLabel,
const BASE_GRAPH_LABELS  bgLabels,
const RAG_FEATURES ragFeatures,
BASE_GRAPH_FEATURES bgFeatures 
)

project node features of a region adjacency graph back to the base graph.

This function can be used to show a segmentation or node features of RAG on pixel / voxel level

◆ readHDF5()

template<... >
void readHDF5 (   ...)

Read the data specified by the given vigra::HDF5ImportInfo object and write the into the given 'array'.

The array must have the correct number of dimensions and shape for the dataset represented by 'info'. When the element type of 'array' differs from the stored element type, HDF5 will convert the type on the fly (except when the HDF5 version is 1.6 or below, in which case an error will result). Multi-channel element types (i.e. vigra::RGBValue, vigra::TinyVector, and vigra::FFTWComplex) are recognized and handled correctly.

Declaration:

namespace vigra {
template<unsigned int N, class T, class StrideTag>
void
}
Argument object for the function readHDF5().
Definition hdf5impex.hxx:683
void readHDF5(...)
Read the data specified by the given vigra::HDF5ImportInfo object and write the into the given 'array...

Usage:

#include <vigra/hdf5impex.hxx>
Namespace: vigra

vigra_precondition(info.numDimensions() == 3, "Dataset must be 3-dimensional.");
MultiArray<3, int> array(shape);
readHDF5(info, array);

◆ writeHDF5()

template<... >
void writeHDF5 (   ...)

Store array data in an HDF5 file.

The number of dimensions, shape and element type of the stored dataset is automatically determined from the properties of the given array. Strided arrays are stored in an unstrided way, i.e. in contiguous scan-order. Multi-channel element types (i.e. vigra::RGBValue, vigra::TinyVector and vigra::FFTWComplex) are recognized and handled correctly (in particular, the will form the innermost dimension of the stored dataset). pathInFile may contain '/'-separated group names, but must end with the name of the dataset to be created.

Declaration:

namespace vigra {
template<unsigned int N, class T, class StrideTag>
void
writeHDF5(const char* filePath, const char* pathInFile,
}
void writeHDF5(...)
Store array data in an HDF5 file.

Usage:

#include <vigra/hdf5impex.hxx>
Namespace: vigra

MultiArrayShape<3>::type shape(100, 200, 20);
MultiArray<3, int> array(shape);
... // fill array with data
writeHDF5("mydata.h5", "/group1/my_dataset", array);

◆ writeHDF5Attr() [1/4]

template<size_t N, class T , class C >
void writeHDF5Attr ( hid_t  loc,
const char name,
MultiArrayView< N, T, C > const array 
)

Write a numeric MultiArray as an attribute with name name of the dataset specified by the handle loc.

#include <vigra/hdf5impex.hxx>
Namespace: vigra

◆ writeHDF5Attr() [2/4]

template<size_t N, class C >
void writeHDF5Attr ( hid_t  loc,
const char name,
MultiArrayView< N, std::string, C > const array 
)

Write a string MultiArray as an attribute with name name of the dataset specified by the handle loc.

#include <vigra/hdf5impex.hxx>
Namespace: vigra

◆ writeHDF5Attr() [3/4]

template<class T >
void writeHDF5Attr ( hid_t  loc,
const char name,
ArrayVectorView< T > &  array 
)

Write a numeric ArrayVectorView as an attribute with name name of the dataset specified by the handle loc.

#include <vigra/hdf5impex.hxx>
Namespace: vigra

◆ writeHDF5Attr() [4/4]

template<class Arr >
void writeHDF5Attr ( std::string  filePath,
std::string  pathInFile,
Arr ar 
)

write an Attribute given a file and a path in the file. the path in the file should have the format [attribute] or /[subgroups/]dataset.attribute or /[subgroups/]group.attribute. The attribute is written to the root group, a dataset or a subgroup respectively

◆ hierarchicalClustering()

template<... >
void hierarchicalClustering (   ...)

Reduce the number of nodes in a graph by iteratively contracting the cheapest edge.

Declarations:

namespace vigra {
template <class GRAPH,
void
hierarchicalClustering(GRAPH const & graph,
}
Options object for hierarchical clustering.
Definition hierarchical_clustering.hxx:647
void hierarchicalClustering(...)
Reduce the number of nodes in a graph by iteratively contracting the cheapest edge.

Hierarchical clustering is a simple and versatile image segmentation algorithm that typically operates either directly on the pixels (e.g. on a vigra::GridGraph) or on a region adjacency graph over suitable superpixels (e.g. on an vigra::AdjacencyListGraph). The graph is passed to the function in its first argument. After clustering is completed, the parameter labelMap contains a mapping from original node IDs to the ID of the cluster each node belongs to. Cluster IDs correspond to the ID of an arbitrarily chosen representative node within each cluster, i.e. they form a sparse subset of the original IDs.

Properties of the graph's edges and nodes are provided in the property maps edgeWeights, edgeLengths, nodeFeatures, and nodeSizes. These maps are indexed by edge or node ID and return the corresponding feature. Features must by arithmetic scalars or, in case of node features, scalars or vectors of scalars (precisely: objects that provide begin() and end() to create an STL range). Edge weights are typically derived from an edge indicator such as the gradient magnitude, and node features are either the responses of a filter family (when clustering on the pixel grid), or region statistics as computed by Feature Accumulators (when clustering on superpixels).

In each step, the algorithm merges the two nodes $u$ and $v$ whose cluster distance is smallest, where the cluster distance is defined as

\[
    d_{uv} = \left( (1-\beta) w_{uv} + \beta || f_u - f_v ||_M \right)
             \cdot \frac{2}{s_u^{-\omega} + s_v^{-\omega}}
\]

with $ w_{uv} $ denoting the weight of edge $uv$, $f_u$ and $f_v$ being the node features (possibly vectors to be compared with metric $M$), and $s_u$ and $s_v$ the corresponding node sizes. The metric is defined in the option object by calling vigra::ClusteringOptions::nodeFeatureMetric() and must be selected from the tags defined in vigra::metrics::MetricType.

The parameters $0 \le \beta \le 1$ and $0 \le \omega \le 1$ control the relative influence of the inputs: With $\beta = 0$, the node features are ignored, whereas with $\beta = 1$ the edge weights are ignored. Similarly, with $\omega = 0$, the node size is ignored, whereas with $\omega = 1$, cluster distances are scaled by the harmonic mean of the cluster sizes, making the merging of small clusters more favorable. The parameters are defined in the option object by calling vigra::ClusteringOptions::nodeFeatureImportance() and vigra::ClusteringOptions::sizeImportance() respectively.

After each merging step, the features of the resulting cluster $z$ and the weights of its outgoing edges are updated by mean of the corresponding properties of the original clusters $u$ and $v$, weighted by the respective node sizes $s_z$ and edge lengths $l_{zy}$:

\begin{eqnarray*}
    s_z & = & s_u + s_v \\
    f_z & = & \frac{s_u f_u + s_v f_v}{s_z} \\
    l_{zy} & = & l_{uy} + l_{vy} \textrm{ for all nodes }y\textrm{ connected to }u\textrm{ or }v \\
    w_{zy} & = & \frac{l_{uy} w_{uy} + l_{vy} w_{vy}}{l_{zy}}
\end{eqnarray*}

Clustering normally stops when only one cluster remains. This default can be overridden by the option object parameters vigra::ClusteringOptions::minRegionCount() and vigra::ClusteringOptions::maxMergeDistance() to stop at a particular number of clusters or a particular cluster distance respectively.

Usage:

#include <vigra/hierarchical_clustering.hxx>
Namespace: vigra

A fully worked example can be found in graph_agglomerative_clustering.cxx

◆ impexListFormats()

std::string impexListFormats ( )

List the image formats VIGRA can read and write.

This is useful for creating error messages if VIGRA encounters an image format it doesn't recognize.

Usage:

#include <vigra/imageinfo.hxx>
Namespace: vigra

std::cout << "supported formats: " << vigra::impexListFormats() << std::endl;
std::string impexListFormats()
List the image formats VIGRA can read and write.
Examples
imageImportInfo_tutorial.cxx, invert_explicitly.cxx, and pyramid.cxx.

◆ impexListExtensions()

std::string impexListExtensions ( )

List the file extension VIGRA understands.

This is useful for creating file dialogs that only list image files VIGRA can actually import.

Usage:

#include <vigra/imageinfo.hxx>
Namespace: vigra

std::cout << "supported extensions: " << vigra::impexListExtensions() << std::endl;
std::string impexListExtensions()
List the file extension VIGRA understands.

◆ isImage()

bool isImage ( char const filename)

Test whether a file is an image format known to VIGRA.

This checks the first few bytes of the file and compares them with the "magic strings" of each recognized image format.

Usage:

#include <vigra/imageinfo.hxx>
Namespace: vigra

std::cout << "is image: " << vigra::isImage("foo.bmp") << std::endl;
bool isImage(char const *filename)
Test whether a file is an image format known to VIGRA.

◆ initImage()

template<... >
void initImage (   ...)

Write a value to every pixel in an image or rectangular ROI.

This function can be used to init the image.

The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer yields VigraTrueType. Since the functor is passed by const reference, its operator() must be const, and its internal state may need to be mutable.

Function initMultiArray() implements the same functionality for arbitrary dimensional arrays. In many situations, the assignment functions of vigra::MultiArrayView offer a simpler and more readable alternative to the init functions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S, class VALUETYPE>
void
template <class T, class S, class FUNCTOR>
void
}
void initImage(...)
Write a value to every pixel in an image or rectangular ROI.

show deprecated declarations

Usage:

#include <vigra/initimage.hxx>
Namespace: vigra

Initialize with a constant:

// init the image with the value 128
initImage(img, 128);
// init the interior with the value 1
initImage(img.subarray(Shape2(10), Shape2(-10)), 1);
// equivalent to
img = 128;
img.init(128);
img.subarray(Shape2(10), Shape2(-10)) = 1;
TinyVectorView< VALUETYPE, TO-FROM > subarray() const
Definition tinyvector.hxx:887

Initialize with a functor:

struct Counter {
Counter() : count(0) {}
int operator()() const { return count++; }
mutable int count;
};
MultiArray<2, int> img(100, 100);
// write the current count in every pixel
initImage(img, Counter());
// equivalent to
#include <vigra/algorithm.hxx>
linearSequence(img.begin(), img.end());

show deprecated examples

◆ initImageWithFunctor()

template<... >
void initImageWithFunctor (   ...)

Write the result of a functor call to every pixel in an image or rectangular ROI.

This function can be used to init the image by calling the given functor for each pixel. The functor is passed by reference, so that its internal state can be updated in each call.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S, class FUNCTOR>
void
}
void initImageWithFunctor(...)
Write the result of a functor call to every pixel in an image or rectangular ROI.

show deprecated declarations

Usage:

#include <vigra/initimage.hxx>
Namespace: vigra

struct Counter {
Counter() : count(0) {}
int operator()() const { return count++; }
int count;
};
MultiArray<2, int> img(100, 100);
// write the current count in every pixel
Counter counter;
initImageWithFunctor(img, counter);
// equivalent to
#include <vigra/algorithm.hxx>
linearSequence(img.begin(), img.end());

show deprecated examples

◆ initImageIf()

template<... >
void initImageIf (   ...)

Write value to pixel in the image if mask is true.

This function can be used to init a region-of-interest of the image.

The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer yields VigraTrueType. Since the functor is passed by const reference, its operator() must be const, and its internal state may need to be mutable.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S,
class TM, class SM,
class VALUETYPE>
void
VALUETYPE const & v);
template <class T, class S,
class TM, class SM,
class FUNCTOR>
void
FUNCTOR const & v);
}
void initImageIf(...)
Write value to pixel in the image if mask is true.

show deprecated declarations

Usage:

#include <vigra/initimage.hxx>
Namespace: vigra

... // init the ROI mask
// set the ROI to one
NumericTraits<RGBValue<unsigned char> >::one());

show deprecated examples

◆ initImageBorder()

template<... >
void initImageBorder (   ...)

Write value to the specified border pixels in the image.

A pixel is initialized if its distance to the border is at most 'borderwidth'.

The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer yields VigraTrueType. Since the functor is passed by const reference, its operator() must be const, and its internal state may need to be mutable.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S, class VALUETYPE>
void
int border_width, VALUETYPE const & v);
template <class T, class S, class FUNCTOR>
void
int border_width, FUNCTOR const & v);
}
void initImageBorder(...)
Write value to the specified border pixels in the image.

show deprecated declarations

Usage:

#include <vigra/initimage.hxx>
Namespace: vigra

#include <vigra/random.hxx>
// fill a border of 5 pixels with random numbers
RandomNumberGenerator< detail::RandomState< detail::MT19937 > > MersenneTwister
Definition random.hxx:634

show deprecated examples

◆ inspectImage()

template<... >
void inspectImage (   ...)

Apply read-only functor to every pixel in the image.

This function can be used to collect statistics of the image etc. The results must be stored in the functor, which serves as a return value (and is therefore passed by reference).

For many common statistics, the use of vigra::acc::extractFeatures() in combination with Feature Accumulators is more convenient.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S, class Functor>
void
Functor & f);
}
void inspectImage(...)
Apply read-only functor to every pixel in the image.

show deprecated declarations

Usage:

#include <vigra/inspectimage.hxx>
Namespace: vigra

... // fill img
// init functor
inspectImage(img, minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;

show deprecated examples

See also
Functors To Inspect Images, Feature Accumulators

◆ inspectImageIf()

template<... >
void inspectImageIf (   ...)

Apply read-only functor to every pixel in the ROI.

This function can be used to collect statistics of the ROI etc. The functor is called whenever the return value of the mask's accessor is not zero. The results must be stored in the functor, which serves as a return value (and is therefore passed by reference.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S,
class TM, class SM, class Functor>
void
Functor & f);
}

show deprecated declarations

Usage:

#include <vigra/inspectimage.hxx>
Namespace: vigra

mask(100, 100);
... // fill img and mask
// init functor
inspectImageIf(img, mask, minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;

show deprecated examples

See also
Functors To Inspect Images, Feature Accumulators

◆ inspectTwoImages()

template<... >
void inspectTwoImages (   ...)

Apply read-only functor to every pixel of both images.

This function can be used to collect statistics for each region of a labeled image, especially in conjunction with the ArrayOfRegionStatistics functor. The results must be stored in the functor which serves as a return value.

Note: For many common statistics, the use of vigra::acc::extractFeatures() in combination with Feature Accumulators is more convenient.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class Functor>
void
Functor & f);
}
void inspectTwoImages(...)
Apply read-only functor to every pixel of both images.

show deprecated declarations

Usage:

#include <vigra/inspectimage.hxx>
Namespace: vigra

MultiArray<2, unsigned char> image1(width, height), image2(width, height);
SomeStatisticsFunctor stats(...); // init functor

show deprecated examples

See also
Functors To Inspect Images, Feature Accumulators

◆ inspectTwoImagesIf()

template<... >
void inspectTwoImagesIf (   ...)

Apply read-only functor to those pixels of both images where the mask image is non-zero.

This function can be used to collect statistics for selected regions of a labeled image, especially in conjunction with the ArrayOfRegionStatistics functor. The results must be stored in the functor which serves as a return value.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class TM, class SM,
class Functor>
void
Functor & f);
}
void inspectTwoImagesIf(...)
Apply read-only functor to those pixels of both images where the mask image is non-zero.

show deprecated declarations

Usage:

#include <vigra/inspectimage.hxx>
Namespace: vigra

MultiArray<2, unsigned char> image1(width, height), image2(width, height),
maskimage(width, height);
SomeStatisticsFunctor stats(...); // init functor

show deprecated examples

See also
Functors To Inspect Images, Feature Accumulators

◆ labelImage()

template<... >
unsigned int labelImage (   ...)

Find the connected components of a segmented image.

Deprecated. Use labelMultiArray() instead.

Connected components are defined as regions with uniform pixel values. Thus, T1 either must be equality comparable, or a suitable EqualityFunctor must be provided that realizes the desired predicate. The destination's value type T2 should be large enough to hold the labels without overflow. Region numbers will be a consecutive sequence starting with one and ending with the region number returned by the function (inclusive). The parameter 'eight_neighbors' determines whether the regions should be 4-connected (false) or 8-connected (true).

Return: the number of regions found (= largest region label)

See labelMultiArray() for a dimension-independent implementation of connected components labelling.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class EqualityFunctor = std::equal_to<T1> >
unsigned int
}
unsigned int labelImage(...)
Find the connected components of a segmented image.

show deprecated declarations

Usage:

#include <vigra/labelimage.hxx>
Namespace: vigra

// threshold at 128
// find 4-connected regions
labelImage(src, labels, false);

show deprecated examples

◆ labelImageWithBackground()

template<... >
unsigned int labelImageWithBackground (   ...)

Find the connected components of a segmented image, excluding the background from labeling.

Deprecated. Use labelMultiArray() instead.

This function works like labelImage(), but considers all background pixels (i.e. pixels having the given 'background_value') as a single region that is ignored when determining connected components and remains untouched in the destination image. Usually, you will zero-initialize the output image, so that the background gets label 0 (remember that actual region labels start at one).

Return: the number of non-background regions found (= largest region label)

See labelMultiArrayWithBackground() for a dimension-independent implementation if this algorithm.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class ValueType,
class EqualityFunctor = std::equal_to<T1> >
unsigned int
ValueType background_value,
}
unsigned int labelImageWithBackground(...)
Find the connected components of a segmented image, excluding the background from labeling.

show deprecated declarations

Usage:

#include <vigra/labelimage.hxx>
Namespace: vigra

// threshold at 128
// find 4-connected regions of foreground (= white pixels) only
labelImageWithBackground(src, labels, false, 0);

show deprecated examples

◆ regionImageToCrackEdgeImage()

template<... >
void regionImageToCrackEdgeImage (   ...)

Transform a labeled image into a crack edge (interpixel edge) image.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2, class DestValue>
void
EdgeImageLabelPolicy labelPolicy = CopyRegionLabels);
}
void regionImageToCrackEdgeImage(...)
Transform a labeled image into a crack edge (interpixel edge) image.

show deprecated declarations

The destination image must be twice the size of the input image (precisely, (2*w-1) by (2*h-1) pixels) to have space for the so called "crack edges" or "interpixel edges" which are logically situated between pixels (at half-integer coordinates of the input image) and correspond to the odd-valued coordinates in the result image (see Crack Edge Image for more details).

When labelPolicy == CopyRegionLabels (the default), this algorithm transfers the labels of a labeled image to the output image (repeating them as appropriate to account for the output image size) and inserts border pixels when the label changes. For example, if a and c are the original labels, and 0 is the value of edge_marker, the transformation looks like this:

original image copy labels and insert edges
a 0 c c c
a c c a 0 0 0 c
a a c => a a a 0 c
a a a a a a 0 0
a a a a a

When labelPolicy == EdgeOverlayOnly, the region pixels of the output image remain untouched, and only the edge marker is inserted. This is especially useful for visualization, when the output is the interpolated original image:

original image destination image overlay edges only
d d d d d d 0 d d d
a c c d d d d d d 0 0 0 d
a a c + d d d d d => d d d 0 d
a a a d d d d d d d d 0 0
d d d d d d d d d d

The algorithm assumes that the original labeled image contains no background. Therefore, it is suitable as a post-processing operation of labelImage() or seededRegionGrowing().

The source value type (SrcAccessor::value-type) must be equality-comparable.

Usage:

#include <vigra/labelimage.hxx>
Namespace: vigra

cellgrid(2*w-1, 2*h-1);
// threshold at 128
// find 4-connected regions
labelImage(src, labels, false);
// create cell grid image, mark edges with 0

show deprecated examples

Preconditions:

The destination image must have twice the size of the source:

w_dest = 2 * w_src - 1
h_dest = 2 * h_src - 1

◆ regionImageToEdgeImage()

template<... >
void regionImageToEdgeImage (   ...)

Transform a labeled image into an edge image.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2, class DestValue>
void
}
void regionImageToEdgeImage(...)
Transform a labeled image into an edge image.

show deprecated declarations

This algorithm marks all pixels with the given edge_marker which belong to a different region (label) than their right or lower neighbors:

original image edges
a c c 1 1 *
a a c => * 1 1
a a a * * *

The non-edge pixels of the destination image will not be touched. The source value type T1 must be equality-comparable.

Usage:

#include <vigra/labelimage.hxx>
Namespace: vigra

edges(w,h);
edges = 255; // init background (non-edge) to 255
// threshold at 128
// find 4-connected regions
labelImage(src, labels, false);
// create edge image, mark edges with 0
regionImageToEdgeImage(labels, edges, 0);

show deprecated examples

◆ labelVolume()

template<... >
unsigned int labelVolume (   ...)

Find the connected components of a segmented volume.

Deprecated. Use labelMultiArray() instead.

Connected components are defined as regions with uniform voxel values. Thus, T1 either must be equality comparable, or an EqualityFunctor must be provided explicitly that realizes the desired equivalence predicate. The destination's value type T2 should be large enough to hold the labels without overflow. Region numbers will be a consecutive sequence starting with one and ending with the region number returned by the function (inclusive).

Return: the number of regions found (= largest region label)

See labelMultiArray() for a dimension-independent implementation of connected components labelling.

Declarations:

pass 3D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class EqualityFunctor = std::equal_to<T1> >
unsigned int
}
unsigned int labelVolume(...)
Find the connected components of a segmented volume.

show deprecated declarations

Usage:

#include <vigra/labelvolume.hxx>
Namespace: vigra

// find 6-connected regions
// find 26-connected regions
Neighborhood3DTwentySix::NeighborCode3D NeighborCode3DTwentySix
Definition voxelneighborhood.hxx:1646

show deprecated examples

◆ labelVolumeSix()

Find the connected components of a segmented volume using the 6-neighborhood.

See labelVolume() for detailed documentation.

◆ labelVolumeWithBackground()

template<... >
unsigned int labelVolumeWithBackground (   ...)

Find the connected components of a segmented volume, excluding the background from labeling.

Deprecated. Use labelMultiArray() instead.

This function works like labelVolume(), but considers all background voxels (i.e. voxels having the given 'background_value') as a single region that is ignored when determining connected components and remains untouched in the destination array. Usually, you will zero-initialize the output array, so that the background gets label 0 (remember that actual region labels start at one).

Return: the number of regions found (= largest region label)

See labelMultiArrayWithBackground() for a dimension-independent implementation if this algorithm.

Declarations:

pass 3D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class ValueType,
class EqualityFunctor = std::equalt_to<T1> >
unsigned int
ValueType backgroundValue,
}
unsigned int labelVolumeWithBackground(...)
Find the connected components of a segmented volume, excluding the background from labeling.

show deprecated declarations

Usage:

#include <vigra/labelvolume.hxx>
Namespace: vigra

// find 6-connected regions
Neighborhood3DSix::NeighborCode3D NeighborCode3DSix
Definition voxelneighborhood.hxx:490

show deprecated examples

◆ localMinima()

template<... >
void localMinima (   ...)

Find local minima in an image or multi-dimensional array.

By default, minima are defined as points which are not at the array border and whose value is lower than the value of all indirect neighbors (i.e. 8-neighbors in 2D, 26-neighbors in 3D, 3N-1 neighbors in N-D). The detected points will be marked with the default value 1 in the destination array.

The defaults can be overridden in various ways by providing LocalMinmaxOptions : you can switch to the direct neighborhood (i.e. 4-neighborhood in 2D, 6-neighborhood in 3D, 2*N neighborhood in N-D), allow minima at the border, discard minima where the function value is not below a given threshold, allow extended minima (i.e. minima that form minimal plateaus rather than isolated pixels – note that this option is only supported for 2D images), and change the marker in the destination image. See usage examples below for details.

There are also variants of the localMinima() function where parameters are passed explicitly rather than via an option object. These versions of the function are deprecated, but will be kept for compatibility.

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class C1, class T2, class C2>
void
LocalMinmaxOptions const & options = LocalMinmaxOptions());
}
Options object for localMinima() and localMaxima().
Definition localminmax.hxx:494
void localMinima(...)
Find local minima in an image or multi-dimensional array.

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
#include <vigra/multi_localminmax.hxx>
Namespace: vigra

// 3D examples (other dimensions work likewise)
Shape3 shape(w,h,d);
MultiArray<3, unsigned char> src(shape), minima(shape);
... // fill src
// use default parameterisation
localMinima(src, minima);
// reset destination image
minima = 0;
// use direct neighborhood (i.e. 6-neighborhood since we are in 3D)
// and allow minima at the image border
localMinima(src, minima,
LocalMinmaxOptions().neighborhood(0).allowAtBorder());

show deprecated examples

◆ localMinima3D()

template<... >
void localMinima3D (   ...)

Find local minima in a 3D multi array.

Deprecated, use localMinima() instead.

◆ localMaxima()

template<... >
void localMaxima (   ...)

Find local maxima in an image or multi-dimensional array.

By default, maxima are defined as points which are not at the array border and whose value is higher than the value of all indirect neighbors (i.e. 8-neighbors in 2D, 26-neighbors in 3D, 3N-1 neighbors in N-D). The detected points will be marked with the default value 1 in the destination array.

The defaults can be overridden in various ways by providing LocalMinmaxOptions : you can switch to the direct neighborhood (i.e. 4-neighborhood in 2D, 6-neighborhood in 3D, 2*N neighborhood in N-D), allow maxima at the border, discard maxima where the function value is not above a given threshold, allow extended maxima (i.e. maxima that form maximal plateaus rather than isolated pixels – note that this option is only supported for 2D images), and change the marker in the destination image. See usage examples below for details.

There are also variants of the localMaxima() function where parameters are passed explicitly rather than via an option object. These versions of the function are deprecated, but will be kept for compatibility.

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class C1, class T2, class C2>
void
LocalMinmaxOptions const & options = LocalMinmaxOptions());
}

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
#include <vigra/multi_localminmax.hxx>
Namespace: vigra

// 3D examples (other dimensions work likewise)
Shape3 shape(w,h,d);
... // fill src
// use default parameterisation
// reset destination image
maxima = 0;
// use direct neighborhood (i.e. 6-neighborhood sine we are in 3D)
// and allow maxima at the image border
LocalMinmaxOptions().neighborhood(0).allowAtBorder());

show deprecated examples

◆ localMaxima3D()

template<... >
void localMaxima3D (   ...)

Find local maxima in a 3D multi array.

Deprecated, use localMaxima() instead.

◆ extendedLocalMinima()

template<... >
void extendedLocalMinima (   ...)

Find local minimal regions (plateaus) in an array.

This function is only needed when you want to pass a non-standard equality predicate via EqualityFunctor. Otherwise (i.e. when equality is defined by the '==' operator of the source value type T1), you can simply call localMinima() with the option LocalMinmaxOptions::allowPlateaus().

This function finds regions of uniform pixel values whose neighboring regions all have larger values, i.e. it finds minimal plateaus of arbitrary size (including size 1). The EqualityFunctor determines when pixels are considered equal, so that one can allow for plateaus that are not quite constant (this is often necessary with float pixel values). Otherwise, the functionality is identical to localMinima().

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2,
unsigned int
EqualityFunctor const & equal,
void extendedLocalMinima(...)
Find local minimal regions (plateaus) in an array.

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
Namespace: vigra

// define an equality functor
template <class T>
{
: t(tolerance)
{}
bool operator()(T l, T r) const
{
return abs(l-r) <= t;
}
T t;
};
MultiArray<2, unsigned char> src(w,h), minima(w,h);
// allow plateaus
localMinima(src, minima, LocalMinmaxOptions().allowPlateaus());
// reset result image
minima.init(0);
// allow plateaus with tolerance (grayvalues may differ by one)
extendedLocalMinima(src, minima, EqualWithToleranceFunctor<unsigned char>(1));

show deprecated examples

◆ extendedLocalMinima3D()

template<... >
void extendedLocalMinima3D (   ...)

Find local minimal regions in a volume.

See extendedLocalMinima().

◆ extendedLocalMaxima()

template<... >
void extendedLocalMaxima (   ...)

Find local maximal regions in an array.

This function is only needed when you want to pass a non-standard equality predicate via EqualityFunctor. Otherwise (i.e. when equality is defined by the '==' operator of the source value type T1), you can simply call localMaxima() with the option LocalMinmaxOptions::allowPlateaus().

This function finds regions of uniform pixel values whose neighboring regions all have smaller values, i.e. it finds maximal plateaus of arbitrary size (including size 1). The EqualityFunctor determines when pixels are considered equal, so that one can allow for plateaus that are not quite constant (this is often necessary with float pixel values). Otherwise, the functionality is identical to localMaxima().

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
unsigned int // return number of maxima
void extendedLocalMaxima(...)
Find local maximal regions in an array.

show deprecated declarations

Usage:

#include <vigra/localminmax.hxx>
Namespace: vigra

// define an equality functor
template <class T>
{
: t(tolerance)
{}
bool operator()(T l, T r) const
{
return abs(l-r) <= t;
}
T t;
};
MultiArray<2, unsigned char> src(w,h), maxima(w,h);
// allow plateaus
localMaxima(src, maxima, LocalMinmaxOptions().allowPlateaus());
// reset result image
maxima.init(0);
// allow plateaus with tolerance (grayvalues may differ by one)
extendedLocalMaxima(src, maxima, EqualWithToleranceFunctor<unsigned char>(1));

show deprecated examples

◆ extendedLocalMaxima3D()

template<... >
void extendedLocalMaxima3D (   ...)

Find local maximal regions in 3D multi array.

See extendedLocalMaxima().

◆ round() [1/2]

REAL round ( REAL  v)

The rounding function.

Defined for all floating point types. Rounds towards the nearest integer such that abs(round(t)) == round(abs(t)) for all t.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ roundi() [1/2]

long long roundi ( double  t)

Round and cast to integer.

Rounds to the nearest integer like round(), but casts the result to long long (this will be faster and is usually needed anyway).

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ ceilPower2()

UInt32 ceilPower2 ( UInt32  x)

Round up to the nearest power of 2.

Efficient algorithm for finding the smallest power of 2 which is not smaller than x (function clp2() from Henry Warren: "Hacker's Delight", Addison-Wesley, 2003, see http://www.hackersdelight.org/). If x > 2^31, the function will return 0 because integer arithmetic is defined modulo 2^32.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ floorPower2()

UInt32 floorPower2 ( UInt32  x)

Round down to the nearest power of 2.

Efficient algorithm for finding the largest power of 2 which is not greater than x (function flp2() from Henry Warren: "Hacker's Delight", Addison-Wesley, 2003, see http://www.hackersdelight.org/).

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ log2i()

Int32 log2i ( UInt32  x)

Compute the base-2 logarithm of an integer.

Returns the position of the left-most 1-bit in the given number x, or -1 if x == 0. That is,

assert(k >= 0 && k < 32 && log2i(1 << k) == k);
Int32 log2i(UInt32 x)
Compute the base-2 logarithm of an integer.
Definition mathutil.hxx:361

The function uses Robert Harley's algorithm to determine the number of leading zeros in x (algorithm nlz10() at http://www.hackersdelight.org/). But note that the functions floorPower2() or ceilPower2() are more efficient and should be preferred when possible.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ sq()

template<class T >
NumericTraits< T >::Promote sq ( t)

The square function.

sq(x) = x*x is needed so often that it makes sense to define it as a function.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ power()

template<unsigned n, class V >
V power ( const V &  x)

Exponentiation to a positive integer power by squaring.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ sqrti()

UInt32 sqrti ( Int32  v)

Signed integer square root.

Unsigned integer square root.

Useful for fast fixed-point computations.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ sign() [1/2]

template<class T >
T sign ( t)

The sign function.

Returns 1, 0, or -1 depending on the sign of t, but with the same type as t.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ signi()

template<class T >
int signi ( t)

The integer sign function.

Returns 1, 0, or -1 depending on the sign of t, converted to int.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ sign() [2/2]

template<class T1 , class T2 >
T1 sign ( T1  t1,
T2  t2 
)

The binary sign function.

Transfers the sign of t2 to t1.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ even()

bool even ( int  t)

Check if an integer is even.

Defined for all integral types.

◆ odd()

bool odd ( int  t)

Check if an integer is odd.

Defined for all integral types.

◆ squaredNorm()

NormTraits< T >::SquaredNormType squaredNorm ( T const t)

The squared norm of a numerical object.

  • For scalar types: equals vigra::sq(t).
  • For vectorial types (including TinyVector): equals vigra::dot(t, t).
  • For complex number types: equals vigra::sq(t.real()) + vigra::sq(t.imag()).
  • For array and matrix types: results in the squared Frobenius norm (sum of squares of the matrix elements).

◆ norm()

template<class T >
NormTraits< T >::NormType norm ( T const t)

The norm of a numerical object.

For scalar types: implemented as abs(t)
otherwise: implemented as sqrt(squaredNorm(t)).

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ symmetric2x2Eigenvalues()

template<class T >
void symmetric2x2Eigenvalues ( a00,
a01,
a11,
T *  r0,
T *  r1 
)

Compute the eigenvalues of a 2x2 real symmetric matrix.

This uses the analytical eigenvalue formula

\[
   \lambda_{1,2} = \frac{1}{2}\left(a_{00} + a_{11} \pm \sqrt{(a_{00} - a_{11})^2 + 4 a_{01}^2}\right)
\]

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ symmetric3x3Eigenvalues()

template<class T >
void symmetric3x3Eigenvalues ( a00,
a01,
a02,
a11,
a12,
a22,
T *  r0,
T *  r1,
T *  r2 
)

Compute the eigenvalues of a 3x3 real symmetric matrix.

This uses a numerically stable version of the analytical eigenvalue formula according to

David Eberly: "Eigensystems for 3 x 3 Symmetric Matrices (Revisited)", Geometric Tools Documentation, 2006

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ ellipticIntegralF()

double ellipticIntegralF ( double  x,
double  k 
)

The incomplete elliptic integral of the first kind.

This function computes

\[
     \mbox{F}(x, k) = \int_0^x \frac{1}{\sqrt{1 - k^2 \sin(t)^2}} dt
\]

according to the algorithm given in Press et al. "Numerical Recipes".

Note: In some libraries (e.g. Mathematica), the second parameter of the elliptic integral functions must be k^2 rather than k. Check the documentation when results disagree!

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ ellipticIntegralE()

double ellipticIntegralE ( double  x,
double  k 
)

The incomplete elliptic integral of the second kind.

This function computes

\[
    \mbox{E}(x, k) = \int_0^x \sqrt{1 - k^2 \sin(t)^2} dt
\]

according to the algorithm given in Press et al. "Numerical Recipes". The complete elliptic integral of the second kind is simply ellipticIntegralE(M_PI/2, k).

Note: In some libraries (e.g. Mathematica), the second parameter of the elliptic integral functions must be k^2 rather than k. Check the documentation when results disagree!

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ chi2()

double chi2 ( unsigned int  degreesOfFreedom,
double  arg,
double  accuracy = 1e-7 
)

Chi square distribution.

Computes the density of a chi square distribution with degreesOfFreedom and tolerance accuracy at the given argument arg by calling noncentralChi2(degreesOfFreedom, 0.0, arg, accuracy).

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ chi2CDF()

double chi2CDF ( unsigned int  degreesOfFreedom,
double  arg,
double  accuracy = 1e-7 
)

Cumulative chi square distribution.

Computes the cumulative density of a chi square distribution with degreesOfFreedom and tolerance accuracy at the given argument arg, i.e. the probability that a random number drawn from the distribution is below arg by calling noncentralChi2CDF(degreesOfFreedom, 0.0, arg, accuracy).

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ noncentralChi2()

double noncentralChi2 ( unsigned int  degreesOfFreedom,
double  noncentrality,
double  arg,
double  accuracy = 1e-7 
)

Non-central chi square distribution.

Computes the density of a non-central chi square distribution with degreesOfFreedom, noncentrality parameter noncentrality and tolerance accuracy at the given argument arg. It uses Algorithm AS 231 from Appl. Statist. (1987) Vol.36, No.3 (code ported from http://lib.stat.cmu.edu/apstat/231). The algorithm has linear complexity in the number of degrees of freedom.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ noncentralChi2CDF()

double noncentralChi2CDF ( unsigned int  degreesOfFreedom,
double  noncentrality,
double  arg,
double  accuracy = 1e-7 
)

Cumulative non-central chi square distribution.

Computes the cumulative density of a chi square distribution with degreesOfFreedom, noncentrality parameter noncentrality and tolerance accuracy at the given argument arg, i.e. the probability that a random number drawn from the distribution is below arg It uses Algorithm AS 231 from Appl. Statist. (1987) Vol.36, No.3 (code ported from http://lib.stat.cmu.edu/apstat/231). The algorithm has linear complexity in the number of degrees of freedom (see noncentralChi2CDFApprox() for a constant-time algorithm).

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ noncentralChi2CDFApprox()

double noncentralChi2CDFApprox ( unsigned int  degreesOfFreedom,
double  noncentrality,
double  arg 
)

Cumulative non-central chi square distribution (approximate).

Computes approximate values of the cumulative density of a chi square distribution with degreesOfFreedom, and noncentrality parameter noncentrality at the given argument arg, i.e. the probability that a random number drawn from the distribution is below arg It uses the approximate transform into a normal distribution due to Wilson and Hilferty (see Abramovitz, Stegun: "Handbook of Mathematical Functions", formula 26.3.32). The algorithm's running time is independent of the inputs, i.e. is should be used when noncentralChi2CDF() is too slow, and approximate values are sufficient. The accuracy is only about 0.1 for few degrees of freedom, but reaches about 0.001 above dof = 5.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ legendre() [1/2]

template<class REAL >
REAL legendre ( unsigned int  l,
int  m,
REAL  x 
)

Associated Legendre polynomial.

Computes the value of the associated Legendre polynomial of order l, m for argument x. x must be in the range [-1.0, 1.0], otherwise an exception is thrown. The standard Legendre polynomials are the special case m == 0.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ legendre() [2/2]

template<class REAL >
REAL legendre ( unsigned int  l,
REAL  x 
)

Legendre polynomial.

Computes the value of the Legendre polynomial of order l for argument x. x must be in the range [-1.0, 1.0], otherwise an exception is thrown.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ sin_pi()

template<class REAL >
REAL sin_pi ( REAL  x)

sin(pi*x).

Essentially calls std::sin(M_PI*x) but uses a more accurate implementation to make sure that sin_pi(1.0) == 0.0 (which does not hold for std::sin(M_PI) due to round-off error), and sin_pi(0.5) == 1.0.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ cos_pi()

template<class REAL >
REAL cos_pi ( REAL  x)

cos(pi*x).

Essentially calls std::cos(M_PI*x) but uses a more accurate implementation to make sure that cos_pi(1.0) == -1.0 and cos_pi(0.5) == 0.0.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ gamma()

double gamma ( double  x)

The gamma function.

This function implements the algorithm from
Zhang and Jin: "Computation of Special Functions", John Wiley and Sons, 1996.

The argument must be <= 171.0 and cannot be zero or a negative integer. An exception is thrown when these conditions are violated.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ loggamma()

double loggamma ( double  x)

The natural logarithm of the gamma function.

This function is based on a free implementation by Sun Microsystems, Inc., see sourceware.org archive. It can be removed once all compilers support the new C99 math functions.

The argument must be positive and < 1e30. An exception is thrown when these conditions are violated.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ closeAtTolerance()

template<class T1 , class T2 >
bool closeAtTolerance ( T1  l,
T2  r,
typename PromoteTraits< T1, T2 >::Promote  epsilon 
)

Tolerance based floating-point equality.

Check whether two floating point numbers are equal within the given tolerance. This is useful because floating point numbers that should be equal in theory are rarely exactly equal in practice. If the tolerance epsilon is not given, twice the machine epsilon is used.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ lessEqualAtTolerance()

template<class T1 , class T2 >
bool lessEqualAtTolerance ( T1  l,
T2  r,
typename PromoteTraits< T1, T2 >::Promote  epsilon 
)

Tolerance based floating-point less-or-equal.

Check whether two floating point numbers are less or equal within the given tolerance. That is, l can actually be greater than r within the given epsilon. This is useful because floating point numbers that should be equal in theory are rarely exactly equal in practice. If the tolerance epsilon is not given, twice the machine epsilon is used.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ greaterEqualAtTolerance()

template<class T1 , class T2 >
bool greaterEqualAtTolerance ( T1  l,
T2  r,
typename PromoteTraits< T1, T2 >::Promote  epsilon 
)

Tolerance based floating-point greater-or-equal.

Check whether two floating point numbers are greater or equal within the given tolerance. That is, l can actually be less than r within the given epsilon. This is useful because floating point numbers that should be equal in theory are rarely exactly equal in practice. If the tolerance epsilon is not given, twice the machine epsilon is used.

#include <vigra/mathutil.hxx>
Namespace: vigra

◆ medianFilter()

template<... >
void medianFilter (   ...)

This function calculates the median of a window of given size for the complete image.

This function calculates the median of a window of given size for the complete image. It also allows a correct border handling, since it uses the applyWindowFunction environment for computation!

All border treatment modes (except BORDER_TREATMENT_CLIP) are supported.

The input pixel type T1 must be a linear space over the window functions' value_type T. Especially, the values must be sortable by std::sort, to derive the mean values aka the median.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
BorderTreatmentMode border = BORDER_TREATMENT_REPEAT);
}
void medianFilter(...)
This function calculates the median of a window of given size for the complete image.

show deprecated declarations

Usage:

#include <vigra/medianfilter.hxx>
Namespace: vigra

unsigned int w=1000, h=1000;
...
// apply a median filter with a window size of 5x5
medianFilter(src, dest, Diff2D(5,5));

Preconditions:

The image must be larger than the window size of the filter.

◆ meshGrid()

triple< Diff2D, Diff2D, MeshGridAccessor > meshGrid ( Diff2D  upperLeft,
Diff2D  lowerRight 
)

Create a mesh grid for the specified rectangle.

The mesh grid concept is adapted from MATLAB. It is a two banded image (i.e. with 2D vector pixel type) whose first band contains the x-coordinates of the current pixel, and whose second band contains the y-coordinates. If upperLeft is not the point (0,0), the mesh grid is translated relative to the pixel indices.

Declarations:

meshGrid(Diff2D upperLeft, Diff2D lowerRight);
meshGrid(Rect2D const & r);
Two dimensional rectangle.
Definition diff2d.hxx:859
triple< Diff2D, Diff2D, MeshGridAccessor > meshGrid(Diff2D upperLeft, Diff2D lowerRight)
Definition meshgrid.hxx:119

Usage:

#include <vigra/meshgrid.hxx>
// create an image whose values are equal to each pixel's distance from the image center
int width = 5, height = 7;
int xc = width/2, yc = height/2; // the image center
FImage dist(width, height);
Point2D upperLeft(-xc, -yc);
using namespace vigra::functor;
transformImage(meshGrid(upperLeft, upperLeft+dist.size()),
destImage(dist),
norm(Arg1()));
Two dimensional point or position.
Definition diff2d.hxx:586

◆ makeBasicImageView() [1/2]

template<class T , class Stride >
BasicImageView< T > makeBasicImageView ( MultiArrayView< 2, T, Stride > const array)

Create a vigra::BasicImageView from an unstrided 2-dimensional vigra::MultiArrayView.

The vigra::BasicImageView will have the same value_type as the original vigra::MultiArrayView.

◆ makeBasicImageView() [2/2]

template<class T >
BasicImageView< T > makeBasicImageView ( MultiArray< 3, T > const array)

Create a vigra::BasicImageView from a 3-dimensional vigra::MultiArray.

This wrapper flattens the two innermost dimensions of the array into single rows of the resulting image. The vigra::BasicImageView will have the same value_type as the original vigra::MultiArray.

◆ makeRGBImageView()

template<class T , class Stride >
BasicImageView< RGBValue< T > > makeRGBImageView ( MultiArrayView< 3, T, Stride > const array)

Create a vigra::BasicImageView from a 3-dimensional vigra::MultiArray.

This wrapper only works if T is a scalar type and the array's innermost dimension has size 3. It then re-interprets the data array as a 2-dimensional array with value_type RGBValue<T>.

◆ createCoupledIterator() [1/7]

template<unsigned int N, class T >
ChunkedArray< N, T >::iterator createCoupledIterator ( ChunkedArray< N, T > &  m)

Returns a CoupledScanOrderIterator to simultaneously iterate over image m1 and its coordinates.

◆ separableConvolveMultiArray()

template<... >
void separableConvolveMultiArray (   ...)

Separated convolution on multi-dimensional arrays.

This function computes a separated convolution on all dimensions of the given multi-dimensional array. Both source and destination arrays are represented by iterators, shape objects and accessors. The destination array is required to already have the correct size.

There are two variants of this functions: one takes a single kernel of type vigra::Kernel1D which is then applied to all dimensions, whereas the other requires an iterator referencing a sequence of vigra::Kernel1D objects, one for every dimension of the data. Then the first kernel in this sequence is applied to the innermost dimension (e.g. the x-axis of an image), while the last is applied to the outermost dimension (e.g. the z-axis in a 3D image).

This function may work in-place, which means that source.data() == dest.data() is allowed. A full-sized internal array is only allocated if working on the destination array directly would cause round-off errors (i.e. if typeid(typename NumericTraits<T2>::RealPromote) != typeid(T2)).

If start and stop have non-default values, they must represent a valid subarray of the input array. The convolution is then restricted to that subarray, and it is assumed that the output array only refers to the subarray (i.e. dest.shape() == stop - start). Negative ROI boundaries are interpreted relative to the end of the respective dimension (i.e. if(stop[k] < 0) stop[k] += source.shape(k);).

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// apply each kernel from the sequence 'kernels' in turn
template <unsigned int N, class T1, class S1,
class T2, class S2,
void
// apply the same kernel to all dimensions
template <unsigned int N, class T1, class S1,
class T2, class S2,
class T>
void
typename MultiArrayShape<N>::type const & start = typename MultiArrayShape<N>::type(),
typename MultiArrayShape<N>::type const & stop = typename MultiArrayShape<N>::type());
}
void separableConvolveMultiArray(...)
Separated convolution on multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
Kernel1D<float> gauss;
gauss.initGaussian(sigma);
// smooth all dimensions with the same kernel
// create 3 Gauss kernels, one for each dimension, but smooth the z-axis less
kernels[2].initGaussian(sigma / 2.0);
// perform Gaussian smoothing on all dimensions
// create output array for a ROI
MultiArray<3, float> destROI(shape - Shape3(10,10,10));
// only smooth the given ROI (ignore 5 pixels on all sides of the array)
separableConvolveMultiArray(source, destROI, gauss, Shape3(5,5,5), Shape3(-5,-5,-5));

show deprecated examples

See also
vigra::Kernel1D, convolveLine()

◆ convolveMultiArrayOneDimension()

template<... >
void convolveMultiArrayOneDimension (   ...)

Convolution along a single dimension of a multi-dimensional arrays.

This function computes a convolution along one dimension (specified by the parameter dim of the given multi-dimensional array with the given kernel. The destination array must already have the correct size.

If start and stop have non-default values, they must represent a valid subarray of the input array. The convolution is then restricted to that subarray, and it is assumed that the output array only refers to the subarray (i.e. dest.shape() == stop - start). Negative ROI boundaries are interpreted relative to the end of the respective dimension (i.e. if(stop[k] < 0) stop[k] += source.shape(k);).

This function may work in-place, which means that source.data() == dest.data() is allowed.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2,
class T>
void
unsigned int dim,
}
void convolveMultiArrayOneDimension(...)
Convolution along a single dimension of a multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
Kernel1D<float> gauss;
gauss.initGaussian(sigma);
// perform Gaussian smoothing along dimension 1 (height)
See also
separableConvolveMultiArray()

◆ gaussianSmoothMultiArray()

template<... >
void gaussianSmoothMultiArray (   ...)

Isotropic Gaussian smoothing of a multi-dimensional arrays.

This function computes an isotropic convolution of the given N-dimensional array with a Gaussian filter at the given standard deviation sigma. Both source and destination arrays are represented by iterators, shape objects and accessors. The destination array is required to already have the correct size. This function may work in-place, which means that source.data() == dest.data() is allowed. It is implemented by a call to separableConvolveMultiArray() with the appropriate kernel.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameter sigma is omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// pass filter scale explicitly
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double sigma,
// pass filer scale(s) in the option object
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
// as above, but execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void gaussianSmoothMultiArray(...)
Isotropic Gaussian smoothing of a multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
Namespace: vigra

Shape3 shape(width, height, depth);
...
// perform isotropic Gaussian smoothing at scale 'sigma'
gaussianSmoothMultiArray(source, dest, sigma);

Multi-threaded execution:

Shape3 shape(width, height, depth);
...
BlockwiseConvolutionOptions<3> opt;
opt.numThreads(4); // use 4 threads (uses hardware default if not given)
opt.innerScale(sigma);
// perform isotropic Gaussian smoothing at scale 'sigma' in parallel

Usage with anisotropic data:

Shape3 shape(width, height, depth);
...
// perform anisotropic Gaussian smoothing at scale 'sigma'
gaussianSmoothMultiArray(source, dest, sigma,
ConvolutionOptions<3>().stepSize(step_size).resolutionStdDev(resolution_sigmas));
See also
separableConvolveMultiArray()

◆ gaussianGradientMultiArray()

template<... >
void gaussianGradientMultiArray (   ...)

Calculate Gaussian gradient of a multi-dimensional arrays.

This function computes the Gaussian gradient of the given N-dimensional array with a sequence of first-derivative-of-Gaussian filters at the given standard deviation sigma (differentiation is applied to each dimension in turn, starting with the innermost dimension). The destination array is required to have a vector valued pixel type with as many elements as the number of dimensions. This function is implemented by calls to separableConvolveMultiArray() with the appropriate kernels.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameter sigma is omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// pass filter scale explicitly
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double sigma,
// pass filter scale(s) in option object
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
// likewise, but execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void gaussianGradientMultiArray(...)
Calculate Gaussian gradient of a multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
Namespace: vigra

Shape3 shape(width, height, depth);
...
// compute Gaussian gradient at scale sigma
gaussianGradientMultiArray(source, dest, sigma);

Usage with anisotropic data:

Shape3 shape(width, height, depth);
...
// compute Gaussian gradient at scale sigma
gaussianGradientMultiArray(source, dest, sigma,
ConvolutionOptions<3>().stepSize(step_size).resolutionStdDev(resolution_sigmas));
See also
separableConvolveMultiArray()

◆ symmetricGradientMultiArray()

template<... >
void symmetricGradientMultiArray (   ...)

Calculate gradient of a multi-dimensional arrays using symmetric difference filters.

This function computes the gradient of the given N-dimensional array with a sequence of symmetric difference filters a (differentiation is applied to each dimension in turn, starting with the innermost dimension). The destination array is required to have a vector valued pixel type with as many elements as the number of dimensions. This function is implemented by calls to convolveMultiArrayOneDimension() with the symmetric difference kernel.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameter sigma is omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// execute algorithm sequentially
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
// execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void symmetricGradientMultiArray(...)
Calculate gradient of a multi-dimensional arrays using symmetric difference filters.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
Namespace: vigra

MultiArray<3, unsigned char>::size_type shape(width, height, depth);
...
// compute gradient
symmetricGradientMultiArray(srcMultiArrayRange(source), destMultiArray(dest));

Usage with anisotropic data:

Shape3 shape(width, height, depth);
...
// compute gradient
symmetricGradientMultiArray(source, dest,
ConvolutionOptions<3>().stepSize(step_size));
See also
convolveMultiArrayOneDimension()

◆ laplacianOfGaussianMultiArray()

template<... >
void laplacianOfGaussianMultiArray (   ...)

Calculate Laplacian of a N-dimensional arrays using Gaussian derivative filters.

This function computes the Laplacian of the given N-dimensional array with a sequence of second-derivative-of-Gaussian filters at the given standard deviation sigma. Both source and destination arrays must have scalar value_type. This function is implemented by calls to separableConvolveMultiArray() with the appropriate kernels, followed by summation.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameter sigma is omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// pass scale explicitly
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double sigma,
// pass scale(s) in option object
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
// likewise, but execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void laplacianOfGaussianMultiArray(...)
Calculate Laplacian of a N-dimensional arrays using Gaussian derivative filters.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
Namespace: vigra

Shape3 shape(width, height, depth);
MultiArray<3, float> source(shape);
...
// compute Laplacian at scale sigma
laplacianOfGaussianMultiArray(source, laplacian, sigma);

Usage with anisotropic data:

MultiArray<3, float> source(shape);
...
// compute Laplacian at scale sigma
laplacianOfGaussianMultiArray(source, laplacian, sigma,
ConvolutionOptions<3>().stepSize(step_size).resolutionStdDev(resolution_sigmas));
See also
separableConvolveMultiArray()

◆ gaussianDivergenceMultiArray()

template<... >
void gaussianDivergenceMultiArray (   ...)

Calculate the divergence of a vector field using Gaussian derivative filters.

This function computes the divergence of the given N-dimensional vector field with a sequence of first-derivative-of-Gaussian filters at the given standard deviation sigma. The input vector field can either be given as a sequence of scalar array views (one for each vector field component), represented by an iterator range, or by a single vector array with the appropriate shape. This function is implemented by calls to separableConvolveMultiArray() with the suitable kernels, followed by summation.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameter sigma is omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// specify input vector field as a sequence of scalar arrays
template <class Iterator,
unsigned int N, class T, class S>
void
template <class Iterator,
unsigned int N, class T, class S>
void
double sigma,
// pass input vector field as an array of vectors
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double sigma,
// pass input vector field as an array of vectors and
// execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void gaussianDivergenceMultiArray(...)
Calculate the divergence of a vector field using Gaussian derivative filters.

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
Namespace: vigra

Shape3 shape(width, height, depth);
...
// compute divergence at scale sigma
gaussianDivergenceMultiArray(source, laplacian, sigma);

Usage with anisotropic data:

...
// compute divergence at scale sigma
gaussianDivergenceMultiArray(source, laplacian, sigma,
ConvolutionOptions<3>().stepSize(step_size).resolutionStdDev(resolution_sigmas));

◆ hessianOfGaussianMultiArray()

template<... >
void hessianOfGaussianMultiArray (   ...)

Calculate Hessian matrix of a N-dimensional arrays using Gaussian derivative filters.

This function computes the Hessian matrix the given scalar N-dimensional array with a sequence of second-derivative-of-Gaussian filters at the given standard deviation sigma. The destination array must have a vector valued element type with N*(N+1)/2 elements (it represents the upper triangular part of the symmetric Hessian matrix, flattened row-wise). This function is implemented by calls to separableConvolveMultiArray() with the appropriate kernels.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameter sigma is omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// pass scale explicitly
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
MultiArrayView<N, TinyVector<T2, int(N*(N+1)/2)>, S2> dest,
double sigma,
// pass scale(s) in option object
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
MultiArrayView<N, TinyVector<T2, int(N*(N+1)/2)>, S2> dest,
// likewise, but execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
MultiArrayView<N, TinyVector<T2, int(N*(N+1)/2)>, S2> dest,
}
void hessianOfGaussianMultiArray(...)
Calculate Hessian matrix of a N-dimensional arrays using Gaussian derivative filters.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
Namespace: vigra

Shape3 shape(width, height, depth);
MultiArray<3, float> source(shape);
...
// compute Hessian at scale sigma
hessianOfGaussianMultiArray(source, dest, sigma);

Usage with anisotropic data:

MultiArray<3, float> source(shape);
...
// compute Hessian at scale sigma
hessianOfGaussianMultiArray(source, dest, sigma,
ConvolutionOptions<3>().stepSize(step_size).resolutionStdDev(resolution_sigmas));
See also
separableConvolveMultiArray(), vectorToTensorMultiArray()

◆ structureTensorMultiArray()

template<... >
void structureTensorMultiArray (   ...)

Calculate the structure tensor of a multi-dimensional arrays.

This function computes the gradient (outer product) tensor for each element of the given N-dimensional array with first-derivative-of-Gaussian filters at the given innerScale, followed by Gaussian smoothing at outerScale. The destination array must have a vector valued pixel type with N*(N+1)/2 elements (it represents the upper triangular part of the symmetric structure tensor matrix, flattened row-wise). If the source array is also vector valued, the resulting structure tensor is the sum of the individual tensors for each channel. This function is implemented by calls to separableConvolveMultiArray() with the appropriate kernels.

Anisotropic data should be provided with appropriate vigra::ConvolutionOptions to adjust the filter sizes for the resolution of each axis. Otherwise, the parameter opt is optional unless the parameters innerScale and outerScale are both omitted.

If you pass vigra::BlockwiseConvolutionOptions instead, the algorithm will be executed in parallel on data blocks of a certain size. The block size can be customized via BlockwiseConvolutionOptions::blockShape(), but the defaults usually work reasonably. By default, the number of threads equals the capabilities of your hardware, but you can change this via BlockwiseConvolutionOptions::numThreads().

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// pass scales explicitly
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
MultiArrayView<N, TinyVector<T2, int(N*(N+1)/2)>, S2> dest,
double innerScale, double outerScale,
// pass scales in option object
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
MultiArrayView<N, TinyVector<T2, int(N*(N+1)/2)>, S2> dest,
// likewise, but execute algorithm in parallel
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
MultiArrayView<N, TinyVector<T2, int(N*(N+1)/2)>, S2> dest,
}
void structureTensorMultiArray(...)
Calculate the structure tensor of a multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_convolution.hxx> (sequential version)
#include <vigra/multi_blockwise.hxx> (parallel version)
Namespace: vigra

Shape3 shape(width, height, depth);
...
// compute structure tensor at scales innerScale and outerScale
structureTensorMultiArray(source, dest, innerScale, outerScale);

Usage with anisotropic data:

...
// compute structure tensor at scales innerScale and outerScale
structureTensorMultiArray(source, dest, innerScale, outerScale,
ConvolutionOptions<3>().stepSize(step_size).resolutionStdDev(resolution_sigmas));
See also
separableConvolveMultiArray(), vectorToTensorMultiArray()

◆ separableMultiDistSquared()

template<... >
void separableMultiDistSquared (   ...)

Euclidean distance squared on multi-dimensional arrays.

The algorithm is taken from Donald Bailey: "An Efficient Euclidean Distance Transform", Proc. IWCIA'04, Springer LNCS 3322, 2004.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// explicitly specify pixel pitch for each coordinate
template <unsigned int N, class T1, class S1,
class T2, class S2,
class Array>
void
bool background,
Array const & pixelPitch);
// use default pixel pitch = 1.0 for each coordinate
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
bool background);
}
void separableMultiDistSquared(...)
Euclidean distance squared on multi-dimensional arrays.

show deprecated declarations

This function performs a squared Euclidean squared distance transform on the given multi-dimensional array. Both source and destination arrays are represented by iterators, shape objects and accessors. The destination array is required to already have the correct size.

This function expects a mask as its source, where background pixels are marked as zero, and non-background pixels as non-zero. If the parameter background is true, then the squared distance of all background pixels to the nearest object is calculated. Otherwise, the distance of all object pixels to the nearest background pixel is calculated.

Optionally, one can pass an array that specifies the pixel pitch in each direction. This is necessary when the data have non-uniform resolution (as is common in confocal microscopy, for example).

This function may work in-place, which means that siter == diter is allowed. A full-sized internal array is only allocated if working on the destination array directly would cause overflow errors (i.e. if NumericTraits<typename DestAccessor::value_type>::max() < N * M*M, where M is the size of the largest dimension of the array.

Usage:

#include <vigra/multi_distance.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
// Calculate Euclidean distance squared for all background pixels
separableMultiDistSquared(source, dest, true);
See also
vigra::distanceTransform(), vigra::separableMultiDistance()

◆ separableMultiDistance()

template<... >
void separableMultiDistance (   ...)

Euclidean distance on multi-dimensional arrays.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// explicitly specify pixel pitch for each coordinate
template <unsigned int N, class T1, class S1,
class T2, class S2, class Array>
void
bool background,
Array const & pixelPitch);
// use default pixel pitch = 1.0 for each coordinate
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
bool background);
}
void separableMultiDistance(...)
Euclidean distance on multi-dimensional arrays.

show deprecated declarations

This function performs a Euclidean distance transform on the given multi-dimensional array. It simply calls separableMultiDistSquared() and takes the pixel-wise square root of the result. See separableMultiDistSquared() for more documentation.

Usage:

#include <vigra/multi_distance.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
// Calculate Euclidean distance for all background pixels
separableMultiDistance(source, dest, true);
See also
vigra::distanceTransform(), vigra::separableMultiDistSquared()

◆ boundaryMultiDistance()

template<... >
void boundaryMultiDistance (   ...)

Euclidean distance to the implicit boundaries of a multi-dimensional label array.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
BoundaryDistanceTag
Specify which boundary is used for boundaryMultiDistance().
Definition multi_distance.hxx:835
@ InterpixelBoundary
Half-integer points between pixels of different labels.
Definition multi_distance.hxx:837
void boundaryMultiDistance(...)
Euclidean distance to the implicit boundaries of a multi-dimensional label array.

This function computes the distance transform of a labeled image simultaneously for all regions. Depending on the requested type of boundary, three modes are supported:

  • OuterBoundary: In each region, compute the distance to the nearest pixel not belonging to that regions. This is the same as if a normal distance transform where applied to a binary image containing just this region.
  • InterpixelBoundary (default): Like OuterBoundary, but shift the distance to the interpixel boundary by subtractiong 1/2. This make the distences consistent accross boundaries.
  • InnerBoundary: In each region, compute the distance to the nearest pixel in the region which is adjacent to the boundary.

If array_border_is_active=true, the outer border of the array (i.e. the interpixel boundary between the array and the infinite region) is also used. Otherwise (the default), regions touching the array border are treated as if they extended to infinity.

Usage:

#include <vigra/multi_distance.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
MultiArray<3, UInt32> labels(shape);
...
// find regions (interpixel boundaries are implied)
labelMultiArray(source, labels);
// Calculate Euclidean distance to interpixel boundary for all pixels
See also
vigra::distanceTransform(), vigra::separableMultiDistance()

◆ fftwCorrespondingShapeR2C()

template<class T , int N>
TinyVector< T, N > fftwCorrespondingShapeR2C ( TinyVector< T, N >  shape)

Find frequency domain shape for a R2C Fourier transform.

When a real valued array is transformed to the frequency domain, about half of the Fourier coefficients are redundant. The transform can be optimized as a R2C transform that doesn't compute and store the redundant coefficients. This function computes the appropriate frequency domain shape for a given shape in the spatial domain. It simply replaces shape[0] with shape[0] / 2 + 1.

#include <vigra/multi_fft.hxx>
Namespace: vigra

◆ convolveFFT()

template<... >
void convolveFFT (   ...)

Convolve an array with a kernel by means of the Fourier transform.

Thanks to the convolution theorem of Fourier theory, a convolution in the spatial domain is equivalent to a multiplication in the frequency domain. Thus, for certain kernels (especially large, non-separable ones), it is advantageous to perform the convolution by first transforming both array and kernel to the frequency domain, multiplying the frequency representations, and transforming the result back into the spatial domain. Some kernels have a much simpler definition in the frequency domain, so that they are readily computed there directly, avoiding Fourier transformation of those kernels.

The following functions implement various variants of FFT-based convolution:

convolveFFT
Convolve a real-valued input array with a kernel such that the result is also real-valued. That is, the kernel is either provided as a real-valued array in the spatial domain, or as a complex-valued array in the Fourier domain, using the half-space format of the R2C Fourier transform (see below).
convolveFFTMany
Like convolveFFT, but you may provide many kernels at once (using an iterator pair specifying the kernel sequence). This has the advantage that the forward transform of the input array needs to be executed only once.
convolveFFTComplex
Convolve a complex-valued input array with a complex-valued kernel, resulting in a complex-valued output array. An additional flag is used to specify whether the kernel is defined in the spatial or frequency domain.
convolveFFTComplexMany
Like convolveFFTComplex, but you may provide many kernels at once (using an iterator pair specifying the kernel sequence). This has the advantage that the forward transform of the input array needs to be executed only once.

The output arrays must have the same shape as the input arrays. In the "Many" variants of the convolution functions, the kernels must all have the same shape.

The origin of the kernel is always assumed to be in the center of the kernel array (precisely, at the point floor(kernel.shape() / 2.0), except when the half-space format is used, see below). The function moveDCToUpperLeft() will be called internally to align the kernel with the transformed input as appropriate.

If a real input is combined with a real kernel, the kernel is automatically assumed to be defined in the spatial domain. If a real input is combined with a complex kernel, the kernel is assumed to be defined in the Fourier domain in half-space format. If the input array is complex, a flag fourierDomainKernel determines where the kernel is defined.

When the kernel is defined in the spatial domain, the convolution functions will automatically pad (enlarge) the input array by at least the kernel radius in each direction. The newly added space is filled according to reflective boundary conditions in order to minimize border artifacts during convolution. It is thus ensured that convolution in the Fourier domain yields the same results as convolution in the spatial domain (e.g. when separableConvolveMultiArray() is called with the same kernel). A little further padding may be added to make sure that the padded array shape uses integers which have only small prime factors, because FFTW is then able to use the fastest possible algorithms. Any padding is automatically removed from the result arrays before the function returns.

When the kernel is defined in the frequency domain, it must be complex-valued, and its shape determines the shape of the Fourier representation (i.e. the input is padded according to the shape of the kernel). If we are going to perform a complex-valued convolution, the kernel must be defined for the entire frequency domain, and its shape directly determines the size of the FFT.

In contrast, a frequency domain kernel for a real-valued convolution must have symmetry properties that allow to drop half of the kernel coefficients, as in the R2C transform. That is, the kernel must have the half-space format, that is the shape returned by fftwCorrespondingShapeR2C(fourier_shape), where fourier_shape is the desired logical shape of the frequency representation (and thus the size of the padded input). The origin of the kernel must be at the point (0, floor(fourier_shape[0] / 2.0), ..., floor(fourier_shape[N-1] / 2.0)) (i.e. as in a regular kernel except for the first dimension).

The Real type in the declarations can be double, float, and long double. Your program must always link against libfftw3. If you use float or long double arrays, you must additionally link against libfftw3f and libfftw3l respectively.

The Fourier transform functions internally create FFTW plans which control the algorithm details. The plans are created with the flag FFTW_ESTIMATE, i.e. optimal settings are guessed or read from saved "wisdom" files. If you need more control over planning, you can use the class FFTWConvolvePlan.

See also applyFourierFilter() for corresponding functionality on the basis of the old image iterator interface.

Declarations:

Real-valued convolution with kernel in the spatial domain:

namespace vigra {
template <unsigned int N, class Real, class C1, class C2, class C3>
void
}
void convolveFFT(...)
Convolve an array with a kernel by means of the Fourier transform.

Real-valued convolution with kernel in the Fourier domain (half-space format):

namespace vigra {
template <unsigned int N, class Real, class C1, class C2, class C3>
void
}

Series of real-valued convolutions with kernels in the spatial or Fourier domain (the kernel and out sequences must have the same length):

namespace vigra {
template <unsigned int N, class Real, class C1,
void
}
void convolveFFTMany(...)
Convolve a real-valued array with a sequence of kernels by means of the Fourier transform.

Complex-valued convolution (parameter fourierDomainKernel determines if the kernel is defined in the spatial or Fourier domain):

namespace vigra {
template <unsigned int N, class Real, class C1, class C2, class C3>
void
}
void convolveFFTComplex(...)
Convolve a complex-valued array by means of the Fourier transform.

Series of complex-valued convolutions (parameter fourierDomainKernel determines if the kernels are defined in the spatial or Fourier domain, the kernel and out sequences must have the same length):

namespace vigra {
template <unsigned int N, class Real, class C1,
void
}
void convolveFFTComplexMany(...)
Convolve a complex-valued array with a sequence of kernels by means of the Fourier transform.

Usage:

#include <vigra/multi_fft.hxx>
Namespace: vigra

// convolve real array with a Gaussian (sigma=1) defined in the spatial domain
// (implicitly uses padding by at least 4 pixels)
MultiArray<2, double> src(Shape2(w, h)), dest(Shape2(w,h));
for(int y=0; y<9; ++y)
for(int x=0; x<9; ++x)
spatial_kernel(x, y) = gauss(x-4.0)*gauss(y-4.0);
// convolve real array with a Gaussian (sigma=1) defined in the Fourier domain
// (uses no padding, because the kernel size corresponds to the input size)
int y0 = h / 2;
for(int y=0; y<fourier_kernel.shape(1); ++y)
for(int x=0; x<fourier_kernel.shape(0); ++x)
fourier_kernel(x, y) = exp(-0.5*sq(x / double(w))) * exp(-0.5*sq((y-y0)/double(h)));

◆ convolveFFTComplex()

template<... >
void convolveFFTComplex (   ...)

Convolve a complex-valued array by means of the Fourier transform.

See convolveFFT() for details.

◆ convolveFFTMany()

template<... >
void convolveFFTMany (   ...)

Convolve a real-valued array with a sequence of kernels by means of the Fourier transform.

See convolveFFT() for details.

◆ convolveFFTComplexMany()

template<... >
void convolveFFTComplexMany (   ...)

Convolve a complex-valued array with a sequence of kernels by means of the Fourier transform.

See convolveFFT() for details.

◆ correlateFFT()

template<... >
void correlateFFT (   ...)

Correlate an array with a kernel by means of the Fourier transform.

This function correlates a real-valued input array with a real-valued kernel such that the result is also real-valued. Thanks to the correlation theorem of Fourier theory, a correlation in the spatial domain is equivalent to a multiplication with the complex conjugate in the frequency domain. Thus, for certain kernels (especially large, non-separable ones), it is advantageous to perform the correlation by first transforming both array and kernel to the frequency domain, multiplying the frequency representations, and transforming the result back into the spatial domain.

The output arrays must have the same shape as the input arrays.

See also convolveFFT() for corresponding functionality.

Declarations:

namespace vigra {
template <unsigned int N, class Real, class C1, class C2, class C3>
void
}
void correlateFFT(...)
Correlate an array with a kernel by means of the Fourier transform.

Usage:

#include <vigra/multi_fft.hxx>
Namespace: vigra

// correlate real array with a template to find best matches
// (implicitly uses padding by at least 4 pixels)
MultiArray<2, double> src(Shape2(w, h)), dest(Shape2(w, h));
MultiArray<2, double> template(Shape2(9, 9));
template = ...;
correlateFFT(src, template, dest);

◆ get() [1/2]

template<unsigned int TARGET_INDEX, class Handle >
CoupledHandleCast< TARGET_INDEX, Handle >::reference get ( Handle &  handle)

Returns reference to the element in the band of the handle with index TARGET_INDEX.

◆ get() [2/2]

template<unsigned int TARGET_INDEX, class Handle >
CoupledHandleCast< TARGET_INDEX, Handle >::const_reference get ( Handle const handle)

Returns a constant reference to the element in the band of the handle with index TARGET_INDEX.

◆ createHierarchicalIterator() [1/6]

template<int N>
HierarchicalIteratorType< N >::type createHierarchicalIterator ( TinyVector< MultiArrayIndex, N > const shape)

Returns a HierarchicalIterator from shape to iterate over coordinates.

◆ createHierarchicalIterator() [2/6]

template<unsigned int N1, class T1 , class S1 >
HierarchicalIteratorType< N1, T1 >::type createHierarchicalIterator ( MultiArrayView< N1, T1, S1 > const m1)

Returns a HierarchicalIterator to simultaneously iterate over image m1 and its coordinates.

◆ createHierarchicalIterator() [3/6]

template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 >
HierarchicalIteratorType< N1, T1, T2 >::type createHierarchicalIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2 
)

Returns a HierarchicalIterator to simultaneously iterate over images m1, m2 and their coordinates.

◆ createHierarchicalIterator() [4/6]

template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 >
HierarchicalIteratorType< N1, T1, T2, T3 >::type createHierarchicalIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2,
MultiArrayView< N3, T3, S3 > const m3 
)

Returns a HierarchicalIterator to simultaneously iterate over images m1, m2, m3 and their coordinates.

◆ createHierarchicalIterator() [5/6]

HierarchicalIteratorType< N1, T1, T2, T3, T4 >::type createHierarchicalIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2,
MultiArrayView< N3, T3, S3 > const m3,
MultiArrayView< N4, T4, S4 > const m4 
)

Returns a HierarchicalIterator to simultaneously iterate over images m1, m2, m3, m4 and their coordinates.

◆ createHierarchicalIterator() [6/6]

HierarchicalIteratorType< N1, T1, T2, T3, T4, T5 >::type createHierarchicalIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2,
MultiArrayView< N3, T3, S3 > const m3,
MultiArrayView< N4, T4, S4 > const m4,
MultiArrayView< N5, T5, S5 > const m5 
)

Returns a HierarchicalIterator to simultaneously iterate over images m1, m2, m3, m4, m5 and their coordinates.

◆ importVolume()

template<... >
void importVolume (   ...)

Function for importing a 3D volume.

Declarations:

namespace vigra {
// variant 1: read data specified by the given VolumeImportInfo object
template <class T, class Stride>
void
// variant 2: read data using a single filename, resize volume automatically
template <class T, class Allocator>
void
const std::string &filename);
// variant 3: read data from an image stack, resize volume automatically
template <class T, class Allocator>
void
const std::string &name_base,
const std::string &name_ext);
}
Argument object for the function importVolume().
Definition multi_impex.hxx:77
void importVolume(...)
Function for importing a 3D volume.

Data can be read either from a single file containing 3D data (supported formats: Andor .SIF or multi-page TIFF), a ".info" text file which describes the contents of an accompanying raw data file, or a stack of 2D images (numbered according to the scheme name_base+"[0-9]+"+name_extension) each representing a slice of the volume. The decision which of these possibilities applies is taken in the VolumeImportInfo constructor, see there for full details.

Variant 1 is the basic version of this function. Here, the info object and a destination array of approriate size must already be constructed. The other variants are just abbreviations provided for your convenience:

// variant 2 is equivalent to
volume.reshape(info.shape());
importVolume(info, volume); // call variant 1
// variant 3 is equivalent to
volume.reshape(info.shape());
importVolume(info, volume); // call variant 1

Usage:

#include <vigra/multi_impex.hxx>
Namespace: vigra

// read data from a multi-page TIFF file, using variant 1
VolumeImportInfo info("multipage.tif");
MultiArray<3, float> volume(info.shape());
importVolume(info, volume);
// read data from a stack of 2D png-images, using variant 1
VolumeImportInfo info("my_data", ".png"); // looks for files 'my_data0.png', 'my_data1.png' etc.
MultiArray<3, float> volume(info.shape());
importVolume(info, volume);

Notice that slice numbers in a stack need not be consecutive (i.e. gaps are allowed) and will be interpreted according to their numerical order (i.e. "009", "010", "011" are read in the same order as "9", "10", "11"). The number of images found determines the depth of the volume.

◆ exportVolume()

template<... >
void exportVolume (   ...)

Function for exporting a 3D volume.

Declarations:

namespace vigra {
// variant 1: writa data as specified in the given VolumeExportInfo object
template <class T, class Tag>
void
// variant 2: write data to a multi-page TIFF file
template <class T, class Tag>
void
const std::string &filename);
// variant 3: write data to an image stack
template <class T, class Tag>
void
const std::string &name_base,
const std::string &name_ext);
}
Argument object for the function exportVolume().
Definition multi_impex.hxx:258
void exportVolume(...)
Function for exporting a 3D volume.

The volume can either be exported as a multi-page TIFF file (variant 2, only available if libtiff is installed), or as a stack of 2D images, one image per slice (variant 3, files are named according to the scheme name_base+"000"+name_ext, name_base+"001"+name_ext etc.). If the target image format does not support the source value_type, all slices will be mapped to the appropriate target range in the same way.

Variant 1 is the basic version of the function. It allows full control over the export via an already constructed vigra::VolumeExportInfo object. The other two are just abbreviations that construct the VolumeExportInfo object internally.

Usage:

#include <vigra/multi_impex.hxx>
Namespace: vigra

... // fill in data
// export a stack named "my_data01.jpg", "my_data02.jpg" etc.
VolumeExportInfo info("my_data", ".jpg");
info.setCompression("JPEG QUALITY=95");
exportVolume(volume, info);

◆ createCoupledIterator() [2/7]

template<int N>
CoupledIteratorType< N >::type createCoupledIterator ( TinyVector< MultiArrayIndex, N > const shape)

Returns a CoupledScanOrderIterator from shape to iterate over coordinates.

◆ createCoupledIterator() [3/7]

template<unsigned int N1, class T1 , class S1 >
CoupledIteratorType< N1, T1 >::type createCoupledIterator ( MultiArrayView< N1, T1, S1 > const m1)

Returns a CoupledScanOrderIterator to simultaneously iterate over image m1 and its coordinates.

◆ createCoupledIterator() [4/7]

template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 >
CoupledIteratorType< N1, T1, T2 >::type createCoupledIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2 
)

Returns a CoupledScanOrderIterator to simultaneously iterate over images m1, m2 and their coordinates.

◆ createCoupledIterator() [5/7]

template<unsigned int N1, class T1 , class S1 , unsigned int N2, class T2 , class S2 , unsigned int N3, class T3 , class S3 >
CoupledIteratorType< N1, T1, T2, T3 >::type createCoupledIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2,
MultiArrayView< N3, T3, S3 > const m3 
)

Returns a CoupledScanOrderIterator to simultaneously iterate over images m1, m2, m3 and their coordinates.

◆ createCoupledIterator() [6/7]

CoupledIteratorType< N1, T1, T2, T3, T4 >::type createCoupledIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2,
MultiArrayView< N3, T3, S3 > const m3,
MultiArrayView< N4, T4, S4 > const m4 
)

Returns a CoupledScanOrderIterator to simultaneously iterate over images m1, m2, m3, m4 and their coordinates.

◆ createCoupledIterator() [7/7]

CoupledIteratorType< N1, T1, T2, T3, T4, T5 >::type createCoupledIterator ( MultiArrayView< N1, T1, S1 > const m1,
MultiArrayView< N2, T2, S2 > const m2,
MultiArrayView< N3, T3, S3 > const m3,
MultiArrayView< N4, T4, S4 > const m4,
MultiArrayView< N5, T5, S5 > const m5 
)

Returns a CoupledScanOrderIterator to simultaneously iterate over images m1, m2, m3, m4, m5 and their coordinates.

◆ labelMultiArray()

template<... >
unsigned int labelMultiArray (   ...)

Find the connected components of a MultiArray with arbitrary many dimensions.

See also labelMultiArrayBlockwise() for a parallel version of this algorithm.

By specifying a background value in the vigra::LabelOptions, this function can also realize the behavior of labelMultiArrayWithBackground().

Declaration:

namespace vigra {
// specify parameters directly
template <unsigned int N, class T, class S1,
class Label, class S2,
class EqualityFunctor = std::equal_to<T> >
EqualityFunctor equal = std::equal_to<T>())
// specify parameters via LabelOptions
template <unsigned int N, class T, class S1,
class Equal = std::equal<T> >
MultiArrayView<N, Label, S2> labels,
LabelOptions const & options,
Equal equal = std::equal<T>());
}
unsigned int labelMultiArray(...)
Find the connected components of a MultiArray with arbitrary many dimensions.
NeighborhoodType
Choose the neighborhood system in a dimension-independent way.
Definition multi_fwd.hxx:186

Connected components are defined as regions with uniform values. Thus, the value type T of the input array data either must be equality comparable, or an EqualityFunctor must be provided that realizes the desired predicate. The destination array's value type Label should be large enough to hold the labels without overflow. Region numbers will form a consecutive sequence starting at one and ending with the region number returned by the function (inclusive).

Argument neighborhood specifies the type of connectivity used. It can take the values DirectNeighborhood (which corresponds to 4-neighborhood in 2D and 6-neighborhood in 3D, default) or IndirectNeighborhood (which corresponds to 8-neighborhood in 2D and 26-neighborhood in 3D).

Return: the highest region label used

Usage:

#include <vigra/multi_labeling.hxx>
Namespace: vigra

// find 6-connected regions
// find 26-connected regions
// find 6-connected regions, ignore the background value 0
// (i.e. call labelMultiArrayWithBackground() internally)
.ignoreBackgroundValue(0));

Required Interface:

T t;
t == t // T is equality comparable
EqualityFunctor equal; // or a suitable functor is supplied
equal(t, t)

◆ labelMultiArrayWithBackground()

template<... >
unsigned int labelMultiArrayWithBackground (   ...)

Find the connected components of a MultiArray with arbitrary many dimensions, excluding the background from labeling.

From a user's point of view, this function is no longer needed because labelMultiArray() can realizes the same behavior when an appropriate background value is specified in its vigra::LabelOptions. Similarly, labelMultiArrayBlockwise() implements a parallel version of this algorithm.

Declaration:

namespace vigra {
template <unsigned int N, class T, class S1,
class Label, class S2
class Equal = std::equal<T> >
T backgroundValue = T(),
Equal equal = std::equal<T>());
}
unsigned int labelMultiArrayWithBackground(...)
Find the connected components of a MultiArray with arbitrary many dimensions, excluding the backgroun...

This function is the same as labelMultiArray(), except for the additional parameter backgroundValue. Points in the input array data with this value (which default to zero) are ignored during labeling, and their output label is automatically set to zero. Region numbers will be a consecutive sequence starting at zero (when background was present) or at one (when no background was present) and ending with the region number returned by the function (inclusive).

Return: the number of non-background regions found (= highest region label, because background has label 0)

Usage:

#include <vigra/multi_labeling.hxx>
Namespace: vigra

// find 6-connected regions, ignoring background value zero (the default)
// find 26-connected regions, using -1 as the background value

Required Interface:

t == backgroundValue // T is equality comparable
EqualityFunctor equal; // or a suitable functor is supplied
equal(t, backgroundValue)

◆ multiBinaryErosion()

template<... >
void multiBinaryErosion (   ...)

Binary erosion on multi-dimensional arrays.

This function applies a flat circular erosion operator with a given radius. The operation is isotropic. The input is interpreted as a binary multi-dimensional array where non-zero pixels represent foreground and zero pixels represent background. In the output, foreground is always represented by ones (i.e. NumericTrais<typename DestAccessor::value_type>::one()).

This function may work in-place, which means that siter == diter is allowed. A temporary internal array is only allocated if working on the destination array directly would cause overflow errors (that is if NumericTraits<typename DestAccessor::value_type>::max() < squaredNorm(shape), i.e. the squared length of the image diagonal doesn't fit into the destination type).

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double radius);
}
void multiBinaryErosion(...)
Binary erosion on multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_morphology.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
// perform isotropic binary erosion
multiBinaryErosion(source, dest, 3);
See also
vigra::discErosion(), vigra::multiGrayscaleErosion()

◆ multiBinaryDilation()

template<... >
void multiBinaryDilation (   ...)

Binary dilation on multi-dimensional arrays.

This function applies a flat circular dilation operator with a given radius. The operation is isotropic. The input is interpreted as a binary multi-dimensional array where non-zero pixels represent foreground and zero pixels represent background. In the output, foreground is always represented by ones (i.e. NumericTrais<typename DestAccessor::value_type>::one()).

This function may work in-place, which means that siter == diter is allowed. A temporary internal array is only allocated if working on the destination array directly would cause overflow errors (that is if NumericTraits<typename DestAccessor::value_type>::max() < squaredNorm(shape), i.e. the squared length of the image diagonal doesn't fit into the destination type).

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double radius);
}
void multiBinaryDilation(...)
Binary dilation on multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_morphology.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
// perform isotropic binary erosion
multiBinaryDilation(source, dest, 3);
See also
vigra::discDilation(), vigra::multiGrayscaleDilation()

◆ multiGrayscaleErosion()

template<... >
void multiGrayscaleErosion (   ...)

Parabolic grayscale erosion on multi-dimensional arrays.

This function applies a parabolic erosion operator with a given spread (sigma) on a grayscale array. The operation is isotropic. The input is a grayscale multi-dimensional array.

This function may work in-place, which means that siter == diter is allowed. A full-sized internal array is only allocated if working on the destination array directly would cause overflow errors (i.e. if typeid(typename DestAccessor::value_type) < N * M*M, where M is the size of the largest dimension of the array.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double sigma);
}
void multiGrayscaleErosion(...)
Parabolic grayscale erosion on multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_morphology.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
// perform isotropic grayscale erosion
multiGrayscaleErosion(source, dest, 3.0);
See also
vigra::discErosion(), vigra::multiBinaryErosion()

◆ multiGrayscaleDilation()

template<... >
void multiGrayscaleDilation (   ...)

Parabolic grayscale dilation on multi-dimensional arrays.

This function applies a parabolic dilation operator with a given spread (sigma) on a grayscale array. The operation is isotropic. The input is a grayscale multi-dimensional array.

This function may work in-place, which means that siter == diter is allowed. A full-sized internal array is only allocated if working on the destination array directly would cause overflow errors (i.e. if typeid(typename DestAccessor::value_type) < N * M*M, where M is the size of the largest dimension of the array.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
double sigma);
}
void multiGrayscaleDilation(...)
Parabolic grayscale dilation on multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_morphology.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
// perform isotropic grayscale erosion
multiGrayscaleDilation(source, dest, 3.0);
See also
vigra::discDilation(), vigra::multiBinaryDilation()

◆ initMultiArray()

template<... >
void initMultiArray (   ...)

Write a value to every element in a multi-dimensional array.

The initial value can either be a constant of appropriate type (compatible with the destination's value_type), or a functor with compatible result_type. These two cases are automatically distinguished when FunctorTraits<FUNCTOR>::isInitializer yields VigraTrueType. Since the functor is passed by const reference, its operator() must be const, and its internal state may need to be mutable.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T, class S, class VALUETYPE>
void
template <unsigned int N, class T, class S, class FUNCTOR>
void
}
void initMultiArray(...)
Write a value to every element in a multi-dimensional array.

show deprecated declarations

Usage:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

MultiArray<3, unsigned int> array(Shape3(100, 200, 50));
// make an array of all ones
initMultiArray(array, 1);
// equivalent calls:
array = 1;
array.init(1);
// fill the array with random numbers
#include <vigra/random.hxx>

show deprecated examples

◆ initMultiArrayBorder()

template<... >
void initMultiArrayBorder (   ...)

Write values to the specified border values in the array.

This functions is similar to initMultiArray(), but it initializes only the array elements whose distance from any array border is at most border_width.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
// init equal borders on all array sides
template <unsigned int N, class T, class S,
class VALUETYPE>
void
template <unsigned int N, class T, class S,
class FUNCTOR>
void
// specify border width individually for all array sides
template <unsigned int N, class T, class S,
class VALUETYPE>
void
VALUETYPE const & v);
}
std::ptrdiff_t MultiArrayIndex
Definition multi_fwd.hxx:60
void initMultiArrayBorder(...)
Write values to the specified border values in the array.

show deprecated declarations

Usage:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

MultiArray<3, unsigned int> array(Shape3(100, 200, 50));
int border_width = 5;
// init the array interior to 1, the border to 2

◆ copyMultiArray()

template<... >
void copyMultiArray (   ...)

Copy a multi-dimensional array.

This function can be applied in two modes:

Standard Mode:
If the source and destination arrays have the same size, the corresponding array elements are simply copied. If necessary, type conversion takes place.
Expanding Mode:
If the source array has length 1 along some (or even all) dimensions, the source value at index 0 is used for all destination elements in those dimensions. For example, if we have single row of data (column length is 1), we can copy it into a 2D image of the same width: The given row is automatically repeated for every row of the destination image. Again, type conversion os performed if necessary.

The arrays must be represented by iterators compatible with vigra::MultiIterator, and the iteration range is specified by means of shape objects. If only the source shape is given the destination array is assumed to have the same shape, and standard mode is applied. If two shapes are given, the size of corresponding dimensions must be either equal (standard copy), or the source length must be 1 (expanding copy).

Declarations:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void copyMultiArray(...)
Copy a multi-dimensional array.

show deprecated declarations

Usage - Standard Mode:

MultiArray<3, int> src(Shape3(100, 200, 50)),
dest(Shape3(100, 200, 50));
...
copyMultiArray(src, dest);
// equivalent to
// copy only the red channel (i.e. channl 0) of an RGB array
copyMultiArray(rgb_src.bindElementChannel(0), dest);
// equivalent to
dest = rgb_src.bindElementChannel(0);

Usage - Expanding Mode:

The source array is effectively only a 2D image (it has a 3D shape, but 'depth' is a singleton dimension with length 1). Thus, the destination will contain 50 identical copies of this image:

MultiArray<3, int> src(Shape2(100, 200)),
dest(Shape3(100, 200, 50));
...
copyMultiArray(src.insertSingletonDimension(2), dest);
// create an RGB image with three identical color bands
copyMultiArray(src.insertSingletonDimension(2), rgb_dest.expandElements(2));

show deprecated examples

◆ transformMultiArray()

template<... >
void transformMultiArray (   ...)

Transform a multi-dimensional array with a unary function or functor.

Note: The effect of this function can often be achieved in a simpler and more readable way by means of array expressions.

This function can be applied in three modes:

Standard Mode:
If the source and destination arrays have the same size, the transformation given by the functor is applied to every source element and the result written into the corresponding destination element. Unary functions, unary functors from the STL and the functors specifically defined in Functors to Transform Images can be used in standard mode. Creation of new functors is easiest by using Functor Expressions
.
Expanding Mode:
If the source array has length 1 along some (or even all) dimensions, the source value at index 0 is used for all destination elements in those dimensions. In other words, the source index is not incremented along these dimensions, but the transformation functor is applied as usual. So, we can expand a small array (e.g. a single row of data, column length is 1), into a larger one (e.g. a 2D image with the same width): the given values are simply reused as necessary (e.g. for every row of the destination image). The same functors as in standard mode can be applied.
Reducing Mode:
If the destination array has length 1 along some (or even all) dimensions, the source values in these dimensions are reduced to single values by means of a suitable functor (e.g. vigra::ReduceFunctor), which supports two function call operators: one with a single argument to collect the values, and without argument to obtain the final (reduced) result. This behavior is a multi-dimensional generalization of the C++ standard function std::accumulate().

The arrays must be represented by MultiArrayViews. If source and destination shapes match, standard mode is applied. If the shapes differ, the size of corresponding dimensions must either be equal, or the source length must be 1 (expand mode), or the destination length must be 1 (reduce mode). However, reduction and expansion cannot be executed at the same time, so the latter conditions are mutual exclusive, even if they apply to different dimensions.

Declarations:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2,
class Functor>
void
MultiArrayView<N, T2, S2> dest, Functor const & f);
}
void transformMultiArray(...)
Transform a multi-dimensional array with a unary function or functor.

show deprecated declarations

Usage - Standard Mode:

Source and destination array have the same size.

#include <cmath> // for sqrt()
dest(Shape3(100, 200, 50));
...
transformMultiArray(src, dest, &std::sqrt );

Usage - Expand Mode:

The source array is effectively only a 2D image(it has a 3D shape, but depth is a singleton dimension with length 1). Thus, the destination will contain 50 identical copies of the transformed source image.

#include <cmath> // for sqrt()
dest(Shape3(100, 200, 50));
...
transformMultiArray(src, dest, &std::sqrt );

Usage - Reduce Mode:

The destination array is effectively only 1D (it's width and height are singleton dimensions). Thus, it will contain accumulated data for every slice of the source volume (or for every frame, if the source is interpreted as an image sequence). In the example, we use the functor vigra::FindAverage to calculate the average gray value of every slice.

dest(Shape3(1, 1, 50));
...
transformMultiArray(src, dest,

Note that the functor must define the appropriate traits described below in order to be recognized as a reduce functor. This is most easily achieved by deriving from UnaryReduceFunctorTag (see vigra::FunctorTraits).

show deprecated examples

Required Interface:

In standard and expand mode, the functor must be a model of UnaryFunction (i.e. support one-argument function call which accepts values of type T1 and a return value that is convertible into T2.

In reduce mode, it must be a model of UnaryAnalyser (i.e. support function call with one argument and no return value functor(arg)) and Initializer (i.e. support function call with no argument, but return value res = functor()). Internally, such functors are recognized by the meta functions FunctorTraits<FUNCTOR>::isUnaryAnalyser and FunctorTraits<FUNCTOR>::isInitializer which must both yield VigraTrueType. Make sure that your functor correctly defines FunctorTraits because otherwise reduce mode will not work. This is most easily achieved by deriving the functor from UnaryReduceFunctorTag (see vigra::FunctorTraits). In addition, the functor must be copy constructible in order to start each reduction with a fresh functor.

See also
Functors to Transform Images, vigra::multi_math, Functor Expressions

◆ combineTwoMultiArrays()

template<... >
void combineTwoMultiArrays (   ...)

Combine two multi-dimensional arrays into one using a binary function or functor.

Note: The effect of this function can often be achieved in a simpler and more readable way by means of array expressions.

This function can be applied in three modes:

Standard Mode:
If the source and destination arrays have the same size, the transformation given by the functor is applied to every pair of corresponding source elements and the result written into the corresponding destination element. Binary functions, binary functors from the STL and the functors specifically defined in Functors to Combine Images can be used in standard mode. Creation of new functors is easiest by using Functor Expressions
.
Expanding Mode:
If the source arrays have length 1 along some (or even all) dimensions, the source values at index 0 are used for all destination elements in those dimensions. In other words, the source index is not incremented along those dimensions, but the transformation functor is applied as usual. So, we can expand small arrays (e.g. a single row of data, column length is 1), into larger ones (e.g. a 2D image with the same width): the given values are simply reused as necessary (e.g. for every row of the destination image). It is not even necessary that the source array shapes are equal. For example, we can combine a small array with one that hase the same size as the destination array. The same functors as in standard mode can be applied.
Reducing Mode:
If the destination array has length 1 along some (or even all) dimensions, the source values in these dimensions are reduced to single values by means of a suitable functor which supports two function call operators: one with two arguments to collect the values, and one without argument to obtain the final (reduced) result. This behavior is a multi-dimensional generalization of the C++ standard function std::accumulate().

The arrays must be represented by MultiArrayViews. If all shapes are identical, standard mode is applied. If the shapes differ, the size of corresponding dimensions must either be equal, or the length of this dimension must be 1 in one or both source arrays (expand mode), or the destination length must be 1 (reduce mode). However, reduction and expansion cannot be executed at the same time, so the latter conditions are mutual exclusive, even if they apply to different dimensions.

Declarations:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T11, class S11,
class T12, class S12,
class T2, class S2,
class Functor>
void
Functor const & f);
}
void combineTwoMultiArrays(...)
Combine two multi-dimensional arrays into one using a binary function or functor.

show deprecated declarations

Usage - Standard Mode:

Source and destination arrays have the same size.

#include <functional> // for std::plus
src2(Shape3(100, 200, 50)),
dest(Shape3(100, 200, 50));
...
combineTwoMultiArrays(src1, src2, dest,
std::plus<int>());

Usage - Expand Mode:

One source array is effectively only a 2D image (it has depth 1). This image will be added to every slice of the other source array, and the result is written into the corresponding destination slice.

#include <functional> // for std::plus
src2(Shape3(100, 200, 50)),
dest(Shape3(100, 200, 50));
...
combineTwoMultiArrays(src1, src2, dest,
std::plus<int>());

Usage - Reduce Mode:

The destination array is only 1D (it's width and height are singleton dimensions). Thus, it will contain accumulated data for every slice of the source volumes (or for every frame, if the sources are interpreted as image sequences). In the example, we use vigra::ReduceFunctor together with a functor expression (see Functor Expressions
) to calculate the total absolute difference of the gray values in every pair of source slices.

#include <vigra/functorexpression.hxx>
using namespace vigra::functor;
src2(Shape3(100, 200, 50)),
dest(Shape3(1, 1, 50));
...
combineTwoMultiArrays(src1, src2, dest,
reduceFunctor(Arg1() + abs(Arg2() - Arg3()), 0) );
// Arg1() is the sum accumulated so far, initialized with 0

Note that the functor must define the appropriate traits described below in order to be recognized as a reduce functor. This is most easily achieved by deriving from BinaryReduceFunctorTag (see vigra::FunctorTraits).

show deprecated examples

Required Interface:

In standard and expand mode, the functor must be a model of BinaryFunction (i.e. support function call with two arguments and a return value which is convertible into T2: T2 res = functor(arg1, arg2)):

In reduce mode, it must be a model of BinaryAnalyser (i.e. support function call with two arguments and no return value functor(arg1, arg2)) and Initializer (i.e. support function call with no argument, but return value res = functor()). Internally, such functors are recognized by the meta functions FunctorTraits<FUNCTOR>::isBinaryAnalyser and FunctorTraits<FUNCTOR>::isInitializer which must both yield VigraTrueType. Make sure that your functor correctly defines FunctorTraits because otherwise reduce mode will not work. This is most easily achieved by deriving the functor from BinaryReduceFunctorTag (see vigra::FunctorTraits). In addition, the functor must be copy constructible in order to start each reduction with a fresh functor.

See also
Functors to Transform Images, vigra::multi_math, Functor Expressions

◆ combineThreeMultiArrays()

template<... >
void combineThreeMultiArrays (   ...)

Combine three multi-dimensional arrays into one using a ternary function or functor.

Note: The effect of this function can often be achieved in a simpler and more readable way by means of array expressions.

Except for the fact that it operates on three input arrays, this function is identical to the standard mode of combineTwoMultiArrays() (reduce and expand modes are not supported).

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T11, class S11,
class T12, class S12,
class T13, class S13,
class T2, class S2,
class Functor>
void
Functor const & f);
}
void combineThreeMultiArrays(...)
Combine three multi-dimensional arrays into one using a ternary function or functor.

show deprecated declarations

Usage:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

#include <vigra/functorexpression.hxx>
src2(Shape3(100, 200, 50)),
src3(Shape3(100, 200, 50)),
dest(Shape3(100, 200, 50));
...
using namespace vigra::functor; // activate VIGRA's lambda library
Arg1()*exp(-abs(Arg2()-Arg3())));

show deprecated examples

See also
Functors to Transform Images, vigra::multi_math, Functor Expressions

◆ inspectMultiArray()

template<... >
void inspectMultiArray (   ...)

Call an analyzing functor at every element of a multi-dimensional array.

This function can be used to collect statistics of the array etc. The results must be stored in the functor, which serves as a return value (therefore, it is passed to the function by reference). The array must be represented as a MultiArrayView.

For many common statistics, the use of vigra::acc::extractFeatures() in combination with Feature Accumulators is more convenient.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T, class S,
class Functor>
void
Functor & f);
}
void inspectMultiArray(...)
Call an analyzing functor at every element of a multi-dimensional array.

show deprecated declarations

Usage:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

MultiArray<3, int> array(Shape3(100, 200, 50));
... // fill array
// init functor
inspectMultiArray(array, minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;

The functor must support function call with one argument.

show deprecated examples

◆ inspectTwoMultiArrays()

template<... >
void inspectTwoMultiArrays (   ...)

Call an analyzing functor at all corresponding elements of two multi-dimensional arrays.

This function can be used to collect statistics over tow arrays. For example, one can holde data, and the other region labels or weights. The results must be stored in the functor, which serves as a return value (and is therefore passed by reference). The arrays must be represented by MultiArrayViews.

For many common statistics, the use of vigra::acc::extractFeatures() in combination with Feature Accumulators is more convenient.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2,
class Functor>
void
Functor & f);
}
void inspectTwoMultiArrays(...)
Call an analyzing functor at all corresponding elements of two multi-dimensional arrays.

show deprecated declarations

Usage:

#include <vigra/multi_pointoperators.hxx>
Namespace: vigra

array2(Shape3(100, 200, 50));
// init functor

The functor must support function call with two arguments.

show deprecated examples

◆ resizeMultiArraySplineInterpolation()

template<... >
void resizeMultiArraySplineInterpolation (   ...)

Resize MultiArray using B-spline interpolation.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2,
void
}
void resizeMultiArraySplineInterpolation(...)
Resize MultiArray using B-spline interpolation.

show deprecated declarations

The function implements separable spline interpolation algorithm described in

M. Unser, A. Aldroubi, M. Eden, "B-Spline Signal Processing" IEEE Transactions on Signal Processing, vol. 41, no. 2, pp. 821-833 (part I), pp. 834-848 (part II), 1993.

to obtain optimal interpolation quality and speed. You may pass the function a spline of arbitrary order (e.g. BSpline<ORDER, double> or CatmullRomSpline<double>). The default is a third order spline which gives a twice continuously differentiable interpolant. The implementation ensures that image values are interpolated rather than smoothed by first calling a recursive (sharpening) prefilter as described in the above paper. Then the actual interpolation is done using resamplingConvolveLine().

The range of both the input and output images (resp. regions) must be given. The input image must have a size of at least 4x4, the destination of at least 2x2. The scaling factors are then calculated accordingly. If the source image is larger than the destination, it is smoothed (band limited) using a recursive exponential filter. The source value_type (SrcAccessor::value_type) must be a linear algebra, i.e. it must support addition, subtraction, and multiplication (+, -, *), multiplication with a scalar real number and NumericTraits. The function uses accessors.

Usage:

#include <vigra/multi_resize.hxx>
Namespace: vigra

dest(Shape3(9, 13, 19)); // double the size
// use default cubic spline interpolator
// use linear interpolator

show deprecated examples

◆ vectorToTensorMultiArray()

template<... >
void vectorToTensorMultiArray (   ...)

Calculate the tensor (outer) product of a N-D vector with itself.

This function is useful to transform vector arrays into a tensor representation that can be used as input to tensor based processing and analysis functions (e.g. tensor smoothing). When the input array has N dimensions, the input value_type must be a vector of length N, whereas the output value_type mus be vectors of length N*(N-1)/2 which will represent the upper triangular part of the resulting (symmetric) tensor. That is, for 2D arrays the output contains the elements [t11, t12 == t21, t22] in this order, whereas it contains the elements [t11, t12, t13, t22, t23, t33] for 3D arrays.

Currently, N <= 3 is required.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void vectorToTensorMultiArray(...)
Calculate the tensor (outer) product of a N-D vector with itself.

show deprecated declarations

Usage:

#include <vigra/multi_tensorutilities.hxx>
Namespace: vigra

◆ tensorTraceMultiArray()

template<... >
void tensorTraceMultiArray (   ...)

Calculate the tensor trace for every element of a N-D tensor array.

This function turns a N-D tensor (whose value_type is a vector of length N*(N+1)/2, see vectorToTensorMultiArray()) representing the upper triangular part of a symmetric tensor into a scalar array holding the tensor trace.

Currently, N <= 3 is required.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void tensorTraceMultiArray(...)
Calculate the tensor trace for every element of a N-D tensor array.

show deprecated declarations

Usage:

#include <vigra/multi_tensorutilities.hxx>
Namespace: vigra

Preconditions:

N == 2 or N == 3

◆ tensorEigenvaluesMultiArray()

template<... >
void tensorEigenvaluesMultiArray (   ...)

Calculate the tensor eigenvalues for every element of a N-D tensor array.

This function turns a N-D tensor (whose value_type is a vector of length N*(N+1)/2, see vectorToTensorMultiArray()) representing the upper triangular part of a symmetric tensor into a vector-valued array holding the tensor eigenvalues (thus, the destination value_type must be vectors of length N).

Currently, N <= 3 is required.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void tensorEigenvaluesMultiArray(...)
Calculate the tensor eigenvalues for every element of a N-D tensor array.

show deprecated declarations

Usage (MultiArrayView API):

#include <vigra/multi_tensorutilities.hxx>
Namespace: vigra

Preconditions:

N == 2 or N == 3

◆ tensorDeterminantMultiArray()

template<... >
void tensorDeterminantMultiArray (   ...)

Calculate the tensor determinant for every element of a ND tensor array.

This function turns a N-D tensor (whose value_type is a vector of length N*(N+1)/2, see vectorToTensorMultiArray()) representing the upper triangular part of a symmetric tensor into the a scalar array holding the tensor determinant.

Currently, N <= 3 is required.

Declarations:

pass arbitrary-dimensional array views:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2>
void
}
void tensorDeterminantMultiArray(...)
Calculate the tensor determinant for every element of a ND tensor array.

show deprecated declarations

Usage (MultiArrayView API):

#include <vigra/multi_tensorutilities.hxx>
Namespace: vigra

Preconditions:

N == 2 or N == 3

◆ watershedsMultiArray()

template<... >
Label watershedsMultiArray (   ...)

Watershed segmentation of an arbitrary-dimensional array.

See also unionFindWatershedsBlockwise() for a parallel version of the watershed algorithm.

This function implements variants of the watershed algorithms described in

[1] L. Vincent and P. Soille: "Watersheds in digital spaces: An efficient algorithm based on immersion simulations", IEEE Trans. Patt. Analysis Mach. Intell. 13(6):583-598, 1991

[2] J. Roerdink, R. Meijster: "The watershed transform: definitions, algorithms, and parallelization strategies", Fundamenta Informaticae, 41:187-228, 2000

The source array data is a boundary indicator such as the gaussianGradientMagnitude() or the trace of the boundaryTensor(), and the destination labels is a label array designating membership of each point in one of the regions found. Plateaus in the boundary indicator are handled via simple tie breaking strategies. Argument neighborhood specifies the connectivity between points and can be DirectNeighborhood (meaning 4-neighborhood in 2D and 6-neighborhood in 3D, default) or IndirectNeighborhood (meaning 8-neighborhood in 2D and 26-neighborhood in 3D).

The watershed variant to be applied can be selected in the WatershedOptions object: When you call WatershedOptions::regionGrowing() (default), the flooding algorithm from [1] is used. Alternatively, WatershedOptions::unionFind() uses the scan-line algorithm 4.7 from [2]. The latter is faster, but does not support any options (if you pass options nonetheless, they are silently ignored).

The region growing algorithm needs a seed for each region. Seeds can either be provided in the destination array labels (which will then be overwritten with the result) or computed automatically by an internal call to generateWatershedSeeds(). In the former case you have full control over seed placement, while the latter is more convenient. Automatic seed computation is performed when you provide seeding options via WatershedOptions::seedOptions() or when the array labels is empty (all zeros), in which case default seeding options are chosen. The destination image should be zero-initialized for automatic seed computation.

Further options to be specified via WatershedOptions are:

  • keepContours(): Whether to keep a 1-pixel-wide contour (with label 0) between regions (otherwise, a complete grow is performed, i.e. all pixels are assigned to a region).
  • stopAtThreshold(): Whether to stop growing when the boundaryness exceeds a threshold (remaining pixels keep label 0).
  • biasLabel(): Whether one region (label) is to be preferred or discouraged by biasing its cost with a given factor (smaller than 1 for preference, larger than 1 for discouragement).

The option turboAlgorithm() is implied by method regionGrowing() (this is in contrast to watershedsRegionGrowing(), which supports an additional algorithm in 2D only).

watershedsMultiArray() returns the number of regions found (= the highest region label, because labels start at 1).

Declaration:

namespace vigra {
template <unsigned int N, class T, class S1,
class Label, class S2>
MultiArrayView<N, Label, S2> labels, // may also hold input seeds
WatershedOptions const & options = WatershedOptions());
}
Options object for watershed algorithms.
Definition watersheds.hxx:775
Label watershedsMultiArray(...)
Watershed segmentation of an arbitrary-dimensional array.

Usage:

#include <vigra/multi_watersheds.hxx>
Namespace: vigra

Example: watersheds of the gradient magnitude (the example works likewise for higher dimensions).

... // read input data
// compute gradient magnitude at scale 1.0 as a boundary indicator
gaussianGradientMagnitude(srcImageRange(src), destImage(gradMag), 1.0);
// example 1
{
// the pixel type of the destination image must be large enough to hold
// numbers up to 'max_region_label' to prevent overflow
// call region-growing algorithm for 4-neighborhood, leave a 1-pixel boundary between
// regions, and autogenerate seeds from all gradient minima where the magnitude is
// less than 2.0.
unsigned int max_region_label =
WatershedOptions().keepContours()
.seedOptions(SeedOptions().minima().threshold(2.0)));
}
// example 2
{
MultiArray<2, unsigned int> labeling(src.shape());
// compute seeds beforehand (use connected components of all pixels
// where the gradient is below 4.0)
unsigned int max_region_label = generateWatershedSeeds(gradMag, labeling,
SeedOptions().levelSets(4.0));
// quantize the gradient image to 256 gray levels
float m, M;
gradMag.minmax(&m, &M);
using namespace multi_math;
MultiArray<2, unsigned char> gradMag256(255.0 / (M - m) * (gradMag - m));
// call region-growing algorithm with 8-neighborhood,
// since the data are 8-bit, a faster priority queue will be used
}
// example 3
{
MultiArray<2, unsigned int> labeling(src.shape());
.. // put seeds in 'labeling', e.g. from an interactive labeling program,
// make sure that label 1 corresponds to the background
// bias the watershed algorithm so that the background is preferred
// by reducing the cost for label 1 to 90%
watershedsMultiArray(gradMag, labeling,
WatershedOptions().biasLabel(1, 0.9));
}
// example 4
{
MultiArray<2, unsigned int> labeling(src.shape());
// use the fast union-find algorithm with 4-neighborhood
watershedsMultiArray(gradMag, labeling, WatershedOptions().unionFind());
}
Options object for generateWatershedSeeds().
Definition watersheds.hxx:330

◆ noiseVarianceEstimation()

template<... >
void noiseVarianceEstimation (   ...)

Determine the noise variance as a function of the image intensity.

This operator applies an algorithm described in

W. Förstner: "Image Preprocessing for Feature Extraction in Digital Intensity, Color and Range Images", Proc. Summer School on Data Analysis and the Statistical Foundations of Geomatics, Lecture Notes in Earth Science, Berlin: Springer, 1999

in order to estimate the noise variance as a function of the image intensity in a robust way, i.e. so that intensity changes due to edges do not bias the estimate. The source value type (SrcAccessor::value_type) must be a scalar type which is convertible to double. The result is written into the result sequence, whose value_type must be constructible from two double values. The following options can be set via the options object (see vigra::NoiseNormalizationOptions for details):

useGradient, windowRadius, noiseEstimationQuantile, noiseVarianceInitialGuess

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1, class BackInsertable>
void
BackInsertable & result,
}
Pass options to one of the noise normalization functions.
Definition noise_normalization.hxx:90
void noiseVarianceEstimation(...)
Determine the noise variance as a function of the image intensity.

show deprecated declarations

Usage:

#include <vigra/noise_normalization.hxx>
Namespace: vigra

std::vector<TinyVector<double, 2> > result;
...
noiseVarianceEstimation(src, result,
NoiseNormalizationOptions().windowRadius(9).noiseVarianceInitialGuess(25.0));
// print the intensity / variance pairs found
for(int k=0; k<result.size(); ++k)
std::cout << "Intensity: " << result[k][0] << ", estimated variance: " << result[k][1] << std::endl;

show deprecated examples

◆ noiseVarianceClustering()

template<... >
void noiseVarianceClustering (   ...)

Determine the noise variance as a function of the image intensity and cluster the results.

This operator first calls noiseVarianceEstimation() to obtain a sequence of intensity/variance pairs, which are then clustered using the median cut algorithm. Then the cluster centers (i.e. average variance vs. average intensity) are determined and returned in the result sequence.

In addition to the options valid for noiseVarianceEstimation(), the following options can be set via the options object (see vigra::NoiseNormalizationOptions for details):

clusterCount, averagingQuantile

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1, class BackInsertable>
void
BackInsertable & result,
}
void noiseVarianceClustering(...)
Determine the noise variance as a function of the image intensity and cluster the results.

show deprecated declarations

Usage:

#include <vigra/noise_normalization.hxx>
Namespace: vigra

std::vector<TinyVector<double, 2> > result;
...
noiseVarianceClustering(src, result,
NoiseNormalizationOptions().windowRadius(9).noiseVarianceInitialGuess(25.0).
clusterCount(15));
// print the intensity / variance pairs representing the cluster centers
for(int k=0; k<result.size(); ++k)
std::cout << "Cluster: " << k << ", intensity: " << result[k][0] << ", estimated variance: " << result[k][1] << std::endl;

show deprecated examples

◆ nonparametricNoiseNormalization()

template<... >
bool nonparametricNoiseNormalization (   ...)

Noise normalization by means of an estimated non-parametric noise model.

The original image is assumed to be corrupted by noise whose variance depends on the intensity in an unknown way. The present functions first calls noiseVarianceClustering() to obtain a sequence of intensity/variance pairs (cluster centers) which estimate this dependency. The cluster centers are connected into a piecewise linear function which is the inverted according to the formula derived in

W. Förstner: "Image Preprocessing for Feature Extraction in Digital Intensity, Color and Range Images", Proc. Summer School on Data Analysis and the Statistical Foundations of Geomatics, Lecture Notes in Earth Science, Berlin: Springer, 1999

The inverted formula defines a pixel-wise intensity transformation whose application turns the original image into one that is corrupted by additive Gaussian noise with unit variance. Most subsequent algorithms will be able to handle this type of noise much better than the original noise.

RGB and other multiband images will be processed one band at a time. The function returns true on success. Noise normalization will fail if the original image does not contain sufficiently homogeneous regions that allow robust estimation of the noise variance.

The options object may use all options described in vigra::NoiseNormalizationOptions.

The function returns false if the noise estimation failed, so that no normalization could be performed.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
bool
}
bool nonparametricNoiseNormalization(...)
Noise normalization by means of an estimated non-parametric noise model.

show deprecated declarations

Usage:

#include <vigra/noise_normalization.hxx>
Namespace: vigra

...
nonparametricNoiseNormalization(src, dest,
NoiseNormalizationOptions().windowRadius(9).noiseVarianceInitialGuess(25.0).
clusterCount(15));

show deprecated examples

◆ quadraticNoiseNormalization()

template<... >
bool quadraticNoiseNormalization (   ...)

Noise normalization by means of an estimated or given quadratic noise model.

This function works like nonparametricNoiseNormalization() excapt that the model for the dependency between intensity and noise variance is assumed to be a quadratic function rather than a piecewise linear function. If the data conform to the quadratic model, this leads to a somewhat smoother transformation. The function returns false if the noise estimation failed, so that no normalization could be performed.

In the second variant of the function, the parameters of the quadratic model are not estimated, but explicitly given according to:

variance = a0 + a1 * intensity + a2 * sq(intensity)

Declarations:

pass 2D array views:

namespace vigra {
// estimate and apply a quadratic noise model
template <class T1, class S1,
class T2, class S2>
bool
// apply a given quadratic noise model
template <class T1, class S1,
class T2, class S2>
void
double a0, double a1, double a2);
}
bool quadraticNoiseNormalization(...)
Noise normalization by means of an estimated or given quadratic noise model.

show deprecated declarations

Usage:

#include <vigra/noise_normalization.hxx>
Namespace: vigra

...
// estimate the noise model and apply it to normalize the noise variance
NoiseNormalizationOptions().windowRadius(9).noiseVarianceInitialGuess(25.0).
clusterCount(15));
vigra_postcondition(success, "quadraticNoiseNormalization(): Unable to estimate noise model.");
// apply a pre-computed noise model

show deprecated examples

Required Interface:

The source value type must be convertible to double or must be a vector whose elements are convertible to double. Likewise, the destination type must be assignable from double or a vector whose elements are assignable from double.

◆ linearNoiseNormalization()

template<... >
bool linearNoiseNormalization (   ...)

Noise normalization by means of an estimated or given linear noise model.

This function works like nonparametricNoiseNormalization() excapt that the model for the dependency between intensity and noise variance is assumed to be a linear function rather than a piecewise linear function. If the data conform to the linear model, this leads to a very simple transformation which is similar to the familiar gamma correction. The function returns false if the noise estimation failed, so that no normalization could be performed.

In the second variant of the function, the parameters of the linear model are not estimated, but explicitly given according to:

variance = a0 + a1 * intensity

Declarations:

pass 2D array views:

namespace vigra {
// estimate and apply a linear noise model
template <class T1, class S1,
class T2, class S2>
bool
// apply a given linear noise model
template <class T1, class S1,
class T2, class S2>
void
double a0, double a1);
}
bool linearNoiseNormalization(...)
Noise normalization by means of an estimated or given linear noise model.

show deprecated declarations

Usage:

#include <vigra/noise_normalization.hxx>
Namespace: vigra

...
// estimate the noise model and apply it to normalize the noise variance
NoiseNormalizationOptions().windowRadius(9).noiseVarianceInitialGuess(25.0).
clusterCount(15));
vigra_postcondition(success, "linearNoiseNormalization(): Unable to estimate noise model.");
// apply a pre-computed noise model

show deprecated examples

Required Interface:

The source value type must be convertible to double or must be a vector whose elements are convertible to double. Likewise, the destination type must be assignable from double or a vector whose elements are assignable from double.

◆ nonlinearDiffusion()

template<... >
void nonlinearDiffusion (   ...)

Perform edge-preserving smoothing at the given scale.

The algorithm solves the non-linear diffusion equation

\[
    \frac{\partial}{\partial t} u =
    \frac{\partial}{\partial x}
      \left( g(|\nabla u|)
             \frac{\partial}{\partial x} u
      \right)
\]

where t is the time, x is the location vector, u( x , t) is the smoothed image at time t, and g(.) is the location dependent diffusivity. At time zero, the image u( x , 0) is simply the original image. The time is proportional to the square of the scale parameter: $t = s^2$. The diffusion equation is solved iteratively according to the Additive Operator Splitting Scheme (AOS) from

J. Weickert: "Recursive Separable Schemes for Nonlinear Diffusion Filters", in: B. ter Haar Romeny, L. Florack, J. Koenderingk, M. Viergever (eds.): 1st Intl. Conf. on Scale-Space Theory in Computer Vision 1997, Springer LNCS 1252

DiffusivityFunctor implements the gradient-dependent local diffusivity. It is passed as an argument to gradientBasedTransform(). The return value must be between 0 and 1 and determines the weight a pixel gets when its neighbors are smoothed. Weickert recommends the use of the diffusivity implemented by class DiffusivityFunctor. It's also possible to use other functors, for example one that always returns 1, in which case we obtain the solution to the linear diffusion equation, i.e. Gaussian convolution.

The source value type must be a linear space with internal addition, scalar multiplication, and NumericTraits defined. The value_type of the DiffusivityFunctor must be the scalar field over wich the source value type's linear space is defined.

In addition to nonlinearDiffusion(), there is an algorithm nonlinearDiffusionExplicit() which implements the Explicit Scheme described in the above article. Both algorithms have the same interface, but the explicit scheme gives slightly more accurate approximations of the diffusion process at the cost of much slower processing.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
void
DiffusivityFunc const & weight, double scale);
template <class T1, class S1,
class T2, class S2,
void
DiffusivityFunc const & weight, double scale);
}
void nonlinearDiffusion(...)
Perform edge-preserving smoothing at the given scale.
void nonlinearDiffusionExplicit(...)
Perform edge-preserving smoothing at the given scale using an explicit scheme.

show deprecated declarations

Usage:

#include <vigra/nonlineardiffusion.hxx>
Namespace: vigra

float edge_threshold, scale;
...
nonlinearDiffusion(src, dest,

show deprecated examples

Precondition:

scale > 0

See also
vigra::DiffusivityFunctor

◆ nonlinearDiffusionExplicit()

template<... >
void nonlinearDiffusionExplicit (   ...)

Perform edge-preserving smoothing at the given scale using an explicit scheme.

See nonlinearDiffusion().

◆ hourGlassFilter()

template<... >
void hourGlassFilter (   ...)

Anisotropic tensor smoothing with the hourglass filter.

This function implements anisotropic tensor smoothing by an hourglass-shaped filters as described in

U. Köthe: "Edge and Junction Detection with an Improved Structure Tensor", in: Proc. of 25th DAGM Symposium, Magdeburg 2003, Lecture Notes in Computer Science 2781, pp. 25-32, Heidelberg: Springer, 2003

It is closely related to the structure tensor (see structureTensor()), but replaces the linear tensor smoothing with a smoothing along edges only. Smoothing across edges is largely suppressed. This means that the image structure is preserved much better because nearby features such as parallel edges are not blended into each other.

The hourglass filter is typically applied to a gradient tensor, i.e. the Euclidean product of the gradient with itself, which can be obtained by a gradient operator followed with vectorToTensor(), see example below. The hourglass shape of the filter can be interpreted as indicating the likely continuations of a local edge element. The parameter sigma determines the radius of the hourglass (i.e. how far the influence of the edge element reaches), and rho controls its opening angle (i.e. how narrow the edge orientation os followed). Recommended values are sigma = 1.4 (or, more generally, two to three times the scale of the gradient operator used in the first step), and rho = 0.4 which corresponds to an opening angle of 22.5 degrees to either side of the edge.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double sigma, double rho);
}
void hourGlassFilter(...)
Anisotropic tensor smoothing with the hourglass filter.

show deprecated declarations

Usage:

#include <vigra/orientedtensorfilters.hxx>
Namespace: vigra

gaussianGradient(img, gradient, 1.0);
void vectorToTensor(...)
Calculate the tensor (outer) product of a 2D vector with itself.

show deprecated examples

See also
vectorToTensor()

◆ isAtImageBorder()

AtImageBorder isAtImageBorder ( int  x,
int  y,
int  width,
int  height 
)

Find out whether a point is at the image border.

This function checks if x == 0 or x == width - 1 and y == 0 or y == height - 1 and returns the appropriate value of vigra::AtImageBorder, or zero when the point is not at the image border. The behavior of the function is undefined if (x,y) is not inside the image.

#include <vigra/pixelneighborhood.hxx>
Namespace: vigra

◆ extractContour()

template<class T , class S , class PointArray >
void extractContour ( MultiArrayView< 2, T, S > const label_image,
Shape2 const anchor_point,
PointArray contour_points 
)
protected

Create a polygon from the interpixel contour of a labeled region.

The point anchor_point must be in the region whose contour we want to extract, and must be adjacent to the contour. The algorithm uses the 'left hand on the wall' algorithm to trace the connected component whose label equals the label of the anchor_point. The contour is returned in countour_points as a closed polygon that circles the region counter-clockwise in the image coordinate system (i.e. the coordinate system where x points to the right and y points downwards). Since the resulting polygon represents the interpixel contour, all points will have one integer and one half-integer coordinate.

◆ convexHull()

void convexHull ( const PointArray1 points,
PointArray2 convex_hull 
)
protected

Compute convex hull of a 2D polygon.

The input array points contains a (not necessarily ordered) set of 2D points whose convex hull is to be computed. The array's value_type (i.e. the point type) must be compatible with std::vector (in particular, it must support indexing, copying, and have size() == 2). The points of the convex hull will be appended to the output array convex_hull (which must support std::back_inserter(convex_hull)). Since the convex hull is a closed polygon, the first and last point of the output will be the same (i.e. the first point will simply be inserted at the end again). The points of the convex hull will be ordered counter-clockwise, starting with the leftmost point of the input. The function implements Andrew's Monotone Chain algorithm.

◆ fillPolygon()

template<class Point , class T , class S , class Value >
void fillPolygon ( Polygon< Point > const p,
MultiArrayView< 2, T, S > &  output_image,
Value  value 
)
protected

Render closed polygon p into the image output_image.

All pixels on the polygon's contour and in its interior are set to the given value. Parts of the polygon outside the image region are clipped. The function uses a robust X-intersection array algorithm that is able to handle all corner cases (concave and self-intersecting polygons, knots on integer coordinates).

◆ polynomialRoots()

template<class POLYNOMIAL , class VECTOR >
bool polynomialRoots ( POLYNOMIAL const poriginal,
VECTOR roots,
bool  polishRoots 
)

Determine the roots of the polynomial poriginal.

The roots are appended to the vector roots, with optional root polishing as specified by polishRoots (default: do polishing). The function uses an improved version of Laguerre's algorithm. The improvements are as follows:

  • It uses a clever initial guess for the iteration, according to a proposal by Tien Chen
  • It estimates each root's multiplicity, again according to Tien Chen, and reduces multiplicity by switching to the polynomial's derivative (which has the same root, with multiplicity reduced by one), as proposed by C. Bond.

The algorithm has been successfully used for polynomials up to order 80. The function stops and returns false if an iteration fails to converge within 80 steps. The type POLYNOMIAL must be compatible to vigra::PolynomialView, VECTOR must be compatible to std::vector with a value_type compatible to the type POLYNOMIAL::Complex.

Declaration:

pass arguments explicitly:

namespace vigra {
template <class POLYNOMIAL, class VECTOR>
bool
}
bool polynomialRoots(POLYNOMIAL const &poriginal, VECTOR &roots, bool polishRoots)
Definition polynomial.hxx:939

Usage:

#include <vigra/polynomial.hxx>
Namespace: vigra

// encode the polynomial x^4 - 1
poly[0] = -1.0;
poly[4] = 1.0;
See also
polynomialRootsEigenvalueMethod()

◆ polynomialRealRoots()

template<class POLYNOMIAL , class VECTOR >
bool polynomialRealRoots ( POLYNOMIAL const p,
VECTOR roots,
bool  polishRoots 
)

Determine the real roots of the polynomial p.

This function simply calls polynomialRoots() and than throws away all complex roots. Accordingly, VECTOR must be compatible to std::vector with a value_type compatible to the type POLYNOMIAL::Real.

Declaration:

pass arguments explicitly:

namespace vigra {
template <class POLYNOMIAL, class VECTOR>
bool
}
bool polynomialRealRoots(POLYNOMIAL const &p, VECTOR &roots, bool polishRoots)
Definition polynomial.hxx:1076

Usage:

#include <vigra/polynomial.hxx>
Namespace: vigra

// encode the polynomial x^4 - 1
poly[0] = -1.0;
poly[4] = 1.0;
See also
polynomialRealRootsEigenvalueMethod()

◆ polynomialWarpWeights()

std::vector< double > polynomialWarpWeights ( double  x,
double  y,
unsigned int  polynom_order 
)

Iterative function for determinination of the polynom weights:

Example: order=2, x, y --—> [1, x, y, x^2, x*y, y^2]

This function is needed, because the polynomial transformation Matrix has the the same number of rows. the target position is then determined by multiplying each x- and y-transformation result value with the corresponding weight for the current x- and y-coordinate, given by this function.

◆ polynomialMatrix2DFromCorrespondingPoints()

template<int PolynomOrder, class SrcPointIterator , class DestPointIterator >
linalg::TemporaryMatrix< double > polynomialMatrix2DFromCorrespondingPoints ( SrcPointIterator  s,
SrcPointIterator  s_end,
DestPointIterator  d 
)

Create polynomial matrix of a certain degree that maps corresponding points onto each other.

For use with polynomialWarpImage() of same degree.

Since polynoms are usually non-linear functions, a special semantics is embedded to define a matrix here. Each matrix consist of two rows, containing x- and y-factors of the polynom.

The meaning of the matrix is explained at the example of a polynom of 2nd order:

First Row = [a_x b_x c_x d_x e_x f_x] Second Row = [a_y b_y c_y d_y e_y f_y]

The transformed coordinate p'=[x' y'] of a position p=[x y] is then:

x' = a_x + b_x*x + c_x*y + d_x*x^2 + e_x*x*y + f_x*y^2 y' = a_y + b_y*x + c_y*y + d_y*x^2 + e_y*x*y + f_y*y^2

Note that the order of the polynom's factors is directly influenced by the polynomialWarpWeights() function and follows the intuitive scheme.

◆ polynomialWarpImage()

template<... >
void polynomialWarpImage (   ...)

Warp an image according to an polynomial transformation.

To get more information about the structure of the matrix, see polynomialMatrix2DFromCorrespondingPoints().

#include <vigra/polynomial_registration.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <int ORDER, class T,
class T2, class S2,
class C>
void
}
void polynomialWarpImage(...)
Warp an image according to an polynomial transformation.

show deprecated declarations

◆ projectiveMatrix2DFromCorrespondingPoints()

linalg::TemporaryMatrix< double > projectiveMatrix2DFromCorrespondingPoints ( SrcPointIterator  s,
SrcPointIterator  send,
DestPointIterator  d 
)

Create homogeneous matrix that maps corresponding points onto each other.

For use with projectiveWarpImage(). Since four corresponding points are needed to be given, the matrix will compute a full projective transform.

◆ projectiveWarpImage()

template<... >
void projectiveWarpImage (   ...)

Warp an image according to an projective transformation.

The matrix can be computed from a set of correspondung points using projectiveMatrix2DFromCorrespondingPoints().

Declarations:

#include <vigra/projective_registration.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <int ORDER, class T,
class T2, class S2,
class C>
void
}
void projectiveWarpImage(...)
Warp an image according to an projective transformation.

show deprecated declarations

The algorithm applies the given projectiveMatrix to the destination coordinates and copies the image value from the resulting source coordinates, using the given SplineImageView src for interpolation. If the resulting coordinate is outside the source image, nothing will be written at that destination point.

The matrix represent a 2-dimensional projective transform by means of homogeneous coordinates, i.e. it must be a 3x3 matrix whose last row is (p1,p2,1).

Required Interface:

double x = ..., y = ...;
if (spline.isInside(x,y))

See also: Functions to specify projective transformation: translationMatrix2D(), scalingMatrix2D(), shearMatrix2D(), rotationMatrix2DRadians(), rotationMatrix2DDegrees() and projectiveMatrix2DFromCorrespondingPoints()

◆ quadraticProgramming()

template<... >
unsigned int quadraticProgramming (   ...)

Solve Quadratic Programming Problem.

The quadraticProgramming() function implements the algorithm described in

D. Goldfarb, A. Idnani: "A numerically stable dual method for solving strictly convex quadratic programs", Mathematical Programming 27:1-33, 1983.

for the solution of (convex) quadratic programming problems by means of a primal-dual method.

#include <vigra/quadprog.hxx>
Namespaces: vigra

Declaration:

namespace vigra {
template <class T, class C1, class C2, class C3, class C4, class C5, class C6, class C7>
T
}
unsigned int quadraticProgramming(...)

The problem must be specified in the form:

\begin{eqnarray*}
   \mbox{minimize } &\,& \frac{1}{2} \mbox{\bf x}'\,\mbox{\bf G}\, \mbox{\bf x} + \mbox{\bf g}'\,\mbox{\bf x} \\
   \mbox{subject to} &\,& \mbox{\bf C}_E\, \mbox{\bf x} = \mbox{\bf c}_e \\
    &\,& \mbox{\bf C}_I\,\mbox{\bf x} \ge \mbox{\bf c}_i
\end{eqnarray*}

Matrix G G must be symmetric positive definite, and matrix CE must have full row rank. Matrix and vector dimensions must be as follows:

  • G: [n * n], g: [n * 1]
  • CE: [me * n], ce: [me * 1]
  • CI: [mi * n], ci: [mi * 1]
  • x: [n * 1]

The function writes the optimal solution into the vector x and returns the cost of this solution. If the problem is infeasible, std::numeric_limits::infinity() is returned. In this case the value of vector x is undefined.

Usage:

Minimize f = 0.5 * x'*G*x + g'*x subject to -1 <= x <= 1. The solution is x' = [1.0, 0.5, -1.0] with f = -22.625.

double Gdata[] = {13.0, 12.0, -2.0,
12.0, 17.0, 6.0,
-2.0, 6.0, 12.0};
double gdata[] = {-22.0, -14.5, 13.0};
double CIdata[] = { 1.0, 0.0, 0.0,
0.0, 1.0, 0.0,
0.0, 0.0, 1.0,
-1.0, 0.0, 0.0,
0.0, -1.0, 0.0,
0.0, 0.0, -1.0};
double cidata[] = {-1.0, -1.0, -1.0, -1.0, -1.0, -1.0};
Matrix<double> G(3,3, Gdata),
g(3,1, gdata),
CE, // empty since there are no equality constraints
ce, // likewise
CI(7,3, CIdata),
ci(7,1, cidata),
x(3,1);
double f = quadraticProgramming(G, g, CE, ce, CI, ci, x);

This algorithm can also be used to solve non-negative least squares problems (see nonnegativeLeastSquares() for an alternative algorithm). Consider the problem to minimize f = (A*x - b)' * (A*x - b) subject to x >= 0. Expanding the product in the objective gives f = x'*A'*A*x - 2*b'*A*x + b'*b. This is equivalent to the problem of minimizing fn = 0.5 * x'*G*x + g'*x with G = A'*A and g = -A'*b (the constant term b'*b has no effect on the optimal solution and can be dropped). The following code computes the solution x' = [18.4493, 0, 4.50725]:

double A_data[] = {
1, -3, 2,
-3, 10, -5,
2, -5, 6
};
double b_data[] = {
27,
-78,
64
};
Matrix<double> A(3, 3, A_data),
b(3, 1, b_data),
G = transpose(A)*A,
g = -(transpose(A)*b),
CE, // empty since there are no equality constraints
ce, // likewise
CI = identityMatrix<double>(3), // constrain all elements of x
ci(3, 1, 0.0), // ... to be non-negative
x(3, 1);
quadraticProgramming(G, g, CE, ce, CI, ci, x);
void transpose(const MultiArrayView< 2, T, C1 > &v, MultiArrayView< 2, T, C2 > &r)
Definition matrix.hxx:965

◆ randomTT800()

RandomTT800 & randomTT800 ( )

Access the global (program-wide) instance of the TT800 random number generator.

◆ randomMT19937()

RandomMT19937 & randomMT19937 ( )

Access the global (program-wide) instance of the MT19937 random number generator.

◆ rf_default()

detail::RF_DEFAULT & rf_default ( )

factory function to return a RF_DEFAULT tag

See also
RandomForest<>::learn()

◆ rf_export_HDF5() [1/3]

template<class T , class Tag >
void rf_export_HDF5 ( const RandomForest< T, Tag > &  rf,
HDF5File h5context,
const std::string &  pathname = "" 
)

Save a random forest to an HDF5File object into a specified HDF5 group.

The random forest is saved as a set of HDF5 datasets, groups, and attributes below a certain HDF5 group (default: current group of the HDF5File object). No additional data should be stored in that group.

Parameters
rfRandom forest object to be exported
h5contextHDF5File object to use
pathnameIf empty or not supplied, save the random forest to the current group of the HDF5File object. Otherwise, save to a new-created group specified by the path name, which may be either relative or absolute.

◆ rf_export_HDF5() [2/3]

template<class T , class Tag >
void rf_export_HDF5 ( const RandomForest< T, Tag > &  rf,
const std::string &  filename,
const std::string &  pathname = "" 
)

Save a random forest to a named HDF5 file into a specified HDF5 group.

The random forest is saved as a set of HDF5 datasets, groups, and attributes below a certain HDF5 group (default: root). No additional data should be stored in that group.

Parameters
rfRandom forest object to be exported
filenameName of an HDF5 file to open
pathnameIf empty or not supplied, save the random forest to the root group of the HDF5 file. Otherwise, save to a new-created group specified by the path name (relative to the root group).

◆ rf_export_HDF5() [3/3]

template<class T , class Tag >
void rf_export_HDF5 ( const RandomForest< T, Tag > &  rf,
hid_t  outf_id,
const std::string &  pathname = "" 
)

Save a random forest to an HDF5 file specified by its id.

The random forest is saved as a set of HDF5 datasets, groups, and attributes below a certain HDF5 group (default: root). No additional data should be stored in that group.

Warning
In case the underlying HDF5 library used by Vigra is not exactly the same library used to open the file with the given id, this method will lead to crashes.
Parameters
rfRandom forest object to be exported
outf_idHDF5 file id
pathnameIf empty or not supplied, save the random forest to the root group of the HDF5 file. Otherwise, save to a new-created group specified by the path name (relative to the root group).

◆ rf_import_HDF5() [1/3]

template<class T , class Tag >
bool rf_import_HDF5 ( RandomForest< T, Tag > &  rf,
HDF5File h5context,
const std::string &  pathname = "" 
)

Read a random forest from an HDF5File object's specified group.

The random forest is read from a certain HDF5 group (default: current group of the HDF5File object) as a set of HDF5 datasets, groups, and attributes. No additional data should be present in that group.

Parameters
rfRandom forest object to be imported
h5contextHDF5File object to use
pathnameIf empty or not supplied, read from the random forest from the current group of the HDF5File object. Otherwise, use the group specified by the path name, which may be either relative or absolute.

◆ rf_import_HDF5() [2/3]

template<class T , class Tag >
bool rf_import_HDF5 ( RandomForest< T, Tag > &  rf,
const std::string &  filename,
const std::string &  pathname = "" 
)

Read a random forest from a named HDF5 file's specified group.

The random forest is read from a certain HDF5 group (default: root group of the HDF5 file) as a set of HDF5 datasets, groups, and attributes. No additional data should be present in that group.

Parameters
rfRandom forest object to be imported
filenameName of an HDF5 file to open
pathnameIf empty or not supplied, read from the random forest from the current group of the HDF5 file. Otherwise, use the group specified by the path name, which may be either relative or absolute.

◆ rf_import_HDF5() [3/3]

template<class T , class Tag >
bool rf_import_HDF5 ( RandomForest< T, Tag > &  rf,
hid_t  inf_id,
const std::string &  pathname = "" 
)

Read a random forest from an HDF5 file specified by its id.

The random forest is read from a certain HDF5 group (default: root group of the HDF5 file) as a set of HDF5 datasets, groups, and attributes. No additional data should be present in that group.

Warning
In case the underlying HDF5 library used by Vigra is not exactly the same library used to open the file with the given id, this method will lead to crashes.
Parameters
rfRandom forest object to be imported
inf_idHDF5 file id
pathnameIf empty or not supplied, read from the random forest from the current group of the HDF5 file. Otherwise, use the group specified by the path name, which may be either relative or absolute.

◆ gcd()

template<typename IntType >
IntType gcd ( IntType  n,
IntType  m 
)

Calculate the greatest common divisor.

This function works for arbitrary integer types, including user-defined (e.g. infinite precision) ones.

#include <vigra/rational.hxx>
Namespace: vigra

◆ lcm()

template<typename IntType >
IntType lcm ( IntType  n,
IntType  m 
)

Calculate the lowest common multiple.

This function works for arbitrary integer types, including user-defined (e.g. infinite precision) ones.

#include <vigra/rational.hxx>
Namespace: vigra

◆ pow() [1/2]

template<typename IntType >
Rational< IntType > pow ( const Rational< IntType > &  r,
int  e 
)

integer powers

throws bad_rational if indeterminate expression.

◆ rational_cast()

template<typename T , typename IntType >
T rational_cast ( const Rational< IntType > &  src)

Type conversion

Executes static_cast<T>(numerator()) / denominator().

Usage:

int i;
double d;
i = rational_cast<int>(r); // round r downwards
d = rational_cast<double>(r); // represent rational as a double
r = rational_cast<Rational<int> >(r); // no change

◆ rbfMatrix2DFromCorrespondingPoints()

linalg::TemporaryMatrix< double > rbfMatrix2DFromCorrespondingPoints ( SrcPointIterator  s,
SrcPointIterator  s_end,
DestPointIterator  d,
RadialBasisFunctor const rbf 
)

Create a matrix that maps corresponding points onto each other using a given RBF.

For use with rbfWarpImage(). For n given (corresponding) points, the matrix will be of size (n+3,2). Note that the representation of this matrix is exactly the same as the "W" matrix of Bookstein. More information can be found in the following article:

Fred L. Bookstein. Principal Warps: Thin-Plate Splines and the Decomposition of Deformations. IEEE PAMI, Vol 11, No 8. 1989

◆ rbfWarpImage()

Warp an image according to an radial basis function based transformation.

To get more information about the structure of the matrix, see rbfMatrix2DFromCorrespondingPoints()

#include <vigra/rbf_registration.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <int ORDER, class T,
class T2, class S2,
class C,
void
}
void rbfWarpImage(SplineImageView< ORDER, T > const &src, DestIterator dul, DestIterator dlr, DestAccessor dest, DestPointIterator d, DestPointIterator d_end, MultiArrayView< 2, double, C > const &W, RadialBasisFunctor rbf)
Warp an image according to an radial basis function based transformation.
Definition rbf_registration.hxx:238

show deprecated declarations

◆ recursiveFilterLine()

template<... >
void recursiveFilterLine (   ...)

Performs a 1-dimensional recursive convolution of the source signal.

The function performs a causal and an anti-causal first or second order recursive filtering with the given filter parameter b1 and border treatment border (first order filter, b2 = 0) or parameters b1, b2 and BORDER_TREATMENT_REFLECT (second order filter). Thus, the result is always a filtering with linear phase.

\[
    \begin{array}{rcl}
    a_{i, causal} & = & source_i + b1 * a_{i-1, causal} + b2 * a_{i-2, causal} \\
    a_{i, anticausal} & = & source_i + b1 * a_{i+1, anticausal} + b2 * a_{i+2, anticausal} \\
    dest_i & = & \frac{1 - b1 - b2}{1 + b1 + b2}(a_{i, causal} + a_{i, anticausal} - source_i)
    \end{array}
\]

The signal's value_type (SrcAccessor::value_type) must be a linear space over double, i.e. addition of source values, multiplication with double, and NumericTraits must be defined.

Declaration:

First order recursive filter:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
double b1, BorderTreatmentMode border)
}
void recursiveFilterLine(...)
Performs a 1-dimensional recursive convolution of the source signal.

Second order recursive filter:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
double b1, double b2)
}

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
DefaultAccessor<vector<float>::iterator, float> FAccessor;
0.5, BORDER_TREATMENT_REFLECT);
iterator end()
Definition tinyvector.hxx:864

Required Interface:

NumericTraits<SrcAccessor::value_type>::RealPromote s = src_accessor(is);
double d;
s = s + s;
s = d * s;
NumericTraits<DestAccessor::value_type>::fromRealPromote(s), id);

Preconditions:

-1 < b < 1

◆ recursiveGaussianFilterLine()

template<... >
void recursiveGaussianFilterLine (   ...)

Compute a 1-dimensional recursive approximation of Gaussian smoothing.

The function applies a causal and an anti-causal third order recursive filter which optimally approximates the Gaussian filter, as proposed in

I. Young, L. van Vliet: Recursive implementation of the Gaussian filter
Signal Processing 44:139-151, 1995

The formulas for transforming the given scale parameter sigma into the actual filter coefficients are taken from Luigi Rosa's Matlab implementation.

The signal's value_type (SrcAccessor::value_type) must be a linear space over double, i.e. addition of source values, multiplication with double, and NumericTraits must be defined.

Declaration:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
void
double sigma);
}
void recursiveGaussianFilterLine(...)
Compute a 1-dimensional recursive approximation of Gaussian smoothing.

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
vigra::DefaultAccessor<vector<float>::iterator, float> FAccessor;
double sigma = 2.5;
sigma);

Required Interface:

NumericTraits<SrcAccessor::value_type>::RealPromote s = src_accessor(is);
double d;
s = s + s;
s = d * s;
NumericTraits<DestAccessor::value_type>::fromRealPromote(s), id);

Preconditions:

0 <= sigma (absolute values are used for negative sigma)

◆ recursiveSmoothLine()

template<... >
void recursiveSmoothLine (   ...)

Convolves the image with a 1-dimensional exponential filter.

This function calls recursiveFilterLine() with b = exp(-1.0/scale) and border = BORDER_TREATMENT_REPEAT. See recursiveFilterLine() for more documentation.

Declaration:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
DestIterator id, DestAccessor ad, double scale)
}
void recursiveSmoothLine(...)
Convolves the image with a 1-dimensional exponential filter.

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

Required Interface:

NumericTraits<SrcAccessor::value_type>::RealPromote s = src_accessor(is);
double d;
s = s + s;
s = d * s;
NumericTraits<DestAccessor::value_type>::fromRealPromote(s), id);

Preconditions:

scale > 0

◆ recursiveFirstDerivativeLine()

template<... >
void recursiveFirstDerivativeLine (   ...)

Performs a 1 dimensional recursive convolution of the source signal.

It uses the first derivative an exponential d/dx exp(-abs(x)/scale) as a kernel. The signal's value_type (SrcAccessor::value_type) must be a linear space over double, i.e. addition and subtraction of source values, multiplication with double, and NumericTraits must be defined. Border treatment is always BORDER_TREATMENT_REPEAT.

Declaration:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
DestIterator id, DestAccessor ad, double scale)
}
void recursiveFirstDerivativeLine(...)
Performs a 1 dimensional recursive convolution of the source signal.

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

Required Interface:

NumericTraits<SrcAccessor::value_type>::RealPromote s = src_accessor(is);
double d;
s = s + s;
s = -s;
s = d * s;
NumericTraits<DestAccessor::value_type>::fromRealPromote(s), id);

Preconditions:

scale > 0

◆ recursiveSecondDerivativeLine()

template<... >
void recursiveSecondDerivativeLine (   ...)

Performs a 1 dimensional recursive convolution of the source signal.

It uses the second derivative an exponential d2/dx2 exp(-abs(x)/scale) as a kernel. The signal's value_type (SrcAccessor::value_type) must be a linear space over double, i.e. addition and subtraction of source values, multiplication with double, and NumericTraits must be defined. Border treatment is always BORDER_TREATMENT_REPEAT.

Declaration:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
DestIterator id, DestAccessor ad, double scale)
}
void recursiveSecondDerivativeLine(...)
Performs a 1 dimensional recursive convolution of the source signal.

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

Required Interface:

NumericTraits<SrcAccessor::value_type>::RealPromote s = src_accessor(is);
double d;
s = s + s;
s = s - s;
s = d * s;
NumericTraits<DestAccessor::value_type>::fromRealPromote(s), id);

Preconditions:

scale > 0

◆ recursiveFilterX()

template<... >
void recursiveFilterX (   ...)

Performs 1 dimensional recursive filtering (1st and 2nd order) in x direction.

It calls recursiveFilterLine() for every row of the image. See recursiveFilterLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
// first order filter
template <class T1, class S1,
class T2, class S2>
void
double b, BorderTreatmentMode border);
// second order filter
template <class T1, class S1,
class T2, class S2>
void
double b1, double b2);
}
void recursiveFilterX(...)
Performs 1 dimensional recursive filtering (1st and 2nd order) in x direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
// apply a first-order filter to the x-axis
recursiveFilterX(src, dest, 0.5, BORDER_TREATMENT_REFLECT);

show deprecated examples

◆ recursiveGaussianFilterX()

template<... >
void recursiveGaussianFilterX (   ...)

Compute 1 dimensional recursive approximation of Gaussian smoothing in y direction.

It calls recursiveGaussianFilterLine() for every column of the image. See recursiveGaussianFilterLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double sigma);
}
void recursiveGaussianFilterX(...)
Compute 1 dimensional recursive approximation of Gaussian smoothing in y direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveGaussianFilterX(src, dest, 3.0);

show deprecated examples

◆ recursiveSmoothX()

template<... >
void recursiveSmoothX (   ...)

Performs 1 dimensional recursive smoothing in x direction.

It calls recursiveSmoothLine() for every row of the image. See recursiveSmoothLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void recursiveSmoothX(...)
Performs 1 dimensional recursive smoothing in x direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveSmoothX(src, dest, 3.0);

show deprecated examples

◆ recursiveFilterY()

template<... >
void recursiveFilterY (   ...)

Performs 1 dimensional recursive filtering (1st and 2nd order) in y direction.

It calls recursiveFilterLine() for every column of the image. See recursiveFilterLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
// first order filter
template <class T1, class S1,
class T2, class S2>
void
double b, BorderTreatmentMode border);
// second order filter
template <class T1, class S1,
class T2, class S2>
void
double b1, double b2);
}
void recursiveFilterY(...)
Performs 1 dimensional recursive filtering (1st and 2nd order) in y direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
// apply a second-order filter to the y-axis
recursiveFilterY(src, dest, -0.6, -0.06);

show deprecated examples

◆ recursiveGaussianFilterY()

template<... >
void recursiveGaussianFilterY (   ...)

Compute 1 dimensional recursive approximation of Gaussian smoothing in y direction.

It calls recursiveGaussianFilterLine() for every column of the image. See recursiveGaussianFilterLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double sigma);
}
void recursiveGaussianFilterY(...)
Compute 1 dimensional recursive approximation of Gaussian smoothing in y direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveGaussianFilterY(src, dest, 3.0);

show deprecated examples

◆ recursiveSmoothY()

template<... >
void recursiveSmoothY (   ...)

Performs 1 dimensional recursive smoothing in y direction.

It calls recursiveSmoothLine() for every column of the image. See recursiveSmoothLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void recursiveSmoothY(...)
Performs 1 dimensional recursive smoothing in y direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveSmoothY(src, dest, 3.0);

show deprecated examples

◆ recursiveFirstDerivativeX()

template<... >
void recursiveFirstDerivativeX (   ...)

Recursively calculates the 1 dimensional first derivative in x direction.

It calls recursiveFirstDerivativeLine() for every row of the image. See recursiveFirstDerivativeLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void recursiveFirstDerivativeX(...)
Recursively calculates the 1 dimensional first derivative in x direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveFirstDerivativeX(src, dest, 3.0);

show deprecated examples

◆ recursiveFirstDerivativeY()

template<... >
void recursiveFirstDerivativeY (   ...)

Recursively calculates the 1 dimensional first derivative in y direction.

It calls recursiveFirstDerivativeLine() for every column of the image. See recursiveFirstDerivativeLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void recursiveFirstDerivativeY(...)
Recursively calculates the 1 dimensional first derivative in y direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveFirstDerivativeY(src, dest, 3.0);

show deprecated examples

◆ recursiveSecondDerivativeX()

template<... >
void recursiveSecondDerivativeX (   ...)

Recursively calculates the 1 dimensional second derivative in x direction.

It calls recursiveSecondDerivativeLine() for every row of the image. See recursiveSecondDerivativeLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void recursiveSecondDerivativeX(...)
Recursively calculates the 1 dimensional second derivative in x direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveSecondDerivativeX(src, dest, 3.0);

show deprecated examples

◆ recursiveSecondDerivativeY()

template<... >
void recursiveSecondDerivativeY (   ...)

Recursively calculates the 1 dimensional second derivative in y direction.

It calls recursiveSecondDerivativeLine() for every column of the image. See recursiveSecondDerivativeLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void recursiveSecondDerivativeY(...)
Recursively calculates the 1 dimensional second derivative in y direction.

show deprecated declarations

Usage:

#include <vigra/recursiveconvolution.hxx>
Namespace: vigra

...
recursiveSecondDerivativeY(src, dest, 3.0);

show deprecated examples

◆ nonlinearLeastSquares()

template<... >
void nonlinearLeastSquares (   ...)

Fit a non-linear model to given data by minimizing least squares loss.

Declarations:

namespace vigra {
// variant 1: optimize a univariate model ('x' is a 1D array of scalar data points)
template <class T, class S1, class S2,
class U, int N,
class Functor>
T
Functor model,
// variant 2: optimize a multivariate model ('x' is a 2D array of vector-valued data points)
template <class T, class S1, class S2,
class U, int N,
class Functor>
T
Functor model,
}
Pass options to nonlinearLeastSquares().
Definition regression.hxx:992
void nonlinearLeastSquares(...)
Fit a non-linear model to given data by minimizing least squares loss.

This function implements the Levenberg-Marquardt algorithm to fit a non-linear model to given data. The model depends on a vector of parameters p which are to be choosen such that the least-squares residual between the data and the model's predictions is minimized according to the objective function:

\[ \tilde \textrm{\bf p} = \textrm{argmin}_{\textrm{\bf p}} \sum_i \left( y_i - f(\textrm{\bf x}_i; \textrm{\bf p}) \right)^2
\]

where $f(\textrm{\bf x}; \textrm{\bf p})$ is the model to be optimized (with arguments $\textrm{\bf x}$ and parameters $\textrm{\bf p}$), and $(\textrm{\bf x}_i; y_i)$ are the feature/response pairs of the given data. Since the model is non-linear (otherwise, you should use ordinary leastSquares()), it must be linearized in terms of a first-order Taylor expansion, and the optimal parameters p have to be determined iteratively. In order for the iterations to converge to the desired solution, a good initial guess on p is required.

The model must be specified by a functor which takes one of the following forms:

typedef double DataType; // type of your data samples, may be any numeric type
static const int N = ...; // number of model parameters
// variant 1: the features x are scalars
{
template <class T>
T operator()(DataType x, TinyVector<T, N> const & p) const { ... }
};
// variant 2: the features x are vectors
struct MultivariateModel
{
template <class T>
T operator()(MultiArrayView<1, DataType> const & x, TinyVector<T, N> const & p) const { ... }
};

Each call to the functor's operator() computes the model's prediction for a single data point. The current model parameters are specified in a TinyVector of appropriate length. The type T must be templated: normally, it is the same as DataType, but the nonlinearLeastSquares() function will temporarily replace it with a special number type that supports automatic differentiation (see vigra::autodiff::DualVector). In this way, the derivatives needed in the model's Taylor expansion can be computed automatically.

When the model is univariate (has a single scalar argument), the samples must be passed to nonlinearLeastSquares() in a pair 'x', 'y' of 1D MultiArrayViews (variant 1). When the model is multivariate (has a vector-valued argument), the 'x' input must be a 2D MultiArrayView (variant 2) whose rows represent a single data sample (i.e. the number of columns corresponds to the length of the model's argument vector). The number of rows in 'x' defines the number of data samples and must match the length of array 'y'.

The TinyVector 'model_parameters' holds the initial guess for the model parameters and will be overwritten by the optimal values found by the algorithm. The algorithm's internal behavior can be controlled by customizing the option object vigra::NonlinearLSQOptions.

The function returns the residual sum of squared errors of the final solution.

Usage:

#include <vigra/regression.hxx>
Namespace: vigra

Suppose that we want to fit a centered Gaussian function of the form

\[ f(x ; a, s, b) = a \exp\left(-\frac{x^2}{2 s^2}\right) + b  \]

to noisy data $(x_i, y_i)$, i.e. we want to find parameters a, s, b such that the residual $\sum_i \left(y_i - f(x_i; a,s,b)\right)^2$ is minimized. The model parameters are placed in a TinyVector<T, 3> p according to the rules
p[0] <=> a, p[1] <=> s and p[2] <=> b.
The following functor computes the model's prediction for a single data point x:

{
template <class T>
T operator()(double x, TinyVector<T, 3> const & p) const
{
return p[0] * exp(-0.5 * sq(x / p[1])) + p[2];
}
};

Now we can find optimal values for the parameters like this:

int size = ...; // number of data points
MultiArray<1, double> x(size), y(size);
... // fill the data arrays
TinyVector<double, 3> p(2.0, 1.0, 0.5); // your initial guess of the parameters
// (will be overwritten with the optimal values)
std::cout << "Model parameters: a=" << p[0] << ", s=" << p[1] << ", b=" << p[2] << " (residual: " << residual << ")\n";

◆ resamplingConvolveLine()

template<... >
void resamplingConvolveLine (   ...)

Performs a 1-dimensional resampling convolution of the source signal using the given set of kernels.

This function is mainly used internally: It is called for each dimension of a higher dimensional array in order to perform a separable resize operation.

Declaration:

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

namespace vigra {
template <class SrcIter, class SrcAcc,
class DestIter, class DestAcc,
class KernelArray,
class Functor>
void
KernelArray const & kernels,
}
void resamplingConvolveLine(...)
Performs a 1-dimensional resampling convolution of the source signal using the given set of kernels.

◆ resamplingConvolveX()

template<... >
void resamplingConvolveX (   ...)

Apply a resampling filter in the x-direction.

This function implements a convolution operation in x-direction (i.e. applies a 1D filter to every row) where the width of the source and destination images differ. This is typically used to avoid aliasing if the image is scaled down, or to interpolate smoothly if the image is scaled up. The target coordinates are transformed into source coordinates by

The samplingRatio and offset must be given as vigra::Rational in order to avoid rounding errors in this transformation. It is required that for all pixels of the target image, xsource remains within the range of the source image (i.e. 0 <= xsource <= sourceWidth-1. Since xsource is in general not an integer, the kernel must be a functor that can be accessed at arbitrary (double) coordinates. It must also provide a member function radius() which specifies the support (non-zero interval) of the kernel. VIGRA already provides a number of suitable functors, e.g. vigra::Gaussian, vigra::BSpline vigra::CatmullRomSpline, and vigra::CoscotFunction. The function resizeImageSplineInterpolation() is implemented by means of resamplingConvolveX() and resamplingConvolveY().

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class Kernel>
void
Kernel const & kernel,
}
void resamplingConvolveX(...)
Apply a resampling filter in the x-direction.

show deprecated declarations

Usage:

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

float sigma = 2.0;
...
// simultaneously enlarge and smooth source image
resamplingConvolveX(src, dest,

show deprecated examples

◆ resamplingConvolveY()

template<... >
void resamplingConvolveY (   ...)

Apply a resampling filter in the y-direction.

This function implements a convolution operation in y-direction (i.e. applies a 1D filter to every column) where the height of the source and destination images differ. This is typically used to avoid aliasing if the image is scaled down, or to interpolate smoothly if the image is scaled up. The target coordinates are transformed into source coordinates by

The samplingRatio and offset must be given as vigra::Rational in order to avoid rounding errors in this transformation. It is required that for all pixels of the target image, ysource remains within the range of the source image (i.e. 0 <= ysource <= sourceHeight-1. Since ysource is in general not an integer, the kernel must be a functor that can be accessed at arbitrary (double) coordinates. It must also provide a member function radius() which specifies the support (non-zero interval) of the kernel. VIGRA already provides a number of suitable functors, e.g. vigra::Gaussian, vigra::BSpline vigra::CatmullRomSpline, and vigra::CoscotFunction. The function resizeImageSplineInterpolation() is implemented by means of resamplingConvolveX() and resamplingConvolveY().

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class Kernel>
void
Kernel const & kernel,
}
void resamplingConvolveY(...)
Apply a resampling filter in the y-direction.

show deprecated declarations

Usage:

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

float sigma = 2.0;
...
// simultaneously enlarge and smooth source image
resamplingConvolveY(src, dest,

show deprecated examples

◆ resamplingConvolveImage()

template<... >
void resamplingConvolveImage (   ...)

Apply two separable resampling filters successively, the first in x-direction, the second in y-direction.

This function is a shorthand for the concatenation of a call to resamplingConvolveX() and resamplingConvolveY() with the given kernels. See there for detailed documentation.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class KernelX, class KernelY>
void
KernelX const & kx,
KernelY const & ky,
}
void resamplingConvolveImage(...)
Apply two separable resampling filters successively, the first in x-direction, the second in y-direct...

show deprecated declarations

Usage:

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

float sigma = 2.0;
...
// simultaneously enlarge and smooth source image
resamplingConvolveImage(src, dest,

◆ pyramidReduceBurtFilter()

template<... >
void pyramidReduceBurtFilter (   ...)

Two-fold down-sampling for image pyramid construction.

This function implements the reduction by one resolution level (first signature) or across several pyramid levels (last signature) of a Gaussian pyramid as described in

P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983

That is, it applies the smoothing filter

[0.25 - centerValue / 2.0, 0.25, centerValue, 0.25, 0.25 - centerValue / 2.0]

to the source image and then copies all pixels with even coordinates to the destination image. The destination image shape must be dest_shape = ceil(src_shape / 2.0). centerValue must be between 0.25 and 0.5 and determines the strength of smoothing (bigger values correspond to less smoothing). If toLevel - fromLevel > 1 in the pyramid variant of the function, this process is repeated until toLevel is reached.

Typically, this functions is used in connection with a vigra::ImagePyramid (last signature below) to perform several levels of reduction in one go.

Declarations:

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
double centerValue = 0.4);
}
void pyramidReduceBurtFilter(...)
Two-fold down-sampling for image pyramid construction.

show deprecated declarations

use a vigra::ImagePyramid :

namespace vigra {
template <class Image, class Alloc>
int fromLevel, int toLevel,
double centerValue = 0.4);
}

◆ pyramidExpandBurtFilter()

template<... >
void pyramidExpandBurtFilter (   ...)

Two-fold up-sampling for image pyramid reconstruction.

This function implements the expansion by one resolution level (first signature) or across several pyramid levels (last signature) of a Gaussian pyramid as described in

P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983

That is, the function first places the pixel values of the low-resolution image at the even pixel coordinates of the high-resolution image (pixels with at least one odd coordinate are zero-initialized) and then applies the interpolation filter

[0.5 - centerValue, 0.5, 2*centerValue, 0.5, 0.5 - centerValue]

to the high-resolution image. The source image shape must be src_shape = ceil(dest_shape / 2.0). centerValue must be between 0.25 and 0.5 and determines the sharpness of the interpolation (bigger values correspond to sharper images). If fromLevel - toLevel > 1 in the pyramid variant of the function, this process is repeated until toLevel is reached.

Typically, this functions is used in connection with a vigra::ImagePyramid (last signature below) to perform several levels of expansion in one go.

Declarations:

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

pass 2D array views:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor>
double centerValue = 0.4);
}
void pyramidExpandBurtFilter(...)
Two-fold up-sampling for image pyramid reconstruction.

show deprecated declarations

use a vigra::ImagePyramid :

namespace vigra {
template <class Image, class Alloc>
int fromLevel, int toLevel,
double centerValue = 0.4);
}

◆ pyramidReduceBurtLaplacian()

template<class Image , class Alloc >
void pyramidReduceBurtLaplacian ( ImagePyramid< Image, Alloc > &  pyramid,
int  fromLevel,
int  toLevel,
double  centerValue = 0.4 
)

Create a Laplacian pyramid.

This function implements the reduction across several resolution levels of a Laplacian pyramid as described in

P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983

It first creates a Gaussian pyramid using pyramidReduceBurtFilter(), then upsamples each level once using pyramidExpandBurtFilter(), and finally stores the difference between the upsampled and original versions of each level (i.e. the Laplacian of Gaussian is approximated by a difference of Gaussian).

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

◆ pyramidExpandBurtLaplacian()

template<class Image , class Alloc >
void pyramidExpandBurtLaplacian ( ImagePyramid< Image, Alloc > &  pyramid,
int  fromLevel,
int  toLevel,
double  centerValue = 0.4 
)

Reconstruct a Laplacian pyramid.

This function implements the reconstruction of a Gaussian pyramid across several resolution levels of a Laplacian pyramid as described in

P. Burt, E. Adelson: "The Laplacian Pyramid as a Compact Image Code", IEEE Trans. Communications, 9(4):532-540, 1983

At each level starting from fromLevel, this function calls pyramidExpandBurtFilter() to interpolate the image to the next highest resolution, and then adds the interpolated image to the image stored at the next level.

#include <vigra/resampling_convolution.hxx>
Namespace: vigra

◆ resizeImageNoInterpolation()

template<... >
void resizeImageNoInterpolation (   ...)

Resize image by repeating the nearest pixel values.

This algorithm is very fast and does not require any arithmetic on the pixel types.

The range of both the input and output images (resp. regions) must be given. Both images must have a size of at least 2x2 pixels. The scaling factors are then calculated accordingly. Destination pixels are directly copied from the appropriate source pixels.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void resizeImageNoInterpolation(...)
Resize image by repeating the nearest pixel values.

show deprecated declarations

Usage:

#include <vigra/resizeimage.hxx>
Namespace: vigra

show deprecated examples

Preconditions:

Source and destination must have at least 2 pixels along each axis.

◆ resizeImageLinearInterpolation()

template<... >
void resizeImageLinearInterpolation (   ...)

Resize image using linear interpolation.

The function uses the standard separable bilinear interpolation algorithm to obtain a good compromise between quality and speed.

The range must of both the input and output images (resp. regions) must be given. Both images must have a size of at least 2x2. The scaling factors are then calculated accordingly. If the source image is larger than the destination, it is smoothed (band limited) using a recursive exponential filter. The source value_type (SrcAccessor::value_type) must be a linear space, i.e. it must support addition, multiplication with a scalar real number and NumericTraits.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void resizeImageLinearInterpolation(...)
Resize image using linear interpolation.

show deprecated declarations

Usage:

#include <vigra/resizeimage.hxx>
Namespace: vigra

show deprecated examples

Preconditions:

Source and destination must have at least 2 pixels along each axis.

◆ resizeImageSplineInterpolation()

template<... >
void resizeImageSplineInterpolation (   ...)

Resize image using B-spline interpolation.

The function implements separable spline interpolation algorithm described in

M. Unser, A. Aldroubi, M. Eden, "B-Spline Signal Processing" IEEE Transactions on Signal Processing, vol. 41, no. 2, pp. 821-833 (part I), pp. 834-848 (part II), 1993.

to obtain optimal interpolation quality and speed. You may pass the function a spline of arbitrary order (e.g. BSpline<ORDER, double> or CatmullRomSpline<double>). The default is a third order spline which gives a twice continuously differentiable interpolant. The implementation ensures that image values are interpolated rather than smoothed by first calling a recursive (sharpening) prefilter as described in the above paper. Then the actual interpolation is done using resamplingConvolveLine().

The range of both the input and output images (resp. regions) must be given. The input image must have a size of at least 4x4, the destination of at least 2x2. The scaling factors are then calculated accordingly. If the source image is larger than the destination, it is smoothed (band limited) using a recursive exponential filter. The source value_type (SrcAccessor::value_type) must be a linear algebra, i.e. it must support addition, subtraction, and multiplication (+, -, *), multiplication with a scalar real number and NumericTraits. The function uses accessors.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class SPLINE>
void
}
void resizeImageSplineInterpolation(...)
Resize image using B-spline interpolation.

show deprecated declarations

Usage:

#include <vigra/resizeimage.hxx>
Namespace: vigra

// use default cubic spline interpolator
// use 5th-order spline interpolator

show deprecated examples

Preconditions:

Source and destination must have at least 2 pixels along each axis.

◆ resizeImageCatmullRomInterpolation()

template<... >
void resizeImageCatmullRomInterpolation (   ...)

Resize image using the Catmull/Rom interpolation function.

The function calls like resizeImageSplineInterpolation() with vigra::CatmullRomSpline as an interpolation kernel. The interpolated function has one continuous derivative. (See resizeImageSplineInterpolation() for more documentation)

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void resizeImageCatmullRomInterpolation(...)
Resize image using the Catmull/Rom interpolation function.

show deprecated declarations

#include <vigra/resizeimage.hxx>
Namespace: vigra

◆ resizeImageCoscotInterpolation()

template<... >
void resizeImageCoscotInterpolation (   ...)

Resize image using the Coscot interpolation function.

The function calls resizeImageSplineInterpolation() with vigra::CoscotFunction as an interpolation kernel. The interpolated function has one continuous derivative. (See resizeImageSplineInterpolation() for more documentation)

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void resizeImageCoscotInterpolation(...)
Resize image using the Coscot interpolation function.

show deprecated declarations

#include <vigra/resizeimage.hxx>
Namespace: vigra

◆ ceil() [1/2]

template<class V , unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
RGBValue< V, RIDX, GIDX, BIDX > ceil ( RGBValue< V, RIDX, GIDX, BIDX > const r)

Apply ceil() function to each RGB component.

◆ floor() [1/2]

template<class V , unsigned int RIDX, unsigned int GIDX, unsigned int BIDX>
RGBValue< V, RIDX, GIDX, BIDX > floor ( RGBValue< V, RIDX, GIDX, BIDX > const r)

Apply floor() function to each RGB component.

◆ seededRegionGrowing()

template<... >
void seededRegionGrowing (   ...)

Region Segmentation by means of Seeded Region Growing.

This algorithm implements seeded region growing as described in

R. Adams, L. Bischof: "Seeded Region Growing", IEEE Trans. on Pattern Analysis and Maschine Intelligence, vol 16, no 6, 1994, and

Ullrich Köthe: Primary Image Segmentation, in: G. Sagerer, S. Posch, F. Kummert (eds.): Mustererkennung 1995, Proc. 17. DAGM-Symposium, Springer 1995

The seed image is a partly segmented image which contains uniquely labeled regions (the seeds) and unlabeled pixels (the candidates, label 0). The highest seed label found in the seed image is returned by the algorithm.

Seed regions can be as large as you wish and as small as one pixel. If there are no candidates, the algorithm will simply copy the seed image into the output image. Otherwise it will aggregate the candidates into the existing regions so that a cost function is minimized. Candidates are taken from the neighborhood of the already assigned pixels, where the type of neighborhood is determined by parameter neighborhood which can take the values FourNeighborCode() (the default) or EightNeighborCode(). The algorithm basically works as follows (illustrated for 4-neighborhood, but 8-neighborhood works in the same way):

  1. Find all candidate pixels that are 4-adjacent to a seed region. Calculate the cost for aggregating each candidate into its adjacent region and put the candidates into a priority queue.

  2. While( priority queue is not empty and termination criterion is not fulfilled)

    1. Take the candidate with least cost from the queue. If it has not already been merged, merge it with it's adjacent region.

    2. Put all candidates that are 4-adjacent to the pixel just processed into the priority queue.

SRGType can take the following values:

CompleteGrow
produce a complete tesselation of the volume (default).
KeepContours
keep a 1-voxel wide unlabeled contour between all regions.
StopAtThreshold
stop when the boundary indicator values exceed the threshold given by parameter max_cost.
KeepContours | StopAtThreshold
keep 1-voxel wide contour and stop at given max_cost.

The cost is determined jointly by the source image and the region statistics functor. The source image contains feature values for each pixel which will be used by the region statistics functor to calculate and update statistics for each region and to calculate the cost for each candidate. The RegionStatisticsArray must be compatible to the ArrayOfRegionStatistics functor and contains an array of statistics objects for each region. The indices must correspond to the labels of the seed regions. The statistics for the initial regions must have been calculated prior to calling seededRegionGrowing() (for example by means of inspectTwoImagesIf()).

For each candidate x that is adjacent to region i, the algorithm will call stats[i].cost(as(x)) to get the cost (where x is a SrcIterator and as is the SrcAccessor). When a candidate has been merged with a region, the statistics are updated by calling stats[i].operator()(as(x)). Since the RegionStatisticsArray is passed by reference, this will overwrite the original statistics.

If a candidate could be merged into more than one regions with identical cost, the algorithm will favour the nearest region. If StopAtThreshold is active, and the cost of the current candidate at any point in the algorithm exceeds the optional max_cost value (which defaults to NumericTraits<double>::max()), region growing is aborted, and all voxels not yet assigned to a region remain unlabeled.

In some cases, the cost only depends on the feature value of the current pixel. Then the update operation will simply be a no-op, and the cost() function returns its argument. This behavior is implemented by the SeedRgDirectValueFunctor. With SRGType == KeepContours, this is equivalent to the watershed algorithm.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class TS, class AS,
class T2, class S2,
SRGType srgType = CompleteGrow,
double max_cost = NumericTraits<double>::max());
}
SRGType
Definition seededregiongrowing.hxx:176
void seededRegionGrowing(...)
Region Segmentation by means of Seeded Region Growing.

show deprecated declarations

Usage:

#include <vigra/seededregiongrowing.hxx>
Namespace: vigra

Example: implementation of the voronoi tesselation

int max_region_label = 100;
// throw in some random points:
for(int i = 1; i <= max_region_label; ++i)
points(w * rand() / RAND_MAX , h * rand() / RAND_MAX) = i;
// calculate Euclidean distance transform
// init statistics functor
// find voronoi region of each point (the point image is overwritten with the
// voronoi region labels)

show deprecated examples

Further requirements are determined by the RegionStatisticsArray.

◆ seededRegionGrowing3D()

template<... >
void seededRegionGrowing3D (   ...)

Three-dimensional Region Segmentation by means of Seeded Region Growing.

This algorithm implements seeded region growing as described in

The seed image is a partly segmented multi-dimensional array which contains uniquely labeled regions (the seeds) and unlabeled voxels (the candidates, label 0). Seed regions can be as large as you wish and as small as one voxel. If there are no candidates, the algorithm will simply copy the seed array into the output array. Otherwise it will aggregate the candidates into the existing regions so that a cost function is minimized. Candidates are taken from the neighborhood of the already assigned pixels, where the type of neighborhood is determined by parameter neighborhood which can take the values NeighborCode3DSix() (the default) or NeighborCode3DTwentySix(). The algorithm basically works as follows (illustrated for 6-neighborhood, but 26-neighborhood works in the same way):

  1. Find all candidate pixels that are 6-adjacent to a seed region. Calculate the cost for aggregating each candidate into its adjacent region and put the candidates into a priority queue.

  2. While( priority queue is not empty)

    1. Take the candidate with least cost from the queue. If it has not already been merged, merge it with it's adjacent region.

    2. Put all candidates that are 4-adjacent to the pixel just processed into the priority queue.

SRGType can take the following values:

CompleteGrow
produce a complete tesselation of the volume (default).
KeepContours
keep a 1-voxel wide unlabeled contour between all regions.
StopAtThreshold
stop when the boundary indicator values exceed the threshold given by parameter max_cost.
KeepContours | StopAtThreshold
keep 1-voxel wide contour and stop at given max_cost.

The cost is determined jointly by the source array and the region statistics functor. The source array contains feature values for each pixel which will be used by the region statistics functor to calculate and update statistics for each region and to calculate the cost for each candidate. The RegionStatisticsArray must be compatible to the ArrayOfRegionStatistics functor and contains an array of statistics objects for each region. The indices must correspond to the labels of the seed regions. The statistics for the initial regions must have been calculated prior to calling seededRegionGrowing3D()

For each candidate x that is adjacent to region i, the algorithm will call stats[i].cost(as(x)) to get the cost (where x is a SrcImageIterator and as is the SrcAccessor). When a candidate has been merged with a region, the statistics are updated by calling stats[i].operator()(as(x)). Since the RegionStatisticsArray is passed by reference, this will overwrite the original statistics.

If a candidate could be merged into more than one regions with identical cost, the algorithm will favour the nearest region. If StopAtThreshold is active, and the cost of the current candidate at any point in the algorithm exceeds the optional max_cost value (which defaults to NumericTraits<double>::max()), region growing is aborted, and all voxels not yet assigned to a region remain unlabeled.

In some cases, the cost only depends on the feature value of the current voxel. Then the update operation will simply be a no-op, and the cost() function returns its argument. This behavior is implemented by the SeedRgDirectValueFunctor.

Declarations:

pass 3D array views:

namespace vigra {
template <class T1, class S1,
class TS, class AS,
class T2, class S2,
void
SRGType srgType = CompleteGrow,
Neighborhood neighborhood = NeighborCode3DSix(),
double max_cost = NumericTraits<double>::max());
}
void seededRegionGrowing3D(...)
Three-dimensional Region Segmentation by means of Seeded Region Growing.

show deprecated declarations

Usage:

#include <vigra/seededregiongrowing3d.hxx>
Namespace: vigra

See seededRegionGrowing() for an example

◆ convolveLine()

template<... >
void convolveLine (   ...)

Performs a 1-dimensional convolution of the source signal using the given kernel.

The KernelIterator must point to the center iterator, and the kernel's size is given by its left (kleft <= 0) and right (kright >= 0) borders. The signal must always be larger than the kernel. At those positions where the kernel does not completely fit into the signal's range, the specified BorderTreatmentMode is applied.

The signal's value_type (SrcAccessor::value_type) must be a linear space over the kernel's value_type (KernelAccessor::value_type), i.e. addition of source values, multiplication with kernel values, and NumericTraits must be defined. The kernel's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.

If start and stop are non-zero, the relation 0 <= start < stop <= width must hold (where width is the length of the input array). The convolution is then restricted to that subrange, and it is assumed that the output array only refers to that subrange (i.e. id points to the element corresponding to start). If start and stop are both zero (the default), the entire array is convolved.

Declarations:

pass Image Iterators and Data Accessors :

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor,
int kleft, int kright, BorderTreatmentMode border,
int start = 0, int stop = 0 )
}
void convolveLine(...)
Performs a 1-dimensional convolution of the source signal using the given kernel.

use argument objects in conjunction with Argument Object Factories :

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class DestIterator, class DestAccessor,
int, int, BorderTreatmentMode> kernel,
int start = 0, int stop = 0)
}

Usage:

#include <vigra/separableconvolution.hxx>
Namespace: vigra

std::vector<float> src, dest;
...
// define binomial filter of size 5
static float kernel[] =
{ 1.0/16.0, 4.0/16.0, 6.0/16.0, 4.0/16.0, 1.0/16.0};
typedef vigra::StandardAccessor<float> KernelAccessor;
vigra::convolveLine(src.begin(), src.end(), FAccessor(), dest.begin(), FAccessor(),
kernel+2, KernelAccessor(), -2, 2, BORDER_TREATMENT_REFLECT);
// ^^^^^^^^ this is the center of the kernel

Required Interface:

NumericTraits<SrcAccessor::value_type>::RealPromote s = src_accessor(is);
s = s + s;
NumericTraits<DestAccessor::value_type>::fromRealPromote(s), id);

If border == BORDER_TREATMENT_CLIP:

NumericTraits<KernelAccessor::value_type>::RealPromote k = kernel_accessor(ik);
k = k + k;
k = k - k;
k = k * k;
k = k / k;

Preconditions:

kleft <= 0
kright >= 0
iend - is >= kright + kleft + 1

If border == BORDER_TREATMENT_CLIP: Sum of kernel elements must be != 0.

◆ separableConvolveX()

template<... >
void separableConvolveX (   ...)

Performs a 1 dimensional convolution in x direction.

It calls convolveLine() for every row of the image. See convolveLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class T3>
void
Kernel1D<T3> const & kernel);
}
void separableConvolveX(...)
Performs a 1 dimensional convolution in x direction.

show deprecated declarations

Usage:

#include <vigra/separableconvolution.hxx>
Namespace: vigra

...
// define Gaussian kernel with std. deviation 3.0
Kernel1D<double> kernel;
kernel.initGaussian(3.0);
// apply 1D filter along the x-axis

show deprecated examples

Preconditions:

  • The x-axis must be longer than the kernel radius: w > std::max(kernel.right(), -kernel.left()).
  • If border == BORDER_TREATMENT_CLIP: The sum of kernel elements must be != 0.

◆ separableConvolveY()

template<... >
void separableConvolveY (   ...)

Performs a 1 dimensional convolution in y direction.

It calls convolveLine() for every column of the image. See convolveLine() for more information about required interfaces and vigra_preconditions.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class T3>
void
Kernel1D<T3> const & kernel);
}
void separableConvolveY(...)
Performs a 1 dimensional convolution in y direction.

show deprecated declarations

Usage:

#include <vigra/separableconvolution.hxx>
Namespace: vigra

...
// define Gaussian kernel with std. deviation 3.0
Kernel1D kernel;
kernel.initGaussian(3.0);
// apply 1D filter along the y-axis

show deprecated examples

Preconditions:

  • The y-axis must be longer than the kernel radius: h > std::max(kernel.right(), -kernel.left()).
  • If border == BORDER_TREATMENT_CLIP: The sum of kernel elements must be != 0.

◆ upwindImage()

template<... >
void upwindImage (   ...)

This function calculates discrete upwinding scheme proposed by J. Weickert (2002) in Coherence-Enhancing Show Filters.

This function calculates of the coherence enhancing shock filter proposed by J. Weickert (2002) in Coherence-Enhancing Show Filters.

This function calculates of the coherence enhancing shock filter proposed by J. Weickert (2002): Coherence-Enhancing Show Filters. It uses the structure tensor information of an image and an iterative discrete upwinding scheme instead of pure dilation and erosion to perform the necessary morphological operations on the image.

An image is upwinded positively (dilation), if the given second src is positive. Otherwise it is upwinds negatively (eroded). The effect can be steered by an upwinding factor.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2
class T3, class S3>
void
}
void upwindImage(...)
This function calculates discrete upwinding scheme proposed by J. Weickert (2002) in Coherence-Enhanc...

show deprecated declarations

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
shockFilter(MultiArrayView<2, T1, S1> const & src,
float sigma, float rho, float upwind_factor_h,
unsigned int iterations);
}

show deprecated declarations

Usage:

#include <vigra/shockilter.hxx>
Namespace: vigra

unsigned int w=1000, h=1000;
...
// apply a shock-filter:
shockFilter(src, dest, 1.0, 5.0, 0.3, 5);

Preconditions:

The image must be larger than the window size of the filter.

◆ readSIF()

void readSIF ( const SIFImportInfo info,
MultiArrayView< 3, float array 
)

Read the image data specified by the given vigra::SIFImportInfo object and write them into the given 'array'.

The array must have the correct number of dimensions and shape for the dataset represented by 'info'.

Declaration:

namespace vigra {
void
}
Extracts image properties from an Andor SIF file header.
Definition sifImport.hxx:88
void readSIF(const SIFImportInfo &info, MultiArrayView< 3, float > array)
Read the image data specified by the given vigra::SIFImportInfo object and write them into the given ...

Usage:

#include <vigra/sifImport.hxx>
Namespace: vigra

SIFImportInfo info(filename);
// create a 3D array of appropriate size
MultiArray<3, float> in(Shape(info.width(), info.height(), info.stacksize()));

◆ readSIFBlock()

void readSIFBlock ( const SIFImportInfo info,
Shape3  offset,
Shape3  shape,
MultiArrayView< 3, float array 
)

Read parts of the image data from an Andor SIF file specified with an SIFImportInfo object and write them into the MultiArray array.

SIFImportInfo info(filename);
// create a 3D array of appropriate size
MultiArray<3, float> in(Shape3(info.width(), info.height(), 1));
readBlock(info, Shape3(0,0,0), Shape3(w,h,1), im); // read the first frame only

◆ operator<<()

std::ostream & operator<< ( std::ostream &  os,
const SIFImportInfo info 
)

Output all information such as shutter, Temperature etc. as human readable output.

Usage:

#include <vigra/sifImport.hxx>
Namespace: vigra

SIFImportInfo info(filename);
std::cout << info << std::endl; // print infos to the console

◆ skeletonizeImage()

template<... >
void skeletonizeImage (   ...)

Skeletonization of all regions in a labeled 2D image.

Declarations:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
SkeletonOptions const & options = SkeletonOptions());
}
void skeletonizeImage(...)
Skeletonization of all regions in a labeled 2D image.
Option object for skeletonizeImage()
Definition skeleton.hxx:258

This function computes the skeleton for each region in the 2D label image labels and paints the results into the result image dest. Input label 0 is interpreted as background and always ignored. Skeletons will be marked with the same label as the corresponding region (unless options returnLength() or returnSalience() are selected, see below). Non-skeleton pixels will receive label 0.

For each region, the algorithm proceeds in the following steps:

  1. Compute the boundaryVectorDistance() relative to the OuterBoundary of the region.
  2. Mark the raw skeleton: find 4-adjacent pixel pairs whose nearest boundary points are neither equal nor adjacent and mark one pixel of the pair as a skeleton candidate. The resulting raw skeleton is 8-connected and thin. Skip the remaining steps when option dontPrune() is selected.
  3. Compute the eccentricity transform of the raw skeleton and turn the skeleton into a tree whose root is the eccentricity center. When option pruneCenterLine() is selected, delete all skeleton points that do not belong to the two longest tree branches and skip the remaining steps.
  4. For each pixel on the skeleton, compute its length attribute as the depth of the pixel's longest subtree. Compute its salience attribute as the ratio between length and distance, where distance is the pixel's distance to the nearest boundary point according to the distance transform. It holds that length >= 0.5 and salience >= 1.0.
  5. Detect skeleton branching points and define skeleton segments as maximal connected pieces without branching points.
  6. Compute length and salience of each segment as the maximum of these attributes among the pixels in the segment. When options returnLength() or returnSalience() are selected, skip the remaining steps and return the requested segment attribute in dest. In this case, dest's value_type should be a floating point type to exactly accomodate the attribute values.
  7. Detect minimal cycles in the raw skeleton that enclose holes in the region (if any) and mark the corresponding pixels as critical for skeleton topology.
  8. Prune skeleton segments according to the selected pruning strategy and return the result. The following pruning strategies are available:
    • pruneLength(threshold, preserve_topology): Retain only segments whose length attribute exceeds the given threshold. When preserve_topology is true (the defult), cycles around holes are preserved regardless of their length. Otherwise, they are pruned as well.
    • pruneLengthRelative(threshold, preserve_topology): Like pruneLength(), but the threshold is specified as a fraction of the maximum segment length in the present region.
    • pruneSalience(threshold, preserve_topology): Retain only segments whose salience attribute exceeds the given threshold. When preserve_topology is true (the defult), cycles around holes are preserved regardless of their salience. Otherwise, they are pruned as well.
    • pruneSalienceRelative(threshold, preserve_topology): Like pruneSalience(), but the threshold is specified as a fraction of the maximum segment salience in the present region.
    • pruneTopology(preserve_center): Retain only segments that are essential for the region's topology. If preserve_center is true (the default), the eccentricity center is also preserved, even if it is not essential. Otherwise, it might be removed. The eccentricity center is always the only remaining point when the region has no holes.

The skeleton has the following properties:

  • It is 8-connected and thin (except when two independent branches happen to run alongside before they divert). Skeleton points are defined by rounding the exact Euclidean skeleton locations to the nearest pixel.
  • Skeleton branches terminate either at the region boundary or at a cycle. There are no branch end points in the region interior.
  • The salience threshold acts as a scale parameter: Large thresholds only retain skeleton branches characterizing the general region shape. When the threshold gets smaller, ever more detailed boundary bulges will be represented by a skeleton branch.

Remark: If you have an application where a skeleton graph would be more useful than a skeleton image, function skeletonizeImage() can be changed/extended easily.

Usage:

#include <vigra/skeleton.hxx>
Namespace: vigra

Shape2 shape(width, height);
MultiArray<2, UInt32> source(shape);
...
// Skeletonize and keep only those segments that are at least 10% of the maximum
// length (the maximum length is half the skeleton diameter).
skeletonizeImage(source, dest,
SkeletonOptions().pruneLengthRelative(0.1));
See also
vigra::boundaryVectorDistance()

◆ slantedEdgeMTF()

template<... >
void slantedEdgeMTF (   ...)

Determine the magnitude transfer function of the camera.

This operator estimates the magnitude transfer function (MTF) of a camera by means of the slanted edge method described in:

ISO Standard No. 12233: "Photography - Electronic still picture cameras - Resolution measurements", 2000

The input must be an image that contains a single step edge with bright pixels on one side and dark pixels on the other. However, the intensity values must be neither saturated nor zero. The algorithms computes the MTF from the Fourier transform of the edge's derivative. Thus, if the actual MTF is anisotropic, the estimated MTF does actually only apply in the direction perpendicular to the edge - several edges at different orientations are required to estimate an anisotropic MTF.

The algorithm returns a sequence of frequency / attenuation pairs. The frequency axis is normalized so that the Nyquist frequency of the original image is 0.5. Since the edge's derivative is computed with subpixel accuracy, the attenuation can usually be computed for frequencies significantly above the Nyquist frequency as well. The MTF estimate ends at either the first zero crossing of the MTF or at frequency 1, whichever comes earlier.

The present implementation improves the original slanted edge algorithm according to ISO 12233 in a number of ways:

  • The edge is not required to run nearly vertically or horizontally (i.e. with a slant of approximately 5 degrees). The algorithm will automatically compute the edge's actual angle and adjust estimates accordingly. However, it is still necessary for the edge to be somewhat slanted, because subpixel-accurate estimation of the derivative is impossible otherwise (i.e. the edge position perpendicular to the edge direction must differ by at least 1 pixel between the two ends of the edge).

  • Our implementation uses a more accurate subpixel derivative algorithm. In addition, we first perform a shading correction in order to reduce possible derivative bias due to nonuniform illumination.

  • If the input image is large enough (i.e. there are at least 20 pixels on either side of the edge over the edge's entire length), our algorithm attempts to subtract the estimated noise power spectrum from the estimated MTF.

The source value type T1 must be a scalar type which is convertible to double. The result is written into the result sequence, which must be back-insertable (supports push_back()) and whose value_type must be constructible from two double values. Algorithm options can be set via the options object (see vigra::NoiseNormalizationOptions for details).

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1, class BackInsertable>
void
}
Pass options to one of the slantedEdgeMTF() functions.
Definition slanted_edge_mtf.hxx:96
void slantedEdgeMTF(...)
Determine the magnitude transfer function of the camera.

show deprecated declarations

Usage:

#include <vigra/slanted_edge_mtf.hxx>
Namespace: vigra

std::vector<vigra::TinyVector<double, 2> > mtf;
...
// keep all options at their default values
slantedEdgeMTF(src, mtf);
// print the frequency / attenuation pairs found
for(int k=0; k<result.size(); ++k)
std::cout << "frequency: " << mtf[k][0] << ", estimated attenuation: " << mtf[k][1] << std::endl;

show deprecated examples

◆ mtfFitGaussian()

template<class Vector >
double mtfFitGaussian ( Vector const mtf)

Fit a Gaussian function to a given MTF.

This function expects a sequence of frequency / attenuation pairs as produced by slantedEdgeMTF() and finds the best fitting Gaussian point spread function (Gaussian functions are good approximations of the PSF of many real cameras). It returns the standard deviation (scale) of this function. The algorithm computes the standard deviation by means of a linear least square on the logarithm of the MTF, i.e. an algebraic fit rather than a Euclidean fit - thus, the resulting Gaussian may not be the one that intuitively fits the data optimally.

Declaration:

namespace vigra {
template <class Vector>
double mtfFitGaussian(Vector const & mtf);
}
double mtfFitGaussian(Vector const &mtf)
Fit a Gaussian function to a given MTF.
Definition slanted_edge_mtf.hxx:708

Usage:

#include <vigra/slanted_edge_mtf.hxx>
Namespace: vigra

std::vector<vigra::TinyVector<double, 2> > mtf;
...
slantedEdgeMTF(src, mtf);
double scale = vigra::mtfFitGaussian(mtf)
std::cout << "The camera PSF is approximately a Gaussian at scale " << scale << std::endl;

Required Interface:

Vector mtf;
double frequency = mtf[0][0];
double attenuation = mtf[0][1];

◆ generateSlicSeeds()

template<... >
unsigned int generateSlicSeeds (   ...)

Generate seeds for SLIC superpixel computation in arbitrary dimensions.

The source array src must be a scalar boundary indicator such as the gradient magnitude. Seeds are initially placed on a regular Cartesian grid with spacing seedDist und then moved to the point with smallest boundary indicator within a search region of radius searchRadius around the initial position. The resulting points are then marked in the output array seeds by consecutive labels.

The function returns the number of selected seeds, which equals the largest seed label because labeling starts at 1.

Declaration:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T, class S1,
class Label, class S2>
unsigned int
unsigned int seedDist,
unsigned int searchRadius = 1);
}
unsigned int generateSlicSeeds(...)
Generate seeds for SLIC superpixel computation in arbitrary dimensions.

Usage:

#include <vigra/slic.hxx>
Namespace: vigra

... // fill src image
// transform image to Lab color space
transformImage(srcImageRange(src), destImage(src), RGBPrime2LabFunctor<float>());
// compute image gradient magnitude at scale 1.0 as a boundary indicator
MultiArray<2, float> grad(src.shape());
gaussianGradientMagnitude(srcImageRange(src), destImage(grad), 1.0);
int seedDistance = 15;
// place seeds on a grid with distance 15, but then move it to the lowest gradient
// poistion in a 3x3 window

For more details and examples see slicSuperpixels().

◆ slicSuperpixels()

template<... >
unsigned int slicSuperpixels (   ...)

Compute SLIC superpixels in arbitrary dimensions.

This function implements the algorithm described in

R. Achanta et al.: "SLIC Superpixels Compared to State-of-the-Art Superpixel Methods", IEEE Trans. Patt. Analysis Mach. Intell. 34(11):2274-2281, 2012

The value type T of the source array src must provide the necessary functionality to compute averages and squared distances (i.e. it must fulfill the requirements of a LinearSpace and support squaredNorm(T const &)). This is true for all scalar types as well as vigra::TinyVector and vigra::RGBValue. The output array labels will be filled with labels designating membership of each point in one of the superpixel regions.

The output array can optionally contain seeds (which will be overwritten by the output) to give you full control over seed placement. If labels is empty, seeds will be created automatically by an internal call to generateSlicSeeds().

The parameter seedDistance specifies the radius of the window around each seed (or, more precisely, around the present regions centers) where the algorithm looks for potential members of the corresponding superpixel. It thus places an upper limit on the superpixel size. When seeds are computed automatically, this parameter also determines the grid spacing for seed placement.

The parameter intensityScaling is used to normalize (i.e. divide) the color/intensity difference before it is compared with the spatial distance. This corresponds to parameter m in equation (2) of the paper.

The options object can be used to specify the number of iterations (SlicOptions::iterations()) and an explicit minimal superpixel size (SlicOptions::minSize()). By default, the algorithm merges all regions that are smaller than 1/4 of the average superpixel size.

The function returns the number of superpixels, which equals the largest label because labeling starts at 1.

Declaration:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T, class S1,
class Label, class S2,
class DistanceType>
unsigned int
DistanceType intensityScaling,
unsigned int seedDistance,
SlicOptions const & options = SlicOptions());
}
unsigned int slicSuperpixels(...)
Compute SLIC superpixels in arbitrary dimensions.
Options object for slicSuperpixels().
Definition slic.hxx:158

Usage:

#include <vigra/slic.hxx>
Namespace: vigra

... // fill src image
// transform image to Lab color space
transformMultiArray(srcMultiArrayRange(src), destMultiArray(src), RGBPrime2LabFunctor<float>());
int seedDistance = 15;
double intensityScaling = 20.0;
// compute seeds automatically, perform 40 iterations, and scale intensity differences
// down to 1/20 before comparing with spatial distances

This works for arbitrary-dimensional arrays.

◆ frostFilter()

template<... >
void frostFilter (   ...)

This function tries to reduce the speckle noise of an image by applying the basic Frost filter.

This function tries to reduce the speckle noise of an image by means of applying the basic Frost filter using a window of given size and a damping factor k. The implementation is according to the article by Lopez & Touzi & Nezry (1990): Adaptive speckle filters and scene heterogenity.

The user has to provide a window size and a damping factor k. The implementation is according to the article by
Lopez & Touzi & Nezry (1990): Adaptive speckle filters and scene heterogenity.

All restrictions of the called functions applyWindowFunction apply.

Preconditions:

0.0 < k <= 1.0

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
BorderTreatmentMode border = BORDER_TREATMENT_REPEAT);
}
void frostFilter(...)
This function tries to reduce the speckle noise of an image by applying the basic Frost filter.

show deprecated declarations

Usage:

#include <vigra/specklefilters.hxx>
Namespace: vigra

unsigned int w=1000, h=1000;
...
// apply a (basic) frost filter with a window size of 5x5 and a damping factor of 0.5
frostFilter(src, dest, Diff2D(5,5), 0.5);

◆ normalizedConvolveImage()

template<... >
void normalizedConvolveImage (   ...)

Performs a 2-dimensional normalized convolution, i.e. convolution with a mask image.

This functions computes normalized convolution as defined in Knutsson, H. and Westin, C-F.: Normalized and differential convolution: Methods for Interpolation and Filtering of incomplete and uncertain data. Proc. of the IEEE Conf. on Computer Vision and Pattern Recognition, 1993, 515-523.

The mask image must be binary and encodes which pixels of the original image are valid. It is used as follows: Only pixel under the mask are used in the calculations. Whenever a part of the kernel lies outside the mask, it is ignored, and the kernel is renormalized to its original norm (analogous to the CLIP BorderTreatmentMode). Thus, a useful convolution result is computed whenever at least one valid pixel is within the current window Thus, destination pixels not under the mask still receive a value if they are near the mask. Therefore, this algorithm is useful as an interpolator of sparse input data. If you are only interested in the destination values under the mask, you can perform a subsequent copyImageIf().

The KernelIterator must point to the center of the kernel, and the kernel's size is given by its upper left (x and y of distance <= 0) and lower right (distance >= 0) corners. The image must always be larger than the kernel. At those positions where the kernel does not completely fit into the image, the specified BorderTreatmentMode is applied. Only BORDER_TREATMENT_CLIP and BORDER_TREATMENT_AVOID are currently supported.

The images's pixel type (SrcAccessor::value_type) must be a linear space over the kernel's value_type (KernelAccessor::value_type), i.e. addition of source values, multiplication with kernel values, and NumericTraits must be defined. The kernel's value_type must be an algebraic field, i.e. the arithmetic operations (+, -, *, /) and NumericTraits must be defined.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class TM, class SM,
class T3>
void
Kernel2D<T3> const & kernel);
}
void normalizedConvolveImage(...)
Performs a 2-dimensional normalized convolution, i.e. convolution with a mask image.

show deprecated declarations

Usage:

#include <vigra/stdconvolution.hxx>
Namespace: vigra

...
// define 3x3 binomial filter
vigra::Kernel2D<float> binom;
binom.initExplicitly(Diff2D(-1,-1), Diff2D(1,1)) = // upper left and lower right
0.0625, 0.125, 0.0625,
0.125, 0.25, 0.125,
0.0625, 0.125, 0.0625;

show deprecated examples

Preconditions:

  • The image must be longer than the kernel radius: w > std::max(kernel.lowerRight().x, -kernel.upperLeft().x) and h > std::max(kernel.lowerRight().y, -kernel.upperLeft().y).
  • The sum of kernel elements must be != 0.
  • border == BORDER_TREATMENT_CLIP || border == BORDER_TREATMENT_AVOID

◆ convolveImageWithMask()

template<... >
void convolveImageWithMask (   ...)

Deprecated name of 2-dimensional normalized convolution, i.e. convolution with a mask image.

See normalizedConvolveImage() for documentation.

Declarations:

pass 2D array views:

namespace vigra {
template <class SrcIterator, class SrcAccessor,
class MaskIterator, class MaskAccessor,
class DestIterator, class DestAccessor,
void
Diff2D kul, Diff2D klr, BorderTreatmentMode border);
}
void convolveImageWithMask(...)
Deprecated name of 2-dimensional normalized convolution, i.e. convolution with a mask image.

show deprecated declarations

◆ radialSymmetryTransform()

template<... >
void radialSymmetryTransform (   ...)

Find centers of radial symmetry in an image.

This algorithm implements the Fast Radial Symmetry Transform according to [G. Loy, A. Zelinsky: "A Fast Radial Symmetry Transform for Detecting Points of Interest", in: A. Heyden et al. (Eds.): Proc. of 7th European Conf. on Computer Vision, Part 1, pp. 358-368, Springer LNCS 2350, 2002]. Minima of the algorithm response mark dark blobs, maxima correspond to light blobs. The "radial strictness parameter" is fixed at alpha = 2.0, the spatial spreading of the raw response is done by a Gaussian convolution at 0.25*scale (these values are recommendations from the paper). Loy and Zelinsky additionally propose to add the operator response from several scales (see usage example below).

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
double scale);
}
void radialSymmetryTransform(...)
Find centers of radial symmetry in an image.

show deprecated declarations

Usage:

#include <vigra/symmetry.hxx>
Namespace: vigra

// use edge detection filters at various scales
for(double scale = 2.0; scale <= 8.0; scale *= 2.0)
{
// find centers of symmetry
}
// mark centers of symmetry
centers.init(128);
localMinima(symmetry, centers, 0);
localMaxima(symmetry, centers, 255);

show deprecated examples

◆ vectorToTensor()

template<... >
void vectorToTensor (   ...)

Calculate the tensor (outer) product of a 2D vector with itself.

This function is useful to transform vector images into a tensor representation that can be used as input to tensor based processing and analysis functions (e.g. tensor smoothing). The input pixel type must be vectors of length 2, whereas the output must contain vectors of length 3 which will represent the tensor components in the order t11, t12 (== t21 due to symmetry), t22.

Note: In order to account for the left-handedness of the image coordinate system, the second tensor component (t12) can be negated by setting negateComponent2 = false. Angles will then be interpreted counter-clockwise rather than clockwise. By default, this behavior is switched off.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
bool negateComponent2 = false);
}

show deprecated declarations

Usage:

#include <vigra/tensorutilities.hxx>
Namespace: vigra

...
gaussianGradient(img, gradient, 2.0);

show deprecated examples

◆ tensorEigenRepresentation()

template<... >
void tensorEigenRepresentation (   ...)

Calculate eigen representation of a symmetric 2x2 tensor.

This function turns a 3-band image representing the tensor components t11, t12 (== t21 due to symmetry), t22 into the a 3-band image holding the eigen representation e1, e2, and angle, where e1 > e2. When the tensor is defined in a left-handed coordinate system (the default on images), the angle will then be given in clockwise orientation, starting at the x-axis. Otherwise, it will be given in counter-clockwise orientation.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void tensorEigenRepresentation(...)
Calculate eigen representation of a symmetric 2x2 tensor.

show deprecated declarations

Usage:

#include <vigra/tensorutilities.hxx>
Namespace: vigra

show deprecated examples

◆ tensorTrace()

template<... >
void tensorTrace (   ...)

Calculate the trace of a 2x2 tensor.

This function turns a 3-band image representing the tensor components t11, t12 (== t21 due to symmetry), t22 into the a 1-band image holding the tensor trace t11 + t22.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2>
void
}
void tensorTrace(...)
Calculate the trace of a 2x2 tensor.

show deprecated declarations

Usage:

#include <vigra/tensorutilities.hxx>
Namespace: vigra

show deprecated examples

◆ tensorToEdgeCorner()

template<... >
void tensorToEdgeCorner (   ...)

Decompose a symmetric 2x2 tensor into its edge and corner parts.

This function turns a 3-band image representing the tensor components t11, t12 (== t21 due to symmetry), t22 into the a 2-band image holding the tensor's edgeness (difference of the tensor's eigenvalues) and orientation, and a 1-band image representing its corner part (equal to the twice the small eigen value). The original tensor must be positive definite and defined in a right-handed coordinate system (e.g. the tensor resulting from boundaryTensor()).

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T21, class S21,
class T22, class S22>
void
}
void tensorToEdgeCorner(...)
Decompose a symmetric 2x2 tensor into its edge and corner parts.

show deprecated declarations

Usage:

#include <vigra/tensorutilities.hxx>
Namespace: vigra

show deprecated examples

◆ parallel_foreach()

template<... >
void parallel_foreach (   ...)

Apply a functor to all items in a range in parallel.

Declarations:

namespace vigra {
// pass the desired number of threads or ParallelOptions::Auto
// (creates an internal thread pool accordingly)
template<class ITER, class F>
void parallel_foreach(int64_t nThreads,
ITER begin, ITER end,
F && f,
const uint64_t nItems = 0);
// use an existing thread pool
template<class ITER, class F>
ITER begin, ITER end,
F && f,
const uint64_t nItems = 0);
// pass the integers from 0 ... (nItems-1) to the functor f,
// using the given number of threads or ParallelOptions::Auto
template<class F>
void parallel_foreach(int64_t nThreads,
F && f);
// likewise with an existing thread pool
template<class F>
F && f);
}
Thread pool class to manage a set of parallel workers.
Definition threadpool.hxx:148
void parallel_foreach(...)
Apply a functor to all items in a range in parallel.

Create a thread pool (or use an existing one) to apply the functor

  • f to all items in the range [begin, end) in parallel.
  • f must be callable with two arguments of type size_t and T, where the first argument is the thread index (starting at 0) and T is convertible from the iterator's reference_type (i.e. the result of *begin).

If the iterators are forward iterators (std::forward_iterator_tag), you can provide the optional argument nItems to avoid the a std::distance(begin, end) call to compute the range's length.

Parameter nThreads controls the number of threads. parallel_foreach will split the work into about three times as many parallel tasks. If nThreads = ParallelOptions::Auto, the number of threads is set to the machine default (std::thread::hardware_concurrency()).

If nThreads = 0, the function will not use threads, but will call the functor sequentially. This can also be enforced by setting the preprocessor flag VIGRA_SINGLE_THREADED, ignoring the value of nThreads (useful for debugging).

Usage:

#include <iostream>
#include <algorithm>
#include <vector>
#include <vigra/threadpool.hxx>
using namespace std;
using namespace vigra;
int main()
{
size_t const n_threads = 4;
size_t const n = 2000;
auto iter = input.begin(),
end = input.end();
// fill input with 0, 1, 2, ...
iota(iter, end, 0);
// compute the sum of the elements in the input vector.
// (each thread computes the partial sum of the items it sees
// and stores the sum at the appropriate index of 'results')
vector<int> results(n_threads, 0);
parallel_foreach(n_threads, iter, end,
// the functor to be executed, defined as a lambda function
// (first argument: thread ID, second argument: result of *iter)
[&results](size_t thread_id, int items)
{
}
);
// collect the partial sums of all threads
cout << "The sum " << sum << " should be equal to " << (n*(n-1))/2 << endl;
}
NumericTraits< V >::Promote sum(TinyVectorBase< V, SIZE, D1, D2 > const &l)
sum of the vector's elements
Definition tinyvector.hxx:2073

◆ importTiffImage()

template<... >
void importTiffImage (   ...)

Read a given TIFF image.

This function calls tiffToScalarImage() or tiffToRGBImage(), depending on the destinations's value_type. Usually, it is better to use importImage(). importTiffImage() should only be used if explicit access to the TIFF object TiffImage is required.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S>
void
}
void importTiffImage(...)
Read a given TIFF image.

show deprecated declarations

Usage:

#include <vigra/tiff.hxx>
Namespace: vigra

Required Interface:

see tiffToScalarImage() and tiffToRGBImage()

Preconditions:

see tiffToScalarImage() and tiffToRGBImage()

◆ tiffToScalarImage()

template<... >
void tiffToScalarImage (   ...)

Convert single-band TiffImage to scalar image.

Note that unexpected results can occur when the destination pixel type is weaker than the pixel type in the file (e.g. when a float file is imported into a unsigned char image).

Declarations:

pass 2D array views:

namespace vigra {
template <class ImageIterator, class Accessor>
void
tiffToScalarImage(TiffImage * tiff, ImageIterator iter, Accessor a)
}
void tiffToScalarImage(...)
Convert single-band TiffImage to scalar image.

show deprecated declarations

Usage:

#include <vigra/tiff.hxx>
Namespace: vigra

TiffImage * tiff = TIFFOpen("tiffimage.tiff", "r");
{
// not a scalar image - handle error
}
MultiArray<2, unsigned char> img(w,h);
tiffToScalarImage(tiff, img);
TIFFClose(tiff);

show deprecated examples

Preconditions:

The output array must have the correct shape.

◆ tiffToRGBImage()

template<... >
void tiffToRGBImage (   ...)

Import a RGB (3-band or color-mapped) TiffImage into a RGB image.

Note that unexpected results can occur when the destination pixel type is weaker than the pixel type in the file (e.g. when a float file is imported into a unsigned char image).

Declarations:

pass 2D array views:

namespace vigra {
template <class RGBImageIterator, class RGBAccessor>
void
}
Definition rgbvalue.hxx:987
void tiffToRGBImage(...)
Import a RGB (3-band or color-mapped) TiffImage into a RGB image.

show deprecated declarations

Usage:

#include <vigra/tiff.hxx>
Namespace: vigra

TiffImage * tiff = TIFFOpen("tiffimage.tiff", "r");
{
// not an RGB image - handle error
}
MultiArray<2, RGBValue<unsigned char> > img(w, h);
tiffToRGBImage(tiff, img);
TIFFClose(tiff);

show deprecated examples

Preconditions:

The destination image must have the appropriate size.

◆ createTiffImage()

template<... >
void createTiffImage (   ...)

Create a TiffImage from the given iterator range.

Type and size of the TiffImage are determined by the input image. Currently, the function can create scalar images and RGB images of type unsigned char, short, int, float, and double.

Usually, it is better to use exportImage(). createTiffImage() should only be used if explicit access to the TIFF object TiffImage is required.

Declarations:

pass 2D array views:

namespace vigra {
template <class T, class S>
void
}
void createTiffImage(...)
Create a TiffImage from the given iterator range.

show deprecated declarations

Usage:

#include <vigra/tiff.hxx>
Namespace: vigra

MultiArray<2, float> img(width, height);
...
TiffImage * tiff = TIFFOpen(("tiffimage.tiff", "w");
TIFFClose(tiff); // implicitly writes the image to the disk

show deprecated examples

◆ createScalarTiffImage()

template<... >
void createScalarTiffImage (   ...)

Create a single-band TiffImage from the given scalar image.

Type and size of the TiffImage are determined by the input image (may be one of unsigned char, short, int, float, or double).

Declarations:

pass 2D array views:

namespace vigra {
template <class ImageIterator, class Accessor>
TiffImage *
Accessor a)
}
void createScalarTiffImage(...)
Create a single-band TiffImage from the given scalar image.

show deprecated declarations

Usage:

#include <vigra/tiff.hxx>
Namespace: vigra

MultiArray<2, float> img(width, height);
...
TiffImage * tiff = TIFFOpen(("tiffimage.tiff", "w");
TIFFClose(tiff); // implicitly writes the image to the disk

show deprecated examples

◆ createRGBTiffImage()

template<... >
void createRGBTiffImage (   ...)

Create a 3-band TiffImage from the given RGB image.

Type and size of the TiffImage are determined by the input image (may be one of unsigned char, int, float, or double).

Declarations:

pass 2D array views:

namespace vigra {
template <class RGBImageIterator, class RGBAccessor>
TiffImage *
}
void createRGBTiffImage(...)
Create a 3-band TiffImage from the given RGB image.

show deprecated declarations

Usage:

#include <vigra/tiff.hxx>
Namespace: vigra

...
TiffImage * tiff = TIFFOpen(("tiffimage.tiff", "w");
TIFFClose(tiff); // implicitly writes the image to the disk

show deprecated examples

◆ operator-() [5/5]

template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > operator- ( TinyVectorBase< V, SIZE, D1, D2 > const v)

Unary negation (construct TinyVector with negative values)

◆ ceil() [2/2]

template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > ceil ( TinyVectorBase< V, SIZE, D1, D2 > const v)

Apply ceil() function to each vector component.

◆ floor() [2/2]

template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > floor ( TinyVectorBase< V, SIZE, D1, D2 > const v)

Apply floor() function to each vector component.

◆ round() [2/2]

template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > round ( TinyVectorBase< V, SIZE, D1, D2 > const v)

Apply round() function to each vector component.

◆ roundi() [2/2]

template<class V , int SIZE, class D1 , class D2 >
TinyVector< std::ptrdiff_t, SIZE > roundi ( TinyVectorBase< V, SIZE, D1, D2 > const v)

Apply roundi() function to each vector component, i.e. return an integer vector.

◆ sqrt()

template<class V , int SIZE, class D1 , class D2 >
TinyVector< V, SIZE > sqrt ( TinyVectorBase< V, SIZE, D1, D2 > const v)

Apply sqrt() function to each vector component.

◆ pow() [2/2]

template<class V , int SIZE, class D1 , class D2 , class E >
TinyVector< V, SIZE > pow ( TinyVectorBase< V, SIZE, D1, D2 > const v,
E  exponent 
)

Apply pow() function to each vector component.

◆ transpose()

template<class V , int SIZE, class T >
TinyVector< V, SIZE > transpose ( TinyVector< V, SIZE > const t,
TinyVector< T, SIZE > const permutation 
)

transposed copy

Elements are arranged such that res[k] = t[permutation[k]].

◆ clipLower() [1/2]

template<class V , int SIZE>
TinyVector< V, SIZE > clipLower ( TinyVector< V, SIZE > const t)

Clip negative values.

All elements smaller than 0 are set to zero.

◆ clipLower() [2/2]

template<class V , int SIZE>
TinyVector< V, SIZE > clipLower ( TinyVector< V, SIZE > const t,
const val 
)

Clip values below a threshold.

All elements smaller than val are set to val.

◆ clipUpper()

template<class V , int SIZE>
TinyVector< V, SIZE > clipUpper ( TinyVector< V, SIZE > const t,
const val 
)

Clip values above a threshold.

All elements bigger than val are set to val.

◆ clip() [1/2]

template<class V , int SIZE>
TinyVector< V, SIZE > clip ( TinyVector< V, SIZE > const t,
const valLower,
const valUpper 
)

Clip values to an interval.

All elements less than valLower are set to valLower, all elements bigger than valUpper are set to valUpper.

◆ clip() [2/2]

template<class V , int SIZE>
TinyVector< V, SIZE > clip ( TinyVector< V, SIZE > const t,
TinyVector< V, SIZE > const valLower,
TinyVector< V, SIZE > const valUpper 
)

Clip values to a vector of intervals.

All elements less than valLower are set to valLower, all elements bigger than valUpper are set to valUpper.

◆ linearIntensityTransform()

LinearIntensityTransform< DestValueType, Multiplier > linearIntensityTransform ( Multiplier  scale,
DestValueType  offset 
)

Apply a linear transform to the source pixel values.

Factory function for a functor that linearly transforms the source pixel values. The functor applies the transform 'destvalue = scale * (srcvalue + offset)' to every pixel. This can, for example, be used to transform images into the visible range 0...255 or to invert an image.

If you leave out the second parameter / offset, you will get an optimized version of the functor which only scales by the given factor, however you have to make the template parameter (pixel type) explicit then.

Traits defined:

FunctorTraits::isUnaryFunctor is true (VigraTrueType)

Declaration:

namespace vigra {
template <class Multiplier, class DestValueType>
template <class DestValueType, class Multiplier>
}
LinearIntensityTransform< DestValueType, Multiplier > linearIntensityTransform(Multiplier scale, DestValueType offset)
Apply a linear transform to the source pixel values.
Definition transformimage.hxx:800

Usage:

#include <vigra/transformimage.hxx>
Namespace: vigra

vigra::IImage src(width, height);
vigra::BImage dest(width, height);
...
vigra::FindMinMax<IImage::PixelType> minmax; // functor to find range
vigra::inspectImage(srcImageRange(src), minmax); // find original range
// transform to range 0...255
vigra::transformImage(srcImageRange(src), destImage(dest),
255.0 / (minmax.max - minmax.min), // scaling
- minmax.min)); // offset

The one-parameter version can be used like this:

// scale from 0..255 to 0..1.0
vigra::transformImage(srcImageRange(src), destImage(dest),

Required Interface:

The source and destination value types must be models of LinearSpace in both cases.

◆ linearRangeMapping()

LinearIntensityTransform< DestValueType, typename NumericTraits< DestValueType >::RealPromote > linearRangeMapping ( SrcValueType  src_min,
SrcValueType  src_max,
DestValueType  dest_min,
DestValueType  dest_max 
)

Map a source intensity range linearly to a destination range.

Factory function for a functor that linearly transforms the source pixel values. The functor applies the transform 'destvalue = scale * (srcvalue + offset)' to every pixel, where scale = (dest_max - dest_min) / (src_max - src_min) and offset = dest_min / scale - src_min. As a result, the pixel values src_max, src_min in the source image are mapped onto dest_max, dest_min respectively. This works for scalar as well as vector pixel types. Instead of src_min and src_max, you may also pass a functor FindMinMax.

Declaration:

namespace vigra {
template <class SrcValueType, class DestValueType>
template <class SrcValueType, class DestValueType>
}
LinearIntensityTransform< DestValueType, typename NumericTraits< DestValueType >::RealPromote > linearRangeMapping(SrcValueType src_min, SrcValueType src_max, DestValueType dest_min, DestValueType dest_max)
Map a source intensity range linearly to a destination range.
Definition transformimage.hxx:882

Usage:

#include <vigra/transformimage.hxx>
Namespace: vigra

vigra::IImage src(width, height);
vigra::BImage dest(width, height);
...
vigra::FindMinMax<IImage::PixelType> minmax; // functor to find range
vigra::inspectImage(srcImageRange(src), minmax); // find original range
// transform to range 0...255
vigra::transformImage(srcImageRange(src), destImage(dest),
minmax.min, minmax.max, // src range
0, 255) // dest range
);
// equivalent, but shorter
vigra::transformImage(srcImageRange(src), destImage(dest),
minmax, // src range
0, 255) // dest range
);

Required Interface:

The source and destination value types must be models of LinearSpace in both cases.

◆ totalVariationFilter()

template<... >
void totalVariationFilter (   ...)

Performs standard Total Variation Regularization.

The algorithm minimizes

\[
       \min_u \int_\Omega \frac{1}{2} (u-f)^2\;dx + \alpha TV(u)\qquad\qquad (1)
\]

where $ f=f(x)$ are the two dimensional noisy data, $ u=u(x)$ are the smoothed data, $ \alpha \ge 0 $ is the filter parameter and $ TV(u)$ is the total variation semi-norm.

Declarations:

namespace vigra {
template <class stride1,class stride2>
double alpha,
int steps,
double eps=0);
double alpha,
int steps,
double eps=0);
}
void totalVariationFilter(...)
Performs standard Total Variation Regularization.

totalVariationFilter() implements a primal-dual algorithm to solve (1).

Input:

data: input data to be smoothed.
alpha: smoothing parameter.
steps: maximal number of iteration steps.
eps: The algorithm stops, if the primal-dual gap is below the threshold eps.

Output:

out contains the filtered data.

In addition, a point-wise weight ( $ \ge 0 $) for the data term can be provided (overloaded function).

Usage:

#include <vigra/tv_filter.hxx>

MultiArray<2,double> data(Shape2(width,height)); // to be initialized
MultiArray<2,double> out(Shape2(width,height));
MultiArray<2,double> weight(Shape2(width,height))); //optional argument in overloaded function, to be initialized if used
int steps; // to be initialized
double alpha,eps; // to be initialized

or

◆ getAnisotropy()

template<... >
void getAnisotropy (   ...)

Sets up directional data for anisotropic regularization.

This routine provides a two-dimensional normalized vector field $ v $, which is normal to edges in the given data, found as the eigenvector of the structure tensor belonging to the largest eigenvalue. $ v $ is encoded by a scalar field $ \varphi $ of angles, i.e. $ v(x)=(\cos(\varphi(x)),\sin(\varphi(x)))^\top $.

In addition, two scalar fields $ \alpha $ and $ \beta $ are generated from scalar parameters $ \alpha_{par}$ and $ \beta_{par}$, such that

$ \alpha(x)= \alpha_{par}$ at edges,
$ \alpha(x)= \beta_{par}$ in homogeneous regions,
$ \beta(x)=\beta_{par}$ .

Declarations:

namespace vigra {
double alpha_par,
double beta_par,
double sigma_par,
double rho_par,
double K_par);
}
void getAnisotropy(...)
Sets up directional data for anisotropic regularization.

Output:

Three scalar fields phi, alpha and beta.

Input:

data:two-dimensional scalar field.
alpha_par,beta_par:two positive values for setting up the scalar fields alpha and beta
sigma_par:non-negative parameter for presmoothing the data.
rho_par:non-negative parameter for presmoothing the structure tensor.
K_par:positive edge sensitivity parameter.

(see anisotropicTotalVariationFilter() and secondOrderTotalVariationFilter() for usage in an application).

◆ anisotropicTotalVariationFilter()

template<... >
void anisotropicTotalVariationFilter (   ...)

Performs Anisotropic Total Variation Regularization.

The algorithm minimizes

\[
\min_u \int_\Omega \frac{1}{2} (u-f)^2 + \sqrt{\nabla u^\top A \nabla u}\;dx\qquad\qquad(2)
\]

where $ f=f(x)$ are the noisy data, $ u=u(x)$ are the smoothed data, $ \nabla u $ is the image gradient in the sense of Total Variation and $ A $ is a locally varying symmetric, positive definite 2x2 matrix.

Matrix $ A $ is described by providing for each data point a normalized eigenvector (via angle $ \phi $) and two eigenvalues $ \alpha>0 $ and $ \beta>0 $.

getAnisotropy() can be use to set up such data $ \phi,\alpha,\beta $ by providing a vector field normal to edges.

Declarations:

namespace vigra {
template <class stride1,class stride2,class stride3,class stride4,class stride5,class stride6>
int steps);
}
void anisotropicTotalVariationFilter(...)
Performs Anisotropic Total Variation Regularization.

anisotropicTotalVariationFilter() implements a primal-dual algorithm to solve (2).

Input:

data:input data to be filtered.
steps:iteration steps.
weight :a point-wise weight ( $ \ge 0 $ ) for the data term.
phi,alpha and beta :describe matrix $ A $, see above.

Output:

out :contains filtered data.

Usage:

E.g. with a solution-dependent adaptivity cf. [1], by updating the matrix $ A=A(u)$ in an outer loop:

#include <vigra/tv_filter.hxx>

MultiArray<2,double> data(Shape2(width,height)); //to be initialized
MultiArray<2,double> out (Shape2(width,height));
MultiArray<2,double> weight(Shape2(width,height)); //to be initialized
MultiArray<2,double> phi (Shape2(width,height));
MultiArray<2,double> alpha(Shape2(width,height));
MultiArray<2,double> beta (Shape2(width,height));
double alpha0,beta0,sigma,rho,K; //to be initialized
int outer_steps,inner_steps;//to be initialized
out=data; // data serves as initial value
for (int i=0;i<outer_steps;i++){
getAnisotropy(out,phi,alpha,beta,alpha0,beta0,sigma,rho,K); // sets phi, alpha, beta
}

[1] Frank Lenzen, Florian Becker, Jan Lellmann, Stefania Petra and Christoph Schnörr, A Class of Quasi-Variational Inequalities for Adaptive Image Denoising and Decomposition, Computational Optimization and Applications, Springer, 2012.

◆ secondOrderTotalVariationFilter()

template<... >
void secondOrderTotalVariationFilter (   ...)

Performs Anisotropic Total Variation Regularization.

The algorithm minimizes

\[
\min_u \int_\Omega \frac{1}{2} (u-f)^2 + \sqrt{\nabla u^\top A \nabla u}  + \gamma |Hu|_F\;dx \qquad\qquad (3)
\]

where $ f=f(x)$ are the noisy data, $ u=u(x)$ are the smoothed data, $ \nabla u $ is the image gradient in the sense of Total Variation, $ A $ is a locally varying symmetric, positive-definite 2x2 matrix and $ |Hu|_F $ is the Frobenius norm of the Hessian of $ u $.

Matrix $ A $ is described by providing for each data point a normalized eigenvector (via angle $ \phi $) and two eigenvalues $ \alpha>0 $ and $ \beta>0 $. getAnisotropy() can be use to set up such data $ \phi,\alpha, \beta $ by providing a vector field normal to edges.

$ \gamma>0 $ is the locally varying regularization parameter for second order.

Declarations:

secondOrderTotalVariationFilter() implements a primal-dual algorithm to solve (3).

Input:

data: the input data to be filtered.
steps : number of iteration steps.
out : contains the filtered data.
weight : point-wise weight ( $ \ge 0$ ) for the data term.
phi,alpha,beta: describe matrix $ A$, see above.
xedges and yedges : binary arrays indicating the presence of horizontal (between (x,y) and (x+1,y)) and vertical edges (between (x,y) and (x,y+1)). These data are considered in the calculation of $ Hu$, such that finite differences across edges are artificially set to zero to avoid second order smoothing over edges.

Usage:

E.g. with a solution-dependent adaptivity (cf.[1]), by updating the matrix $ A=A(u)$ in an outer loop:

#include <vigra/tv_filter.hxx>

MultiArray<2,double> data(Shape2(width,height)); //to be initialized
MultiArray<2,double> out(Shape2(width,height));
MultiArray<2,double> weight(Shape2(width,height))); //to be initialized
MultiArray<2,double> phi(Shape2(width,height);
MultiArray<2,double> alpha(Shape2(width,height);
MultiArray<2,double> beta(Shape2(width,height));
MultiArray<2,double> gamma(Shape2(width,height)); //to be initialized
MultiArray<2,double> xedges(Shape2(width,height)); //to be initialized
MultiArray<2,double> yedges(Shape2(width,height)); //to be initialized
double alpha0,beta0,sigma,rho,K; //to be initialized
int outer_steps,inner_steps;//to be initialized
out=data; // data serves as initial value
for (int i=0;i<outer_steps;i++){
getAnisotropy(out,phi,alpha,beta,alpha0,beta0,sigma,rho,K); // sets phi, alpha, beta
}

[1] Frank Lenzen, Florian Becker, Jan Lellmann, Stefania Petra and Christoph Schnörr, A Class of Quasi-Variational Inequalities for Adaptive Image Denoising and Decomposition, Computational Optimization and Applications, Springer, 2012.

◆ principalComponents()

template<class T , class C1 , class C2 , class C3 >
void principalComponents ( MultiArrayView< 2, T, C1 > const features,
MultiArrayView< 2, T, C2 fz,
MultiArrayView< 2, T, C3 zv 
)

Decompose a matrix according to the PCA algorithm.

This function implements the PCA algorithm (principal component analysis).

  • features must be a matrix with shape (numFeatures * numSamples), which is decomposed into the matrices
  • fz with shape (numFeatures * numComponents) and
  • zv with shape (numComponents * numSamples)

such that

\[
     \mathrm{features} \approx \mathrm{fz} * \mathrm{zv}
 \]

(this formula requires that the features have been centered around the mean by linalg::prepareRows&nbsp;(features, features, ZeroMean)).

The shape parameter numComponents determines the complexity of the decomposition model and therefore the approximation quality (if numComponents == numFeatures, the representation becomes exact). Intuitively, fz is a projection matrix from the reduced space into the original space, and zv is the reduced representation of the data, using just numComponents features.

Declaration:

#include <vigra/unsupervised_decomposition.hxx>

namespace vigra {
template <class U, class C1, class C2, class C3>
void
}
void principalComponents(MultiArrayView< 2, T, C1 > const &features, MultiArrayView< 2, T, C2 > fz, MultiArrayView< 2, T, C3 > zv)
Decompose a matrix according to the PCA algorithm.
Definition unsupervised_decomposition.hxx:120

Usage:

... // fill the input matrix
int numComponents = 3;
// center the data
prepareRows(data, data, ZeroMean);
// compute the reduced representation
Matrix<double> model = fz*zv;
double meanSquaredError = squaredNorm(data - model) / numSamples;

◆ pLSA()

template<... >
void pLSA (   ...)

Decompose a matrix according to the pLSA algorithm.

This function implements the pLSA algorithm (probabilistic latent semantic analysis) proposed in

T. Hofmann: "Probabilistic Latent Semantic Analysis", in: UAI'99, Proc. 15th Conf. on Uncertainty in Artificial Intelligence, pp. 289-296, Morgan Kaufmann, 1999

  • features must be a matrix with shape (numFeatures * numSamples) and non-negative entries, which is decomposed into the matrices
  • fz with shape (numFeatures * numComponents) and
  • zv with shape (numComponents * numSamples)

such that

\[
     \mathrm{features} \approx \mathrm{fz} * \mathrm{zv}
 \]

(this formula applies when pLSA is called with PLSAOptions.normalizedComponentWeights(false). Otherwise, you must normalize the features by calling linalg::prepareColumns&nbsp;(features, features, UnitSum) to make the formula hold).

The shape parameter numComponents determines the complexity of the decomposition model and therefore the approximation quality. Intuitively, features are a set of words, and the samples a set of documents. The entries of the features matrix denote the relative frequency of the words in each document. The components represents a (presumably small) set of topics. The matrix fz encodes the relative frequency of words in the different topics, and the matrix zv encodes to what extend each topic explains the content of each document.

The option object determines the iteration termination conditions and the output normalization. In addition, you may pass a random number generator to pLSA() which is used to create the initial solution.

Declarations:

#include <vigra/unsupervised_decomposition.hxx>

namespace vigra {
template <class U, class C1, class C2, class C3, class Random>
void
pLSA(MultiArrayView<2, U, C1> const & features,
Random const& random,
PLSAOptions const & options = PLSAOptions());
template <class U, class C1, class C2, class C3>
void
pLSA(MultiArrayView<2, U, C1> const & features,
PLSAOptions const & options = PLSAOptions());
}
Option object for the pLSA algorithm.
Definition unsupervised_decomposition.hxx:159
void pLSA(...)
Decompose a matrix according to the pLSA algorithm.

Usage:

... // fill the input matrix
int numTopics = 3;
pLSA(words, fz, zv, PLSAOptions().normalizedComponentWeights(false));
Matrix<double> model = fz*zv;

◆ asString()

template<class T >
std::string asString ( t)

Convert a value to a string. Available for integral and floating point types and void *.

◆ tolower()

std::string tolower ( std::string  s)

Convert string to lower case.

◆ normalizeString()

std::string normalizeString ( std::string const s)

Convert string to lower case and remove any white space characters.

◆ for_each_in_tuple()

template<typename TPL , typename FUNCTOR >
void for_each_in_tuple ( TPL &&  t,
FUNCTOR &&  f 
)

The for_each_in_tuple function calls the functor f on all elements of the tuple t. For each element type in the tuple, the functor must have an appropriate overload of operator().

Example:

#include <iostream>
#include <tuple>
struct print
{
template <typename T>
void operator()(T const & t) const
{
std::cout << t << std::endl;
}
};
struct add_one
{
template <typename T>
void operator()(T & t) const
{
t += 1;
}
};
int main()
{
std::tuple<int, double, size_t> tpl(-5, 0.4, 10);
vigra::for_each_in_tuple(tpl, add_one());
vigra::for_each_in_tuple(tpl, print());
}
void for_each_in_tuple(TPL &&t, FUNCTOR &&f)
Definition utilities.hxx:282

◆ separableVectorDistance()

template<... >
void separableVectorDistance (   ...)

Compute the vector distance transform of a N-dimensional binary array.

Declarations:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2, class Array>
void
bool background,
Array const & pixelPitch=TinyVector<double, N>(1));
}
void separableVectorDistance(...)
Compute the vector distance transform of a N-dimensional binary array.

This function works like separableMultiDistance() (see there for details), but returns in each pixel the vector to the nearest background pixel rather than the scalar distance. This enables much more powerful applications.

Usage:

#include <vigra/vector_distance.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
...
// For each background pixel, find the vector to the nearest foreground pixel.
separableVectorDistance(source, dest, true);
See also
vigra::separableMultiDistance(), vigra::boundaryVectorDistance()

◆ boundaryVectorDistance()

template<... >
void boundaryVectorDistance (   ...)

Compute the vector distance transform to the implicit boundaries of a multi-dimensional label array.

Declarations:

namespace vigra {
template <unsigned int N, class T1, class S1,
class T2, class S2,
class Array>
void
Array const & pixelPitch=TinyVector<double, N>(1));
}
@ OuterBoundary
Pixels just outside of each region.
Definition multi_distance.hxx:836
void boundaryVectorDistance(...)
Compute the vector distance transform to the implicit boundaries of a multi-dimensional label array.

This function works like boundaryMultiDistance() (see there for details), but returns in each pixel the vector to the nearest boundary pixel rather than the scalar distance. This enables much more powerful applications. Additionally, it support a pixelPitch parameter which allows to adjust the distance calculations for anisotropic grid resolution.

Usage:

#include <vigra/vector_distance.hxx>
Namespace: vigra

Shape3 shape(width, height, depth);
MultiArray<3, UInt32> labels(shape);
...
// For each region, find the vectors to the nearest boundary pixel, including the
// outer border of the array.
boundaryVectorDistance(labels, dest, true);
See also
vigra::boundaryMultiDistance(), vigra::separableVectorDistance()

◆ isAtVolumeBorder()

AtVolumeBorder isAtVolumeBorder ( int  x,
int  y,
int  z,
int  width,
int  height,
int  depth 
)

Find out whether a voxel is at the volume border.

This function checks if x == 0 or x == width - 1 and y == 0 or y == height - 1 and so on and returns the appropriate value of vigra::AtVolumeBorder, or zero when the voxel is not at te volume border. The behavior of the function is undefined if (x,y,z) is not inside the volume.

◆ isAtVolumeBorderAntiCausal()

AtVolumeBorder isAtVolumeBorderAntiCausal ( int  x,
int  y,
int  z,
int  width,
int  height,
int  depth 
)

Find out whether a voxel is at a scan-order relevant volume border. This function checks if x == 0 or y == 0 or z == 0 and returns the appropriate value of vigra::AtVolumeBorder, or zero when the voxel is not at te volume border. The behavior of the function is undefined if (x,y,z) is not inside the volume.

TODO: Write new comment

◆ generateWatershedSeeds()

template<... >
unsigned int generateWatershedSeeds (   ...)

Generate seeds for watershed computation and seeded region growing.

The source image is a boundary indicator such as the gradient magnitude or the trace of the boundaryTensor(). Seeds are generally generated at locations where the boundaryness (i.e. the likelihood of the point being on the boundary) is very small. In particular, seeds can be placed by either looking for local minima (possibly including minimal plateaus) of the boundaryness, of by looking at level sets (i.e. regions where the boundaryness is below a threshold). Both methods can also be combined, so that only minima below a threshold are returned. The particular seeding strategy is specified by the options object (see SeedOptions).

The pixel type of the input image must be LessThanComparable. The pixel type of the output image must be large enough to hold the labels for all seeds. (typically, you will use UInt32). The function will label seeds by consecutive integers (starting from 1) and returns the largest label it used.

Pass IndirectNeighborhood or DirectNeighborhood (first form of the function) or vigra::EightNeighborCode or vigra::FourNeighborCode (second and third forms) to determine the neighborhood where pixel values are compared.

Declarations:

use arbitrary-dimensional arrays:

namespace vigra {
template <unsigned int N, class T, class S1,
class Label, class S2>
generateWatershedSeeds(MultiArrayView<N, T, S1> const & data,
SeedOptions const & options = SeedOptions());
}

show deprecated declarations

Usage:

#include <vigra/multi_watersheds.hxx> (MultiArray variant)
#include <vigra/watersheds.hxx> (deprecated variants)
Namespace: vigra

For detailed examples see watershedsMultiArray() and watershedsRegionGrowing().

◆ watershedsUnionFind()

template<... >
unsigned int watershedsUnionFind (   ...)

Region segmentation by means of the union-find watershed algorithm.

Note: This function is largely obsolete, watershedsMultiArray() should be preferred unless top speed is required.

This function implements the union-find version of the watershed algorithms described as algorithm 4.7 in

J. Roerdink, R. Meijster: "The watershed transform: definitions, algorithms, and parallelization strategies", Fundamenta Informaticae, 41:187-228, 2000

The source image is a boundary indicator such as the gaussianGradientMagnitude() or the trace of the boundaryTensor(). Local minima of the boundary indicator are used as region seeds, and all other pixels are recursively assigned to the same region as their lowest neighbor. Pass vigra::EightNeighborCode or vigra::FourNeighborCode to determine the neighborhood where pixel values are compared. The pixel type of the input image must be LessThanComparable. The function uses accessors.

Note that VIGRA provides an alternative implementation of the watershed transform via watershedsRegionGrowing(). It is slower, but offers many more configuration options.

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
class Neighborhood>
unsigned int
Neighborhood neighborhood = EightNeighborCode());
}
unsigned int watershedsUnionFind(...)
Region segmentation by means of the union-find watershed algorithm.

show deprecated declarations

Usage:

#include <vigra/watersheds.hxx>
Namespace: vigra

Example: watersheds of the gradient magnitude.

... // read input data
// compute gradient magnitude as boundary indicator
// the pixel type of the destination image must be large enough to hold
// numbers up to 'max_region_label' to prevent overflow

show deprecated examples

◆ watershedsRegionGrowing()

template<... >
unsigned int watershedsRegionGrowing (   ...)

Region segmentation by means of a flooding-based watershed algorithm.

Note: This function is largely obsolete, watershedsMultiArray() should be preferred unless top speed is required.

This function implements variants of the watershed algorithm described in

L. Vincent and P. Soille: "Watersheds in digital spaces: An efficient algorithm based on immersion simulations", IEEE Trans. Patt. Analysis Mach. Intell. 13(6):583-598, 1991

The source image is a boundary indicator such as the gaussianGradientMagnitude() or the trace of the boundaryTensor(), and the destination is a label image designating membership of each point in one of the regions. Plateaus in the boundary indicator (i.e. regions of constant gray value) are handled via a Euclidean distance transform by default.

By default, the destination image is assumed to hold seeds for a seeded watershed transform. Seeds may, for example, be created by means of generateWatershedSeeds(). Note that the seeds will be overridden with the final watershed segmentation.

Alternatively, you may provide SeedOptions in order to instruct watershedsRegionGrowing() to generate its own seeds (it will call generateWatershedSeeds() internally). In that case, the destination image should be zero-initialized.

You can specify the neighborhood system to be used by passing FourNeighborCode or EightNeighborCode (default).

Further options to be specified via WatershedOptions are:

  • Whether to keep a 1-pixel-wide contour (with label 0) between regions or perform complete grow (i.e. all pixels are assigned to a region).
  • Whether to stop growing when the boundaryness exceeds a threshold (remaining pixels keep label 0).
  • Whether to use a faster, but less powerful algorithm ("turbo algorithm"). It is faster because it orders pixels by means of a BucketQueue (therefore, the boundary indicator must contain integers in the range [0, ..., bucket_count-1], where bucket_count is specified in the options object), it only supports complete growing (no contour between regions is possible), and it handles plateaus in a simplistic way. It also saves some memory because it allocates less temporary storage.
  • Whether one region (label) is to be preferred or discouraged by biasing its cost with a given factor (smaller than 1 for preference, larger than 1 for discouragement).

Note that VIGRA provides an alternative implementation of the watershed transform via watershedsUnionFind().

Declarations:

pass 2D array views:

namespace vigra {
template <class T1, class S1,
class T2, class S2,
unsigned int
Neighborhood neighborhood = EightNeighborCode(),
WatershedOptions const & options = WatershedOptions());
template <class T1, class S1,
class T2, class S2>
unsigned int
WatershedOptions const & options = WatershedOptions());
}
unsigned int watershedsRegionGrowing(...)
Region segmentation by means of a flooding-based watershed algorithm.

show deprecated declarations

Usage:

#include <vigra/watersheds.hxx>
Namespace: vigra

Example: watersheds of the gradient magnitude.

... // read input data
// compute gradient magnitude at scale 1.0 as a boundary indicator
// example 1
{
// the pixel type of the destination image must be large enough to hold
// numbers up to 'max_region_label' to prevent overflow
// call watershed algorithm for 4-neighborhood, leave a 1-pixel boundary between regions,
// and autogenerate seeds from all gradient minima where the magnitude is below 2.0
unsigned int max_region_label =
WatershedOptions().keepContours()
.seedOptions(SeedOptions().minima().threshold(2.0)));
}
// example 2
{
MultiArray<2, unsigned int> labeling(w, h);
// compute seeds beforehand (use connected components of all pixels
// where the gradient is below 4.0)
unsigned int max_region_label =
generateWatershedSeeds(gradMag, labeling,
SeedOptions().levelSets(4.0));
// quantize the gradient image to 256 gray levels
MultiArray<2, unsigned char> gradMag256(w, h);
FindMinMax<float> minmax;
inspectImage(gradMag, minmax); // find original range
transformImage(gradMag, gradMag256,
linearRangeMapping(minmax, 0, 255));
// call the turbo algorithm with 256 bins, using 8-neighborhood
watershedsRegionGrowing(gradMag256, labeling,
WatershedOptions().turboAlgorithm(256));
}
// example 3
{
MultiArray<2, unsigned int> labeling(w, h);
.. // get seeds from somewhere, e.g. an interactive labeling program,
// make sure that label 1 corresponds to the background
// bias the watershed algorithm so that the background is preferred
// by reducing the cost for label 1 to 90%
watershedsRegionGrowing(gradMag, labeling,
WatershedOptions().biasLabel(1, 0.9));
}

show deprecated examples

◆ watersheds3D()

template<... >
unsigned int watersheds3D (   ...)

Region Segmentation by means of the watershed algorithm.

This function is deprecated, use watershedsMultiArray() instead.

Declarations:

show deprecated declarations

This function implements the union-find version of the watershed algorithms as described in

J. Roerdink, R. Meijster: "The watershed transform: definitions, algorithms, and parallelization strategies", Fundamenta Informaticae, 41:187-228, 2000

The source volume is a boundary indicator such as the gradient magnitude of the trace of the boundaryTensor(). Local minima of the boundary indicator are used as region seeds, and all other voxels are recursively assigned to the same region as their lowest neighbor. Pass vigra::NeighborCode3DSix or vigra::NeighborCode3DTwentySix to determine the neighborhood where voxel values are compared. The voxel type of the input volume must be LessThanComparable.

Usage:

#include <vigra/watersheds3D.hxx>
Namespace: vigra

Example: watersheds3D of the gradient magnitude.

Shape3 shape(w, h, d);
MultiArray<3, float> src(shape), grad(shape);
...
double scale = 1;
MultiArray<3, int> labels(shape);
// find 6-connected regions
int max_region_label = watersheds3DSix(grad, labels);
// find 26-connected regions
max_region_label = watersheds3DTwentySix(grad, labels);

show deprecated examples

© Ullrich Köthe (ullrich.koethe@iwr.uni-heidelberg.de)
Heidelberg Collaboratory for Image Processing, University of Heidelberg, Germany

html generated using doxygen and Python
vigra 1.12.1