Skip to content
Browse files

Syntactic sugar for g++-4.1.

  • Loading branch information...
1 parent 5f29e8f commit 7fb664849e9abdf30a530d3521c68c1869b80896 md@ip-10-224-82-32.eu-west-1.compute.internal committed with md
Showing with 9 additions and 4 deletions.
  1. +2 −1 backend/BitArrayScoreTable.cc
  2. +7 −3 backend/PreSelectScoreTable.cc
View
3 backend/BitArrayScoreTable.cc
@@ -122,7 +122,8 @@ BitArrayScoreTable::querySingleColor (ImageInformation &truncated, int pos,
{
CoeffInformation ci;
- score.addToScore (weights[0] * (::abs (truncated.at(0).val () - average)));
+ int difference = (int)(truncated.at(0).val () - average);
+ score.addToScore (weights[0] * (::abs (difference)));
for (int j = 1; j < truncated.size (); ++j)
{
ci = truncated.at(j);
View
10 backend/PreSelectScoreTable.cc
@@ -78,11 +78,15 @@ PreSelectScoreTable::p_query (ImageInformation &qY, ImageInformation &qU,
double avgY = qY.at(0).val ();
double avgU = qU.at(0).val ();
double avgV = qV.at(0).val ();
+ int difference;
for (int i = 0; i < scores.size (); ++i)
{
- scores[i].addToScore (m_weightY[0] * (::abs (avgY - m_averageY[i])));
- scores[i].addToScore (m_weightU[0] * (::abs (avgU - m_averageU[i])));
- scores[i].addToScore (m_weightV[0] * (::abs (avgV - m_averageV[i])));
+ difference = (int)(avgY - m_averageY[i]);
+ scores[i].addToScore (m_weightY[0] * (::abs (difference)));
+ difference = (int)(avgU - m_averageU[i]);
+ scores[i].addToScore (m_weightU[0] * (::abs (difference)));
+ difference = (int)(avgV - m_averageV[i]);
+ scores[i].addToScore (m_weightV[0] * (::abs (difference)));
}
querySingleColor (qY, scores, m_positiveY, m_negativeY, m_weightY);

0 comments on commit 7fb6648

Please sign in to comment.
Something went wrong with that request. Please try again.