Skip to content
Snippets Groups Projects
Commit 854b6823 authored by Julien Malik's avatar Julien Malik
Browse files

ENH: remove lots of commented code and multiple return statement

parent 5138e863
No related branches found
No related tags found
No related merge requests found
...@@ -41,48 +41,6 @@ public: ...@@ -41,48 +41,6 @@ public:
TOutput jointEntropy = itk::NumericTraits<TOutput>::Zero; TOutput jointEntropy = itk::NumericTraits<TOutput>::Zero;
HistogramFrequencyType totalFreq = histogram->GetTotalFrequency(); HistogramFrequencyType totalFreq = histogram->GetTotalFrequency();
/* for(unsigned long pos = 0; pos< itA.Size(); ++pos)
{
double value = static_cast<double>(itA.GetPixel(pos));
unsigned int bin =
HistogramFrequencyType freq = histogram.GetFrequency(, 0);
if (freq > 0)
{
entropyX += freq*vcl_log(freq);
}
}
entropyX = -entropyX/static_cast<TOutput>(totalFreq) + vcl_log(totalFreq);
for (unsigned int i = 0; i < this->GetHistogramSize()[1]; ++i)
{
HistogramFrequencyType freq = histogram.GetFrequency(i, 1);
if (freq > 0)
{
entropyY += freq*vcl_log(freq);
}
}
entropyY = -entropyY/static_cast<TOutput>(totalFreq) + vcl_log(totalFreq);
HistogramIteratorType it = histogram.Begin();
HistogramIteratorType end = histogram.End();
while (it != end)
{
HistogramFrequencyType freq = it.GetFrequency();
if (freq > 0)
{
jointEntropy += freq*vcl_log(freq);
}
++it;
}
jointEntropy = -jointEntropy/static_cast<TOutput>(totalFreq) +
vcl_log(totalFreq);
return entropyX + entropyY - jointEntropy; */
typename HistogramType::MeasurementVectorType sample(2); typename HistogramType::MeasurementVectorType sample(2);
for (unsigned long pos = 0; pos < itA.Size(); ++pos) for (unsigned long pos = 0; pos < itA.Size(); ++pos)
{ {
...@@ -106,28 +64,8 @@ public: ...@@ -106,28 +64,8 @@ public:
vcl_log(totalFreq); vcl_log(totalFreq);
return jointEntropy; return jointEntropy;
/* TOutput meanA = 0.0;
TOutput meanB = 0.0;
for(unsigned long pos = 0; pos< itA.Size(); ++pos)
{
meanA += static_cast<TOutput>(itA.GetPixel(pos));
meanB += static_cast<TOutput>(itB.GetPixel(pos));
}*/
return static_cast<TOutput>(0);
} }
/* void SetHistogram(HistogramType* histo)
{
m_Histogram = histo;
}
protected:
HistogramType::Pointer m_Histogram; */
}; };
} }
} // end namespace otb } // end namespace otb
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment