Hi Im new in PS eye SDK programming, im using opencv 2.1 in VS 2003.net
Im having trouble processing image from Ps eye from color to gray then grey to tresh.
im having an error message of “Null Array pointer is passed”
here is my code
int _tmain(int argc, _TCHAR* argv[])
{
DWORD dwFrames=0;
DWORD dwCurrentTime=0;
DWORD dwLastUpdateTime=0;
DWORD dwElapsedTime=0;
int key=0;
cvNamedWindow( “Sdsd”, CV_WINDOW_AUTOSIZE );
IplImage *pCapImage=0;
IplImage *gray_img=0;
IplImage *img=0;
PBYTE pCapBuffer = NULL;
pCapImage = cvCreateImage( cvSize(320, 240), IPL_DEPTH_8U, 4);
CLEyeCameraInstance camera;
camera= CLEyeCreateCamera(CLEyeGetCameraUUID(0),CLEYE_COLOR_PROCESSED,CLEYE_QVGA,60);
cvGetImageRawData( pCapImage, &pCapBuffer; );
CLEyeCameraStart( camera );
// Set some camera parameters
CLEyeSetCameraParameter( camera, CLEYE_GAIN, 79 );
CLEyeSetCameraParameter( camera, CLEYE_AUTO_EXPOSURE,TRUE );
CLEyeSetCameraParameter( camera, CLEYE_ZOOM, 0 );
CLEyeSetCameraParameter( camera, CLEYE_ROTATION, 0 );
while((char) key != 27 )
{
dwFrames++;
dwCurrentTime = GetTickCount();
dwElapsedTime = dwCurrentTime - dwLastUpdateTime;
CLEyeCameraGetFrame( camera, pCapBuffer );
cvCvtColor(pCapImage,gray_img,CV_RGB2GRAY);
cvThreshold(gray_img,thres_img,70,255,CV_THRESH_BINARY_INV);
cvShowImage( “Sdsd”,thres_img );
if(dwElapsedTime >= 1000)// FPS Count
{
cout<
dwLastUpdateTime = dwCurrentTime;
}
key = cvWaitKey(1);
}
CLEyeCameraStop(camera);
cvReleaseImage(&gray;_img);
cvReleaseImage(&pCapImage;);
return 0;
}
can someone help me?