Emgu.CV.CvInvoke.cvQueryFrame C# (CSharp) Method

cvQueryFrame() private method

private cvQueryFrame ( IntPtr capture ) : IntPtr
capture IntPtr
return IntPtr
        public static extern IntPtr cvQueryFrame(IntPtr capture);

Usage Example

コード例 #1
0
ファイル: Capture.cs プロジェクト: zliu100/emgu_openCV
        /// <summary>
        /// Capture a Gray image frame
        /// </summary>
        /// <returns> A Gray image frame</returns>
        public virtual Image <Gray, Byte> QueryGrayFrame()
        {
            IntPtr img = CvInvoke.cvQueryFrame(Ptr);

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

            Image <Gray, Byte> res;

            if (iplImage.nChannels == 3)
            { //if the image captured is Bgr, convert it to Grayscale
                res = new Image <Gray, Byte>(iplImage.width, iplImage.height);
                CvInvoke.cvCvtColor(img, res.Ptr, Emgu.CV.CvEnum.COLOR_CONVERSION.CV_BGR2GRAY);
            }
            else
            {
                res = new Image <Gray, byte>(iplImage.width, iplImage.height, iplImage.widthStep, iplImage.imageData);
            }

            //inplace flip the image if necessary
            res._Flip(FlipType);

            return(res);
        }
All Usage Examples Of Emgu.CV.CvInvoke::cvQueryFrame
CvInvoke