Main Content

snapshot

Acquire single image frame from Ryze drone camera

Since R2020a

Add-On Required: This feature requires the MATLAB Support Package for Ryze Tello Drones add-on.

Description

frame = snapshot(cameraObj) returns a single image from the drone camera object, specified as cameraObj. Calling snapshot in a loop returns a new frame for each iteration of the loop.

example

[frame,ts] = snapshot(cameraObj) acquires a single image from the drone camera object, specified as cameraObj, assigns it to the variable frame, and returns the timestamp ts.

example

Examples

collapse all

Connect to a Ryze Tello drone.

droneObj = ryze()
droneObj = 
          ryze with properties:

                    Name: "Tello"
                      ID: "TELLO-D2B07B"
               IPAddress: "192.168.10.1"
                   State: "landed"
            BatteryLevel: 50%
             StationMode: 0
        AvailableCameras: ["FPV"]

Connect to the drone's camera using the camera object.

cameraObj = camera(droneObj);
cameraObj = 
          Camera with properties:

                    Name: "FPV"
              Resolution: "720x960" 

Capture an image from the drone's camera.

frame = snapshot(cameraObj);

Connect to a Ryze Tello drone.

droneObj = ryze()
droneObj = 
          ryze tello with properties:

                    Name: "Tello"
                      ID: "TELLO-D2B07B"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]

Connect to the drone's camera using the camera object.

cameraObj = camera(droneObj);
cameraObj = 
          Camera with properties:

                    Name: "FPV"
              Resolution: "720x960" 

Capture an image from the drone camera and assign it to frame, acquire the timestamp, and assign it to ts.

[frame,ts] = snapshot(cameraObj);

Display the acquired image.

imshow(frame)

Display the timestamp of the snapshot.

ts
time =  
        datetime
          15-Aug-2019 14:07:19                   

Input Arguments

collapse all

Ryze drone camera connection object, specified as cameraObj.

Output Arguments

collapse all

The RGB image captured by the drone's camera, specified as a uint8 matrix.

Version History

Introduced in R2020a