SimilarityTransform (scikit-image) 和 warpAffine (openCV) 之间的区别?
Difference between SimilarityTransform (scikit-image) and warpAffine (openCV)?
我目前正在学习insightface and in particular this preprocess function。
它同时使用了 scikit-image SimilarityTransform
函数 (documentation) and openCV warpAffine
function (documentation)
两者之间是否存在根本区别,或者它们只是调用相同数学变换的两种不同方式?
基本上都是代表affine transform. However SimilarityTransform
is used to compute this transformation between two sets of points and warpAffine
is used to transform image using affine transformation. The OpenCV's equivalent to SimilarityTransform
is getAffineTransform
. You can find more information regarding these functions here.
A similarity transform is a special case of an affine transform,其中剪切为0。(只允许缩放,旋转和平移。)scikit-image也有一个AffineTransform对象。
scikit-image 中的变换对象既可用于估计变换,如 Piotr 所指出的,也可用于执行变换,使用 skimage.transform.warp
。
@Juan 的回答更准确。 SimilarityTransform
的 opencv 版本应该是 estimateRigidTransform
和 fullAffine=false
.
你应该在这里找到答案
Given a set of points, how to calculate similarity transform(translation,scale,rotation)?
我目前正在学习insightface and in particular this preprocess function。
它同时使用了 scikit-image SimilarityTransform
函数 (documentation) and openCV warpAffine
function (documentation)
两者之间是否存在根本区别,或者它们只是调用相同数学变换的两种不同方式?
基本上都是代表affine transform. However SimilarityTransform
is used to compute this transformation between two sets of points and warpAffine
is used to transform image using affine transformation. The OpenCV's equivalent to SimilarityTransform
is getAffineTransform
. You can find more information regarding these functions here.
A similarity transform is a special case of an affine transform,其中剪切为0。(只允许缩放,旋转和平移。)scikit-image也有一个AffineTransform对象。
scikit-image 中的变换对象既可用于估计变换,如 Piotr 所指出的,也可用于执行变换,使用 skimage.transform.warp
。
@Juan 的回答更准确。 SimilarityTransform
的 opencv 版本应该是 estimateRigidTransform
和 fullAffine=false
.
你应该在这里找到答案
Given a set of points, how to calculate similarity transform(translation,scale,rotation)?