package OpenCV::Webcam; our %EXPORT_TAGS = ( 'all' => [ qw( ) ] ); our @EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } ); our @EXPORT = qw( ); our $VERSION = '0.01'; use Inline C => Config => MYEXTLIB => 'C:\OpenCV2.0\lib\libcv200.dll.a C:\OpenCV2.0\lib\libhighgui200.dll.a C:\OpenCV2.0\lib\libcxcore200.dll.a', INC => '-IC:\OpenCV2.0\include\opencv'; use Inline C => <<'END_OF_C_CODE'; #include "cv.h" #include "highgui.h" CvCapture *capture = 0; IplImage *frame = 0; int* height, width, step, channels, depth; int new() { capture = cvCaptureFromCAM( 0 ); printf("\nSetting Capture!\n"); } char* GetImage() { char *data; printf("\nGetting Image Data!\n"); frame = cvQueryFrame( capture ); cvCvtColor(frame, frame, CV_BGR2RGB); data = (char*)frame->imageData; return(data); } int Release() { printf("\nReleasing Capture!\n"); cvReleaseCapture( &capture ); } END_OF_C_CODE