I have a text file and content is :
# Details for object 1 ("PASperson")
# Center point -- not available in other PASCAL databases -- refers
# to person head center
Original label for object 1 "PASperson" : "UprightPerson"
Center point on object 1 "PASperson" (X, Y) : (281, 169)
Bounding box for object 1 "PASperson" (Xmin, Ymin) - (Xmax, Ymax) : (250, 151) - (299, 294)
# Details for object 2 ("PASperson")
# Center point -- not available in other PASCAL databases -- refers
# to person head center
Original label for object 2 "PASperson" : "UprightPerson"
Center point on object 2 "PASperson" (X, Y) : (247, 373)
Bounding box for object 2 "PASperson" (Xmin, Ymin) - (Xmax, Ymax) : (215, 354) - (274, 466)
Now i want to get Xmin Ymin Xmax Ymax value and use in my c++ program to compare these coordinate with my newly generated coordinate. So how to do this. I can get string "Xmax, Ymax" from text file but i don't know how to read after that to get coordinate . My code is to serach string is:
int main()
{
std::string data;
ifstream read_file("crop001501.txt",ios::in);
char *search="Xmax, Ymax";
int offset;
while(std::getline(read_file ,data))
{
//read_file>>data;
//cout<<data<<endl;
if ((offset = data.find(search, 0)) != string::npos) {
cout << "found '" << search << endl;}
}
cin.get();
return 0;
}
This program is searching string Xmax,Ymax in every line and whenever found then printing found. but I want this string's pointer so that i can increase pointer value and read value of Xmin then skip , and read value of Ymin then skip ) - and read value of Xmax and same for Ymax . After getting value go to next line and do same. If anyone know any other method to read these value then please tell me , I don't need value of X,Y . If any mistake then sorry I am new here . Thanks in advance