Ask Your Question

OpenCV 4.0.1 cannot parse XML file anymore

asked 2019-04-05 16:08:07 -0600


I just upgraded my projects dependencies from OpenCV 3.4.4 to 4.0.1. I have a XML and YAML wrapper for the persistence module in OpenCV and it did work before without problems. Now, I have the following problem, when I try to read a node from the XML file:

terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.0.1) opencv/modules/core/src/persistence.cpp:1716: error: (-215:Assertion failed) blockIdx < fs_data_ptrs.size() in function 'getNodePtr'

Both, blockIdx and fs_data_ptrs.size() are 0, when I try to read ANY node and then it fails. I'm thought it might be a problem with the XML format, but I reformated it in many ways: tabs, 2 spaces, 4 spaces, different indendations, without the "opencv_storage" tag etc. but nothing seems to work. My XML looks like this:

<?xml version="1.0"?>

I'm reading from the file like this:

cv::FileStorage base_node_ = cv::FileStorage(file_path, cv::FileStorage::READ);
    throw SomeException("text");
cv::FileNode category_node = base_node_["logging"];

And in the last line here, it crashes already. I have no idea what to try anymore. Can anyone help me?


edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted

answered 2019-04-07 02:27:40 -0600

berak gravatar image

sorry, but i cannot reproduce it with either 4.0.0 or 4.1.0

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2019-04-05 16:08:07 -0600

Seen: 645 times

Last updated: Apr 05 '19