1 | initial version |
you write:
write( fs , "keypoint", keypoints );
you read:
FileNode kptFileNode = fs2["keypoint1"];
see the mismatch ? you have to use the same "key" for both, ie "keypoint", not "keypoint1"
btw, the whole could be rewritten like:
FileStorage fs("keypoint1.yml", FileStorage::WRITE);
fs << "keypoint" << keypoints;
fs.release();
vector<KeyPoint> keypoint1s;
FileStorage fs2("keypoint1.yml", FileStorage::READ);
fs2["keypoint"] >> keypoint1s;
fs2.release();