Skip to content
Snippets Groups Projects
Commit 54778197 authored by RIBEIRO-LUSTOSA Leandro's avatar RIBEIRO-LUSTOSA Leandro
Browse files

added cpp file for vision stream display

parent b88e2a88
No related branches found
No related tags found
No related merge requests found
cmake_minimum_required (VERSION 2.8)
project(tello-vision)
find_package(OpenCV REQUIRED)
include_directories(${OpenCV_INCLUDE_DIRS})
add_executable(tello-vision tello-vision.cpp)
target_link_libraries(tello-vision ${OpenCV_LIBS})
#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;
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment