ExtractCVSCPP.cpp
Go to the documentation of this file.
00001 #include <ros/ros.h>
00002 
00003 #include <sstream>
00004 #include <iostream>
00005 #include <tinyxml/tinyxml.h>
00006 #include <fstream>
00007 
00008 int main(int argc, char* argv[]) {
00009 
00010         ros::init(argc, argv, "extractcvscpp");
00011         ros::NodeHandle n;
00012 
00013         TiXmlDocument doc( "julian_prosilica1.xml" );
00014         if (!doc.LoadFile()) {
00015                 ROS_ERROR("could not load xml file");
00016                 return 1;
00017         }
00018         ROS_INFO("Loaded xml document");
00019 
00020         TiXmlElement *root = doc.RootElement();
00021         std::fstream filestr ("julian_prosilica1_th1eqth2_blurwidth_numgraphs.dat", std::fstream::in | std::fstream::out | std::fstream::trunc);
00022 
00023         for(TiXmlElement* image = root->FirstChildElement(); image; image = image->NextSiblingElement()) {
00024                 std::string threshold1 = "";
00025                 std::string threshold2 = "";
00026                 std::string blurwidth = "";
00027                 std::string resultGraphmass = "";
00028                 std::string numGraphs = "";
00029                 for (TiXmlElement* entry = image->FirstChildElement(); entry; entry = entry->NextSiblingElement()) {
00030                         std::string name = entry->FirstChild("name")->FirstChild()->Value();
00031                         std::string value = entry->FirstChild("content")->FirstChild()->Value();
00032                         if (name == "filter1_threshold1") {
00033                                 threshold1 = value;
00034                         } else if (name == "filter1_threshold2") {
00035                                 threshold2 = value;
00036                         } else if (name == "filter0_blurwidth") {
00037                                 blurwidth = value;
00038                         } else if (name == "result_graphmass") {
00039                                 resultGraphmass = value;
00040                         } else if (name == "result_numgraphs") {
00041                                 numGraphs = value;
00042                         }
00043                 }
00044                 if (threshold1 == threshold2) {
00045                         filestr<<threshold1<<"\t"<<blurwidth<<"\t"<<numGraphs<<"\n";
00046                 }
00047         }
00048         filestr.close();
00049 
00050         return 0;
00051 
00052 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends


face_contour_detector
Author(s): Fabian Wenzelmann and Julian Schmid
autogenerated on Wed Dec 26 2012 16:18:17