I'm running python 3.6.10 on a MacOS X. I used to be able to run openCV's SIFT without issue but now I am getting a segmentation fault. I've recreated the issue below with example data. Is anyone familiar with this error?
import cv2
from skimage import data
cv2.__version__
Out[8]: '3.4.2'
image = data.astronaut()
sift = cv2.xfeatures2d.SIFT_create()
kp1, des1 = sift.detectAndCompute(image, None)
Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)
This is due to upgrading to Big Sur where the previous built version of OpenCV was on your previous operating system. There are some incompatibilities when you use the binaries for the previous OS and you try to use it with your current OS. The solution is to uninstall and reinstall the package so that it is properly built on your system. This will require that you upgrade to the latest version of OpenCV though, so you won't be able to use 3.4.2 anymore.
In your terminal, do pip uninstall opencv-python
or pip uninstall opencv-contrib-python
depending on what flavour you installed, then reinstall by pip install opencv-python
or pip install opencv-contrib-python
.