Skip to content

Angular Convolution

Jack Featherstone edited this page Apr 18, 2022 · 2 revisions

Angular Convolution

This page covers various aspects of the implementation of the angular convolution, pepe.tracking.angularConvolution(). Note that the full documentation for this function can be found here; this page is more focused on the technical details, as opposed to the practical use cases.

Image Rotation

The image rotation used in the angular convolution is done using Pillow's Image.rotate() method. This implementation is very fast (~10us per evaluation for a reasonable image), and there is thus no reason to implement my own rotation function.

Angle Sensitivity

While we can, in theory -- and in practice, since Image.rotate() will always return an image as if the process worked fine -- always rotate an image by an arbitrarily small angle, there is some minimum angle for which the resultant image will still actually be different. This limit is defined by the size of the image to be rotated, with a larger image leading to more resolution in the rotation.

The plot below shows the difference before and after rotating images of various sizes to emphasize this effect.

Rotation difference plot

The colors gradient represents the size of the images, with blue being the largest (~2000 x 2000) and pink being the smallest (~10 x 10). As expected, larger images become zero at smaller angles when compared to the lower resolution images. We can then identify the point at which each of these curves reach zero, and plot that as a function of the image size:

Rotation difference plot

From this, we can gather that the limit of rotation (for any reasonable image) is approximately 10-3 radians. In the pepe.tracking.angularConvolution() method, we set the default angle resolution as .01 radians, since this it is most likely that practical use will involve images towards the left side of this plot. We could use a fitted version of this curve to interpolate what the best angle resolution is for any arbitrary image, but there isn't a ton of overhead for the rotation evaluation, so this isn't really necessary.

Clone this wiki locally