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

| Algorithms to Inspect Images |

## Functions

template<... >
void | inspectImage (...)
| Apply read-only functor to every pixel in the image. More...
template<... >
void | inspectImageIf (...)
| Apply read-only functor to every pixel in the ROI. More...
template<... >
void | inspectTwoImages (...)
| Apply read-only functor to every pixel of both images. More...
template<... >
void | inspectTwoImagesIf (...)
| Apply read-only functor to those pixels of both images where the mask image is non-zero. More...

## Detailed Description

Collect information and statistics over all or selected pixels.

## Function Documentation

## ◆ inspectImage()

void vigra::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
inspectImage(MultiArrayView<2, T, S> const & img,
Functor & f);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class ImageIterator, class Accessor, class Functor>
void
inspectImage(ImageIterator upperleft, ImageIterator lowerright, Accessor a,
Functor & f)
}
use argument objects in conjunction with Argument Object Factories :
namespace vigra {
template <class ImageIterator, class Accessor, class Functor>
void
inspectImage(triple<ImageIterator, ImageIterator, Accessor> img,
Functor & f)
}

Usage:

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

MultiArray<2, unsigned char> img(width, height);
... // fill img
// init functor
FindMinMax<unsined char> minmax;
inspectImage(img, minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;

show deprecated examples

// init functor
vigra::BImage img;
vigra::FindMinMax<vigra::BImage::PixelType> minmax;
vigra::inspectImage(srcImageRange(img), minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;
Required Interface:
ConstImageIterator upperleft, lowerright;
ConstImageIterator::row_iterator ix = upperleft.rowIterator();
Accessor accessor;
Functor functor;
functor(accessor(ix)); // return not used

See also
  Functors To Inspect Images, Feature Accumulators

## ◆ inspectImageIf()

void vigra::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
inspectImageIf(MultiArrayView<2, T, S> const & img,
MultiArrayView<2, TM, SM> const & mask,
Functor & f);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class ImageIterator, class Accessor,
class MaskImageIterator, class MaskAccessor, class Functor>
void
inspectImageIf(ImageIterator upperleft, ImageIterator lowerright,
MaskImageIterator mask_upperleft, MaskAccessor ma,
Functor & f)
}
use argument objects in conjunction with Argument Object Factories :
namespace vigra {
template <class ImageIterator, class Accessor,
class MaskImageIterator, class MaskAccessor, class Functor>
void
inspectImageIf(triple<ImageIterator, ImageIterator, Accessor> img,
pair<MaskImageIterator, MaskAccessor> mask,
Functor & f)
}

Usage:

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

MultiArray<2, unsigned char> img(100, 100),
mask(100, 100);
... // fill img and mask
// init functor
FindMinMax<unsigned char> minmax;
inspectImageIf(img, mask, minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;

show deprecated examples

vigra::BImage img(100, 100);
vigra::BImage mask(100, 100);
// init functor
vigra::FindMinMax<vigra::BImage::PixelType> minmax;
vigra::inspectImageIf(srcImageRange(img),
maskImage(mask), minmax);
cout << "Min: " << minmax.min << " Max: " << minmax.max;
Required Interface:
ConstImageIterator upperleft, lowerright;
MaskImageIterator mask_upperleft;
ConstImageIterator::row_iterator ix = upperleft.rowIterator();
MaskImageIterator::row_iterator mx = mask_upperleft.rowIterator();
Accessor accessor;
MaskAccessor mask_accessor;
Functor functor;
if(mask_accessor(mx)) functor(accessor(ix));

See also
  Functors To Inspect Images, Feature Accumulators

## ◆ inspectTwoImages()

void vigra::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
inspectTwoImages(MultiArrayView<2, T1, S1> const & img1,
MultiArrayView<2, T2, S2> const & img2,
Functor & f);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class ImageIterator1, class Accessor1,
class ImageIterator2, class Accessor2,
class Functor>
void
inspectTwoImages(ImageIterator1 upperleft1, ImageIterator1 lowerright1, Accessor1 a1,
ImageIterator2 upperleft2, Accessor2 a2,
Functor & f)
}
use argument objects in conjunction with Argument Object Factories :
namespace vigra {
template <class ImageIterator1, class Accessor1,
class ImageIterator2, class Accessor2,
class Functor>
void
inspectTwoImages(triple<ImageIterator1, ImageIterator1, Accessor1> img1,
pair<ImageIterator2, Accessor2> img2,
Functor & f)
}

Usage:

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

MultiArray<2, unsigned char> image1(width, height), image2(width, height);
SomeStatisticsFunctor stats(...); // init functor
inspectTwoImages(image1, image2, stats);

show deprecated examples

vigra::BImage image1;
vigra::BImage image2;
SomeStatisticsFunctor stats(...); // init functor
vigra::inspectTwoImages(srcImageRange(image1), srcImage(image2),
stats);
Required Interface:
ImageIterator1 upperleft1, lowerright1;
ImageIterator2 upperleft2;
ImageIterator1::row_iterator ix1 = upperleft1.rowIterator();
ImageIterator2::row_iterator ix2 = upperleft2.rowIterator();
Accessor1 accessor1;
Accessor2 accessor2;
Functor functor;
functor(accessor1(ix1), accessor2(ix2)); // return not used

See also
  Functors To Inspect Images, Feature Accumulators

Examples:
  watershed.cxx.

## ◆ inspectTwoImagesIf()

void vigra::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
inspectTwoImagesIf(MultiArrayView<2, T1, S1> const & img1,
MultiArrayView<2, T2, S2> const & img2,
MultiArrayView<2, TM, SM> const & mask,
Functor & f);
}

