Applied XIMEA path (by Marian Zajko) with multiple changes #2054

This commit is contained in:
Andrey Kamaev 2012-06-26 11:47:49 +00:00
parent e9e66e5796
commit f9418853a0

View File

@ -1,8 +1,8 @@
#include "precomp.hpp" #include "precomp.hpp"
#include "xiApi.h" #include "xiApi.h"
#include "xiExt.h" #include "xiExt.h"
#include "m3Api.h"
/**********************************************************************************/ /**********************************************************************************/
@ -18,20 +18,20 @@ public:
virtual bool setProperty(int, double); virtual bool setProperty(int, double);
virtual bool grabFrame(); virtual bool grabFrame();
virtual IplImage* retrieveFrame(int); virtual IplImage* retrieveFrame(int);
virtual int getCaptureDomain() { return CV_CAP_XIAPI; } // Return the type of the capture object: CV_CAP_VFW, etc... virtual int getCaptureDomain() { return CV_CAP_XIAPI; } // Return the type of the capture object: CV_CAP_VFW, etc...
protected: protected:
void init(); void init();
void errMsg(char* msg, int errNum); void errMsg(const char* msg, int errNum);
IplImage* frame; IplImage* frame;
HANDLE hmv; HANDLE hmv;
DWORD numDevices; DWORD numDevices;
XI_IMG image; XI_IMG image;
int width; int width;
int height; int height;
int format; int format;
int timeout; int timeout;
}; };
/**********************************************************************************/ /**********************************************************************************/
@ -43,7 +43,7 @@ CvCapture* cvCreateCameraCapture_XIMEA( int index )
if( capture->open( index )) if( capture->open( index ))
return capture; return capture;
delete capture; delete capture;
return 0; return 0;
} }
@ -51,8 +51,9 @@ CvCapture* cvCreateCameraCapture_XIMEA( int index )
// Enumerate connected devices // Enumerate connected devices
void CvCaptureCAM_XIMEA::init() void CvCaptureCAM_XIMEA::init()
{ {
xiGetNumberDevices( &numDevices); xiGetNumberDevices( &numDevices);
hmv = NULL; hmv = NULL;
memset(&image, 0, sizeof(XI_IMG));
} }
@ -60,57 +61,85 @@ void CvCaptureCAM_XIMEA::init()
// Initialize camera input // Initialize camera input
bool CvCaptureCAM_XIMEA::open( int wIndex ) bool CvCaptureCAM_XIMEA::open( int wIndex )
{ {
int mvret = XI_OK; int mvret = XI_OK;
if(numDevices == 0) if(numDevices == 0)
return false; return false;
if((mvret = xiOpenDevice( wIndex, &hmv)) != XI_OK)
{
errMsg("Open XI_DEVICE failed", mvret);
return false;
}
// always use auto exposure/gain if((mvret = xiOpenDevice( wIndex, &hmv)) != XI_OK)
xiSetParamInt( hmv, XI_PRM_AEAG, 1); {
errMsg("Open XI_DEVICE failed", mvret);
return false;
}
// always use auto white ballance // always use auto exposure/gain
xiSetParamInt( hmv, XI_PRM_AUTO_WB, 1); mvret = xiSetParamInt( hmv, XI_PRM_AEAG, 1);
if(mvret != XI_OK) goto error;
xiGetParamInt( hmv, XI_PRM_WIDTH, &width); // always use auto white ballance
xiGetParamInt( hmv, XI_PRM_HEIGHT, &height); mvret = xiSetParamInt( hmv, XI_PRM_AUTO_WB, 1);
if(mvret != XI_OK) goto error;
// default image format RGB24
xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, XI_RGB24);
format = XI_RGB24;
// allocate frame buffer for RGB24 image
frame = cvCreateImage(cvSize( width, height), IPL_DEPTH_8U, 3);
//default capture timeout 10s mvret = xiGetParamInt( hmv, XI_PRM_WIDTH, &width);
timeout = 10000; if(mvret != XI_OK) goto error;
return true; mvret = xiGetParamInt( hmv, XI_PRM_HEIGHT, &height);
if(mvret != XI_OK) goto error;
// default image format RGB24
format = XI_RGB24;
mvret = xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, format);
if(mvret != XI_OK) goto error;
// allocate frame buffer for RGB24 image
frame = cvCreateImage(cvSize( width, height), IPL_DEPTH_8U, 3);
//default capture timeout 10s
timeout = 10000;
mvret = xiStartAcquisition(hmv);
if(mvret != XI_OK)
{
errMsg("StartAcquisition XI_DEVICE failed", mvret);
goto error;
}
return true;
error:
xiCloseDevice(hmv);
hmv = NULL;
return false;
} }
/**********************************************************************************/ /**********************************************************************************/
void CvCaptureCAM_XIMEA::close() void CvCaptureCAM_XIMEA::close()
{ {
xiCloseDevice(hmv); xiStopAcquisition(hmv);
hmv = NULL; xiCloseDevice(hmv);
hmv = NULL;
} }
/**********************************************************************************/ /**********************************************************************************/
bool CvCaptureCAM_XIMEA::grabFrame() bool CvCaptureCAM_XIMEA::grabFrame()
{ {
int mvret = XI_OK; image.size = sizeof(XI_IMG);
image.size = sizeof(XI_IMG); int mvret = xiGetImage( hmv, timeout, &image);
if((mvret = xiGetImage( hmv, timeout, &image)) != XI_OK)
{ if(mvret == MM40_ACQUISITION_STOPED)
errMsg("Error during GetImage", mvret); {
return false; xiStartAcquisition(hmv);
} mvret = xiGetImage(hmv, timeout, &image);
}
if(mvret != XI_OK)
{
errMsg("Error during GetImage", mvret);
return false;
}
return true; return true;
} }
@ -118,136 +147,150 @@ bool CvCaptureCAM_XIMEA::grabFrame()
IplImage* CvCaptureCAM_XIMEA::retrieveFrame(int) IplImage* CvCaptureCAM_XIMEA::retrieveFrame(int)
{ {
// update cvImage after format has changed // update cvImage after format has changed
if( image.width != width || image.height != height || image.frm != format) if( (int)image.width != width || (int)image.height != height || image.frm != (XI_IMG_FORMAT)format)
{ {
cvReleaseImage(&frame); cvReleaseImage(&frame);
switch( image.frm) switch( image.frm)
{ {
case XI_MONO8 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_8U, 1); break; case XI_MONO8 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_8U, 1); break;
case XI_MONO16 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_16U, 1); break; case XI_MONO16 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_16U, 1); break;
case XI_RGB24 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_8U, 3); break; case XI_RGB24 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_8U, 3); break;
case XI_RGB32 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_8U, 4); break; case XI_RGB32 : frame = cvCreateImage(cvSize( image.width, image.height), IPL_DEPTH_8U, 4); break;
} default :
// update global image format return frame;
format = image.frm; }
width = image.width; // update global image format
height = image.height; format = image.frm;
} width = image.width;
height = image.height;
}
// copy pixel data // copy pixel data
switch( image.frm) switch( image.frm)
{ {
case XI_MONO8 : memcpy( frame->imageData, image.bp, image.width*image.height); break; case XI_MONO8 : memcpy( frame->imageData, image.bp, image.width*image.height); break;
case XI_MONO16 : memcpy( frame->imageData, image.bp, image.width*image.height*sizeof(WORD)); break; case XI_MONO16 : memcpy( frame->imageData, image.bp, image.width*image.height*sizeof(WORD)); break;
case XI_RGB24 : memcpy( frame->imageData, image.bp, image.width*image.height*3); break; case XI_RGB24 : memcpy( frame->imageData, image.bp, image.width*image.height*3); break;
case XI_RGB32 : memcpy( frame->imageData, image.bp, image.width*image.height*sizeof(DWORD)); break; case XI_RGB32 : memcpy( frame->imageData, image.bp, image.width*image.height*sizeof(DWORD)); break;
} default: break;
return frame; }
return frame;
} }
/**********************************************************************************/ /**********************************************************************************/
double CvCaptureCAM_XIMEA::getProperty( int property_id ) double CvCaptureCAM_XIMEA::getProperty( int property_id )
{ {
if(hmv == NULL) if(hmv == NULL)
return 0; return 0;
int ival = 0; int ival = 0;
float fval = 0; float fval = 0;
switch( property_id ) switch( property_id )
{ {
// OCV parameters // OCV parameters
case CV_CAP_PROP_POS_FRAMES : return (double) image.nframe; case CV_CAP_PROP_POS_FRAMES : return (double) image.nframe;
case CV_CAP_PROP_FRAME_WIDTH : xiGetParamInt( hmv, XI_PRM_WIDTH, &ival); return ival; case CV_CAP_PROP_FRAME_WIDTH : xiGetParamInt( hmv, XI_PRM_WIDTH, &ival); return ival;
case CV_CAP_PROP_FRAME_HEIGHT : xiGetParamInt( hmv, XI_PRM_HEIGHT, &ival); return ival; case CV_CAP_PROP_FRAME_HEIGHT : xiGetParamInt( hmv, XI_PRM_HEIGHT, &ival); return ival;
case CV_CAP_PROP_FPS : xiGetParamFloat( hmv, XI_PRM_FRAMERATE, &fval); return fval; case CV_CAP_PROP_FPS : xiGetParamFloat( hmv, XI_PRM_FRAMERATE, &fval); return fval;
case CV_CAP_PROP_GAIN : xiGetParamFloat( hmv, XI_PRM_GAIN, &fval); return fval; case CV_CAP_PROP_GAIN : xiGetParamFloat( hmv, XI_PRM_GAIN, &fval); return fval;
case CV_CAP_PROP_EXPOSURE : xiGetParamInt( hmv, XI_PRM_EXPOSURE, &ival); return ival; case CV_CAP_PROP_EXPOSURE : xiGetParamInt( hmv, XI_PRM_EXPOSURE, &ival); return ival;
// XIMEA camera properties // XIMEA camera properties
case CV_CAP_PROP_XI_DOWNSAMPLING : xiGetParamInt( hmv, XI_PRM_DOWNSAMPLING, &ival); return ival; case CV_CAP_PROP_XI_DOWNSAMPLING : xiGetParamInt( hmv, XI_PRM_DOWNSAMPLING, &ival); return ival;
case CV_CAP_PROP_XI_DATA_FORMAT : xiGetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, &ival); return ival; case CV_CAP_PROP_XI_DATA_FORMAT : xiGetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, &ival); return ival;
case CV_CAP_PROP_XI_OFFSET_X : xiGetParamInt( hmv, XI_PRM_OFFSET_X, &ival); return ival; case CV_CAP_PROP_XI_OFFSET_X : xiGetParamInt( hmv, XI_PRM_OFFSET_X, &ival); return ival;
case CV_CAP_PROP_XI_OFFSET_Y : xiGetParamInt( hmv, XI_PRM_OFFSET_Y, &ival); return ival; case CV_CAP_PROP_XI_OFFSET_Y : xiGetParamInt( hmv, XI_PRM_OFFSET_Y, &ival); return ival;
case CV_CAP_PROP_XI_TRG_SOURCE : xiGetParamInt( hmv, XI_PRM_TRG_SOURCE, &ival); return ival; case CV_CAP_PROP_XI_TRG_SOURCE : xiGetParamInt( hmv, XI_PRM_TRG_SOURCE, &ival); return ival;
case CV_CAP_PROP_XI_GPI_SELECTOR : xiGetParamInt( hmv, XI_PRM_GPI_SELECTOR, &ival); return ival; case CV_CAP_PROP_XI_GPI_SELECTOR : xiGetParamInt( hmv, XI_PRM_GPI_SELECTOR, &ival); return ival;
case CV_CAP_PROP_XI_GPI_MODE : xiGetParamInt( hmv, XI_PRM_GPI_MODE, &ival); return ival; case CV_CAP_PROP_XI_GPI_MODE : xiGetParamInt( hmv, XI_PRM_GPI_MODE, &ival); return ival;
case CV_CAP_PROP_XI_GPI_LEVEL : xiGetParamInt( hmv, XI_PRM_GPI_LEVEL, &ival); return ival; case CV_CAP_PROP_XI_GPI_LEVEL : xiGetParamInt( hmv, XI_PRM_GPI_LEVEL, &ival); return ival;
case CV_CAP_PROP_XI_GPO_SELECTOR : xiGetParamInt( hmv, XI_PRM_GPO_SELECTOR, &ival); return ival; case CV_CAP_PROP_XI_GPO_SELECTOR : xiGetParamInt( hmv, XI_PRM_GPO_SELECTOR, &ival); return ival;
case CV_CAP_PROP_XI_GPO_MODE : xiGetParamInt( hmv, XI_PRM_GPO_MODE, &ival); return ival; case CV_CAP_PROP_XI_GPO_MODE : xiGetParamInt( hmv, XI_PRM_GPO_MODE, &ival); return ival;
case CV_CAP_PROP_XI_LED_SELECTOR : xiGetParamInt( hmv, XI_PRM_LED_SELECTOR, &ival); return ival; case CV_CAP_PROP_XI_LED_SELECTOR : xiGetParamInt( hmv, XI_PRM_LED_SELECTOR, &ival); return ival;
case CV_CAP_PROP_XI_LED_MODE : xiGetParamInt( hmv, XI_PRM_LED_MODE, &ival); return ival; case CV_CAP_PROP_XI_LED_MODE : xiGetParamInt( hmv, XI_PRM_LED_MODE, &ival); return ival;
case CV_CAP_PROP_XI_AUTO_WB : xiGetParamInt( hmv, XI_PRM_AUTO_WB, &ival); return ival; case CV_CAP_PROP_XI_AUTO_WB : xiGetParamInt( hmv, XI_PRM_AUTO_WB, &ival); return ival;
case CV_CAP_PROP_XI_AEAG : xiGetParamInt( hmv, XI_PRM_AEAG, &ival); return ival; case CV_CAP_PROP_XI_AEAG : xiGetParamInt( hmv, XI_PRM_AEAG, &ival); return ival;
case CV_CAP_PROP_XI_EXP_PRIORITY : xiGetParamFloat( hmv, XI_PRM_EXP_PRIORITY, &fval); return fval; case CV_CAP_PROP_XI_EXP_PRIORITY : xiGetParamFloat( hmv, XI_PRM_EXP_PRIORITY, &fval); return fval;
case CV_CAP_PROP_XI_AE_MAX_LIMIT : xiGetParamInt( hmv, XI_PRM_EXP_PRIORITY, &ival); return ival; case CV_CAP_PROP_XI_AE_MAX_LIMIT : xiGetParamInt( hmv, XI_PRM_EXP_PRIORITY, &ival); return ival;
case CV_CAP_PROP_XI_AG_MAX_LIMIT : xiGetParamFloat( hmv, XI_PRM_AG_MAX_LIMIT, &fval); return fval; case CV_CAP_PROP_XI_AG_MAX_LIMIT : xiGetParamFloat( hmv, XI_PRM_AG_MAX_LIMIT, &fval); return fval;
case CV_CAP_PROP_XI_AEAG_LEVEL : xiGetParamInt( hmv, XI_PRM_AEAG_LEVEL, &ival); return ival; case CV_CAP_PROP_XI_AEAG_LEVEL : xiGetParamInt( hmv, XI_PRM_AEAG_LEVEL, &ival); return ival;
case CV_CAP_PROP_XI_TIMEOUT : return timeout; case CV_CAP_PROP_XI_TIMEOUT : return timeout;
}
return 0; }
return 0;
} }
/**********************************************************************************/ /**********************************************************************************/
bool CvCaptureCAM_XIMEA::setProperty( int property_id, double value ) bool CvCaptureCAM_XIMEA::setProperty( int property_id, double value )
{ {
int ival = (int) value; int ival = (int) value;
float fval = (float) value; float fval = (float) value;
int mvret = XI_OK; int mvret = XI_OK;
switch(property_id) switch(property_id)
{ {
// OCV parameters // OCV parameters
case CV_CAP_PROP_FRAME_WIDTH : mvret = xiSetParamInt( hmv, XI_PRM_WIDTH, ival); break; case CV_CAP_PROP_FRAME_WIDTH : mvret = xiSetParamInt( hmv, XI_PRM_WIDTH, ival);
case CV_CAP_PROP_FRAME_HEIGHT : mvret = xiSetParamInt( hmv, XI_PRM_HEIGHT, ival); break; if(mvret == XI_OK) width = ival;
case CV_CAP_PROP_FPS : mvret = xiSetParamFloat( hmv, XI_PRM_FRAMERATE, fval); break; break;
case CV_CAP_PROP_GAIN : mvret = xiSetParamFloat( hmv, XI_PRM_GAIN, fval); break; case CV_CAP_PROP_FRAME_HEIGHT : mvret = xiSetParamInt( hmv, XI_PRM_HEIGHT, ival);
case CV_CAP_PROP_EXPOSURE : mvret = xiSetParamInt( hmv, XI_PRM_EXPOSURE, ival); break; if(mvret == XI_OK) height = ival;
// XIMEA camera properties break;
case CV_CAP_PROP_XI_DOWNSAMPLING : mvret = xiSetParamInt( hmv, XI_PRM_DOWNSAMPLING, ival); break; case CV_CAP_PROP_FPS : mvret = xiSetParamFloat( hmv, XI_PRM_FRAMERATE, fval); break;
case CV_CAP_PROP_XI_DATA_FORMAT : mvret = xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, ival); break; case CV_CAP_PROP_GAIN : mvret = xiSetParamFloat( hmv, XI_PRM_GAIN, fval); break;
case CV_CAP_PROP_XI_OFFSET_X : mvret = xiSetParamInt( hmv, XI_PRM_OFFSET_X, ival); break; case CV_CAP_PROP_EXPOSURE : mvret = xiSetParamInt( hmv, XI_PRM_EXPOSURE, ival); break;
case CV_CAP_PROP_XI_OFFSET_Y : mvret = xiSetParamInt( hmv, XI_PRM_OFFSET_Y, ival); break; // XIMEA camera properties
case CV_CAP_PROP_XI_TRG_SOURCE : mvret = xiSetParamInt( hmv, XI_PRM_TRG_SOURCE, ival); break; case CV_CAP_PROP_XI_DOWNSAMPLING : mvret = xiSetParamInt( hmv, XI_PRM_DOWNSAMPLING, ival); break;
case CV_CAP_PROP_XI_GPI_SELECTOR : mvret = xiSetParamInt( hmv, XI_PRM_GPI_SELECTOR, ival); break; case CV_CAP_PROP_XI_DATA_FORMAT : mvret = xiSetParamInt( hmv, XI_PRM_IMAGE_DATA_FORMAT, ival);
case CV_CAP_PROP_XI_TRG_SOFTWARE : mvret = xiSetParamInt( hmv, XI_PRM_TRG_SOURCE, 1); break; if(mvret == XI_OK) format = ival;
case CV_CAP_PROP_XI_GPI_MODE : mvret = xiSetParamInt( hmv, XI_PRM_GPI_MODE, ival); break; break;
case CV_CAP_PROP_XI_GPI_LEVEL : mvret = xiSetParamInt( hmv, XI_PRM_GPI_LEVEL, ival); break; case CV_CAP_PROP_XI_OFFSET_X : mvret = xiSetParamInt( hmv, XI_PRM_OFFSET_X, ival); break;
case CV_CAP_PROP_XI_GPO_SELECTOR : mvret = xiSetParamInt( hmv, XI_PRM_GPO_SELECTOR, ival); break; case CV_CAP_PROP_XI_OFFSET_Y : mvret = xiSetParamInt( hmv, XI_PRM_OFFSET_Y, ival); break;
case CV_CAP_PROP_XI_GPO_MODE : mvret = xiSetParamInt( hmv, XI_PRM_GPO_MODE, ival); break; case CV_CAP_PROP_XI_TRG_SOURCE : mvret = xiSetParamInt( hmv, XI_PRM_TRG_SOURCE, ival); break;
case CV_CAP_PROP_XI_LED_SELECTOR : mvret = xiSetParamInt( hmv, XI_PRM_LED_SELECTOR, ival); break; case CV_CAP_PROP_XI_GPI_SELECTOR : mvret = xiSetParamInt( hmv, XI_PRM_GPI_SELECTOR, ival); break;
case CV_CAP_PROP_XI_LED_MODE : mvret = xiSetParamInt( hmv, XI_PRM_LED_MODE, ival); break; case CV_CAP_PROP_XI_TRG_SOFTWARE : mvret = xiSetParamInt( hmv, XI_PRM_TRG_SOURCE, 1); break;
case CV_CAP_PROP_XI_AUTO_WB : mvret = xiSetParamInt( hmv, XI_PRM_AUTO_WB, ival); break; case CV_CAP_PROP_XI_GPI_MODE : mvret = xiSetParamInt( hmv, XI_PRM_GPI_MODE, ival); break;
case CV_CAP_PROP_XI_MANUAL_WB : mvret = xiSetParamInt( hmv, XI_PRM_LED_MODE, ival); break; case CV_CAP_PROP_XI_GPI_LEVEL : mvret = xiSetParamInt( hmv, XI_PRM_GPI_LEVEL, ival); break;
case CV_CAP_PROP_XI_AEAG : mvret = xiSetParamInt( hmv, XI_PRM_AEAG, ival); break; case CV_CAP_PROP_XI_GPO_SELECTOR : mvret = xiSetParamInt( hmv, XI_PRM_GPO_SELECTOR, ival); break;
case CV_CAP_PROP_XI_EXP_PRIORITY : mvret = xiSetParamFloat( hmv, XI_PRM_EXP_PRIORITY, fval); break; case CV_CAP_PROP_XI_GPO_MODE : mvret = xiSetParamInt( hmv, XI_PRM_GPO_MODE, ival); break;
case CV_CAP_PROP_XI_AE_MAX_LIMIT : mvret = xiSetParamInt( hmv, XI_PRM_EXP_PRIORITY, ival); break; case CV_CAP_PROP_XI_LED_SELECTOR : mvret = xiSetParamInt( hmv, XI_PRM_LED_SELECTOR, ival); break;
case CV_CAP_PROP_XI_AG_MAX_LIMIT : mvret = xiSetParamFloat( hmv, XI_PRM_AG_MAX_LIMIT, fval); break; case CV_CAP_PROP_XI_LED_MODE : mvret = xiSetParamInt( hmv, XI_PRM_LED_MODE, ival); break;
case CV_CAP_PROP_XI_AEAG_LEVEL : mvret = xiSetParamInt( hmv, XI_PRM_AEAG_LEVEL, ival); break; case CV_CAP_PROP_XI_AUTO_WB : mvret = xiSetParamInt( hmv, XI_PRM_AUTO_WB, ival); break;
case CV_CAP_PROP_XI_TIMEOUT : timeout = ival; break; case CV_CAP_PROP_XI_MANUAL_WB : mvret = xiSetParamInt( hmv, XI_PRM_LED_MODE, ival); break;
} case CV_CAP_PROP_XI_AEAG : mvret = xiSetParamInt( hmv, XI_PRM_AEAG, ival); break;
case CV_CAP_PROP_XI_EXP_PRIORITY : mvret = xiSetParamFloat( hmv, XI_PRM_EXP_PRIORITY, fval); break;
case CV_CAP_PROP_XI_AE_MAX_LIMIT : mvret = xiSetParamInt( hmv, XI_PRM_EXP_PRIORITY, ival); break;
case CV_CAP_PROP_XI_AG_MAX_LIMIT : mvret = xiSetParamFloat( hmv, XI_PRM_AG_MAX_LIMIT, fval); break;
case CV_CAP_PROP_XI_AEAG_LEVEL : mvret = xiSetParamInt( hmv, XI_PRM_AEAG_LEVEL, ival); break;
case CV_CAP_PROP_XI_TIMEOUT : timeout = ival; break;
}
if(mvret != XI_OK)
{
errMsg("Set parameter error", mvret);
return false;
}
else
return true;
if(mvret != XI_OK)
{
errMsg("Set parameter error", mvret);
return false;
}
else
return true;
} }
/**********************************************************************************/ /**********************************************************************************/
void CvCaptureCAM_XIMEA::errMsg(char* msg, int errNum) void CvCaptureCAM_XIMEA::errMsg(const char* msg, int errNum)
{ {
char buf[512]; #if defined WIN32 || defined _WIN32
sprintf( buf, "%s : %d\n", msg, errNum); char buf[512];
OutputDebugString(buf); sprintf( buf, "%s : %d\n", msg, errNum);
OutputDebugString(buf);
#else
fprintf(stderr, "%s : %d\n", msg, errNum);
#endif
} }
/**********************************************************************************/ /**********************************************************************************/