如何在anaconda

时间:2017-03-19 11:56:33

标签: python-3.x opencv anaconda windows-7-x64

任何人都可以告诉我命令为anaconda获取contrib模块

我需要那个模块  matches = flann.knnMatch(des1,des2,k = 2) 正确运行

抛出的错误是 cv2.error:...... \ modules \ python \ src2 \ cv2.cpp:163:错误:( - 215)数据通常应为NULL!在函数NumpyAllocator :: allocate

另外我使用的是Anaconda openCV版本3,严格来说不想切换到较低版本 附:正如许多地方所建议的那样编辑文件cv2.cpp选项不适用于anaconda。

5 个答案:

答案 0 :(得分:9)

我建议在你的anaconda环境中安装pip,然后执行:pip install opencv-contrib-python。这将是opencv和opencv-contrib。

答案 1 :(得分:6)

Anaconda支持pip install将软件包安装到conda环境中。您可以从这个知名的Unofficial Windows Binaries for Python Extension Packages网站下载OpenCV 3.2.0 opencv_contrib。请参阅下面的文件名以获取正确的版本。然后在Anaconda Prompt窗口中键入命令以安装包:

对于Python 3.5和64位Windows:

pip install opencv_python‑3.2.0+contrib‑cp35‑cp35m‑win_amd64.whl

对于Python 3.6和64位Windows:

pip install opencv_python‑3.2.0+contrib‑cp36‑cp36m‑win_amd64.whl

Anaconda存储库中的大多数OpenCV 3.2.0软件包如果与opencv_contrib一起提供,则不具体。 pip install方法更容易且经过验证,请参阅one of the SO post。唯一的缺点是conda list不会在那里显示pip已安装的软件包,但实际上它是。

但是,如果您想在conda install上进行试用,则下面是为Python 3.5或3.6安装OpenCV 3.2.0的命令,但可能没有 opencv_contrib

conda install -c conda-forge opencv=3.2.0 

希望得到这个帮助。

答案 2 :(得分:4)

更新:似乎该软件包的作者已将其删除。我用新的链接编辑了我的答案。

您可以尝试:https://anaconda.org/michael_wild/opencv-contrib

这个anaconda软件包包含带有基本OpenCV3的contrib模块。虽然文件列表显示它目前只适用于Windows!

答案 3 :(得分:1)

这个问题很旧,但我想用最新的信息来更新答案。我的Anaconda版本是2019.10,构建通道是py_37_0。我使用了#include <stdio.h> #include <stdlib.h> #include <ctype.h> #define MESSAGE 100 int main( void ) { char message[MESSAGE]; size_t alphabet = 0; size_t digit = 0; printf("Please enter your message:\n"); if( ! fgets(message, sizeof message, stdin) ) { perror( "fgets failed:" ); exit( EXIT_FAILURE ); } printf( "The given message is:%s\n", message ); for( size_t i = 0; message[i]; i++ ) { if ( isalpha( message[i] ) ) { alphabet++; message[i] = (islower(message[i]) ) ? (char)toupper(message[i]) : (char)tolower(message[i]); } else if ( isdigit( message[i] )) { digit++; } } printf("Number of Alphabets in the string is : %zu\n", alphabet); printf("Number of Digits in the string is : %zu\n", digit); printf("Case changed message is: %s\n", message ); } pip install opencv-python==3.4.2.17。现在它们也可以在Anaconda导航器中作为已安装的软件包看到,并且我可以使用SIFT等获得专利的方法。

答案 4 :(得分:0)

这在Windows 10的Anaconda 5.3和python 3.6上对我有用

implementation ('android.arch.persistence.room:runtime:$rootProject.roomVersion',{
    exclude group: 'com.android.support', module: 'support-core-utils'
})