petercorke / petercorke/machinevision-toolbox-python

test_image_reshape.py: warp/undistort/interp2d tests are empty stubs

Open
#53 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

tech-debt
Dominant language
Python
Stars
219
Forks
30
Avg merge
12d 23h
Merged PRs (30d)
5

Description

Found 2026-08-03 while auditing warpAffine/warpPerspective/remap-based methods for OpenCV 4/5 numeric-drift issues (see #44). `tests/test_image_reshape.py`'s `test_warp`, `test_warp_affine`, `test_warp_perspective`, `test_undistort`, and `test_interp2d` are all empty stubs (`# Add test cases for the decimate method` / `pass`) -- zero real assertions, for five distinct methods in `ImageReshape.py` that wrap `cv2.warpAffine`/`cv2.warpPerspective`/`cv2.remap`/`cv2.undistort`.

`test_rotate` (same file) does have real coverage and was specifically checked against a real OpenCV 5.0.0.93 install as part of #44 -- its one exact-equality assertion (`rotate(0)`, an identity transform) is confirmed safe on both versions, no drift. But the five methods above have no coverage at all to check.

Fix

Write real tests for each: a known input + expected transform (e.g. `warp_affine` with a translation matrix, `undistort` with known distortion coefficients on a synthetic pattern), asserting geometric correctness with a tolerance rather than exact pixel equality -- OpenCV's own migration notes describe revised interpolation between versions 4 and 5, so any assertion here should tolerate small numeric drift by construction, not just by accident.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in tests/test_image_reshape.py and compare the empty test_warp, test_warp_affine, test_warp_perspective, test_undistort, and test_interp2d stubs with the corresponding methods in ImageReshape.py. Use the issue's suggested synthetic inputs and transforms, then add tolerance-based assertions for geometric correctness. Done means each method has real coverage without relying on exact pixel equality across OpenCV versions.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
72/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.