public ImageProcessor canny(ImageProcessor ip){
		//Filter out noise
		ImageProcessor result = ip.duplicate();
		result.blurGaussian(sigma);
		
		//Compute the intensity gradient using Sobel
		ImageProcessor Gx = xGradient(result);
		ImageProcessor Gy = yGradient(result);
	
		//Compute the magnitude of the gradient
		FloatProcessor gradientMag = gradientStrength(Gx, Gy);
		gradientMag.resetMinAndMax();
		
		if(gradientMag.getMax() > 0) gradientMag.multiply(1.0/gradientMag.getMax());
		
		
		//Perform non-Maximum Supression to remove weak edges
		ImageProcessor suppressed = nonMaxSuppression(Gx, Gy, gradientMag);
		
		
		double highThreshold = getHighThreshold(gradientMag.convertToByteProcessor(false), percentNotEdges);
		double lowThreshold = thresholdRatio * highThreshold;
		
		//now perform hysterisis
		result = doHysterisis(suppressed, gradientMag, lowThreshold, highThreshold);
		
		return result;
	}