title: Increase fps on Basler camera
body: <p>I am working in a real time image processing project, I am using a Basler camera model acA1300-200uc with communication by USB3, but I am having troubles with the fps of my c++ program because the camera supports over 200 fps but my program only runs arround 30 fps and I dont know how to increase it, my project need 100 fps aprox.</p>
  
  <p>This is my code, I hope you can help me, thanks in advance.</p>
  
  <pre><code>#include &lt;Windows.h&gt;
  #include &lt;opencv2\core\core.hpp&gt;
  #include &lt;opencv2\highgui\highgui.hpp&gt;
  #include &lt;opencv2\video\video.hpp&gt;
  #include &lt;pylon\PylonIncludes.h&gt;
  #include &lt;time.h&gt;
  
  using namespace Pylon;
  
  // Settings for using Basler USB cameras.
  #include &lt;pylon/usb/BaslerUsbInstantCamera.h&gt;
  typedef Pylon::CBaslerUsbInstantCamera Camera_t;
  
  using namespace Basler_UsbCameraParams;
  using namespace cv;
  using namespace std;
  
  static const uint32_t c_countOfImagesToGrab = 1000;
  
  int main(int argc, char* argv[]) {
  int frames = 0;
  double seconds = 0,fps;
  time_t start, end;
  Pylon::PylonAutoInitTerm autoInitTerm;
  try
  {
      CDeviceInfo info;
      info.SetDeviceClass(Camera_t::DeviceClass());
      Camera_t camera(CTlFactory::GetInstance().CreateFirstDevice(info));
      cout &lt;&lt; "Dispositivo utilizado: " &lt;&lt; camera.GetDeviceInfo().GetModelName() &lt;&lt; endl;
      camera.Open();
      camera.MaxNumBuffer = 10;
      CImageFormatConverter formatConverter;
      formatConverter.OutputPixelFormat = PixelType_BGR8packed;
      CPylonImage pylonImage;
      Mat openCvImage, gray_img;
      vector&lt;Vec3f&gt; circles;
      int64_t W = 800, H = 600;
  
      camera.Width.SetValue(W);
      camera.Height.SetValue(H);
  
      camera.StartGrabbing(c_countOfImagesToGrab, GrabStrategy_LatestImageOnly);
      CGrabResultPtr ptrGrabResult;
  
      camera.RetrieveResult(5000, ptrGrabResult, TimeoutHandling_ThrowException);
      cout &lt;&lt; "SizeX: " &lt;&lt; ptrGrabResult-&gt;GetWidth() &lt;&lt; endl;
      cout &lt;&lt; "SizeY: " &lt;&lt; ptrGrabResult-&gt;GetHeight() &lt;&lt; endl;
      cvNamedWindow("OpenCV Display Window", CV_WINDOW_AUTOSIZE);
  
      time(&amp;start);
      while (camera.IsGrabbing())
      {
          camera.RetrieveResult(5000, ptrGrabResult, TimeoutHandling_ThrowException);
          if (ptrGrabResult-&gt;GrabSucceeded())
          {
              formatConverter.Convert(pylonImage, ptrGrabResult);
              openCvImage = Mat(ptrGrabResult-&gt;GetHeight(), ptrGrabResult-&gt;GetWidth(), CV_8UC3, (uint8_t *)pylonImage.GetBuffer());
  
              imshow("OpenCV Display Window", openCvImage);
              frames++;
              if (waitKey(30)&gt;=0) break;
          }
      }
      time(&amp;end);
  }
  catch (...) { cout &lt;&lt; "error" &lt;&lt; endl; }
  seconds = difftime(end, start);
  fps = frames / seconds;
  cout &lt;&lt; "fps: " &lt;&lt; fps;
  Sleep(1000);
  }
  </code></pre>