I would like to robustly estimate a polynomial geometric transform with scikit-image skimage.transform and skimage.measure.ransac
The ransack documentation gives a very nice example of how to do exactly that but with a Similarity Transform. Here is how it goes:
from skimage.transform import SimilarityTransform
from skimage.measure import ransac
model, inliers = ransac((src, dst), SimilarityTransform, 2, 10)
I need to use skimage.transform.PolynomialTransform instead of SimilarityTransform, and I need to be able to specify the polynomial order.
But the RANSAC call takes as input the PolynomialTransform(), which does not take any input parameters. The desired polynomial order is indeed specified in the estimate attribute of PolynomialTransform()... So the RANSAC call uses the default value for the polynomial order, which is 2, while I would need a 3rd or 4th order polynomial.
I suspect it's a basic python problem? Thanks in advance!
We could provide a mechanism in RANSAC to pass on arguments to the estimator (feel free to file a ticket). A quick workaround, however, would be:
The
PolyTF_4
class can then be passed directly to RANSAC.