Emgu.CV 4.2.0 image conversion methods not available
Asked Answered
O

3

9

I have a .Net Standard 2.0 project with latest version of Emgu.CV - 4.2.0.3636 installed via Nuget package. I also have System.Drawing.Common package which brings support for bitmaps. I need a possibility to convert Mat into Bitmap and to create Mats from existing Bitmaps. Previously Mats had Bitmap property and there was a constructor of Image, for example, accepting Bitmap as an argument. From what I see in release notes of 4.2.0 version of Emgu.CV - these have been replaced with ToMat() extension method for bitmaps and AsBitmap() method for Mats/Images. However for me both of these methods are not available.

Release notes on official website say:

It has been added to the Emgu.CV.UI nuget package (or dll file)

In the same time I don't see the Emgu.CV.UI package in nuget, only the Emgu.CV one which I already have installed.

What else may I have missing?

Orts answered 4/2, 2020 at 19:15 Comment(0)
B
12

Since Emgu 4.4.0, the bitmap part is in a third (NuGet) package Emgu.CV.Bitmap which solves this problem (used to be within Emgu.CV.runtime.windows with 4.3.0 and before).

So you need the THREE packages:

  • Emgu.CV (of course)
  • Emgu.CV.runtime.windows
  • and now, Emgu.CV.Bitmap
Baggy answered 7/10, 2020 at 21:45 Comment(0)
E
5

You also need to add a Emgu.Cv Runtime package for your OS. So for Windows you will need to add Emgu.Cv.Runtime.Windows

Erdman answered 5/2, 2020 at 21:18 Comment(2)
I'll have to suggest to EMGU to update their documentation about the version change, THIS is the package that's requried and not "Emgu.CV.UI"Mechanism
Yes. Once install the runtime package, image can be converted to bitmap by Image<,>.AsBitmap()Pneuma
M
1

I had the same problem even though I had the Emgu.CV.runtime.windows package.

In order to get access to the ToBitmap() methods I did need the Emgu.CV.UI.dll

Doesn't look like it's included with either the runtime or the Emgu.CV nuget packages.

How I got it was to go to the github page, download this which has the UI.dll built in the bin folder (or build the project yourself)

Reference that dll and you get access to the methods. Hopefully in the future they make it available via nuget

Morph answered 4/6, 2020 at 5:27 Comment(1)
I managed to get ToBitmap() and AsBitmap() working in a .Net Core 3.1 project by using these two nuget packages: Emgu.CV.runtime.windows and Emgu.CV.UIInbred

© 2022 - 2024 — McMap. All rights reserved.