automatically select the thresh hold for canny