implementation of 30 frame collection+median filter