In openCV, the low and high thresholds for the canny operator are mandatory:
cvCanny(input,output,thresh1,thresh2)
In Matlab, there\'s an o
As Luca Del Tongo has suggested, you can calculate the thresholds from the grey image, e.g. in Java using OpenCV...
MatOfDouble mu = new MatOfDouble();
MatOfDouble stddev = new MatOfDouble();
Core.meanStdDev(greyMat, mu, stddev);
threshold1 = mu.get(0, 0)[0];
threshold2 = stddev.get(0, 0)[0];
Imgproc.Canny(greyMat, outputMat, threshold1, threshold2);