I have problem in converting System.Drawing.Image to Emgu.CV.Image.
i can load my image in formapplication
string im_name = str[index];
Emgu.CV.Image<Bgr, Byte> img = new Image<Bgr, byte>(im_name);
but this code gives me error of invalid arguments
System.Drawing.Image img_btmap = System.Drawing.Image.FromFile( im_name);
Emgu.CV.Image<Bgr, Byte> img1 = new Image<Bgr, byte>(img_btmap);
Somebody has idea why???
regards
Change the line to:
The
Emgu.CV.Imageconstructor is expecting Bitmap class which inherits from Image class.Make sure to dispose img_btmap later otherwise you risk the file being locked.
Edit: most simple way of ensuring proper disposing is using the
usingblock like this: