Potential bug in Shape Context
File: https://github.com/Itseez/opencv/blob...
Line: 235
In function computeDistance(InputArray contour1, InputArray contour2) the following line seems to be a potential bug. The computation of shape context descriptor of the first shape is fine since it uses its own mean distance for distance noramlisation. However, the second shape is using he mean distance of first shape. The two shapes can be different in the scales so they should use their own mean distance to normalise themselves.
set2SCE.extractSCD(set2, set2SCD, inliers2, set1SCE.getMeanDistance());
I have to review the paper again, and see if I remember why I did it like this. But in any case, the shape distance should be somewhat invariant to scale transformations, since the affine correction within the TPS transformation is of very low cost. What you say makes sense though.