Test for enough corner markers always passes
The test condition for the test_detect_enough_cornermarkers
test always passes due to a bad assert condition that forgets that '&' takes precedence over comparison operators:
assert(len(keypoints) >= 2 & len(keypoints) <= 4)
I can show that this test always passes
[hidde@nidstang zesje]$ python
Python 3.7.3 (default, Mar 26 2019, 21:43:19)
[GCC 8.2.1 20181127] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> val = 0
>>> assert(0 >= 2 & 0 <= 4) # Does not throw an exception
>>>
Naturally, this should be assert(len(keypoints) >= 2 and len(keypoints) <= 4)
However, changing that makes all the current testing material invalid:
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex5.jpg] FAILED [ 39%]
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex1.jpg] FAILED [ 41%]
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[jamy2.jpg] FAILED [ 42%]
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[jamy1.jpg] FAILED [ 44%]
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex6.jpg] FAILED [ 46%]
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex2.jpg] FAILED [ 48%]
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex4.jpg] FAILED [ 50%]
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[latex3.jpg] FAILED [ 51%]
Therefore, fixing this means that new testing data has to be generated. For the record, this does work with some of our own data:
tests/test_rotation_scan.py::test_detect_enough_cornermarkers[slated_mc.jpg_zesje.jpg] PASSED [ 53%]
Additionally, I would suggest adding a few tests that check for negatives too. (In this way, the previous zesje group would have noticed this error)