The following is just a theory and may not work, I'm not very experienced with opencv / emgucv
Both System.Drawing.Bitmap and Emgu.CV.Image have constructors that take scan0 as an argument. You can allocate memory for the image and pass this pointer to these constructors. memory can be allocated var ptr = Marshal.AllocHGlobal(stride*height) (do not forget about free) or by allocating a managed array of sufficient size and access to its address. The address can be purchased as follows:
var array = new byte[stride*height]; var gch = GCHandle.Alloc(array, GCHandleType.Pinned); var ptr = gch.AddrOfPinnedObject();
It also "issues" the array, so it cannot be moved by the garbage collector, and the address will not change.
We will use these constructors:
Bitmap(int width, int height, int stride, PixelFormat format, IntPtr scan0); Image<Bgr, Byte>(int width, int height, int stride, IntPtr scan0);
width and height arguments are self explanatory. format for the PixelFormat.Format24bppRgb PixelFormat.Format24bppRgb . stride - the number of bytes for one line of the image, it should also be aligned (be a multiple of 4). This can be done like this:
var stride = (width * 3); var align = stride % 4; if(align != 0) stride += 4 - align;
And scan0 is a pointer to our memory block.
Therefore, I suggest that after creating System.Drawing.Bitmap and Emgu.CV.Image using these constructors, the same memory block will be used. If not, this means that opencv or Bitmap, or both the blocks provided by the copy, and the possible solution (if one exists) are definitely not worth the effort.