Skip to main content

clausal-opencv

OpenCV (cv2) predicates for Clausal Prolog.

Wraps the computer-vision functions of opencv-python as Clausal Prolog predicates: image I/O, properties, arithmetic, color conversion, filtering, morphology, thresholding, contours, geometric transformations, non-mutating drawing, classical feature detection, classical object detection, camera calibration, and video I/O.

Install

pip install clausal-opencv

opencv-python (OpenCV 4; OpenCV 5 moved KAZE, AKAZE, BRISK, HOG and the cascade classifier out of the main package) is pulled in as a dependency. For headless environments, install opencv-python-headless<5 first to override the default.

Use

In a seam (.seam) file:

-import_from(opencv, [imread, shape, IMREAD_COLOR])

test("read an image and query its shape") <- (
    imread("photo.jpg", IMREAD_COLOR, IMG),
    shape(IMG, [H, W, 3]),
    H > 0,
    W > 0
)

See docs/ for the predicate catalogue and worked examples.

Implementation status

See ../../implementation_plans/opencv/overview.md.

  • Phase 1 — Core, I/O, Properties, Arithmetic
  • Phase 2 — Color Conversions
  • Phase 3 — Filtering and Morphology
  • Phase 4 — Thresholding and Contours
  • Phase 5 — Geometric Transformations
  • Phase 6 — Drawing (non-mutating)
  • Phase 7 — Features and Matching
  • Phase 8 — Object Detection
  • Phase 9 — Camera Calibration and Homography
  • Phase 10 — Video I/O

Metadata

Release files for clausal-opencv 0.1.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 clausal-opencv 0.1.0
File Size Uploaded
clausal_opencv-0.1.0.tar.gz 38.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clausal-opencv 0.1.0
File Interpreter ABI Platform
clausal_opencv-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 71.7 kB

Release files / clausal_opencv-0.1.0.tar.gz

Download URL clausal_opencv-0.1.0.tar.gz
Size 38.3 kB
Tags Source
SHA-256 checksum
How to use checksums
d1655afad9e8062fe8b833bb9b23b71e6d5f9c32a0cac6dd6ff7f7f7e13ac862
BLAKE2b-256 checksum
How to use checksums
fbf05766780a5f5935d1fea5ddc591f1c83cd667b3477d278f3671dfeb6e0ed9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release files / clausal_opencv-0.1.0-py3-none-any.whl

Download URL clausal_opencv-0.1.0-py3-none-any.whl
Size 33.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
45cbb118421932d09bd12fc06b813322469c5e84e2300af1c2dfdccd60eb5271
BLAKE2b-256 checksum
How to use checksums
1958ab72bbe7fb6ea27035eda2725b4f9fdcce90a295803398a5137413330312
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 7, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files

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