The threshold value should depent on the number of pixels in a frame image and should not be absolute.