Main Content

sim3d.sensors.IdealCamera

Create ideal camera actor to capture image and make it available in MATLAB

Since R2022b

    Description

    Use the sim3d.sensors.IdealCamera object to create a virtual ideal camera object in the 3D environment. You can use the ideal camera actor to capture an image and return the image to MATLAB®. After you create a sim3d.sensors.IdealCamera object you can modify aspects of the actor object by setting property values.

    Creation

    Description

    camera = sim3d.sensors.IdealCamera()creates a default sim3d.sensors.IdealCamera object in the 3D environment.

    camera = sim3d.sensors.IdealCamera(Name=Value) specifies options using one or more optional name-value arguments. For example, to create a camera actor with horizontal field of view of 60, set HorizontalFieldOfView to 60.

    Input Arguments

    expand all

    Name-Value Arguments

    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',"Camera",'ImageSize', [768, 1024],'HorizontalFieldOfView', 60)

    Name of actor, specified as a character array or string. If you do not specify an actor name, then the software assigns the actor an autogenerated name. Use this argument to set the name of the sim3d.sensors.IdealCamera object.

    Note

    If you specify the same name as an actor that already exists, then the software appends actor name you specify with a unique identifier.

    Image size returned by camera, specified as a 1-by-2 vector of real positive integers, 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 actor object. After you add an actor to the sim3d.World object, the default parent actor is the Scene Origin at [0,0,0]. Use this property to set any actor in the 3D environment as the parent actor of a sim3d.sensors.IdealCamera object.

    This property is read-only.

    Children of actor, specified as a structure. Each field of the structure contains a handle to the child of a sim3d.sensors.IdealCamera object.

    Parent world, specified as a handle to the parent sim3d.World object. You can use this property only if the sim3d.sensors.IdealCamera object is added to the parent sim3d.World object.

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

    Data Types: uint32

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

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

    Actor orientation representation in the 3D environment, specified as 'Default', 'MATLAB', 'ISO8855', 'AERO', 'VRML', or 'SAE'. The values are not case-sensitive. To display the actor transformation in the specified coordinate system, set this property first, and then set the transform properties Translation, Rotation, and Scale.

    Coordinate System Description
    'Default'

    The default coordinate system, in m and rad.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward right.

    • Z-axis points upward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Counterclockwise rotation about Z-axis

    Three dimensional default coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'MATLAB'

    The MATLAB coordinate system, in m and rad.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward left.

    • Z-axis points upward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional MATLAB coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'ISO8855'

    The ISO 8855 standard coordinate system, in m and deg. For more information, see ISO Standards.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward left.

    • Z-axis points upward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional ISO8855 coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'AERO'

    The coordinate system for aerospace applications, in m and rad. For more information, see Body Coordinates (Aerospace Blockset).

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward right.

    • Z-axis points downward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional aero coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'VRML'

    The X3D ISO standard coordinate system, in m and rad.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points upward.

    • Z-axis points toward right.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Counterclockwise rotation about Y-axis

    • Yaw — Counterclockwise rotation about Z-axis

    Three dimensional VRML coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    'SAE'

    The SAE J670 standard coordinate system, in m and rad. For more information, see SAE International Standards.

    Axes

    • X-axis points away from the viewer.

    • Y-axis points toward right.

    • Z-axis points downward.

    Rotation

    • Roll — Clockwise rotation about X-axis

    • Pitch — Clockwise rotation about Y-axis

    • Yaw — Clockwise rotation about Z-axis

    Three dimensional SAE coordinate system with X,Y,Z, Roll, Pitch, and Yaw labelled

    Data Types: string

    Relative translation (x,y,z) of the actor object to its parent actor, specified as a real 1-by-3 vector, in m. Use Translation to change the position of the sim3d.sensors.IdealCamera object in the 3D environment along the X, Y, and Z axes of the coordinate system. When you add an actor to the 3D environment the default parent actor is the Scene Origin at (0,0,0).

    Example: camera.Translation = [1,2,1]

    Relative rotation (roll, pitch, yaw) of the actor object to its parent actor, specified as a real 1-by-3 vector, in rad. Use Rotation to rotate the sim3d.sensors.IdealCamera object in the 3D environment.

    Example: camera.Rotation = [pi/4,pi/8,pi/2]

    Type of actor mobility to respond to physics and/or move the actor during simulation, specified as 'sim3d.utils.MobilityTypes.Movable' or 'sim3d.utils.MobilityTypes.Static'.

    Example: camera.Mobility = sim3d.utils.MobilityTypes.Movable

    Data Types: sim3d.utils.MobilityTypes

    Object Functions

    readReturn image captured with camera

    Version History

    Introduced in R2022b