Blob detection

Fixed for grayscale images.