Automatic selection of canny thresholding method