calculating median rgb bg from first 50 frames