determine the number of added samples using edge threshold