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

| Algorithms to Inspect Images |
--- | --- | ---

## Namespaces

namespace | vigra::functor

## Functions

template<...> void | inspectImage (ImageIterator upperleft, ImageIterator lowerright, Accessor a, Functor &f)
| Apply read-only functor to every pixel in the image.
template<...> void | inspectImageIf (ImageIterator upperleft, ImageIterator lowerright, Accessor a, MaskImageIterator mask_upperleft, MaskAccessor ma, Functor &f)
| Apply read-only functor to every pixel in the ROI.
template<...> void | inspectTwoImages (ImageIterator1 upperleft1, ImageIterator1 lowerright1, Accessor1 a1, ImageIterator2 upperleft2, Accessor2 a2, Functor &f)
| Apply read-only functor to every pixel of both images.
template<...> void | inspectTwoImagesIf (ImageIterator1 upperleft1, ImageIterator1 lowerright1, Accessor1 a1, ImageIterator2 upperleft2, Accessor2 a2, MaskImageIterator mupperleft, MaskAccessor mask, Functor &f)
| 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 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 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 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

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. 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 (koethe@informatik.uni-hamburg.de) Cognitive Systems Group, University of Hamburg, Germany | html generated using doxygen and Python VIGRA 1.4.0 (21 Dec 2005)