A Method for Threshold Selection in Edge Width Detection of Objects in the Image