Parameters of observation are tuned to produce some good result in recognizing simple patterns. Added output of connected groups (using disjoint set O(N log N) method).