Main Content

snapshot

Acquire single image frame from Parrot drone FPV camera

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

Description

frame = snapshot(cameraObj) returns a single image from the Parrot® 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 Parrot drone camera object, specified as cameraObj, assigns it to the variable frame, and returns the timestamp ts.

example

Examples

collapse all

Connect to a Parrot Mambo FPV drone over a wireless network.

parrotObj = parrot('Mambo')
parrotObj = 
          parrot with properties:

                    Name: "Mambo"
                      ID: "Mambo_650559"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]   

Connect to the FPV camera

cameraObj = camera(parrotObj,'FPV')
cameraObj = 
          camera with properties:

                    Name: "FPV"
              Resolution: "640x360"                    

Capture an image from the FPV camera

frame = snapshot(cameraObj);

Connect to a Parrot Mambo FPV drone over a wireless network.

parrotObj = parrot('Mambo')
parrotObj = 
          parrot with properties:

                    Name: "Mambo"
                      ID: "Mambo_650559"
                   State: "landed"
            BatteryLevel: 50%
        AvailableCameras: ["FPV"]   

Connect to the FPV camera

cameraObj = camera(parrotObj,'FPV')
cameraObj = 
          camera with properties:

                    Name: "FPV"
              Resolution: "640x360"                    

Capture an image from the FPV 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-Mar-2019 14:07:19                   

Input Arguments

collapse all

Parrot drone camera connection object, specified as a camera object.

Output Arguments

collapse all

The RGB image captured by the FPV camera of the drone, specified as a real-valued matrix.

Version History

Introduced in R2019a

See Also

|