Merge perimeters of adjacent regions having the same perimeter settings