Comments (10)
Which opencv version is it that you are using? In opencv 3.x, the SIFT and SURF descriptors are part of the xfeatures2d submodule. Try the following to get an instance of a sift descriptor (similar for SURF):
sift = cv.xfeatures2d.SIFT_create()
from opencv2-python-tutorials.
Ok so i changed the code:
import cv2
import numpy as np
img = cv2.imread('home.jpg')
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv.xfeatures2d.SIFT_create()
kp = sift.detect(gray,None)
img=cv2.drawKeypoints(gray,kp)
cv2.imwrite('sift_keypoints.jpg',img)+
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'
rebuild the library?
I think i had CMake installed, cause i had several errors like this, but once i installed Pycharm IDE, i deleted the Cmake. I never understood what cmake does. Why did they removed the sift anyway?
from opencv2-python-tutorials.
I solved it by installing the opencv contrib python package
sudo pip3 install opencv-contrib-python
import cv2
sift = cv.xfeatures2d.SIFT_create()
from opencv2-python-tutorials.
I'm getting same error in opencv==4.1.0 and python3.x when i'm using
sirt = cv2.xfeatures2d.SIFT_create()
Error is
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 can i resolve this?
from opencv2-python-tutorials.
I'm getting same error in opencv==4.1.0 and python3.x when i'm using
sirt = cv2.xfeatures2d.SIFT_create()
Error is
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 can i resolve this?
You should rebuild openCV sift feature included as it is not free preinstalled.
from opencv2-python-tutorials.
as far as i can remember, sift is no longer part of opencv. I just re-notices this issue a year later.. Shall i close the issue?
from opencv2-python-tutorials.
as far as i can remember, sift is no longer part of opencv. I just re-notices this issue a year later.. Shall i close the issue?
Sure. But if you want to re-build opencv with surf - have a look here.
from opencv2-python-tutorials.
Thanks!
from opencv2-python-tutorials.
This is my error please guide:
Traceback (most recent call last):
File "C:/Users/Furqan Haider/Desktop/Sensation Home Work/Home Work 2/Python Camera Calibration/Stereo Image/Stereo_Test.py", line 7, in
sift = cv.SIFT()
AttributeError: module 'cv2.cv2' has no attribute 'SIFT'
from opencv2-python-tutorials.
As i have commented:
"as far as i can remember, sift is no longer part of opencv. I just re-notices this issue a year later.. Shall i close the issue?"
You may not be avle to use SIFT anymore. Look it up a bit more, you may find a way. zoldaten said you can rebuild opencv with surf.
from opencv2-python-tutorials.
Related Issues (20)
- tutorials doc code at page 138 not work as img show below.
- Update README.md file
- Hough Transform Example Code Does Not Produce the Plot Shown
- Update the cv2.findCountours return value example in `Contours:Getting Started`.
- Illustration about `minAreaRect()` is wrong. HOT 1
- Contours : Getting Started —— the code is wrong
- Typo in formula "How Otsu’s Binarization Works?"
- Is there any assistance needed ? HOT 1
- trying to crop the original part of the image for the excersice...
- "Mathematical Tools in OpenCV" page is missing.
- Inpainting, for anisotropic pixel
- hi,how to get camera_list ?
- local variable 'tot_error' referenced before assignment
- Hello, please tell me how to get the Mask image
- Turn off automatic publishing for this repository HOT 2
- Description of `minAreaRect` output is wrong
- FYI: This repo is unmaintained! HOT 1
- Proposing a PR to fix a few small typos
- How to remove thick long lines in image?
- Need to extract test strip image mask
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opencv2-python-tutorials.