Open alisterburt opened 1 month ago
Yes, absolutely. Good catch. I'll be thinking about how to implement this. The first thought I have is to just "invert" the angles (360-n) before rotating coords.
Yep! that works for 2D - for 3D you'll want to invert the rotation matrices. torch.linalg.inv() will work and is cheap, I like to use it because it's explicit. Technically more efficient to transpose the rotation matrix rather than inverting it because the transpose of a rotation matrix is its inverse
worth adding a note if you implement this to explain what you're doing, it's one of these things that isn't obvious when reading code
Something we didn't talk about but that is worth being very explicit about is what we mean by 'rotate this image n degrees in this direction'
Right handed rotations in a right handed coordinate system are expected to behave a certain way. We are currently rotating coordinates then sampling at the rotated positions, which has the effect of applying the inverse rotation. c.f. https://en.wikipedia.org/wiki/Active_and_passive_transformation
I think we should explicitly invert this so that the rotation has the same effect on the image we view as applying the rotation matrix on a set of coordinates - what do you think?