Commit d54866c0 authored by untereiner's avatar untereiner

MR filtering

parent fc45ade8
......@@ -134,7 +134,7 @@ void computeNoise(typename PFP::MAP& map, long amount, const VertexAttribute<typ
} //namespace Filtering
}
} //namespace Surface
} //namespace Algo
......
......@@ -49,12 +49,12 @@ namespace Primal
namespace Regular
{
enum FilterType
enum FilteringType
{
F_HighPass = 0,
F_LowPass,
F_BandPass,
F_None,
F_None
} ;
template <typename PFP>
......@@ -70,7 +70,7 @@ protected:
std::vector<Algo::MR::Filter*> synthesisFilters ;
std::vector<Algo::MR::Filter*> analysisFilters ;
FilterType filter;
FilteringType filter;
unsigned int thresholdLow;
unsigned int thresholdHigh;
......
......@@ -46,7 +46,7 @@ Map2MR<PFP>::Map2MR(typename PFP::MAP& map) :
shareVertexEmbeddings(true),
filter(F_None)
{
std::cout << "filter = " << filter << std::endl;
}
template <typename PFP>
......@@ -252,8 +252,15 @@ void Map2MR<PFP>::analysis()
m_map.decCurrentLevel() ;
// for(unsigned int i = 0; i < analysisFilters.size(); ++i)
// (*analysisFilters[i])() ;
for(unsigned int i = 0; i < analysisFilters.size(); ++i)
(*analysisFilters[i])() ;
{
std::cout << "filter false" << std::endl;
(*analysisFilters[i])(false) ;
}
}
template <typename PFP>
......@@ -261,24 +268,26 @@ void Map2MR<PFP>::synthesis()
{
assert(m_map.getCurrentLevel() < m_map.getMaxLevel() || !"synthesis : called on max level") ;
// for(unsigned int i = 0; i < synthesisFilters.size(); ++i)
// (*synthesisFilters[i])() ;
for(unsigned int i = 0; i < synthesisFilters.size(); ++i)
(*synthesisFilters[i])() ;
{
std::cout << "filter = " << filter << std::endl;
// for(unsigned int i = 0; i < synthesisFilters.size(); ++i)
// {
// if((filter == F_LowPass && m_map.getCurrentLevel() <= thresholdHigh) ||
// (filter == F_HighPass && m_map.getCurrentLevel() >= thresholdLow) ||
// (filter == F_BandPass && (thresholdLow >= m_map.getCurrentLevel() && m_map.getCurrentLevel() <= thresholdHigh)))
// {
// std::cout << "without details" << std::endl;
// (*synthesisFilters[i])(true) ;
// }
// else
// {
// std::cout << "with details" << std::endl;
// (*synthesisFilters[i])(false) ;
// }
// }
if((filter == F_LowPass && m_map.getCurrentLevel() <= thresholdHigh))// ||
//(filter == F_HighPass && m_map.getCurrentLevel() >= thresholdLow) ||
//(filter == F_BandPass && (thresholdLow >= m_map.getCurrentLevel() && m_map.getCurrentLevel() <= thresholdHigh)))
{
std::cout << "filter true , currentLevel = " << m_map.getCurrentLevel() << ", level = " << thresholdHigh << std::endl;
(*synthesisFilters[i])(true) ;
}
else
{
std::cout << "filter false" << std::endl;
(*synthesisFilters[i])(false) ;
}
}
m_map.incCurrentLevel() ;
}
......
......@@ -47,6 +47,7 @@ public:
} ;
} // namespace MR
} // namespace Algo
......
Markdown is supported
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