|
@@ -1,17 +1,15 @@
|
|
|
#include <iostream>
|
|
|
#include <QImage>
|
|
|
+#include <vector>
|
|
|
+#include <QString>
|
|
|
#include "SLList.hpp"
|
|
|
|
|
|
-void usage(char** argv)
|
|
|
-{
|
|
|
- std::cout << "usage : " << argv[0] << " json1 json2 image" << std::endl;
|
|
|
-}
|
|
|
|
|
|
int main(int argc, char** argv)
|
|
|
{
|
|
|
- if(argc!=4)
|
|
|
+ /*if(argc!=4)
|
|
|
{
|
|
|
- usage(argv);
|
|
|
+ std::cout << "usage : " << argv[0] << " json1 json2 image" << std::endl;
|
|
|
return EXIT_FAILURE;
|
|
|
}
|
|
|
|
|
@@ -21,8 +19,42 @@ int main(int argc, char** argv)
|
|
|
SLList sll1(fichier1);
|
|
|
SLList sll2(fichier2);
|
|
|
QImage img(argv[3]);
|
|
|
- std::pair<double, int> resultat = sll1.distance_avg(&sll2, &img);
|
|
|
- std::cout << "( " << resultat.first << " , " << resultat.second << " )" << std::endl;
|
|
|
- //resultat = sll1.distance_hausdorff(&sll2, &img);
|
|
|
- //std::cout << "( " << resultat.first << " , " << resultat.second << " )" << std::endl;
|
|
|
+ std::pair<double, int> resultat = SLList::distance(&sll1, &sll2, &img);
|
|
|
+ std::cout << "( " << resultat.first << " , " << resultat.second << " )" << std::endl;*/
|
|
|
+
|
|
|
+ std::string path="../officialTestDirectory/img";
|
|
|
+ std::vector<std::string> numImg;
|
|
|
+ std::vector<std::string> nomExpert;
|
|
|
+
|
|
|
+ for(unsigned int i=1; i<10; i++)
|
|
|
+ numImg.push_back(std::string("0").append(std::to_string(i)));
|
|
|
+ for(unsigned int i=10; i<41; i++)
|
|
|
+ numImg.push_back(std::to_string(i));
|
|
|
+
|
|
|
+ nomExpert.push_back("algo");
|
|
|
+ nomExpert.push_back("jing");
|
|
|
+ nomExpert.push_back("rcozot");
|
|
|
+ nomExpert.push_back("remiS");
|
|
|
+ nomExpert.push_back("samuel");
|
|
|
+
|
|
|
+ for(unsigned int i=0; i<numImg.size(); i++)
|
|
|
+ {
|
|
|
+ QImage img(std::string(path).append(numImg[i]).append(".jpg").c_str());
|
|
|
+ SLList listA(std::string(path).append(numImg[i]).append("_").append(nomExpert[1]).append(".json"));
|
|
|
+ SLList listB(std::string(path).append(numImg[i]).append("_").append(nomExpert[2]).append(".json"));
|
|
|
+ SLList listC(std::string(path).append(numImg[i]).append("_").append(nomExpert[3]).append(".json"));
|
|
|
+ SLList listD(std::string(path).append(numImg[i]).append("_").append(nomExpert[4]).append(".json"));
|
|
|
+ std::pair<double, int> dAB = SLList::distance(&listA, &listB, &img);
|
|
|
+ std::pair<double, int> dAC = SLList::distance(&listA, &listC, &img);
|
|
|
+ std::pair<double, int> dAD = SLList::distance(&listA, &listD, &img);
|
|
|
+ std::pair<double, int> dBC = SLList::distance(&listB, &listC, &img);
|
|
|
+ std::pair<double, int> dBD = SLList::distance(&listB, &listD, &img);
|
|
|
+ std::pair<double, int> dCD = SLList::distance(&listC, &listD, &img);
|
|
|
+ std::cout << "--------" << numImg[i] << "--------" << std::endl;
|
|
|
+ std::cout << "Score A - Jing : " << std::get<0>(dAB)+std::get<0>(dAC)+std::get<0>(dAD) << std::endl;
|
|
|
+ std::cout << "Score B - rcozot : " << std::get<0>(dAB)+std::get<0>(dBC)+std::get<0>(dBD) << std::endl;
|
|
|
+ std::cout << "Score C - remiS : " << std::get<0>(dAC)+std::get<0>(dBC)+std::get<0>(dCD) << std::endl;
|
|
|
+ std::cout << "Score D - samuel : " << std::get<0>(dAD)+std::get<0>(dBD)+std::get<0>(dCD) << std::endl;
|
|
|
+ std::cout << std::endl << std::endl << std::endl;
|
|
|
+ }
|
|
|
}
|