Skip to content

Feature request: optionally resolve real-space shift from phase cross-correlation registration #6604

Closed

Description

@jni

Description:

It turns out 😅 that phase cross-correlation registration shifts are only correct modulo the image size along each axis. If your image size is (2000, 2000), and you get a shift of (-150, 200), then the actual shift could be any of:

  • (-150, 200)
  • (-150, -1800)
  • (1850, 200)
  • (1850, -1800)

In general, all $2^n$ possible combinations are equally likely, where $n$ is the number of dimensions. The only way to disambiguate appears to be to compute the cross-correlation in real space post-hoc for the overlapping area in all of these combinations. Note that this is only O(npixels) because the possible overlap areas are mutually exclusive and form a tiling of the reference image, so it's not as expensive as it initially sounds.

See this image.sc thread for details.

Activity

  1. stefanv commented on Nov 1, 2022

    @stefanv
    Member

    Nice find! A great reminder of the properties of the FFT :)

    Is intensity correlation the best way to disambiguate, or should we also allow for other options (i.e., the cost functions supported by the registration module)?

  2. jni commented on Nov 1, 2022

    @jni
    MemberAuthor

    Well, maybe, but (correct me if I'm wrong), phase cross correlation implies image cross correlation as the metric, so it would be weird to switch metrics halfway?

  3. stefanv commented on Nov 2, 2022

    @stefanv
    Member

    I think you're right.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions