Image Component Library (ICL)
Public Types | Public Member Functions | Private Attributes | List of all members
icl::filter::ProximityOp Class Reference

Class for computing proximity measures. More...

#include <ProximityOp.h>

Inheritance diagram for icl::filter::ProximityOp:
icl::filter::BinaryOp icl::utils::Uncopyable icl::utils::Configurable

Public Types

enum  applymode { full, same, valid }
 enum to specify the current apply mode of a ProximityOp More...
 
enum  optype { sqrDistance, crossCorr, crossCorrCoeff }
 enum to specify the current operation type of a ProximityOp More...
 
- Public Types inherited from icl::utils::Configurable
typedef Function< void, const Property & > Callback
 Function type for changed properties. More...
 

Public Member Functions

ICLFilter_API ProximityOp (optype ot, applymode am=valid)
 Creates a new ProximityOp object with given apply mode and optype. More...
 
virtual ~ProximityOp ()
 Destructor. More...
 
virtual ICLFilter_API void apply (const core::ImgBase *poSrc1, const core::ImgBase *poSrc2, core::ImgBase **ppoDst)
 applies the current op given source image, template and destination image More...
 
ICLFilter_API void setOpType (optype ot)
 sets the current optype More...
 
ICLFilter_API void setApplyMode (applymode am)
 sets the current applymode More...
 
ICLFilter_API optype getOpType () const
 returns the current optype More...
 
ICLFilter_API applymode getApplyMode () const
 returns the current applymode More...
 
virtual void apply (const core::ImgBase *operand1, const core::ImgBase *operand2, core::ImgBase **result)=0
 import apply symbol from parent class More...
 
virtual const core::ImgBaseapply (const core::ImgBase *operand1, const core::ImgBase *operand2)
 import apply symbol from parent class More...
 
- Public Member Functions inherited from icl::filter::BinaryOp
 BinaryOp ()
 default constructor More...
 
 BinaryOp (const BinaryOp &other)
 copy constructor More...
 
BinaryOpoperator= (const BinaryOp &other)
 assignment operator More...
 
virtual ~BinaryOp ()
 virtual destructor More...
 
virtual const core::ImgBaseapply (const core::ImgBase *operand1, const core::ImgBase *operand2)
 applyfunction without explicit destination image More...
 
void operator() (const core::ImgBase *src1, const core::ImgBase *src2, core::ImgBase **dst)
 function operator (alternative for apply(src1,src2,dst) More...
 
const core::ImgBaseoperator() (const core::ImgBase *src1, const core::ImgBase *src2)
 function operator for the implicit destination apply(a,b) call More...
 
const core::ImgBaseoperator() (const core::ImgBase &sr1, const core::ImgBase &src2)
 reference based function operator More...
 
void setClipToROI (bool bClipToROI)
 sets if the image should be clip to ROI or not More...
 
void setCheckOnly (bool bCheckOnly)
 sets if the destination image should be adapted to the source, or if it is only checked if it can be adapted. More...
 
bool getClipToROI () const
 returns the ClipToROI status More...
 
bool getCheckOnly () const
 returns the CheckOnly status More...
 
- Public Member Functions inherited from icl::utils::Configurable
virtual ~Configurable ()
 virtual destructor More...
 
 Configurable (const Configurable &other)
 Copy constructor. More...
 
Configurableoperator= (const Configurable &other)
 Assignment operator. More...
 
void setConfigurableID (const std::string &ID)
 sets the ID of this configurable More...
 
const std::string & getConfigurableID () const
 returns the configurables static ID More...
 
bool isOrderedFlagSet () const
 returns whether the ordered flag is set More...
 
void deactivateProperty (const std::string &pattern)
 adds an additional deativation pattern More...
 
void deleteDeactivationPattern (const std::string &pattern)
 removed a formerly added deactivation pattern More...
 
std::vector< std::string > getPropertyListWithoutDeactivated () const
 this returns a filtered list of properties (using all filters added by deactivateProperty) More...
 
virtual void adaptProperty (const std::string &name, const std::string &newType, const std::string &newInfo, const std::string &newToolTip)
 this function can be used to adapt a specific property afterwards More...
 
void registerCallback (const Callback &cb)
 add a callback for changed properties More...
 
void removedCallback (const Callback &cb)
 removes a callback that was registered before More...
 
void syncChangesTo (Configurable *others, int num=1)
 this can be used to let this instance also apply property changes to others More...
 
virtual void setPropertyValue (const std::string &propertyName, const Any &value)
 sets a property value More...
 
virtual std::vector< std::string > getPropertyList () const
 returns a list of All properties, that can be set using setProperty More...
 
virtual bool supportsProperty (const std::string &propertyName) const
 base implementation for property check (seaches in the property list) More...
 
virtual void saveProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC) const
 writes all available properties into a file More...
 
