background = video.nextframe() while(video.hasframes()){ newframe = video.nextframe() Difference = abs(background - newframe) show(difference) }