Commit cb5d520f authored by Yann Jacquelet's avatar Yann Jacquelet
Browse files

Touch histo3d_rgb.

	* green/mln/accu/stat/histo3_rgb.hh: Touch it.

git-svn-id: https://svn.lrde.epita.fr/svn/oln/trunk@4614 4aad255d-cdde-0310-9447-f3009e2ae8c0
parent c4126b21
2009-10-07 Yann Jacquelet <jacquelet@lrde.epita.fr>
Touch histo3d_rgb.
* green/mln/accu/stat/histo3_rgb.hh: Touch it.
2009-10-07 Yann Jacquelet <jacquelet@lrde.epita.fr>
Fix a bug in kmean1d.
......
......@@ -77,13 +77,13 @@
namespace mln
{
namespace accu
{
namespace stat
{
// Forward declaration
template <typename V>
struct histo3d_rgb;
......@@ -92,10 +92,10 @@ namespace mln
namespace meta
{
namespace stat
{
struct histo3d_rgb : public Meta_Accumulator<histo3d_rgb>
{
template <typename V>
......@@ -104,17 +104,17 @@ namespace mln
typedef accu::stat::histo3d_rgb<V> ret;
};
};
} // end of namespace mln::accu::meta::stat
} // end of namespace mln::accu::meta
} // end of namespace mln::accu
namespace trait
{
template <typename V>
struct accumulator_< mln::accu::stat::histo3d_rgb<V> >
{
......@@ -125,34 +125,34 @@ namespace mln
};
template <typename V>
struct set_precise_binary_<op::eq,
struct set_precise_binary_<op::eq,
accu::stat::histo3d_rgb<V>,
accu::stat::histo3d_rgb<V> >
{
typedef bool ret;
};
} // end of namespace mln::trait
namespace accu
{
namespace stat
{
{
/// \brief Define an histogram which returns an image3d .
/// \brief Define an histogram which returns an image3d .
///
/// Param V defines the space in which we count the values.
/// For instance, this histogram works image2d<rgb<2>> or
/// For instance, this histogram works image2d<rgb<2>> or
/// image2d<rgb<7>>. The histogram count the occurrence of each value.
/// The number of bins depends of the grayscale values, for 8 bits there
/// is 256x3 bins. Note that over
/// is 256x3 bins. Note that over
/// quantification works too.
///
/// \ingroup modaccuvalues
template <typename V>
struct histo3d_rgb :
struct histo3d_rgb :
public mln::accu::internal::base<image3d<unsigned>, histo3d_rgb<V> >
{
typedef V argument;
......@@ -163,22 +163,22 @@ namespace mln
/// \{
/// \brief Initialize the size of the resulting image1d.
///
/// Initialize the size the resulting image from the theorical dynamic
/// Initialize the size the resulting image from the theorical dynamic
/// of the greylevel values (Use V to manage it).
histo3d_rgb();
/// \}
/// Manipulators.
/// \{
/// \brief Initialize the histogram with zero value.
///
/// This method must be called just before starting the use of the
/// histogram. If it's not, resulting values won't converge to the
/// This method must be called just before starting the use of the
/// histogram. If it's not, resulting values won't converge to the
/// density.
void init();
/// \brief Update the histogram with the RGB pixel t.
/// \param[in] t a greylevel pixel of type V.
///
......@@ -219,7 +219,7 @@ namespace mln
/// The operator compare all the bins from the two histogram.
template <typename V>
bool operator==(const histo3d_rgb<V>& histo1,
bool operator==(const histo3d_rgb<V>& histo1,
const histo3d_rgb<V>& histo2);
#ifndef MLN_INCLUDE_ONLY
......@@ -232,7 +232,7 @@ namespace mln
typedef mln_trait_value_comp(V,0) comp0;
typedef mln_trait_value_comp(V,1) comp1;
typedef mln_trait_value_comp(V,2) comp2;
// comp keep a trace of the dimension of the theorical image.
// mln_min(comp) --> 0
// mln_max(comp) --> 2^(n-1) [127 for n=7][255 for n=8] ...
......@@ -243,7 +243,7 @@ namespace mln
point3d(mln_max(comp0),
mln_max(comp1),
mln_max(comp2))));
trace::exiting("mln::accu::stat::histo3d_rgb<V>::histo3d_rgb");
}
......@@ -263,7 +263,7 @@ namespace mln
{
trace::entering("mln::accu::stat::histo3d_rgb<V>::take");
// Just convert a greyscale value (int_u8 like) to a position for an
// Just convert a greyscale value (int_u8 like) to a position for an
// iterator on the resulting image.
// Take care to the constructor : Point(slice, row, column)
++count_(point3d(t.blue(), t.red(), t.green()));
......@@ -271,7 +271,7 @@ namespace mln
trace::exiting("mln::accu::stat::histo3d_rgb<V>::take");
}
template <typename V>
inline
void histo3d_rgb<V>::take(const histo3d_rgb<V>& other)
......@@ -282,7 +282,7 @@ namespace mln
trace::exiting("mln::accu::stat::histo3d_rgb<V>::take");
}
template <typename V>
inline
typename histo3d_rgb<V>::result histo3d_rgb<V>::to_result() const
......@@ -292,7 +292,7 @@ namespace mln
trace::exiting("mln::accu::stat::histo3d_rgb<V>::to_result");
return count_;
}
template <typename V>
inline
histo3d_rgb<V>::operator result() const
......@@ -301,7 +301,7 @@ namespace mln
trace::exiting("mln::accu::stat::histo3d_rgb<V>::operator result");
return count_;
}
}
template <typename V>
inline
......@@ -309,13 +309,13 @@ namespace mln
{
trace::entering("mln::accu::stat::histo3d_rgb<V>::is_valid");
bool result = count_.is_valid();
trace::exiting("mln::accu::stat::histo3d_rgb<V>::is_valid");
return result;
}
template <typename V>
bool operator==(const histo3d_rgb<V>& histo1,
bool operator==(const histo3d_rgb<V>& histo1,
const histo3d_rgb<V>& histo2)
{
trace::entering("mln::accu::stat::operator==");
......@@ -323,7 +323,7 @@ namespace mln
bool result = true;
const image3d<unsigned>& res1 = histo1.to_result();
const image3d<unsigned>& res2 = histo2.to_result();
mln_precondition(res1.is_valid());
mln_precondition(res2.is_valid());
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment