Skip to content
Official Implementation of "Drone Shadow Tracking"
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Drone Shadow Tracking

Xiaoyan Zou, Ruofan Zhou, Majed El Helou and Sabine Süsstrunk.

This is a Python implementation for the Drone Shadow Tracking paper.



  • Python 3.6.5
  • Opencv 3.4.3
  • MATLAB R2017b

Quick start (Demo)

In demo folder, you can easily reproduce ths results reported in the paper by simply run the following command:


VIDEO_NAME can be the following: 1_simple.mp4, 2_bird.mp4, 3_comFace.mp4, 3_four.mp4, 4_newspaper.mp4, 5_bag.mp4, 5_grass.mp4, 5_people.mp4

How to run on your own video

Note: all prepared files should be placed at root folder.

Step 1: obtain video frames which will create video frames to the VIDEO_NAME_frames folder in data_frames folder at root. The video frames are used for shadow detection and the initial bounding box of the drone.

python -n VIDEO_NAME.mp4

Step 2: create shadow detection results

Open create_shadow_mask.m and modify frame_folder and masks_folder. Then run it to obtain the shadow detection masks.

Step 3: ground truth image (for the first frame)

Take the first frame of the video, and use PhotoShop to obtain a ground truth of the drone shadow. Note that the background should set to white and the drone's shadow should set to black. Please name the ground truth image as video name and place it at root.

  • eg. video_name = vid.mp4 --> ground truth img_name = vid.png

Step 4: initial bounding box of the drone

Apply the ground truth image to to create the VIDEO_NAME.txt at root which represents the location of the initial bounding box of the drone.


Step 5: run tracking

Having above files ready, we can run the main codes.


To save video and frames:

python -n VIDEO_NAME.VIDEO_FORMAT -o OUTPUT_FOLDER -sv true -sf true

To save video and frames: python -n VIDEO_NAME.VIDEO_FORMAT -o OUTPUT_FOLDER -sv true -sf true


MOSSE Tracking Algorithm, original implementation MIT License
This is the python implementation of the - Visual object tracking using adaptive correlation filters. Code link:

Shadow Detection code: Derek Bradley and Gerhard Roth, “Adaptive thresholding using the integral image,” Journal of Graphics Tools,vol. 12, no. 2, pp. 13–21, 2007. Given by Vatsal Shah and Vineet Gandhi, “An iterative approach for shadow removal in document images,” in In Proc. IEEE International Conference on Acoustics, Speech and Signal Processing (ICASSP), 2018, pp. 1892–1896.

You can’t perform that action at this time.