Issues with using PolynomialTransform

Sample image and/or code


I have an image of a microscope slide imaged from (what we assume to be) essentially two different angles. The left half of the image (channel 1.png in the Drive link above) corresponds to one angle whereas the right half of the image (channel 2.png) corresponds to the other.

Analysis goals

I’m trying to establish a mapping between a globally affine-transformed channel 1 and channel 2 using a 3rd-order polynomial transformation. That is, I’ve done the affine transform to warp channel 1 (post-affine in the drive link above, ignore the rings surrounding the points), and now I’m trying to further warp the affine-transformed image to match channel 2 even more closely.


When I try to perform the transformation, I get the result in the post-polynomial image in the Drive link above. I followed the example from this StackOverflow post: python - Image warping with scikit-image and transform.PolynomialTransform - Stack Overflow

Here’s my code:

            tform = estimate_transform('polynomial', self.channel2, dst, order = 3)
            final = warp(dst, tform, output_shape = (self.x_dim, self.y_dim//2))

x_dim and y_dim are image dimensions.

I have no idea what’s going wrong, so I’d appreciate any help you could provide!

Adding to the scikit-image forum.