Counting pixel connectivity groups How many 4-connected and 8-connected components are present in the binary image below?



Using definition of connectivities from the same textbook

"A connected component is a group of pixels that are connected in the sense that there is a connected path between any two pixels in the component. 4-connected means that the path comprises only horizontal or vertical neighbours (i.e. NSEW directions). In 8- connected regions the path may include diagonal neighbours as well (i.e. NW, SW, NE, SE directions)."

I get four 4-connected groups and three 8-connected groups.



The answer though is four 4-connected regions and one 8-connected region and it comes with the following diagram.



I realise I might be double counting some of the clusters, but I don't see how does the author get his/her answer from the above picture. Looking at it I get two 4-connected groups and one 8-connected groups. Unless the correct groups are grouped like this.
N-connectedness means that from any pixel to any other within the component, there should exist a path composed of N-connected steps. In other words, as long as two groups have one connected neighbor, they should be merged into a single group. It does not mean a 2 or 3 pixel group, but rather a component which consists of linked pixels.

See the connectedness garph theory. 

With such definition, it is obvious that the author is right.