Search code examples
pythonopencvscikit-image

Difference between SimilarityTransform (scikit-image) and warpAffine (openCV)?


I am currently studying insightface and in particular this preprocess function.

It uses both scikit-image SimilarityTransform function (documentation) and openCV warpAffine function (documentation)

Is there a fundamental difference between the two or are they simply two different ways of calling the same mathematical transformation ?


Solution

  • A similarity transform is a special case of an affine transform, in which the shear is 0. (Only scale, rotation, and translation are allowed.) scikit-image also has an AffineTransform object.

    The transform objects in scikit-image can be used both to estimate the transform, as pointed out by Piotr, but also to perform the transform, using skimage.transform.warp.