how to read a YML vector in python
OPENCV 4.2
I record a vector in C++
vector<float> myVector;
//... filling vector somewhere ...
name = "myVector";
// storing vector
myFileStorage << name << myVector;
This gives an YML file beginning like this:
%YAML:1.0
---
myVector: [ 0., 1.00840342e+00, 1.09243703e+02 ]
Afterward I can't retrieve this vector in python (FileNode type returns NONE) while getting Mat style is as easy as:
f= cv.FileStorage(file, cv.FILE_STORAGE_READ)
data0 = (f.getNode("data0").mat())
I've added a subroutine getting this done manually but it's a pity to not be able to retrieve it directly from FileStorage.
EDIT
@berak : Being a new user I can't reply before 2 days...
With a one-line instruction I can get back OpenCV Mat from FileStorage
For Vector I would love something like
myVector = (f.getNode("myVector").vect())
I've not found any answer yet.
unclear, what you mean here, can you explain more, please ?