Emgu.CV.CvInvoke.cvRetrieveFrame C# (CSharp) Метод

cvRetrieveFrame() приватный Метод

private cvRetrieveFrame ( IntPtr capture, int streamIdx ) : IntPtr
capture IntPtr
streamIdx int
Результат IntPtr
        public static extern IntPtr cvRetrieveFrame(IntPtr capture, int streamIdx);

Usage Example

Пример #1
0
        /// <summary>
        /// Retrieve all the points (x, y, z position in meters) from Kinect, row by row.
        /// </summary>
        /// <returns>All the points (x, y, z position in meters) from Kinect, row by row.</returns>
        public MCvPoint3D32f[] RetrievePointCloudMap()
        {
            IntPtr img = CvInvoke.cvRetrieveFrame(Ptr, (int)OpenNIDataType.PointCloudMap);

            if (img == IntPtr.Zero)
            {
                return(null);
            }

            if (FlipType != Emgu.CV.CvEnum.FLIP.NONE)
            {
                CvInvoke.cvFlip(img, img, FlipType);
            }

            MIplImage iplImage = (MIplImage)Marshal.PtrToStructure(img, typeof(MIplImage));

            MCvPoint3D32f[] points = new MCvPoint3D32f[iplImage.width * iplImage.height];
            GCHandle        handle = GCHandle.Alloc(points, GCHandleType.Pinned);

            using (Matrix <float> m = new Matrix <float>(iplImage.height, iplImage.width, handle.AddrOfPinnedObject()))
            {
                CvInvoke.cvCopy(img, m, IntPtr.Zero);
            }
            handle.Free();

            return(points);
        }
All Usage Examples Of Emgu.CV.CvInvoke::cvRetrieveFrame
CvInvoke