OpenCV中unsigned char *转换成IplImage *

 

  
  
  
  
  1. STDMETHODIMP BufferCB( double dblSampleTime, BYTE * pBuffer, long lBufferSize )
  2. //lBufferSize=320*240*3  
  3. {  
  4.     IplImage* image = cvCreateImageHeader(cvSize(320,240), IPL_DEPTH_8U, 3); 
  5.     image->origin = ~image->origin;
  6.     cvSetData(image, pBuffer, 320*3);  
  7.     cvNamedWindow("window");   
  8.     cvShowImage("window", image);
  9.   cvWaitKey(0);
  10.     cvDestroyWindow("window");  
  11. }  

 

你可能感兴趣的:(职场,char,opencv,休闲,IplImage)