Skip to content
Snippets Groups Projects
tello-vision.cpp 535 B
Newer Older
#include "opencv2/opencv.hpp"
#include <iostream>

using namespace cv;

int main(int argc, char** argv) {

    Mat frame;

    VideoCapture cap("udp://127.0.0.1:11111",CAP_FFMPEG);

    cap >> frame; // get a first frame!

    for(;;) {

        cap >> frame;

        imshow("tello vision", frame);

        if ( frame.empty() ) break; // end of video stream

        if( waitKey(10) == 27 ) break; // stop capturing by pressing ESC

    }

    // the camera will be closed automatically upon exit
    cap.release();
    return 0;

}