Pattern detection update

- connected regions are found via Region Adjacency Graph
- Pattern generator is updated, 3 .mat files uploaded containing some
square patterns of 3 densities each.