virtual void loadProperties (const std::string &filename, const std::vector< std::string > &propertiesToSkip=EMPTY_VEC)
 reads a camera config file from disc More...
 
virtual std::string getPropertyType (const std::string &propertyName) const
 get type of property More...
 
virtual std::string getPropertyInfo (const std::string &propertyName) const
 get information of a properties valid values More...
 
virtual Any getPropertyValue (const std::string &propertyName) const
 returns the current value of a property or a parameter More...
 
virtual std::string getPropertyToolTip (const std::string &propertyName) const
 returns the tooltip description for a given property More...
 
virtual int getPropertyVolatileness (const std::string &propertyName) const
 Returns whether this property may be changed internally. More...
 

Private Attributes

core::Img32fm_poImageBuffer
 internal used buffer for handling unsupported formats More...
 
core::Img32fm_poTemplateBuffer
 internal used buffer for handling unsupported formats More...
 

Additional Inherited Members

- Static Public Member Functions inherited from icl::utils::Configurable
static std::string create_default_ID (const std::string &prefix)
 this function can be used in subclasses to create a default ID More...
 
static Configurableget (const std::string &id)
 returns configurable by given ID More...
 
static void register_configurable_type (const std::string &classname, Function< Configurable * > creator)
 registers a configurable type More...
 
static std::vector< std::string > get_registered_configurables ()
 returns a list of all registered configurable classnames More...
 
static Configurablecreate_configurable (const std::string &classname)
 creates a configurable by given name More...
 
- Static Public Attributes inherited from icl::utils::Configurable
static const std::vector< std::string > EMPTY_VEC
 used as shortcut – just an empty vector of std::strings More...
 
- Protected Member Functions inherited from icl::filter::BinaryOp
bool prepare (core::ImgBase **ppoDst, core::depth eDepth, const utils::Size &imgSize, core::format eFormat, int nChannels, const utils::Rect &roi, utils::Time timestamp=utils::Time::null)
 
virtual bool prepare (core::ImgBase **ppoDst, const core::ImgBase *poSrc)
 check+adapt destination image to properties of given source image More...
 
virtual bool prepare (core::ImgBase **ppoDst, const core::ImgBase *poSrc, core::depth eDepth)
 
- Protected Member Functions inherited from icl::utils::Uncopyable
 Uncopyable ()
 Empty base constructor. More...
 
- Protected Member Functions inherited from icl::utils::Configurable
void addProperty (const std::string &name, const std::string &type, const std::string &info, const Any &value=Any(), const int volatileness=0, const std::string &tooltip=std::string())
 This can be used by derived classes to store supported properties in the internal list. More...
 
void addChildConfigurable (Configurable *configurable, const std::string &childPrefix="")
 This adds another configurable as child. More...
 
void removeChildConfigurable (Configurable *configurable)
 removes the given child configurable More...
 
Propertyprop (const std::string &propertyName)
 this CAN be used e.g. to store a property value in internal property-list More...
 
const Propertyprop (const std::string &propertyName) const
 this CAN be used e.g. to store a property value in internal property-list More...
 
 Configurable (const std::string &ID="", bool ordered=true)
 create this configurable with given ID More...
 
void call_callbacks (const std::string &propertyName, const Configurable *caller) const
 calls all registered callbacks More...
 
- Static Protected Member Functions inherited from icl::filter::BinaryOp
static bool check (const core::ImgBase *operand1, const core::ImgBase *operand2, bool checkDepths=true)
 
- Protected Attributes inherited from icl::utils::Configurable
std::vector< Callbackcallbacks
 internally managed list of callbacks More...
 

Detailed Description

Class for computing proximity measures.

(Only available for Img8u and Img32f, IPP only!)

Overview

"The functions described in this section compute the proximity (similarity) measure between an image and a template (another image). These functions may be used as feature detection functions, as well as the components of more sophisticated techniques. There are several ways to compute the measure of similarity between two images. One way is to compute the Euclidean distance, or sum of the squared distances (SSD), of an image and a template. The smaller is the value of SSD at a particular pixel, the more similarity exists between the template and the image in the neighborhood of that pixel."

The ProximityOp class summarizes these image similarity measurement techniques and provides their functionality by implementing the ICLFilter packages BinaryOp interface.
There are two different variables, that influencing the internal functionality of the ProximityOps apply function.

ApplyMode

The first variable - the so called "applymode" - determines in which region of the source image a specific proximity measure is applied. The following ASCII image describes the differences between the values "full", "valid" and "same"

