affichier un vector de type cvPoint2D32f
bonjour
je suis débutante en c++, dans mon travail j'utilise la bibliothèque opencv,
ma question est la suivante: comment je peux afficher un vecteur de type cvPoint2D32f dans un fichier texte?
j'ai essayer ces instructions :
Code:
1 2 3 4 5 6 7 8
|
ofstream fichier ("D:\\test.txt", ios::out | ios::trunc);
if(fichier){
for (int i=0;i<pointsout.size(); i++){
fichier<< pointsout[i]>>std::endl;
}
fichier.close();
} |
alors j'obtiens le message d'erreur suivant:
Citation:
error: no match for 'operator <<' in fichier<<pointsout.std::vector<_Tp,_Alloc:::operator[] [with_Tp=CvPoint2D32f, alloc= .....
et j'ai essayer ces instructions afin d'utiliser printf:
Code:
1 2 3 4 5
| for (int i=0;i<pointsout.size(); i++){
printf("%f\t", pointsout[i]);
}
fichier.close();
} |
alors j'ai obtenu l'affichage mais j'ai un problème de la conversation de CvPoint2D32f.
j’espère bien trouver une solution rapide. Merci d'avance