how to get IntPtr data from byte[] [closed]

asked 2014-07-07 21:59:09 -0500

there are already image data in byte[] arr, 3 channels of bmp file, and also a MIplImage raw reated for it. how to get raw.imageData from arr? using CvInvoke.cvSetData() failed, as 2 parameters both need IntPtr type; using Marshal.StructureToPtr() passed compile, but crush when runs, indicates "Specify the structure must be able to directly copied to the unit structure, or has the layout information" so, how can I get the imagedata of byte[] into IntPtr for MIplImage?

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by sturkmen
close date 2020-10-27 23:10:34.012028


Maybe convert it to Mat, then use Mat::convertTo(...) to change it?

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-07-08 02:37:12 -0500 )edit

ppl here can help you with opencv issues, not so much with specific emgu/c# problems.

mind asking here : ?

berak gravatar imageberak ( 2014-07-08 08:15:54 -0500 )edit

@thdrksdfthmn MIplImage inherits from Mat, both of them have the IntPtr data, so I guess Mat will not help.... @berak I already asked on at the same time, but also no answers ...

alex17swim gravatar imagealex17swim ( 2014-07-08 20:31:39 -0500 )edit

Try it, and post the minimal code, maybe more help will come...

thdrksdfthmn gravatar imagethdrksdfthmn ( 2014-07-09 02:13:19 -0500 )edit