Commit f1fe5e78635a6e4f1480a82632162bd768476963

Authored by Josh Klontz
1 parent 0ffc0a8f

training bug fix

sdk/openbr_plugin.cpp
... ... @@ -868,6 +868,7 @@ void MatrixOutput::initialize(const FileList &targetFiles, const FileList &query
868 868 data.create(queryFiles.size(), targetFiles.size(), CV_32FC1);
869 869 }
870 870  
  871 +/* MatrixOutput - protected methods */
871 872 QString MatrixOutput::toString(int row, int column) const
872 873 {
873 874 if (targetFiles[column] == "Label")
... ... @@ -881,6 +882,8 @@ void MatrixOutput::set(float value, int i, int j)
881 882 data.at<float>(i,j) = value;
882 883 }
883 884  
  885 +BR_REGISTER(Output, MatrixOutput)
  886 +
884 887 /* Gallery - public methods */
885 888 TemplateList Gallery::read()
886 889 {
... ... @@ -1164,7 +1167,7 @@ void Distance::train(const TemplateList &amp;templates)
1164 1167 {
1165 1168 const TemplateList samples = templates.mid(0, 2000);
1166 1169 const QList<float> sampleLabels = samples.labels<float>();
1167   - QSharedPointer<MatrixOutput> memoryOutput((MatrixOutput*)Output::make("Matrix", FileList(samples.size()), FileList(samples.size())));
  1170 + QScopedPointer<MatrixOutput> memoryOutput(dynamic_cast<MatrixOutput*>(Output::make(".Matrix", FileList(samples.size()), FileList(samples.size()))));
1168 1171 compare(samples, samples, memoryOutput.data());
1169 1172  
1170 1173 double genuineAccumulator, impostorAccumulator;
... ...
sdk/openbr_plugin.h
... ... @@ -703,6 +703,7 @@ protected:
703 703  
704 704 const QString abstraction = baseClassName();
705 705 if (name.endsWith(abstraction)) name = name.left(name.size()-abstraction.size());
  706 + if (name.startsWith("br::")) name = name.right(name.size()-4);
706 707 if (registry->contains(name)) qFatal("%s registry already contains object named: %s", qPrintable(abstraction), qPrintable(name));
707 708 registry->insert(name, this);
708 709 }
... ...