sentences:  The input data can be modified "in situ" (which carries the risk of data corruption), or labeling information can be maintained in an additional data structure.Connectivity checks are carried out by checking neighbor pixels' labels (neighbor elements whose labels are not assigned yet are ignored), or say, the North-East, the North, the North-West and the West of the current pixel (assuming 8-connectivity).4-connectivity uses only North and West neighbors of the current pixel.