User avatar
HermannSW
Posts: 1489
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Camera controlled automatic PT approach for a landing capturing

Thu Sep 19, 2019 7:47 pm

Two years ago I played with PT (Pan Tilt) bracket for Raspberry camera with my caterpilar robot (only the tilt part):
https://www.raspberrypi.org/forums/view ... 1#p1231151

The raspiraw based automatic tilt procedure brought camera into a defined position after starting.
Camera went up, then vertically down, and then stepwise up until black robot front became bottom of FoV:
Image


My secondary living place in Holzgerlingen/Germany (near IBM Böblingen lab) has a nice view out of slanted roof window onto entry lane of Stuttgart airport. As a new project I wanted (as the title says) do automatic PT control for a (centered) capturing of approach for a landing. Recently I received some new 1$ PT brackets from aliexpress for that (I have some SG90 servos at home already):
Image

As a pilot study I took a short video with Raspberry camera of an approach for a landing during dusk, with this command:

Code: Select all

$ raspivid -t 0 -md 1 -w 1920 -h 1080 -o tst.h264 -fps 30

Then I converted it to .mp4:

Code: Select all

$ ffmpeg -framerate 30 -i tst.h264 -c copy out.mp4

Finally I did cut out partfrom second 16 to second 44:

Code: Select all

ffmpeg -ss 16 -i out.mp4  -t 28 -c copy out.1.mp4

And converted that to a nice (scaled down to 640x360) animated .gif using this thechnique:
http://blog.pkh.me/p/21-high-quality-gi ... fmpeg.html
Image


I did upload the complete [email protected] .mp4 to youtube as well.
In one of the first frames you can see roof top of next house and airplane at top left:
https://www.youtube.com/watch?v=sW4VpSM ... e=youtu.be
Image


I am really happy that capturing airplane video at dusk works, and that I did capture the airplane quite well given the fact that I did it blindly with no video control during capturing.

Yesterday I took some screenshots from https://www.flightradar24.com. In this screenshot I marked the airplanes with approach for a landing at Stuttart airport (white circle) with blue circles (you can click on an airplane and get start and destination airport information). Holzgerlingen is marked with filled red circle:
Image


As you can see there is a steady stream of airplanes landing, so automatic PT capturing might move camera to left, wait for airplane to come in sight, follow it centered until it is out of sight, and then repeat.

Today was a good pilot study, more to come.

P.S:
This is a good "slow speed" (the servo motors, not the airplanes) live camera video processing excercise before doing live camera video processing to control high speed caterpillar robot.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
DougieLawson
Posts: 36098
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website Twitter

Re: Camera controlled automatic PT approach for a landing capturing

Fri Sep 20, 2019 2:15 pm

Get yourself a RTL-SDR USB radio and a copy of PiAware. From that you can get JSON for every aircraft in your local area - with speed, heading, altitude and lat/lon.
Note: Having anything humorous in your signature is completely banned on this forum. Wear a tin-foil hat and you'll get a ban.

Any DMs sent on Twitter will be answered next month.

This is a doctor free zone.

User avatar
HermannSW
Posts: 1489
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Camera controlled automatic PT approach for a landing capturing

Sat Sep 21, 2019 2:19 pm

While that sounds interesting, it does not help to get centered video of each approach for a landing.
And this project will be an exercise on life video frame feature extraction and live control of PT camera.
When capturing blinking plane in dusk will work (easier), next step could be capturing airplane at daylight as well.
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1489
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Camera controlled automatic PT approach for a landing capturing

Wed Oct 02, 2019 5:56 pm

Today I was at secondary living place earlier, at daylight. And I took video of airplane that did take off in Stuttgart with destination Milan, when passing Holzgerlingen. This time with smartphone camera, so audio is available:
https://www.youtube.com/watch?v=Akf9BqgvXac
Image


It is better to capture airplane at daylight (dark dot before bright background) than capturing only airplane lights in darkness. I will try to use 3.98° M12 mount lens to see more from the plane (if PT platform can handle 70mm lens weight):
"70mm F1.6 3.98° lens allows for clear 500m distant video"
https://www.raspberrypi.org/forums/view ... p?t=227166
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1489
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Camera controlled automatic PT approach for a landing capturing

Fri Oct 11, 2019 4:58 pm

I just measured the weight of v1 camera with 70mm M12 lens mounted as 19.1g.
Not sure whether PT bracket can carry that and function as well:
Image


I don't know the shortest distance between secondary living place slanted roof window and a passing airplane.
But in "WoodenBoardPi" thread I just made photo with 70mm lens showing house of my friend 1.73km distant !
This is promising for "automatic capturing of airplane" size on image and quality.
(passing airplanes feel to be closer than 1.7km at shortest distance)
https://www.raspberrypi.org/forums/view ... 9#p1550469
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

User avatar
HermannSW
Posts: 1489
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

Re: Camera controlled automatic PT approach for a landing capturing

Sat Oct 12, 2019 2:18 pm

I am not in Holzgerlingen right now, but flightradar24 allowed me to watch some departures from Stuttgart airport.
Four airplanes heading to southeast Europe or Italy took the lower trajectory, but the Airbus A319 to Lisbon took the upper trajectory:
Image


I constructed the trajectory from two known points in gmaps pedometer in order to find the minimal distance point, marked with blue above. The distance to my slanted roof window is 1.46km. Assuming that airplane is still below 1km height the total distance is slightly more than to the house of my friend in previous posting [sqrt(1.46^2+1^2)=1.77]. Airbus A319 has length 34m, perhasp 3 times the width of my friends house. Fuselage height is 4m, a little less than 2 floors of my friend's house.

Expected size of airplane is roughly 300 pixel width and 60 pixel height -- we will see later how good this rule of a thumb calculation matches real airplane captures:
Image


P.S:
Just building PT camera system. Controlling two SG90 servos with pigpio pigs library is so simple:
"flag_semaphore att rest R A S P B E R R Y ready"
https://www.raspberrypi.org/forums/view ... 7&t=254180
Image
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://gitlab.freedesktop.org/HermannSW/gst-template
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

Return to “Camera board”