Closed tjzetty closed 3 years ago
Hi @tjzetty, I'm using opencv to do that. Take a look at this method :) https://github.com/AlanNaoto/carla-dataset-runner/blob/master/utils/create_video_on_hdf5/create_content_on_hdf5.py#L55-L79
Awesome, thank you! So could I pass the hdf5 file as an argument to the python file like this: python3 create_content_on_hdf5.py datafile.hdf5
ATM the input to create_video_sample() is hardcoded to the path, so you'd have to change this string yourself in the python file and then do
python3 create_content_on_hdf5.py
So is there a way to get the images with the bounding boxes as well? I imagine the timestamps and RGB data were gathered from an image.
I do save the bounding box images in the footage. Take a look on the "create_content_on_hdf5.py" file.
# bb
bb_vehicles = bb_vehicles_data
bb_walkers = bb_walkers_data
if all(bb_vehicles != -1):
for bb_idx in range(0, len(bb_vehicles), 4):
coordinate_min = (int(bb_vehicles[0 + bb_idx]), int(bb_vehicles[1 + bb_idx]))
coordinate_max = (int(bb_vehicles[2 + bb_idx]), int(bb_vehicles[3 + bb_idx]))
cv2.rectangle(rgb_data, coordinate_min, coordinate_max, (0, 255, 0), 1)
if all(bb_walkers != -1):
for bb_idx in range(0, len(bb_walkers), 4):
coordinate_min = (int(bb_walkers[0 + bb_idx]), int(bb_walkers[1 + bb_idx]))
coordinate_max = (int(bb_walkers[2 + bb_idx]), int(bb_walkers[3 + bb_idx]))
cv2.rectangle(rgb_data, coordinate_min, coordinate_max, (0, 0, 255), 1)
All your suggestions worked for me, thank you!
Could you explain how you converted the rgb data into a video format? I would like this for presenting.