detectStructure finds width and height of the arrangement