|
From: Gustavo P. B. <gb...@us...> - 2005-06-23 03:18:57
|
Update of /cvsroot/kimageprocess/kimageprocess/src/plugins/fann In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17877/src/plugins/fann Modified Files: fann.cpp fann.h Log Message: All managers classes now use self() (global instance), which is much better than being passing pointers all around Index: fann.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/plugins/fann/fann.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- fann.h 10 Apr 2005 20:42:58 -0000 1.2 +++ fann.h 23 Jun 2005 03:18:48 -0000 1.3 @@ -96,4 +96,4 @@ void slotClassifyImage(); }; -#endif \ No newline at end of file +#endif Index: fann.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/plugins/fann/fann.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- fann.cpp 19 Jun 2005 02:03:16 -0000 1.3 +++ fann.cpp 23 Jun 2005 03:18:48 -0000 1.4 @@ -70,8 +70,8 @@ if (m_network) fann_destroy(m_network); - m_input = imageManager()->activeFeaturesCount(); - m_output = imageManager()->sampleCount(); + m_input = KTImageManager::self()->activeFeaturesCount(); + m_output = KTImageManager::self()->sampleCount(); //create the network m_network = fann_create(m_connectionRate, m_learningRate, 3, m_input, m_input, m_output); @@ -82,7 +82,7 @@ m_error = 0.0; //start training - imageManager()->generatePatternFile(0, this); + KTImageManager::self()->calculateSampleData(0, this); struct fann_train_data tfanndata; float *tempf_outputs; @@ -150,7 +150,7 @@ if (!m_network) return; - KTImage *img = imageManager()->testingImage(); + KTImage *img = KTImageManager::self()->testingImage(); m_width = img->width(); m_height = img->height(); @@ -162,7 +162,7 @@ m_colorStep = 255/(m_output-1); kdDebug() << "Color step is: " << m_colorStep << endl; m_patterns.clear(); - imageManager()->generateTestPatFile(0, this); + KTImageManager::self()->calculateTestData(0, this); //save the image KURL dest = KFileDialog::getSaveURL(QString::null,i18n("*.pgm|PGM File"),0,i18n("Save classified image")); @@ -239,4 +239,4 @@ m_patterns.append(pat); } -#include "fann.moc" \ No newline at end of file +#include "fann.moc" |