0

After saving a image in PNG format using

bitmap.save(filename, ImageFormat.PNG),

I now try to read the same image

Image<Rgb, Byte> inpImage = new Image<Rgb, Byte>(dir + fn_only + "_ms.png") using emgu Image. On runtime I get a

System.TypeInitializationException occurred in Emgu.CV.dll

Exception:

System.TypeInitializationException: The type initializer for 'Emgu.CV.CvInvoke' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'opencv _core242': The specified module could not be found. (Exception from HRESULT: 0x8 007007E) at Emgu.CV.CvInvoke.cvRedirectError(CvErrorCallback errorHandler, IntPtr user data, IntPtr prevUserdata) at Emgu.CV.CvInvoke..cctor() --- End of inner exception stack trace --- at Emgu.CV.Image`2..ctor(String fileName)

when opencv_242 is present. On dependency check it says NVCUDA is missing. I do not have a GPU, obv there wont be NVCUDA in that case.

I tried color type RGB and BGR.

change
  • 3,400
  • 7
  • 32
  • 42
  • 2
    possible duplicate of [EmguCV TypeInitializationException](http://stackoverflow.com/questions/11369684/emgucv-typeinitializationexception) – rold2007 Oct 27 '13 at 21:26
  • If it's an NVCUDA issue, then you should read my answer to this question (not the approved answer): http://stackoverflow.com/questions/12594993/emgucv-nvcuda-dll-could-not-be-found/12613872#12613872. By the way, you DO have a GPU, it's only not an Nvidia GPU. – rold2007 Oct 29 '13 at 06:11

1 Answers1

2
//a way is first open the PNG in a bitmap

Bitmap bitmap = new Bitmap(dir + fn_only + "_ms.png");

//and read the bitman how image

Image<Rgb, Byte> inpImage = new Image<Rgb, Byte>(bitmap);

ref: http://www.emgu.com/wiki/index.php/Working_with_Images Creating image from Bitmap

chefjuanpi
  • 1,570
  • 15
  • 27