Registry / ai-ml / quadrilateral-fitter

quadrilateral-fitter

JSON →
library1.12pypypi✓ verified 87d ago

QuadrilateralFitter is an efficient and easy-to-use Python library for fitting irregular quadrilaterals from irregular polygons or any noisy data. Current version is 1.12, released on PyPI. The library is actively maintained and provides a simple API to fit quadrilaterals to polygon data, often used in computer vision and geometry processing. Release cadence is irregular, with minor updates.

pip install quadrilateral-fitter
INSTALL
IMPORT
SIG · QUADRILATERAL-FITT
Q
quadrilateral-fitter
ai-mlpythonv1.12
Install
7.8s avg
Import
1548ms
Disk
242MB
Pass rate
9/ 10
Env Coverage9 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v1.12 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✓ —
✓ 7.2s
py 3.11
✓ —
✓ 7.5s
py 3.12
✓ —
✓ 7.9s
py 3.13
✓ —
✓ 8.1s
py 3.9
✕ build_error
✓ 8.4s
242MB installed
● package 242MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

QuadrilateralFitter
✓ from quadrilateral_fitter import QuadrilateralFitter
✗ from quadrilateral_fitter import QuadrilateralFitter
The correct import uses underscore (quadrilateral_fitter) matching the package name.

Basic usage: fit a quadrilateral to a noisy polygon.

from quadrilateral_fitter import QuadrilateralFitter # Example polygon: coordinates (x, y) list of points polygon = [(0, 0), (1, 0), (1, 1), (0.5, 1.5), (0, 1)] # Create fitter instance fitter = QuadrilateralFitter(polygon) # Fit the quadrilateral fitted_quad = fitter.fit() # Access fitted vertices print(fitted_quad.vertices)
Debug
Known issues
gotchaInput polygon must be a list of (x, y) tuples or a numpy array with shape (N, 2). Order matters: vertices should be in sequential order around the polygon.
fix
Ensure polygon is closed? Not required but points should be in order. For unordered points, the fit may produce unexpected results.
affects: all
deprecatedIn version 1.x, the method 'fit' returns a 'Quadrilateral' object. In future versions, the API might change. Use the current pattern.
fix
Check documentation for any changes when upgrading.
affects: <=1.12
Errors
Common errors & fixes
ImportError: cannot import name 'QuadrilateralFitter' from 'quadrilateral_fitter'
Trying to import from the wrong module path or the package not installed correctly.
fix
Run 'pip install quadrilateral-fitter' and use 'from quadrilateral_fitter import QuadrilateralFitter'.
TypeError: __init__() missing 1 required positional argument: 'polygon'
QuadrilateralFitter requires the polygon argument at initialization.
fix
Provide the polygon as a list of coordinates: QuadrilateralFitter([(x1,y1), (x2,y2), ...])
Upgrade
Version history
1.12latest on PyPI · released Aug 28, 2024
Audit
Dependencies

No dependency data recorded yet.

Agent activity
14 hits · last 30 days
node
12
OpenAI (training)
1
Resources
quadrilateral-fitter — pip install quadrilateral-fitter · libregistry