petercorke / petercorke/machinevision-toolbox-python

Several point-feature tests use bare except: pass, so a broken detector passes silently

Open Beginner friendly
#51 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 adding regression tests for BRISK/AKAZE (see the opencv5 migration issue, #44). tests/test_image_point_features.py's test_sift, test_surf, test_orb, test_corners, and test_feature_properties all wrap the actual detector call in a bare try: ... except: pass. This means a completely broken detector (e.g. the exact AttributeError: BRISK_create not found bug fixed in #44) would make these tests pass silently instead of failing -- confirmed by construction while writing test_brisk/test_akaze without that pattern: reverting the BRISK/AKAZE fix makes the new tests fail loudly (as expected), but the same revert applied to SIFT/ORB would not be caught by the existing tests at all.

Fix

Remove the bare except: pass from these five tests; assert the real expected outcome directly (matching the pattern used for the new test_brisk/test_akaze). If a specific environment genuinely can't run one of these (e.g. SURF requiring a non-free build flag), skip explicitly with self.skipTest(reason) rather than swallowing all exceptions.

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_point_features.py with test_sift, test_surf, test_orb, test_corners, and test_feature_properties, then compare them with test_brisk and test_akaze. Run the point-feature tests and make detector failures surface; where an environment genuinely cannot run a detector, verify that it is skipped explicitly with a reason rather than silently passing.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.