Processing Image from PS Eye
Posted: 30 September 2011 08:42 PM   [ Ignore ]
New Member
Rank
Total Posts:  3
Joined  2011-09-30

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<       dwFrames = 0;
      dwLastUpdateTime = dwCurrentTime;
      }
      key = cvWaitKey(1);
     

  }
  CLEyeCameraStop(camera);
cvReleaseImage(&gray;_img);
      cvReleaseImage(&pCapImage;);
  return 0;
}

can someone help me?

Profile
 
 
Posted: 01 November 2011 02:18 AM   [ Ignore ]   [ # 1 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

MrRedsource,

From your code it looks like you have not created the gray_img. So I suspect that the error you are getting comes from the:

cvCvtColor(pCapImage,gray_img,CV_RGB2GRAY); 

Having the gray_img = NULL.

Profile
 
 
Posted: 28 August 2013 06:38 PM   [ Ignore ]   [ # 2 ]
New Member
Rank
Total Posts:  1
Joined  2013-08-28

you should first create grey color image , here is a professional color adjusting application c# you ajust color balance and brightness and contrast. you can process image color, mode and so on.

Profile
 
 
Posted: 12 March 2014 06:50 PM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  1
Joined  2014-03-12
Most More - 28 August 2013 06:38 PM

you should first create grey color image , here is a professional color adjusting application you ajust color balance and brightness and contrast. you can process image color, mode and so on.

can you provide some codes or tutorials, thank you

Profile
 
 
 
 


RSS 2.0     Atom Feed