|
From: Gustavo P. B. <gb...@us...> - 2005-04-06 04:13:01
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25586/src/methods/hsvcm Modified Files: hsvcm.cpp Log Message: - Implemented the usage of the features in KTHSVCM - implemented entropy function - implemented angsecmom function Index: hsvcm.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/hsvcm/hsvcm.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- hsvcm.cpp 5 Apr 2005 22:49:08 -0000 1.4 +++ hsvcm.cpp 6 Apr 2005 04:12:52 -0000 1.5 @@ -76,6 +76,40 @@ calculateHSVCM(); + int d,i,j,k; + QValueList<float> results[9]; + + FeatureList features = KTFeatureManager::self()->features("hsvcm"); + + /* results calculation: second step (2/3) */ + for (d = 0; d < 9; ++d) + { + QDictIterator<KTFeature> it(features); + for (; it.current(); ++it) + if (it.current()->enabled()) + results[d].append(it.current()->calculate(img, d)); + } + + //FIXME: Hardcoded using mean of all angles + for (i=0; i < results[0].count(); ++i) + { + for (int j=1; j < 9; j++) + results[0][i] += results[j][i]; + results[0][i] /= 9.; + } + + //final results + QValueList<float> result; + for (j=0; j < results[0].count(); ++j) + result.append(results[0][j]); + + if (backend != 0) + { + if (m_testingPattern) + backend->parseResults(result); + else + backend->parseSampleResults(result, imgClass); + } //delete the GLCM's after calculating for (int d=0; d < 9; d++) @@ -240,7 +274,6 @@ S = S / m_quantS; m_cm[d][V][H][S]++; - kdDebug() << "Got H,S,V = " << H << " " << S << " " << V << endl; } } |