Skip to content

Event Camera

Robotics / sensors

Resources

Dataset MVSEC

Download

pip install h5py
import h5py

def print_hdf5_structure(g, indent=0):
    """Recursively print the structure of an HDF5 file/group."""
    spacing = "  " * indent
    if isinstance(g, h5py.Dataset):
        print(f"{spacing}- Dataset: {g.name}, shape={g.shape}, dtype={g.dtype}")
    elif isinstance(g, h5py.Group):
        print(f"{spacing}+ Group: {g.name}")
        for key in g.keys():
            print_hdf5_structure(g[key], indent + 1)

# Open MVSEC file (replace with your file path)
file_path = "/home/user/Downloads/outdoor_day1_gt-001.hdf5"
with h5py.File(file_path, "r") as f:
    print("Top-level groups:", list(f.keys()))
    print("\nFull structure:\n")
    print_hdf5_structure(f)
  1. *_data.hdf5 This is the raw sensor data:

  2. *_gt.hdf5 This is the ground truth file:

View image from file

import h5py
import cv2
import numpy as np

# Path to your MVSEC dataset file (data file, not gt)
file_path = "/home/user/Downloads/outdoor_day1_data-004.hdf5"

# Open HDF5 file
with h5py.File(file_path, "r") as f:
    # Explore groups
    print("Top-level groups:", list(f.keys()))

    # APS frames are typically under: /davis/left/images/data
    images = f["davis"]["left"]["image_raw"]


    print("Number of images:", images.shape[0])
    print("Image shape:", images.shape[1:])  # (height, width)

    # Extract the first image
    first_img = images[0]  # shape (H, W), dtype=uint8

    # Show with OpenCV
    cv2.imshow("First APS Image", first_img)
    cv2.waitKey(0)
    cv2.destroyAllWindows()

Resources