Feature based stitching's wave correction bugfix.

When we have similar matrices in input, then algorithm returns matrices
with NaN values.
Merge pull request #3222 from dmitrygribanov:dg/2.4-stitching-wave-correction-bugfix