looks like the size of the KeyPoint (second argument, if the first is a Point) is set to be the “diameter”, which is twice the “radius”, and “radius” is calculated thusly:
that looks like it’s taking the barycenter (from moments calculation), then taking all the distances to all the contour points, and taking the median of that.