0
$\begingroup$

In the old Tangent Prop paper (you don't need to know this paper), the tangent vector of the rotation transformation (think of this as a vector-valued function) at some input image is approximated by (1) rotating this input image by a very small amount, (2) subtracting this rotated image from the original image and (3) dividing the result of subtraction by the degree rotated.

However, I'm not understanding what it means to rotate an image (i.e., a matrix) by a very small amount (less than one degree).

Also, how can this be implemented in Python using libraries like Python / Scipy / Skimage?

In addition, how am I supposed to know that the image has actually been rotated, since the rotation is so small?

Note: I tried to do rotation with Skimage, but it seems like Skimage allows rotations of at least 1 degree.

Since I'm new to these concepts, I wouldn't mind if someone points me to some resources or references since it might be hard to provide a succinct answer.

$\endgroup$
2
  • $\begingroup$ I must admit I don't understand the question: You know what it means to rotate an image, right? $\endgroup$ May 27, 2020 at 10:17
  • $\begingroup$ The matrix will be the same M*N when we apply the transform only the values will be different. I suggest to read on image spatial transforms from youtube.com/watch?v=-vpJ_juSX7Q $\endgroup$
    – MimSaad
    Jun 27, 2020 at 9:57

2 Answers 2

1
$\begingroup$

From the article:

First the image is rotated by an infinitesimal amount $\alpha$. This is done by computing the rotated coordinates of each pixel and interpolating the gray level values at the new coordinates.

Interpolation is key to very small rotations. It allows to sample the image between the pixel center points as if it was a smooth 2-dimensional function. You can choose the interpolation method in skimage.transform.rotate using the parameter order. It controls the order of the interpolation method which (I think) is an interpolating cardinal B-spline. Higher orders give better results but are slower to compute.

If the tangent vector calculated by rotation, subtraction and division is increasingly non-zero as you go further away from the center, then that is an expected result and you can conclude that some rotation took place.

$\endgroup$
1
  • $\begingroup$ +1... I was going to say the same $\endgroup$
    – MimSaad
    Jun 27, 2020 at 9:50
0
$\begingroup$

Your equation is essentially the definition of a derivative. As far as I can see, your definition is equivalent to finding the directional derivative at each point in the direction of the rotation (tangential to a circle centered at your rotation). A directional derivative can be found as the dot of the gradient and a unit direction vector. Thus, your problem is the equivalent of finding the gradient of a discretely sampled surface. There are various techniques for this.

You don't actually need to rotate the image to perform the calculation. The two approaches should be close approximations for each other for very small angles. For larger angles, the two approaches will diverge. This is very much like trying to estimate a derivative from differences.


I forgot to mention that you'll need to multiply by the radius as well.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.