Image Component Library (ICL)
ChromaClassifier.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 : ICLCore/src/ICLCore/ChromaClassifier.h **
10 ** Module : ICLCore **
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 <ICLCore/Types.h>
35 #include <ICLCore/Parable.h>
36 
37 namespace icl{
38  namespace core{
41  public:
43  inline bool operator()(icl8u chromaR, icl8u chromaG) const{
44  return parables[0](chromaR) > chromaG && parables[1](chromaR) < chromaG;
45  }
47  inline bool operator()(icl8u r, icl8u g, icl8u b) const{
48  int sum = r+g+b+1;
49  return (*this)((255*r)/sum,(255*g)/sum);
50  }
52  void show()const{
53  std::cout << "chroma classifier:" << std::endl;
54  parables[0].show();
55  parables[1].show();
56  }
58  // ParableSet parables;
60  };
61  } // namespace core
62 }
undocument this line if you encounter any issues!
Definition: Any.h:37
Utility class for the parable-based chromaticity segmentation.
Definition: Parable.h:48
Ipp8u icl8u
8Bit unsigned integer type for the ICL
Definition: BasicTypes.h:64
bool operator()(icl8u r, icl8u g, icl8u b) const
classifies a given r-g-b-Pixel
Definition: ChromaClassifier.h:47
bool operator()(icl8u chromaR, icl8u chromaG) const
classifies a given R-G-Pixel
Definition: ChromaClassifier.h:43
void show() const
Shows this classifier to std::out.
Definition: ChromaClassifier.h:52
Parable parables[2]
Used two parables.
Definition: ChromaClassifier.h:59
void show() const
shows this parable to std::out
Definition: Parable.h:88
Classifier interface using RG-chromaticity space and two parables.
Definition: ChromaClassifier.h:40