void CascadeWriter::writeStages() { xml.writeStartElement("stages"); for (int i = 0; i < m_cascadeObj.stageNum(); i++) { QString stageStr = QString(" stage %1 ").arg(i); xml.writeComment(stageStr); Stage stage = m_cascadeObj.getStage(i); xml.writeStartElement("_"); xml.writeTextElement("maxWeakCount", QString::number(stage.maxWeakCount())); xml.writeTextElement("stageThreshold", QString::number(stage.stageThreshold())); // write weak classifiers xml.writeStartElement("weakClassifiers"); for (int j = 0; j < stage.maxWeakCount(); j++) { WeakClassifier wc = stage.getWeakClassifier(j); xml.writeStartElement("_"); xml.writeTextElement("internalNodes", wc.internalNodes()); xml.writeTextElement("leafValues", wc.leafValues()); xml.writeEndElement(); } xml.writeEndElement(); xml.writeEndElement(); } xml.writeEndElement(); }
WeakClassifier::WeakClassifier(const WeakClassifier &other) { m_internalNodes = other.internalNodes(); m_leafValues = other.leafValues(); }