Feature::Feature(const Feature &other) { m_tilted = other.tilted(); for (int i = 0; i < other.rectangleCount(); i++) { m_rectanglesList.append(other.getRectangle(i)); m_rectangleFactorsList.append(other.getRectangleFactor(i)); } }
void CascadeWriter::writeFeatures() { xml.writeStartElement("features"); for (int i = 0; i < m_cascadeObj.featureNum(); i++) { xml.writeStartElement("_"); xml.writeStartElement("rects"); Feature feature = m_cascadeObj.getFeature(i); for (int j = 0; j < feature.rectangleCount(); j++) { QRect rect = feature.getRectangle(j); int factor = feature.getRectangleFactor(j); QString str = QString("%1 %2 %3 %4 %5.").arg(rect.x()).arg(rect.y()).arg(rect.width()).arg(rect.height()).arg(factor); xml.writeTextElement("_", str); } xml.writeEndElement(); xml.writeTextElement("titled", QString::number(feature.tilted())); xml.writeEndElement(); } xml.writeEndElement(); }