Dear members of stack overflow, hi:
I have just learned a little bit of opencv in VC++. Now, I faced a new problem:
I want to input my video frames from an EPIPHAN VGA2USB device. So, I installed the device drivers, downloaded its SDK, and opened one of its sample projects, named V2U, in Microsoft Visual Studio 2010. Using the SDK Release Notes.pdf, I added the line:
V2U_GrabFrame2* currFrame= FrmGrab_Frame(fg, V2U_GRABFRAME_FORMAT_RGB16, NULL);
to the main
function of it (fg
is a frame grabber object and FrmGrab_Frame
, according to the pdf, returns a frame). The type V2U_GrabFrame2
is defined as:
typedef struct ioctl_grabframe2 {
#define V2U_GrabFrame2_Fields(pointer) \
pointer pixbuf; /* IN should be filled by user process */\
V2U_UINT32 pixbuflen; /* IN should be filled by user process */\
V2U_UINT32 palette; /* IN pixel format */\
V2URect crop; /* IN/OUT cropping area; all zeros = full frame */\
V2U_VideoMode mode; /* OUT VGA mode */\
V2U_UINT32 imagelen; /* OUT size of the image stored in pixbuf */\
V2U_INT32 retcode; /* OUT return/error code */
V2U_GrabFrame2_Fields(void*)
} V2U_PACKED V2U_GrabFrame2, V2UGrabFrame2;
in a header file. I may have to create a cv::Mat
object from the info in currFrame
, so that I can process it using opencv tools. Would anyone share a similar experience that can help a real beginner, please?!