show deprecated declarations

pass Image Iterators and Data Accessors :
namespace vigra {
template <class ImageIterator1, class Accessor1,
class ImageIterator2, class Accessor2,
class MaskImageIterator, class MaskAccessor,
class Functor>
void
inspectTwoImagesIf(ImageIterator1 upperleft1, ImageIterator1 lowerright1, Accessor1 a1,
ImageIterator2 upperleft2, Accessor2 a2,
MaskImageIterator mupperleft, MaskAccessor mask,
Functor & f)
}
use argument objects in conjunction with Argument Object Factories :
namespace vigra {
template <class ImageIterator1, class Accessor1,
class ImageIterator2, class Accessor2,
class MaskImageIterator, class MaskAccessor,
class Functor>
void
inspectTwoImagesIf(triple<ImageIterator1, ImageIterator1, Accessor1> img1,
pair<ImageIterator2, Accessor2> img2,
pair<MaskImageIterator, MaskAccessor> mimg,
Functor & f)
}

Usage:

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

MultiArray<2, unsigned char> image1(width, height), image2(width, height),
maskimage(width, height);
SomeStatisticsFunctor stats(...); // init functor
inspectTwoImagesIf(image1, image2, maskimage, region_stats);

show deprecated examples

vigra::BImage image1;
vigra::BImage image2;
vigra::BImage maskimage;
SomeStatisticsFunctor stats(...); // init functor
vigra::inspectTwoImagesIf(srcImageRange(image1), srcImage(image2),
srcImage(maskimage), region_stats);
Required Interface:
ImageIterator1 upperleft1, lowerright1;
ImageIterator2 upperleft2;
MaskImageIterator upperleftm;
ImageIterator1::row_iterator ix1 = upperleft1.rowIterator();
ImageIterator2::row_iterator ix2 = upperleft2.rowIterator();
MaskImageIterator::row_iterator mx = mupperleft.rowIterator();
Accessor1 accessor1;
Accessor2 accessor2;
MaskAccessor mask;
Functor functor;
if(mask(mx))
functor(accessor1(ix1), accessor2(ix2));

See also
  Functors To Inspect Images, Feature Accumulators

© 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.11.0