add a new sampling method by setting a edge threshold based on the bbox