Adding Blob detection function