Image Component Library (ICL)
|
Class for computing proximity measures. More...
#include <ProximityOp.h>
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 Member Functions | |
ICLFilter_API | ProximityOp (optype ot, applymode am=valid) |
Creates a new ProximityOp object with given apply mode and optype. | |
virtual | ~ProximityOp () |
Destructor. | |
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 | |
ICLFilter_API void | setOpType (optype ot) |
sets the current optype | |
ICLFilter_API void | setApplyMode (applymode am) |
sets the current applymode | |
ICLFilter_API optype | getOpType () const |
returns the current optype | |
ICLFilter_API applymode | getApplyMode () const |
returns the current applymode | |
Private Attributes | |
core::Img32f * | m_poImageBuffer |
internal used buffer for handling unsupported formats | |
core::Img32f * | m_poTemplateBuffer |
internal used buffer for handling unsupported formats |
Class for computing proximity measures.
(Only available for Img8u and Img32f, IPP only!)
"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.
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 +------------+
This time three different metrics for the similarity measurements are implemented (IPP Only)
The formulas can be found in the ippi-manual!
optypes:
enum to specify the current apply mode of a ProximityOp
enum to specify the current operation type of a ProximityOp
Creates a new ProximityOp object with given apply mode and optype.
ot | optype for the ProximityOp |
am | apply mode for the ProximityOp (default = "valid") |
virtual icl::filter::ProximityOp::~ProximityOp | ( | ) | [inline, virtual] |
Destructor.
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.
poSrc1 | source image |
poSrc2 | template |
ppoDst | destination image (apated automatically) |
Implements icl::filter::BinaryOp.
returns the current applymode
returns the current optype
sets the current applymode
am | new applymode value |
sets the current optype
ot | new optype |
internal used buffer for handling unsupported formats
internal used buffer for handling unsupported formats