TypeError: Required argument 'outImage' (pos 3) not found opencv
2018-02-26 15:27
531 查看
在使用Python OpenCV对图像进行SIFT特征提取过程中,按照https://docs.opencv.org/3.3.0/da/df5/tutorial_py_sift_intro.html给出的示例程序,会出现下面错误:
即:TypeError: Required argument 'outImage' (pos 3) not found opencv(缺失了第3个参数)
根据这里的启发(在进行特征匹配时,也会遇到与上述错误类似的错误,下面的答案可以完美解决):
https://stackoverflow.com/questions/31631352/typeerror-required-argument-outimg-pos-6-not-found
查看出错的函数的文档:
少了输出图像,而在CV的官方文档中,输出的图像是以赋值的形式给出的,即:
import cv2
import numpy as np
img = cv2.imread('home.jpg')
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
kp = sift.detect(gray,None)
img=cv2.drawKeypoints(gray,kp,img)
cv2.imwrite('sift_keypoints.jpg',img)而函数的文档介绍是,输出的图像是以参数的形式给出的,即:
import cv2
import numpy as np
img = cv2.imread('left01.jpg')
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
kp = sift.detect(gray,None)
cv2.drawKeypoints(gray,kp,img)
cv2.imwrite('sift_keypoints.jpg',img)
即:TypeError: Required argument 'outImage' (pos 3) not found opencv(缺失了第3个参数)
根据这里的启发(在进行特征匹配时,也会遇到与上述错误类似的错误,下面的答案可以完美解决):
https://stackoverflow.com/questions/31631352/typeerror-required-argument-outimg-pos-6-not-found
查看出错的函数的文档:
少了输出图像,而在CV的官方文档中,输出的图像是以赋值的形式给出的,即:
import cv2
import numpy as np
img = cv2.imread('home.jpg')
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
kp = sift.detect(gray,None)
img=cv2.drawKeypoints(gray,kp,img)
cv2.imwrite('sift_keypoints.jpg',img)而函数的文档介绍是,输出的图像是以参数的形式给出的,即:
import cv2
import numpy as np
img = cv2.imread('left01.jpg')
gray= cv2.cvtColor(img,cv2.COLOR_BGR2GRAY)
sift = cv2.xfeatures2d.SIFT_create()
kp = sift.detect(gray,None)
cv2.drawKeypoints(gray,kp,img)
cv2.imwrite('sift_keypoints.jpg',img)
相关文章推荐
- opencv error bad argument (default classifier file not found)
- python socket send 函数 报错:TypeError: a bytes-like object is required, not 'str'
- 在Mac下使用QT调用OpenCV产生error: symbol(s) not found for architecture x86_64错误
- MAC下编译PHP5.5.7问题:configure: error: freetype.h not found.
- @RequestParam注解使用:Name for argument type [java.lang.String] not available, and parameter name information not found in class file either.
- required a bean of type 'org.hibernate.SessionFactory' that could not be found.
- PCL编译提示CMake Error: Boost not Found(common is required but boost was not found)
- python解决osx安装PIL时的_imagingft.c:73:10: fatal error: 'freetype/fterrors.h' file not found
- opencv2.0 源码安装 for x86 make出现error: 'ptrdiff_t' does not name a type 解决
- OpenCV Error: Unspecified error (The node does not represent a user object (unknown type?)) incvRead
- python 3.5: TypeError: a bytes-like object is required, not 'str' when writing to a file
- python3中,socket使用send函数时出现的错误:TypeError: a bytes-like object is required, not 'str'
- Field XXX in XXXX required a bean of type XXXX that could not be found.
- python error python version 2.7 required,which was not found in the registry
- openCV error: Bad argument (unrecognized or unsupported array type)
- Python 3.x Error:TypeError: a bytes-like object is required, not 'str'
- 8. wrong 2nd argument type found 'android.app.Fragment.' required 'Android.support.v4.app.Fragment'
- Uncaught TypeError: Failed to execute 'removeChild' on 'Node': 1 argument required, but only 0 prese
- Name for argument type [java.lang.String] not available, and parameter name information not found in
- Error 40000: Object (" ") did not match the required type `Hash'