简体   繁体   English

在 colab 上运行 SURF 算法

[英]Run SURF algorithm on colab

I used to run SURF and SIFT on Colab using OpenCV 3.4.2.17.我曾经使用 OpenCV 3.4.2.17 在 Colab 上运行 SURF 和 SIFT。 However, I can not use this version of opencv any more.但是,我不能再使用这个版本的 opencv 了。 Is there any other way to run SURF on Colab?还有其他方法可以在 Colab 上运行 SURF 吗? I can SIFT pantent has expired since 2020. Below is the error I can SIFT pantent has expired since 2020. 下面是错误

error: OpenCV(4.6.0) /io/opencv_contrib/modules/xfeatures2d/src/surf.cpp:1027: error: (-213:The function/feature is not implemented) This algorithm is patented and is excluded in this configuration; error: OpenCV(4.6.0) /io/opencv_contrib/modules/xfeatures2d/src/surf.cpp:1027: error: (-213:The function/feature is not implemented) 该算法已获得专利,并被排除在该配置中; Set OPENCV_ENABLE_NONFREE CMake option and rebuild the library in function 'create'设置 OPENCV_ENABLE_NONFREE CMake 选项并在 function 'create' 中重建库

I have tried to downgrade Opencv version to 4.2.0, 3.4.8.29, 3.4.2.17 and 4.4.0.46.我尝试将 Opencv 版本降级到 4.2.0、3.4.8.29、3.4.2.17 和 4.4.0.46。 I also tried to downgrade paython to version 3.6 to work with old version opencv library.我还尝试将 paython 降级到版本 3.6 以使用旧版本 opencv 库。

Don't downgrade.不要降级。 Build OpenCV using your own configuration.使用您自己的配置构建 OpenCV。 See https://docs.opencv.org/4.7.0/d7/d9f/tutorial_linux_install.html .请参阅https://docs.opencv.org/4.7.0/d7/d9f/tutorial_linux_install.html

Here I have downloaded the opencv and the opencv_contrib sources in the "git" subdirectory.在这里,我已经在“git”子目录中下载了 opencv 和 opencv_contrib 源代码。 I don't want to use IPP, but I want the nonfree libraries to be built:我不想使用 IPP,但我希望构建非自由库:

mkdir -p build && cd build

Then (choose your Python directory):然后(选择您的 Python 目录):

cmake -DPYTHON_INCLUDE_DIR=/usr/include/python3.9 -DPYTHON_LIBRARY=/usr/lib -DWITH_IPP=OFF -DOPENCV_ENABLE_NONFREE:BOOL=ON -DOPENCV_EXTRA_MODULES_PATH=../git/opencv_contrib/modules../git/opencv

Then:然后:

cmake --build.

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM