Note that there are some explanatory texts on larger screens.

plurals
  1. POUsing embeddedFrameCounter in the FlyCapture2 C++ API
    primarykey
    data
    text
    <p>I want to implement a framesafe capture with Point Grey Research cameras. To do that, I want to check if any frames have been missed by any cameras. The wrapper class that I am extending to do this is using the FlyCapture 2 API, so I would like to keep using that if possible.</p> <p>The <a href="http://www.ptgrey.com/support/kb/index.asp?a=4&amp;q=141" rel="nofollow">PGR FAQ on this question</a> only refers to the old API and IEEE-1394 cameras (the ones I use use USB 3.0). I am trying to use the frame counting functionality previously provided by uiSeqNum through the ImageMetadata object and its embeddedFrameCounter member. However, it always seems to be 0.</p> <p>I wonder if I am making a stupid mistake along the way or if it's a bug. In any case this code should run if you link the necessary files for OpenCV and Flycapture.</p> <pre><code>#include&lt;iostream&gt; #include"opencv2\opencv.hpp" #include"FlyCapture2.h" int main() { BusManager busMgr; PGRGuid guid; Camera cam; Image rawImage, convertedimage; busMgr.GetCameraFromIndex(0, &amp;guid); cam.Connect(&amp;guid); cam.SetVideoModeAndFrameRate(VIDEOMODE_640x480RGB,FRAMERATE_30); cam.StartCapture(); IplImage* src_img; while ((waitKey(30) &gt; 0) == false) { cam.RetrieveBuffer(&amp;rawImage); ImageMetadata metadata = rawImage.GetMetadata(); cout &lt;&lt; "framecount: " &lt;&lt; metadata.embeddedFrameCounter &lt;&lt; endl; rawImage.Convert(PIXEL_FORMAT_BGR, &amp;convertedimage); src_img = cvCreateImage(cvSize(rawImage.GetCols(),rawImage.GetRows()),IPL_DEPTH_8U,3); memcpy(src_img-&gt;imageData, convertedimage.GetData(), convertedimage.GetDataSize()); cvShowImage("Test", src_img); cvReleaseData(src_img) } waitKey(0); } </code></pre> <p>As an aside: tips on improving the memory management in this capture loop are appreciated.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload