【发布时间】:2019-05-31 01:27:47
【问题描述】:
我在 Ubuntu Linux 上运行 OpenCvShare 时遇到问题。它一直说找不到 libOpenCvSharpExtern。
我在 Ubuntu 18.04.1 x64 上运行 OpenCvSharp 时遇到问题。我创建了一个 .NET Core/Standard 解决方案(Standard 是一个库项目,Core 是运行器)。库项目引用 Nuget 包: OpenCvSharp4 (4.0.0.20181225) OpenCvSharp4.runtime.ubuntu.18.04-x64 (4.0.0.20181225)。
然后,在成功编译后,我使用以下命令发布了运行器项目:
dotnet publish -c Release -r ubuntu.18.04-x64
当我在 Ubuntu 上运行可执行文件时,抛出以下错误:
Unhandled Exception: OpenCvSharp.OpenCvSharpException: Failed to create VideoCapture System.TypeInitializationException: The type initializer for 'OpenCvSharp.NativeMethods' threw an exception. OpenCvSharp.OpenCvSharpException: Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libOpenCvSharpExtern: cannot open shared object file: No such file or directory ---> System.DllNotFoundException:
Unable to load shared library 'OpenCvSharpExtern' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libOpenCvSharpExtern: cannot open shared object file: No such file or directory
文件 libOpenCvSharpExtern.so 与可执行文件位于同一路径,我也将其复制到 usr/local/lib 中,但 id 没有帮助。应用程序旨在根据摄像头馈送检测人脸。
【问题讨论】:
-
我也有同样的问题。
-
我什至在 Ubunty 18.04 上成功编译了 opencv 和 opencvsharp,即使这样也没有检测到。
标签: c# opencv ubuntu opencvsharp