Hey guys, I am using EmguCv wrapper inside Unity to develop some game. Right now, Iam confronted with problem of CONVERTATION *IplImage*(Image) to Texture2D(unity texture). I've read a lot of posts before and implemented one idea: Unfortunately it workes only for histogram drawing. What I've done there: Firstly, I convert Image to Image, then I got ManagedArray of bytes from Image and set the data to newly created Texture2D:
CvInvoke.cvCvtColor(img.Ptr, copy_img, COLOR_CONVERSION.CV_BGR2RGBA); Array bytes = copy_img.ManagedArray; int h = bytes.GetLength(0); int w = bytes.GetLength(1);
for (int i = 0; i
t.SetPixel(y, x, new UnityEngine.Color((float)r, (float)g, (float)b, (float)a));
} }