Composite denominator
This modification corrects the rotation search for industrial sample where there are very flat regions. Without this correction there is a strong bias to increase the overlap over flat regions which give always a very good match for a wide range of overlap. And bigger the overlap then smaller the average mismatch. So the original bias was toward bigger overlaps