Image Component Library (ICL)
ChamferOp.h
Go to the documentation of this file.
1 /********************************************************************
2 ** Image Component Library (ICL) **
3 ** **
4 ** Copyright (C) 2006-2013 CITEC, University of Bielefeld **
5 ** Neuroinformatics Group **
6 ** Website: www.iclcv.org and **
7 ** http://opensource.cit-ec.de/projects/icl **
8 ** **
9 ** File : ICLFilter/src/ICLFilter/ChamferOp.h **
10 ** Module : ICLFilter **
11 ** Authors: Christof Elbrechter **
12 ** **
13 ** **
14 ** GNU LESSER GENERAL PUBLIC LICENSE **
15 ** This file may be used under the terms of the GNU Lesser General **
16 ** Public License version 3.0 as published by the **
17 ** **
18 ** Free Software Foundation and appearing in the file LICENSE.LGPL **
19 ** included in the packaging of this file. Please review the **
20 ** following information to ensure the license requirements will **
21 ** be met: http://www.gnu.org/licenses/lgpl-3.0.txt **
22 ** **
23 ** The development of this software was supported by the **
24 ** Excellence Cluster EXC 277 Cognitive Interaction Technology. **
25 ** The Excellence Cluster EXC 277 is a grant of the Deutsche **
26 ** Forschungsgemeinschaft (DFG) in the context of the German **
27 ** Excellence Initiative. **
28 ** **
29 ********************************************************************/
30 
31 #pragma once
32 
33 #include <ICLUtils/CompatMacros.h>
34 #include <ICLUtils/Point.h>
35 #include <ICLCore/Img.h>
36 #include <ICLFilter/UnaryOp.h>
37 #include <vector>
38 
39 namespace icl{
40  namespace filter{
42 
190  public:
194  hausdorff_mean
195  };
200  distancePenalty
201  };
202 
204 
218  ChamferOp( icl32s horizontalAndVerticalNeighbourDistance=3, icl32s diagonalNeighborDistance=4, int scaleFactor=1, bool scaleUpResult=true);
219 
221  virtual ~ChamferOp(){}
222 
224 
234  virtual void apply(const core::ImgBase *poSrc, core::ImgBase **ppoDst);
235 
237  using UnaryOp::apply;
238 
240 
248  static void renderModel(const std::vector<utils::Point> &model, core::ImgBase **image, const utils::Size &size, icl32s bg=0, icl32s fg=255, utils::Rect roi=utils::Rect::null);
249 
250 
252 
260  static double computeDirectedHausdorffDistance(const core::Img32s *chamferImage,
261  const std::vector<utils::Point> &model,
262  hausdorffMetric m=hausdorff_mean,
263  outerROIPenaltyMode pm=noPenalty,
264  icl32s penaltyValue=0);
266 
275  static double computeDirectedHausdorffDistance(const core::Img32s *chamferImage,
276  const core::Img32s *modelChamferImage,
278  ChamferOp::outerROIPenaltyMode pm=noPenalty,
279  icl32s penaltyValue=0);
280 
281 
283 
295  static double computeSymmetricHausdorffDistance(const core::Img32s *chamferImageA,
296  const core::Img32s *chamferImageB,
297  hausdorffMetric m=hausdorff_mean,
298  ChamferOp::outerROIPenaltyMode pm=noPenalty,
299  icl32s penaltyValue=0);
301 
323  static double computeSymmetricHausdorffDistance(const std::vector<utils::Point> setA, const utils::Size &sizeA, const utils::Rect &roiA, core::ImgBase **bufferA,
324  const std::vector<utils::Point> setB, const utils::Size &sizeB, const utils::Rect &roiB, core::ImgBase **bufferB,
325  hausdorffMetric m=hausdorff_mean,
326  ChamferOp::outerROIPenaltyMode pm=noPenalty,
327  icl32s penaltyValue=0,
328  ChamferOp coA=ChamferOp(),
329  ChamferOp coB=ChamferOp() );
330 
332 
345  static double computeSymmeticHausdorffDistance(const core::Img32s *chamferImage,
346  const std::vector<utils::Point> &model,
347  const utils::Size &modelImageSize,
348  const utils::Rect &modelImageROI,
349  core::ImgBase **bufferImageA,
350  core::ImgBase **bufferImageB,
351  hausdorffMetric m=hausdorff_mean,
352  ChamferOp::outerROIPenaltyMode pm=noPenalty,
353  icl32s penaltyValue=0,
354  ChamferOp co=ChamferOp());
355 
356 
357  private:
360 
363 
366 
369 
372  };
373  } // namespace filter
374 }
int m_iScaleFactor
internal scale factor
Definition: ChamferOp.h:365
Chamfering Unit.
Definition: ChamferOp.h:189
undocument this line if you encounter any issues!
Definition: Any.h:37
Definition: ChamferOp.h:199
Definition: ChamferOp.h:193
ICLQt_API ImgROI roi(ImgQ &r)
creates a ROI-struct from an image
icl32s m_iDiagonalNeighborDistance
internally used variable for diagonal adjacent pixels
Definition: ChamferOp.h:362
static const Rect null
null Rect is w=0, h=0, x=0, y=0
Definition: Rect.h:99
Ipp32s icl32s
32bit signed integer type for the ICL
Definition: BasicTypes.h:58
virtual ~ChamferOp()
destructor
Definition: ChamferOp.h:221
bool m_bScaleUpResult
defines whether to scale up the result image if m_iScaleFactor is > 1
Definition: ChamferOp.h:368
Abstract Base class for Unary Operators.
Definition: UnaryOp.h:51
Size class of the ICL.
Definition: Size.h:61
ICLQt_API core::Img< T > filter(const core::Img< T > &image, const std::string &filter)
applies a filter operation on the source image (affinity for float)
hausdorffMetric
decides which metric is used to calculate the Hausdorff distance
Definition: ChamferOp.h:192
outerROIPenaltyMode
decides how to punish model point, that are outside the images ROI, but inside of the image Rect
Definition: ChamferOp.h:197
icl32s m_iHorizontalAndVerticalNeighbourDistance
internally used variable for horizontally or vertically adjacent pixels
Definition: ChamferOp.h:359
#define ICLFilter_API
Definition: CompatMacros.h:175
Definition: ChamferOp.h:198
virtual void apply(const core::ImgBase *operand1, core::ImgBase **dst)=0
pure virtual apply function, that must be implemented in all derived classes
Rectangle class of the ICL used e.g. for the Images ROI-rect.
Definition: Rect.h:95
ImgBase is the Image-Interface class that provides save access to underlying Img-template .
Definition: ImgBase.h:131
The Img class implements the ImgBase Image interface with type specific functionalities .
Definition: Img.h:49
core::Img32s m_oBufferImage
temporarily use buffer
Definition: ChamferOp.h:371