Image: iiiiiiiiiiiiii   Mask: mmmmm       resulting images:
       iiiiiiiiiiiiii         mmxmm
       iiiiiiiiiiiiii         mmmmm       +---+
       iiiiiiiiiiiiii        (5x3)        |   | := original image area
       iiiiiiiiiiiiii                     +---+
        (14 x 5)
full: mmmmm                               full result:
      mmx<--- fist pos.                      rrrrrrrrrrrrrrrr
      mmmmmiiiiiiiiiiiii                     r+------------+r
          iiiiiiiiiiiiii                     r|rrrrrrrrrrrr|r
          iiiiiiiiiiiiii                     r|rrrrrrrrrrrr|r
          iiiiiiiiiiiiii                     r|rrrrrrrrrrrr|r
          iiiiiiiiiiiiimmmmm                 r+------------+r
                       mmx<-- last pos.      rrrrrrrrrrrrrrrr
                       mmmmm
same:                                      same result:
        mmmmm
 first: mmxmmiiiiiiiiiii                     +------------+
        mmmmmiiiiiiiiiii                     |rrrrrrrrrrrr|
          iiiiiiiiiiiiii                     |rrrrrrrrrrrr|
          iiiiiiiiiiimmmmm                   |rrrrrrrrrrrr|
          iiiiiiiiiiimmxmm <-- last          +------------+
                     mmmmm
valid:                                     valid result:
          mmmmmiiiiiiiii                     +------------+
   first: mmxmmiiiiiiiii                     | rrrrrrrrrr |
          mmmmmiiiimmmmm                     | rrrrrrrrrr |
          iiiiiiiiimmxmm  <-- last           | rrrrrrrrrr |
          iiiiiiiiimmmmm                     +------------+

Operations

This time three different metrics for the similarity measurements are implemented (IPP Only)

The formulas can be found in the ippi-manual!

optypes:

Member Enumeration Documentation

◆ applymode

enum to specify the current apply mode of a ProximityOp

See also
ProximityOp
Enumerator
full 

destination image has size (w1+w2-1)x(h1+h2-1)

same 

destination image has size (w1)x(h1)

valid 

destination image has size (w1-w2+1)x(h1-h2+1)

◆ optype

enum to specify the current operation type of a ProximityOp

See also
ProximityOp
Enumerator
sqrDistance 

square distance metric

crossCorr 

cross correlation metric

crossCorrCoeff 

cross correlation coefficient metric

Constructor & Destructor Documentation

◆ ProximityOp()

ICLFilter_API icl::filter::ProximityOp::ProximityOp ( optype  ot,
applymode  am = valid 
)

Creates a new ProximityOp object with given apply mode and optype.

Parameters
otoptype for the ProximityOp
amapply mode for the ProximityOp (default = "valid")

◆ ~ProximityOp()

virtual icl::filter::ProximityOp::~ProximityOp ( )
inlinevirtual

Destructor.

Member Function Documentation

◆ apply() [1/3]

virtual ICLFilter_API void icl::filter::ProximityOp::apply ( const core::ImgBase poSrc1,
const core::ImgBase poSrc2,
core::ImgBase **  ppoDst 
)
virtual

applies the current op given source image, template and destination image

allowed input image types are icl8u and icl32f other types are converted internally to float images. The destination image is adapted automatically; it depth becomes depth32f.

Parameters
poSrc1source image
poSrc2template
ppoDstdestination image (apated automatically)

Implements icl::filter::BinaryOp.

◆ apply() [2/3]

virtual const core::ImgBase* icl::filter::BinaryOp::apply

import apply symbol from parent class

◆ apply() [3/3]

virtual void icl::filter::BinaryOp::apply

import apply symbol from parent class

◆ getApplyMode()

ICLFilter_API applymode icl::filter::ProximityOp::getApplyMode ( ) const

returns the current applymode

Returns
current applymode

◆ getOpType()

ICLFilter_API optype icl::filter::ProximityOp::getOpType ( ) const

returns the current optype

Returns
current optype

◆ setApplyMode()

ICLFilter_API void icl::filter::ProximityOp::setApplyMode ( applymode  am)

sets the current applymode

Parameters
amnew applymode value

◆ setOpType()

ICLFilter_API void icl::filter::ProximityOp::setOpType ( optype  ot)

sets the current optype

Parameters
otnew optype

Member Data Documentation

◆ m_poImageBuffer

core::Img32f* icl::filter::ProximityOp::m_poImageBuffer
private

internal used buffer for handling unsupported formats

◆ m_poTemplateBuffer

core::Img32f* icl::filter::ProximityOp::m_poTemplateBuffer
private

internal used buffer for handling unsupported formats


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