4da*_*ong 0 python opencv visual-studio-code
我已经在windows DOS下安装了opencv,在vscode中可以成功导入,但是当我使用这种方法时:cvtColor它显示Module 'cv2' has no 'cvtColor' memberpylint(no-member)
当我运行这段代码时:
cv2_rgb = cv2.cvtColor(val_xyz, cv2.COLOR_XYZ2RGB)
Run Code Online (Sandbox Code Playgroud)
val_xyz = [ 15.4999257 20.91432805 8.15938343]
表明:
Exception has occurred: error
OpenCV(4.2.0) c:\projects\opencv-python\opencv\modules\imgproc\src\color.simd_helpers.hpp:92: error: (-2:Unspecified error) in function '__cdecl cv::impl::`anonymous-namespace'::CvtHelper<struct cv::impl::`anonymous namespace'::Set<3,-1,-1>,struct cv::impl::A0x2c98332e::Set<3,4,-1>,struct cv::impl::A0x2c98332e::Set<0,2,5>,2>::CvtHelper(const class cv::_InputArray &,const class cv::_OutputArray &,int)'
> Invalid number of channels in input image:
> 'VScn::contains(scn)'
> where
> 'scn' is 1
File "C:\dataset\opencv_hello.py", line 33, in <module>
cv2_lab = cv2.cvtColor(val_xyz, cv2.COLOR_XYZ2RGB)
Run Code Online (Sandbox Code Playgroud)
这是 Pylint 的缺点。您可以:
# pylint: disable=no-member禁用特定行 ( )上的警告.pylintrc: [TYPECHECK]
ignored-modules=cv2
Run Code Online (Sandbox Code Playgroud)
.pylintrc: [MESSAGES CONTROL]
disable=no-member
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2856 次 |
| 最近记录: |