calc_dominant_height function

Calculates dominant height