Now I had some time to look at it more closely.
It is pretty cool and basically it fulfills everything I wrote under item 2.
It should be possible to run it in one script, e.g. copying your code into tello3.py.
And I have access to "frame" so I could do interesting things with opencv.
I don't have any experience with opencv, but it looks very promising.
Scaling down for performance was not necessary, I can change the scale factor to 1.
I also tried to scale it down for the video window and store the original frame in test.jpg. Worked.
It works as a proof of concept, but I met a few difficulties.
First, there are many error messages. It is not so disturbing when they are in a separate window (which is a temporary and makeshift solution).
The same kind of error messages occur when I call ffmpeg to display the video. At one time I forgot to send "streamon" and got these error messages
Code:
d:\daten\robotics\tello>python3 takePhoto.py
warning: Error opening file (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:856)
warning: udp://@0.0.0.0:11111 (/build/opencv/modules/videoio/src/cap_ffmpeg_impl.hpp:857)
So opencv works with ffmpeg. Interesting.
In the combined script, I seem to have some timing issues, or I am not doing things in the right order. The video window opens but it hangs and has to be killed (Windows taskmanager).
Back to the two-scripts-variety:
It works fine when
Tello is parked on the ground. In flight it shows the video in the window, but when I try to take a photo things get ugly.
Tello stops to respond to commands and fortunately it does an emergency landing. The photo is not stored.
Conclusion:
Hot stuff, but some investigating has to be done.