Given a grayscale image, this program thresholds the image with the preset threshold value and extracts black coloured blobs on white background and stores them in separate images.
Each pixel of the image is iterated once using loops. While doing so, if we encounter a black pixel and it is not a part of any eisting blobs, flood-fill algorithm is used to find all the contigious blob pixels. Instead of replacing the target pixels in the flood-fill algorithm, they are added to the Blob object. Further, the calculated blobs are painted on separate images and stored.
- Can be used to find any number of blobs.
- Can be used to find convex or concave blobs, and also the blobs that are intertwined or form an enclave.
- Can be used as a preliminary step of OCR/Pattern recognition.