OpenCV  3.4.16
Open Source Computer Vision
The Hierarchical Data Format (hdf) I/O

Here you will know how to read and write a HDF5 file using OpenCV. Specifically, it shows you how to read/write groups, datasets and attributes.

Note
The HDF5 library has to be installed in your system to use this module.