Added variable threshold sizes for Canny detection.