Skip to content

hdf_open

hdffunctionOpenCV 5.0.0
import { hdf_open } from '@banou/opencv-wasm'

Use after await initOpenCV(). See the initialization and named imports guide.

ARGUMENTSHDF5Filename
FUNCTIONhdf_open
RETURN TYPEhdf_HDF5 | null
Call structure. A void return can still write to destination arguments. The parameter descriptions define inputs, outputs and ownership.

Open or create hdf5 file

Note: If the specified file does not exist, it will be created using default properties. Otherwise, it is opened in read and write mode with default access properties. Any operations except dscreate() functions on object will be thread safe. Multiple datasets can be created inside a single hdf5 file, and can be accessed from the same hdf5 object from multiple instances as long read or write operations are done over non-overlapping regions of dataset. Single hdf5 file also can be opened by multiple instances, reads and writes can be instantiated at the same time as long as non-overlapping regions are involved. Object is released using close().

  • Example below opens and then releases the file.
    // open / auto create hdf5 file
    cv::Ptr<cv::hdf::HDF5> h5io = cv::hdf::open( "mytest.h5" );
    // ...
    // release
    h5io->close();
  

Visualization of 10x10 CV_64FC2 (Hilbert matrix) using HDFView tool

  • Text dump (3x3 Hilbert matrix) of hdf5 dataset using h5dump tool:
  $ h5dump test.h5
  HDF5 "test.h5" {
  GROUP "/" {
     DATASET "hilbert" {
        DATATYPE  H5T_ARRAY { [2] H5T_IEEE_F64LE }
        DATASPACE  SIMPLE { ( 3, 3 ) / ( 3, 3 ) }
        DATA {
        (0,0): [ 1, -1 ], [ 0.5, -0.5 ], [ 0.333333, -0.333333 ],
        (1,0): [ 0.5, -0.5 ], [ 0.333333, -0.333333 ], [ 0.25, -0.25 ],
        (2,0): [ 0.333333, -0.333333 ], [ 0.25, -0.25 ], [ 0.2, -0.2 ]
        }
     }
  }
  }
  
hdf_open(HDF5Filename: EmbindString): hdf_HDF5 | null;
HDF5Filename

specify the HDF5 filename.

Returns a pointer to the hdf5 object class

Returns

The hdf_HDF5 | null result.

These signatures describe this package. Upstream documentation can mention optional backends that are absent from this build. Check runtime compatibility before choosing a backend or file format.