|
My Project
|
Go to the source code of this file.
Data Structures | |
| class | CMeans |
| class | CMeansInitializerSizedPlugin |
| class | CMeans::Initializer |
| class | CMeans::SparseProbmap |
Typedefs | |
| typedef TFactory< CMeans::Initializer > | CMeansInitializerPlugin |
| typedef THandlerSingleton< TFactoryPluginHandler< CMeansInitializerPlugin > > | CMeansInitializerPluginHandler |
Functions | |
| template<typename T, template< class > class Field> | |
| void | cmeans_evaluate_probabilities (const Field< T > &image, const Field< float > &gain, const std::vector< double > &class_centers, std::vector< Field< float > > &pv) |
| evaluate the probabilities for a c-means classification with gain field | |
| template<typename T, template< class > class Field> | |
| double | cmeans_update_class_centers (const Field< T > &image, const Field< float > &gain, const std::vector< Field< float > > &pv, std::vector< double > &class_centers) |
Variables | |
| template<> | |
| const char *const | TPluginHandler< TFactory< CMeans::Initializer > >::m_help |
| */ | |
| void cmeans_evaluate_probabilities | ( | const Field< T > & | image, |
| const Field< float > & | gain, | ||
| const std::vector< double > & | class_centers, | ||
| std::vector< Field< float > > & | pv ) |
evaluate the probabilities for a c-means classification with gain field
This function evaluates the per-pixel class probabilities for a c-means classification with gain field correction.
With n classes the evalaution is done aoocrding to
\[p_{k,i} := \left\{\begin{array}{lcl} I_k < c_0 & & p_{k,0} = 1, p_{k,i} = 0 \: \forall \: i \in [1, n-1]\\ c_j < I_k < c_{j+1} & & p_{k,l} = \frac{(I_k - g_k * c_{m})^2}{(I_k - g_k * c_{m})^2 + (I_k - g_k * c_{l})^2} \: \forall \: (l,m) \in \{(j, j+1), (j+1, j)\}\\ I_k > c_{n-1} & & p_{k,n} = 1, p_{k,i} = 0 \: \forall \: i \in [0, n-2] \end{array} \right. \]
| T | input pixel type of the data to be classified |
| Field | template of the data field type |
| [in] | image | image the classification is applied to |
| [in] | gain | multiplicative gain field |
| [in] | class_centers | |
| [out] | pv | probability fields containing the evaluated probabilities |
| double cmeans_update_class_centers | ( | const Field< T > & | image, |
| const Field< float > & | gain, | ||
| const std::vector< Field< float > > & | pv, | ||
| std::vector< double > & | class_centers ) |
Evaluate the new clas centers from
\[\sum_{k,i} (p_{i,k} I_k - g_k c_i)^2 \rightarrow \min \]
In order to avoid a ping-pong effect, the actual class center update is evaluated according to
\[c_i^{(t+1)} = \frac{1}{2} \left( \sum_{k} \frac{p_{i,k}^2 g_k I_k}{ p_{i,k}^2 g_k^2 } - c_i^{(t)} \right) \]
| T | input pixel type of the data to be classified |
| Field | template of the data field type |
| [in] | image | image the classification is applied to |
| [in] | gain | multiplicative gain field |
| [in] | pv | probability fields |
| [in,out] | class_centers |
Definition at line 234 of file cmeans.hh.
References cvwarn().
| const char* const TPluginHandler< TFactory< CMeans::Initializer > >::m_help |