#include "iclOpROIHandler.h"
#ifndef UNARY_OP_H
#define UNARY_OP_H
namespace icl{
/// Abstract Base class for I=f(I1,I2) operators
/** The Binary Operator class provides an abstract class interface for all
Operators that are computing a result image of two input images (e.g.
pixel-wise "+" or "-" operators.
\section OPLIST list of unary operators
The ICLFilter package provides the complete filtering functions supported
by the ICL. Currently the following subpackages are included in the ICLFilter library:
- Arithmetic: The Arithmetic Class contains a lot of arithmetic functions
(like add, mul,etc) working on images
- Canny: The Canny Edge Detector, only available when having IPP.
- Compare: Compares two images, or one image with an constant pixelwise
and saves the binary result in an output image.
- Convolution: The Convolution class provides functionality for any
kind of convolution filters.
- GeoTransforms: Contains functions for mirroring and affine transformations.
- IntegralImg: Class for creating integral images.
- LocalThreshold:C.E.: **TODO** document this
- Logical: The Logical Class contains a lot of logical functions (like
AND, OR, XOR, etc) working on images with integer Types
- LUT: Class for applying table lookup transformation to Img8u images.
- Median: Class that provides median filter abilities.
- Morphological: Class that provides morphological operations.
- Proximity: Class for computing proximity (similarity) measure between
an image and a template (another image).
- Skin: This class implements a Skin color detection algorithm
- Threshold: Class for thresholding operations
- Weighted Sum: Accumulate weighted pixel values of all image channels
- Wiener: Class for Wiener Filter. Wiener filters remove additive noise
from degraded images, to restore a blurred image, only available when having IPP.
A detailed description of the provided functions in each package is included in
the class description.
*/
class UnaryOp{
public:
virtual ~UnaryOp(){}
/// pure virtual apply function, that must be implemented in all derived classes
virtual void apply(const ImgBase *operand1, ImgBase **dst)=0;
void setClipToROI (bool bClipToROI) { m_oROIHandler.setClipToROI(bClipToROI); }
void setCheckOnly (bool bCheckOnly) { m_oROIHandler.setCheckOnly(bCheckOnly); }
bool getClipToROI() const { return m_oROIHandler.getClipToROI(); }
bool getCheckOnly() const { return m_oROIHandler.getCheckOnly(); }
protected:
bool prepare (ImgBase **ppoDst, depth eDepth, const Size &imgSize,
format eFormat, int nChannels, const Rect& roi,
Time timestamp=Time::null){
return m_oROIHandler.prepare(ppoDst, eDepth,imgSize,eFormat, nChannels, roi, timestamp);
}
/// check+adapt destination image to properties of given source image
virtual bool prepare (ImgBase **ppoDst, const ImgBase *poSrc) {
return m_oROIHandler.prepare(ppoDst, poSrc);
}
/// check+adapt destination image to properties of given source image
/// but use explicitly given depth
virtual bool prepare (ImgBase **ppoDst, const ImgBase *poSrc, depth eDepth) {
return m_oROIHandler.prepare(ppoDst, poSrc, eDepth);
}
private:
OpROIHandler m_oROIHandler;
};
}
#endif