Guest User

Untitled

a guest
Oct 24th, 2016
74
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. camera.StartGrabbing();
  2. CPylonImage image;
  3. CImageFormatConverter fc;
  4. fc.OutputPixelFormat = PixelType_RGB8packed;
  5.  
  6. while(camera.IsGrabbing())
  7. {
  8. camera.RetrieveResult( 1000, ptrGrabResult, TimeoutHandling_ThrowException);
  9. if (ptrGrabResult->GrabSucceeded())
  10. {
  11. fc.Convert(image, ptrGrabResult);
  12.  
  13.  
  14. cv_img = cv::Mat(ptrGrabResult->GetHeight(),ptrGrabResult->GetWidth(), CV_8UC3,(uint8_t*)image.GetBuffer());
  15. d_frame= GpuMat(cv_img);
  16. char key = (char) waitKey(1);
  17.  
  18. if(waitKey(30)==27)
  19. {
  20. camera.StopGrabbing();
  21. }
  22.  
  23.  
  24. }
  25. }
RAW Paste Data