Quantising the image, e.g. histogram thresholding for discrimination between background and foreground patterns