static double g22_squareness(Rect r) { ret distanceToProbability(doubleRatio(max(r.w, r.h), min(r.w, r.h))-1); }