degate  0.1.2
Public Member Functions | Private Attributes
degate::IPThresholding< ImageTypeIn, ImageTypeOut > Class Template Reference

Processor: Create a binary image from a single channel image. More...

#include <IPThresholding.h>

Inheritance diagram for degate::IPThresholding< ImageTypeIn, ImageTypeOut >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 IPThresholding (double _threshold=0.5)
 The constructor.
virtual ~IPThresholding ()
 The destructor.
virtual ImageBase_shptr run (ImageBase_shptr _in)
 Start processing.

Private Attributes

double threshold

Detailed Description

template<typename ImageTypeIn, typename ImageTypeOut>
class degate::IPThresholding< ImageTypeIn, ImageTypeOut >

Processor: Create a binary image from a single channel image.

Definition at line 36 of file IPThresholding.h.


Constructor & Destructor Documentation

template<typename ImageTypeIn , typename ImageTypeOut >
degate::IPThresholding< ImageTypeIn, ImageTypeOut >::IPThresholding ( double  _threshold = 0.5) [inline]

The constructor.

Definition at line 47 of file IPThresholding.h.

                                            :
      ImageProcessorBase("IPThresholding",
                         "Binarize an image.",
                         false,
                         typeid(typename ImageTypeIn::pixel_type),
                         typeid(typename ImageTypeOut::pixel_type)),
      threshold(_threshold) { }
template<typename ImageTypeIn , typename ImageTypeOut >
virtual degate::IPThresholding< ImageTypeIn, ImageTypeOut >::~IPThresholding ( ) [inline, virtual]

The destructor.

Definition at line 59 of file IPThresholding.h.

{}

Member Function Documentation

template<typename ImageTypeIn , typename ImageTypeOut >
virtual ImageBase_shptr degate::IPThresholding< ImageTypeIn, ImageTypeOut >::run ( ImageBase_shptr  _in) [inline, virtual]

Start processing.

Implements degate::ImageProcessorBase.

Definition at line 62 of file IPThresholding.h.

References degate::IPThresholding< ImageTypeIn, ImageTypeOut >::threshold.

                                                     {

      assert(_in != NULL);

      std::shared_ptr<ImageTypeIn> img_in =
        std::dynamic_pointer_cast<ImageTypeIn>(_in);

      std::shared_ptr<ImageTypeOut>
        img_out(new ImageTypeOut(_in->get_width(), _in->get_height()));

      assert(img_in != NULL);
      assert(img_out != NULL);

      thresholding_image<ImageTypeOut, ImageTypeIn>(img_out, img_in, threshold);

      return img_out;
    }

Member Data Documentation

template<typename ImageTypeIn , typename ImageTypeOut >
double degate::IPThresholding< ImageTypeIn, ImageTypeOut >::threshold [private]

The documentation for this class was generated from the following file: