In openCV, the low and high thresholds for the canny operator are mandatory:
cvCanny(input,output,thresh1,thresh2)
In Matlab, there\'s an o
Check out this link: http://www.pyimagesearch.com/2015/04/06/zero-parameter-automatic-canny-edge-detection-with-python-and-opencv/
They implement a similar solution using basic statistics to determine the low and high threshold for Canny edge detection.
def auto_canny(image, sigma=0.33):
# compute the median of the single channel pixel intensities
v = np.median(image)
# apply automatic Canny edge detection using the computed median
lower = int(max(0, (1.0 - sigma) * v))
upper = int(min(255, (1.0 + sigma) * v))
edged = cv2.Canny(image, lower, upper)
# return the edged image
return edged