2

Int16[19200]
私はそれをに変えたいの配列を持っていますImage[160,120,1]

これを行う最速の方法は何ですか?

120 fps で行う必要があるため、非常に効率的である必要があります。
ありがとう
SW

4

1 に答える 1

2

それを見つけた:

            GCHandle handle = GCHandle.Alloc(dataArray, GCHandleType.Pinned);
            IntPtr imageHeaderForBytes = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(MIplImage)));
            CvInvoke.cvInitImageHeader(
                  imageHeaderForBytes,
                  new Size(160, 120),
                  Emgu.CV.CvEnum.IPL_DEPTH.IPL_DEPTH_16S, 1, 0, 4);
            Marshal.WriteIntPtr(
                  imageHeaderForBytes,
                  (int)Marshal.OffsetOf(typeof(MIplImage), "imageData"),
                  handle.AddrOfPinnedObject());

            CvInvoke.cvCopy(imageHeaderForBytes, EMGUImage.Ptr, IntPtr.Zero);

            Marshal.FreeHGlobal(imageHeaderForBytes);
            handle.Free();
于 2011-02-14T02:21:31.657 に答える