Main Content

sim3d.sensors.IdealCamera

Capture an image and make it available in MATLAB

Since R2022b

    Description

    Use the sim3d.sensors.IdealCamera class to capture an image with the virtual ideal camera in the 3D simulation environment and return the image to MATLAB®.

    Creation

    Description

    camera = sim3d.sensors.IdealCamera('ActorName',actor) returns a sim3d.sensors.IdealCamera object with the actor specified by ActorName.

    camera = sim3d.sensors.IdealCamera('ImageSize',[VerticalResolution, HorizontalResolution]) returns an image of the size specified by 'ImageSize'.

    camera = sim3d.sensors.IdealCamera('HorizontalFieldOfView',fieldOfView) returns the horizontal field of view in degrees, specified by 'HorizontalFieldOfView's.

    Input Arguments

    expand all

    Specify optional pairs of arguments as Name1=Value1,...,NameN=ValueN, where Name is the argument name and Value is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

    Example: Camera = sim3d.sensors.IdealCamera('ActorName',Camera2)

    Name of camera actor, specified as a character vector or string.

    Example: Camera = sim3d.sensors.IdealCamera('ActorName',Camera2)

    Image size returned by camera, specified as a 1-by-2 vector of real positive integers. The unit is in Pixels.

    Horizontal field of view in degrees, specified as a real nonnegative scalar.

    Properties

    expand all

    Parent of actor, specified as a handle to the parent sim3d.Actor object.

    Children of actor, specified as a handle to the children sim3d.Actor object.

    This property is read only.

    Parent world method handle, specified as a handle to the sim3d.World object.

    Unique ID of the sensor, specified as a real positive scalar.

    Data Types: uint32

    Translation of sensor relative to the parent vehicle, specified as a real 1-by-3 vector, in meters.

    Rotation (roll, pitch, yaw) of sensor relative to the parent vehicle, specified as a real 1-by-3 vector, in radians.

    Object Functions

    readReturn image captured with camera

    Version History

    Introduced in R2022b