question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Jetson] libOpenCvSharpExtern: cannot open shared object file: No such file or directory

See original GitHub issue

Summary of your issue

I’m trying to use opencvsharp in Jetson. The app is .NET 5 console app. I added OpenCvSharp4 and OpenCvSharp4.runtime.linux-arm. I got error libOpenCvSharpExtern: cannot open shared object file: No such file or directory.

  1. I’m not sure about OpenCvSharp4.runtime.linux-arm, can it work for linux-arm64? Or I need to build from source code by myself? If yes, do we have any instruction for this (jetson)?
  2. What about OpenCV 4.1.1, is it supported by opencvsharp?

Environment

  • Jetson Nano (linux-arm64)
  • OpenCV 4.1.1
  • .NET 5 Console App

Example code:

var videoCapture = new VideoCapture();

videoCapture.Open(0);

var frame = new Mat();
var frameId = 0;
var maxFrame = 1;
while (videoCapture.IsOpened())
{
    if(videoCapture.Read(frame))
    {
        frameId++;
        var image = BitmapConverter.ToBitmap(frame);
        image.Save($"{frameId}.jpg");

        if (frameId >= maxFrame)
        {
            break;
        }
    }
}

Output:

Unhandled exception. System.TypeInitializationException: The type initializer for 'OpenCvSharp.Internal.NativeMethods' threw an exception.
 ---> 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
   at OpenCvSharp.Internal.NativeMethods.redirectError(CvErrorCallback errCallback, IntPtr userdata, IntPtr& prevUserdata)
   at OpenCvSharp.Internal.ExceptionHandler.RegisterExceptionCallback()
   at OpenCvSharp.Internal.NativeMethods.LoadLibraries(IEnumerable`1 additionalPaths)
   at OpenCvSharp.Internal.NativeMethods..cctor()
   --- End of inner exception stack trace ---
   at OpenCvSharp.Internal.NativeMethods.videoio_VideoCapture_new1(IntPtr& returnValue)
   at OpenCvSharp.VideoCapture..ctor()
   at Program.Main(String[] args) in /Program.cs:line 18

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

4reactions
AvenSuncommented, May 23, 2021

@leopripos the attached file I built works well on Jetson, but it’s not the latest version. libOpenCvSharpExtern for Jetson you can have a try.

1reaction
dev-nextprogresscommented, May 23, 2021

Hi and first let me thanks @shimat and all the contributors to this great library. I am having the same question about the linux-arm64 runtime identifier. It appears as if the linux-arm package is not compatible with ARM64. The LoadLibrary call on the linux-arm version fails (I verified that the O/S can find it). I know we could probably try to build it ourselves but it’s a bit of a chore if you are not deeply familiar with CMake and such. So if there are any plans to create a linux-arm64 package that would be great to know. Thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

throwing error when running Yolo on jetson Nano (cannot ...
I am trying to run this Yolo model on Jetson Nano ... Yolo on jetson Nano (cannot open shared object file: No such...
Read more >
How to run OpenCvSharp on Ubuntu 18.04?
I have a problem with running OpenCvShare on the Ubuntu Linux. It keeps saying that libOpenCvSharpExtern is not found. I have a problem...
Read more >
opencvsharp
Native binding (OpenCvSharpExtern.dll / libOpenCvSharpExtern.so) is required to work OpenCvSharp. To use OpenCvSharp, you should add both OpenCvSharp4 and ...
Read more >
Installing Ubuntu 20.04 LTS and running YOLOv4 ...
in my case I was facing this error: Error while loading shared libraries: lcublas: cannot open shared object file: No such file or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found