c++opencvvisual-studio-2013ar.drone

Getting an Image (Stream Data) from the ArDrone 2.0, using opencv2 or opencv


I want to get an image (Stream Data) from the ArDrone, using opencv2 or opencv.

#include <iostream>
#include <opencv2/highgui.hpp>
#include <opencv2/imgproc.hpp>

using namespace std;
using namespace cv;

int main()
{
    cv::VideoCapture cap;
    cv::Mat image;

    if (!cap.open("tcp://192.168.1.1:5555"))
    {
        printf("AR.Drone ERROR CONNECT\n");
        return -1;
    }

    while (1)
    {
        cap >> image;

        if (!image.empty())
        {
            cv::imshow("AR.Drone", image);
            cout << "OK" << endl;
        }
        else
        {
            cout << "ERROR" << endl;
            cv::waitKey(1);
        }
    }

    return 0;
}

Solution

  • I ve just discovered that great solution which mixes AR Drone 2 and OpenCV. It may help to have a look to it : https://github.com/puku0x/cvdrone