Main Content

datastore

Create datastore from sensor data object

Since R2024b

Description

ds = datastore(sensorDataObj) creates a datastore ds for the specified sensor data object sensorDataObj.

Note

This function requires the Scenario Builder for Automated Driving Toolbox™ support package. You can install the Scenario Builder for Automated Driving Toolbox support package from the Add-On Explorer. For more information about installing add-ons, see Get and Manage Add-Ons.

example

Examples

collapse all

Specify a sequence of image filenames.

images = ["Frame01.png","Frame02.png","Frame03.png","Frame04.png","Frame05.png", ...
    "Frame06.png","Frame07.png","Frame08.png","Frame09.png","Frame10.png"]';

Specify timestamps for each image frame.

timestamps = (0.1:0.1:1)';

Create a camera data object using the specified timestamps and image files.

camData = scenariobuilder.CameraData(timestamps,images)
camData = 
  CameraData with properties:

                Name: ''

          NumSamples: 10
            Duration: 0.9000
          SampleRate: 11.1111
          SampleTime: 0.1000
          Timestamps: [10×1 double]

              Frames: [10×1 string]
    SensorParameters: []

          Attributes: []

Create a datastore from the camera data object.

ds = datastore(camData);

Read the first image from the created datastore.

I = read(ds);

Visualize the image.

imshow(I)

Input Arguments

collapse all

Sensor data, specified as a CameraData object or LidarData object.

Output Arguments

collapse all

Image datastore, returned as an ImageDatastore object.

Version History

Introduced in R2024b