[ 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.
template<... >
void | inspectImageIf (...)
| Apply read-only functor to every pixel in the ROI.
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.

## Detailed Description

Apply read-only functor to every pixel

## Function Documentation

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. The function uses an accessor to access the pixel data.

Declarations:

pass arguments explicitly:

        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

        // 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

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. Accessors are used to access the pixel and mask data.

Declarations:

pass arguments explicitly:

        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

        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));

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. Accessors are used to access the pixel data.

Declarations:

pass arguments explicitly:

        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

        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

Examples:
  watershed.cxx.

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. Accessors are used to access the pixel data.

Declarations:

pass arguments explicitly:

        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

        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));

© 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.9.0 (Tue Nov 6 2012)