People have been asking for years how to resolve the problem with "sift = cv2.xfeatures2d.SIFT_create()" and the error it gives. The answer guys is simple, just remove "xfeatures2d" and put instead "sift = cv2.SIFT_create()"
So after a couple of hours struggle I managed to get xfeatures2d working. If you are getting "AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' error" message, this is for you. 1 - you need python 3.7, doesn't work if you have 3.8. 2 - uninstall opencv-python and opencv-contrib-python if you have them installed. 3 - Go to pypi.org/project/opencv-python/3.4.2.16/#files and download opencv-python for your OS. In my case it was opencv_python-3.4.2.16-cp37-cp37m-win32.whl (Win10 with 32bit Python installed) 4 - Go to pypi.org/project/opencv-contrib-python/3.4.2.16/#files and download opencv-contrib-python for your OS just like previous step. 5 - Using pip, install both whl files: # pip install opencv_python-3.4.2.16-cp37-cp37m-win32.whl # pip install opencv_contrib_python-3.4.2.16-cp37-cp37m-win32.whl that should be it. If you are a PyCharm user and want to install these in your venv, then please move the whl files into your project folder, switch to terminal by clicking Terminal button on the left bottom of your PyCharm (next to python console, run, TODO). Then run the commands above in your project folder. Be sure you have no opencv-python and opencv-contrib-python installed in your venv. The video tutorial is good however some parts feels so "copy-paste". I have no idea index_params = dict(algorithm=0, trees=5) does or why the search_params is an empty dict etc. In the end, yes it works but could have been better.
Hi sir Thank you very much, it is a great lesson for me. Could you please tell me what is the key point? Do the key points are equal to the total pixels of the image sir?
Can we compare two face using this code and find the similarity percentage ? I am trying to compare two face similarity percentage in android . If possible please make image comparison video in android using opencv Thanks you for this video You are doing nice job 👌👌👍 👍
while running i got this error cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SIFT::create' how to fix
Can there be more than one image as anchor image? For example, a person's face has three profiles front, left and right... how does one go about anchoring three images to find out a similar looking person? Can siamese network help me with it? Or would I have to go about find a more sophisticated way?
Hi can we also compare the canvas images by applying different colors to it ? we have application with html canvas elements and need to automate the image processing to do automation on it by adding annotations ,applying color to images etc..,
if I try to install this version in pycharm, its giving me an error message like this can you suggest some other technique to overcome this error please Could not find a version that satisfies the requirement opencv-contrib-python==3.4.2.17 (from versions: ) No matching distribution found for opencv-contrib-python==3.4.2.17
Hi. I tried to downgrade the OpenCV version to recommended but faced the same problem, Also I receive the following msg, which means that now it is impossible to use SIFT. error: OpenCV(4.1.2) /io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'create' Could you pls assist to find out solution. Thanks
i see. but i think for what i am trying to do i will keep using SequenceMatcher to find similarities between a given picture and a bunch of other pictures, because it's more pure, since i check the binary and it doesn't matter if the file i'm comparing with other files is an image, or some other file. the only problem is the file size, since it throws off the accuracy(depending on how many pictures i have in different sizes). the easiest solution for me is probably converting all image files and preferably also the image file i wanna compare with all other image files to the exact same file size, if only temporarily. and i would only have to do it once to the pictures i will use as a library anyway.
People have been asking for years how to resolve the problem with "sift = cv2.xfeatures2d.SIFT_create()" and the error it gives.
The answer guys is simple, just remove "xfeatures2d" and put instead "sift = cv2.SIFT_create()"
I am a fan of your work. That is not the George Washington bridge. It is the Manhattan Bridge.
So after a couple of hours struggle I managed to get xfeatures2d working. If you are getting "AttributeError: module 'cv2.cv2' has no attribute 'xfeatures2d' error" message, this is for you.
1 - you need python 3.7, doesn't work if you have 3.8.
2 - uninstall opencv-python and opencv-contrib-python if you have them installed.
3 - Go to pypi.org/project/opencv-python/3.4.2.16/#files and download opencv-python for your OS. In my case it was opencv_python-3.4.2.16-cp37-cp37m-win32.whl (Win10 with 32bit Python installed)
4 - Go to pypi.org/project/opencv-contrib-python/3.4.2.16/#files and download opencv-contrib-python for your OS just like previous step.
5 - Using pip, install both whl files:
# pip install opencv_python-3.4.2.16-cp37-cp37m-win32.whl
# pip install opencv_contrib_python-3.4.2.16-cp37-cp37m-win32.whl
that should be it.
If you are a PyCharm user and want to install these in your venv, then please move the whl files into your project folder, switch to terminal by clicking Terminal button on the left bottom of your PyCharm (next to python console, run, TODO). Then run the commands above in your project folder. Be sure you have no opencv-python and opencv-contrib-python installed in your venv.
The video tutorial is good however some parts feels so "copy-paste". I have no idea index_params = dict(algorithm=0, trees=5) does or why the search_params is an empty dict etc. In the end, yes it works but could have been better.
Hi, nice work! Opencv is not supporting anymore 'xfeatures2d' method - so with the latest version of Opencv, the code will not work
Hi sir
Thank you very much, it is a great lesson for me. Could you please tell me what is the key point? Do the key points are equal to the total pixels of the image sir?
Can we compare two face using this code and find the similarity percentage ?
I am trying to compare two face similarity percentage in android .
If possible please make image comparison video in android using opencv
Thanks you for this video You are doing nice job 👌👌👍 👍
did you find something about that? cause I am trying to do just as what you was looking for
Me too. Am looking for how similar two identical face are.
Me too. Please revert back
while running i got this error
cv2.error: OpenCV(4.1.0) C:\projects\opencv-python\opencv_contrib\modules\xfeatures2d\src\sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'cv::xfeatures2d::SIFT::create'
how to fix
even i have the error and i couldn't find a solution if u have fixed please help me out with this
Can there be more than one image as anchor image? For example, a person's face has three profiles front, left and right... how does one go about anchoring three images to find out a similar looking person? Can siamese network help me with it? Or would I have to go about find a more sophisticated way?
Thank you for this great tutorial!
Hi
can we also compare the canvas images by applying different colors to it ?
we have application with html canvas elements and need to automate the image processing to do automation on it by adding annotations ,applying color to images etc..,
Yes it's possible to do that as well.
Hello sir , could you explain the meaning of 6074 matches @10:49?
Next time add a short film of how to install the included modules, it will save a lot of time for us
'xfeatures2d' is not an attribute to cv2. You forgot to mention how to resolve this, please inform
pip3 install opencv-contrib-python==3.4.2.17
if I try to install this version in pycharm, its giving me an error message like this
can you suggest some other technique to overcome this error please
Could not find a version that satisfies the requirement opencv-contrib-python==3.4.2.17 (from versions: )
No matching distribution found for opencv-contrib-python==3.4.2.17
@@sharathra4239 I have the same issue, I guess no solution found?
@@sharathra4239 u should use google colab
@@sharathra4239 I also have the same issue, hopefully someone can enlighten us
sir how to enable SIFT algorithm
Hi. I tried to downgrade the OpenCV version to recommended but faced the same problem, Also I receive the following msg, which means that now it is impossible to use SIFT. error:
OpenCV(4.1.2) /io/opencv_contrib/modules/xfeatures2d/src/sift.cpp:1207: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'create' Could you pls assist to find out solution. Thanks
i have same problem did you find any solution
i see. but i think for what i am trying to do i will keep using SequenceMatcher to find similarities between a given picture and a bunch of other pictures, because it's more pure, since i check the binary and it doesn't matter if the file i'm comparing with other files is an image, or some other file. the only problem is the file size, since it throws off the accuracy(depending on how many pictures i have in different sizes). the easiest solution for me is probably converting all image files and preferably also the image file i wanna compare with all other image files to the exact same file size, if only temporarily. and i would only have to do it once to the pictures i will use as a library anyway.
'NoneType' object has no attribute 'shape'
Stucked up at absolute error(sift) could anyone help me please to overcome it?
Stucked up at that error for 1 week.
i need to see if cat is same