Skip to main content

pocpy (Phase Only Correlation in Python)

This repository contains implementations of phase only correlation and rotation invariant phase only correlation in python.

Installing pocpy

$ pip install pocpy

Usage

import cv2
import numpy as np

import pocpy

f = cv2.imread("reference.png", cv2.IMREAD_GRAYSCALE).astype(np.float64)
g = cv2.imread("target.png", cv2.IMREAD_GRAYSCALE).astype(np.float64)

# translation only
peak, dy, dx = pocpy.poc(f, g)

# translation, rotation and scale
peak, dy, dx, angle, scale = pocpy.ripoc(f, g)
  • f and g are 2D arrays of the same shape.
  • poc returns the sub-pixel translation (dy, dx) of g relative to f.
  • ripoc assumes g is f translated by (dy, dx) and then rotated by angle degrees (counter-clockwise, as in cv2.getRotationMatrix2D) and scaled by scale about the image center.
  • peak is the height of the correlation peak and can be used as a similarity measure.
  • Rotation is estimated within ±90 degrees, because the amplitude spectrum used by ripoc cannot distinguish angle from angle ± 180.

Development

$ uv sync
$ uv run pytest
$ uv run ruff check .
$ uv run ruff format --check .

Metadata

Release files for pocpy 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pocpy 0.3.0
File Size Uploaded Provenance
pocpy-0.3.0.tar.gz 4.4 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pocpy 0.3.0
File Interpreter ABI Platform
pocpy-0.3.0-py3-none-any.whl Python 3 none any Details

Total release size: 9.4 kB

Release files / pocpy-0.3.0.tar.gz

Download URL pocpy-0.3.0.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4c9876b4452c5047f497a2aeafeece4ff1e3130e78c3cf3ef9edb4b286bfcc52
BLAKE2b-256 checksum
How to use checksums
e2d0790c912c29d94667c8c4f7874c460a2000a3c651f8226ecff7c1c8ee27ce
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / pocpy-0.3.0-py3-none-any.whl

Download URL pocpy-0.3.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ff9e971117521dad11d690919c13fd2b3f4d36406b0d9d4ecf7e36e2750f1b2
BLAKE2b-256 checksum
How to use checksums
86fbcd9d94c3fa64f0ceebd5bfd637ed00dc12530209f02ca5a9bba2ade63851
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for pocpy 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page