Ask Your Question
0

OpenCV 4.0.1 cannot parse XML file anymore

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

Hi,

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"?>
<opencv_storage>
<logging>
  <logFile>recorder.log</logFile>
  <logLevel>warning</logLevel>
  <logDir>../output</logDir>
  <logType>file</logType>
</logging>
</opencv_storage>

I'm reading from the file like this:

cv::FileStorage base_node_ = cv::FileStorage(file_path, cv::FileStorage::READ);
if(!base_node_.isOpened())
    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?

Thanks!

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

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

Stats

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

Seen: 774 times

Last updated: Apr 05 '19