Numpy uses a separate version number for the C API. Whenever any changes are made to the C API, this number is increased (irrespective of whether binary compatibility was broken or not). Since the changes are infrequent, there is no 1:1 mapping between Numpy versions and the C API version.
The error message suggests that you have a version of Numpy that provides an older revision of the C-API, compared to what OpenCV was originally built with.
There is a handy table in the source code. Since it was a bit harder to find, let me reproduce it here:
C API Version | Numpy Version
0x00000008 - 1.7.x
0x00000009 - 1.8.x
0x00000009 - 1.9.x
0x0000000a - 1.10.x
0x0000000a - 1.11.x
0x0000000a - 1.12.x
0x0000000b - 1.13.x
0x0000000c - 1.14.x
0x0000000c - 1.15.x
0x0000000d - 1.16.x
0x0000000d - 1.19.x
0x0000000e - 1.20.x
0x0000000e - 1.21.x
0x0000000e - 1.22.x
Note: Last updated 2021-05-24.
Based on that table, you should upgrade Numpy to any of the following versions: 1.10.x, 1.11.x, 1.12.x
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…