puku0x / cvdrone

CV Drone (= OpenCV + AR.Drone)
https://github.com/puku0x/cvdrone/wiki/How-to-build
Other
202 stars 94 forks source link

How can I take a picture through cvdrone? #53

Open minng90 opened 7 years ago

minng90 commented 7 years ago

Hello. I really appreciate you for offering this sdk. I want to take a picture which saves in my usb through cvdrone by pressing 'o' (on the keyboard). How can I do that?? Thank you.

nikovert commented 7 years ago
cv::Mat image = ardrone.getImage();
cv::imwrite("ardronePic.png", image);

thats for taking the picture, and to have it done when 'o' is pressed:

int key = cv::waitKey(33);
if (key == ‘o'){
    cv::Mat image = ardrone.getImage();
    cv::imwrite("ardronePic.png", image);
}