本文整理汇总了C++中BitmapImage::findAnswers方法的典型用法代码示例。如果您正苦于以下问题:C++ BitmapImage::findAnswers方法的具体用法?C++ BitmapImage::findAnswers怎么用?C++ BitmapImage::findAnswers使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BitmapImage
的用法示例。
在下文中一共展示了BitmapImage::findAnswers方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: gradeResponseCards
void gradeResponseCards(){
string gabarito;
string path;
DIR* directory;
struct dirent *ep;
list<string> gabaritos;
cout << "Entre com o gabarito oficial: ";
getline(cin, gabarito);
cout << "Entre com o caminho com os gabaritos à serem corrigidos: ";
getline(cin, path);
directory = opendir(path.c_str());
if(directory == NULL){
cerr << "Error(" << errno << ") opening " << directory << endl;
return;
}
while((ep = readdir(directory))){
auto filePath = path + "/" + ep->d_name;
if(has_suffix(filePath, ".bmp")){
cout << filePath << endl;
gabaritos.push_back(filePath);
}
}
cout << "-------------------------------------------------" << endl;
cout << " Gabarito: " << gabarito << endl;
cout << "-------------------------------------------------" << endl;
cout << " Diretorio: " << directory << endl;
for(auto it = gabaritos.begin(); it != gabaritos.end(); it++){
cout << "-------------------------------------------------" << endl;
string aux="";
aux+= *it;
string aux2="";
BitmapImage teste = BitmapImage(aux, find_file_name((*it)));
cout << teste.fileName << endl;
teste.toBlackAndWhite();
teste.Erode(5);
teste.Dilate(8);
teste.findTopLeftRectangle();
teste.findBotLeftRectangle();
teste.findTopRightRectangle();
teste.findAnswers(teste.topLeft);
cout << " Respostas: ";
int sum = 0;
int blank = 0;
int multipleAnswers = 0;
for (int i = 0; i < teste.answers.size(); i++) {
if(gabarito[i] == teste.answers[i]) sum++;
if(teste.answers[i] == 'O') blank++;
if(teste.answers[i] == 'X') multipleAnswers ++;
cout << teste.answers[i];
}
cout << endl;
cout << " Acertos: " << sum << endl;
cout << " Brancos: " << blank << endl;
cout << " Multiplas Respostas: " << multipleAnswers << endl;
}
cout << "-------------------------------------------------" << endl;
return;
}