Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C# - Emgu cv How to load an image from a folder using CvInvoke.cvLoadImage("ClassPic1.jpg") as intptr and access it

How to load an image from a specific folder using Emgu cv CvInvoke.cvLoadImage(...)?I am tryng to do it like this

    IntPtr inputImage = CvInvoke.cvLoadImage("C:\\Users\\...\\ClassPic1.jpg");

Is that ok? If so, How am i gonna access it later as an Emgu.CV.Image file so that i will do my image processing on it?

like image 349
Sisay Avatar asked Dec 11 '22 14:12

Sisay


2 Answers

You should probably use the following method to load the image:

Image<Bgr, Byte> img1 = new Image<Bgr, Byte>("..\\..\\MyImage.jpg");// path can be absolute or relative.

this img1 variable can be accessed later to perform manipulations on it.

check this link for more details. http://www.emgu.com/wiki/index.php/Working_with_Images

like image 89
Shiva Avatar answered Dec 28 '22 06:12

Shiva


OpenCV functions are in CvInvoke class

so: CvInvoke.

those are all static functions.

like image 29
dajuric Avatar answered Dec 28 '22 08:12

dajuric