• + 1 comment

    To segment the image based on simple 4-pixel connectivity, we look for connected regions of '1's.

    Here's the image with segmented objects marked by different numbers: public holidays Copy code 000112233344 556677788944 556799944444 9 4 So, there are 9 4-connected objects in the given binary image.