Some comments; bug found: vertical aligned blobs are not grouped together
Fixed grouping bug, but more improvements are possible

* The blobs are sorted from left to right, but, after one iteration
over all blobs, the ungrouped blobs were in the reverse order. From
left side, it's not a problem. Looking from right, some left-aligned
blobs have very different rightmost x coordinate.