Reading a PSEye Camera frame
Posted: 30 December 2013 09:35 PM   [ Ignore ]
New Member
Rank
Total Posts:  5
Joined  2013-12-30

I found something interesting I hope someone can explain to me this behaviour.

Following this example if I use the regular code (around line 108) :

while(_running)
{
  cvGetImageRawData(pCapImage, &pCapBuffer;);
  CLEyeCameraGetFrame(_cam, pCapBuffer);
  cvShowImage(_windowName, pCapImage);
}

The pCapBuffer is updated, BUT if I just do:

while(_running)

  CLEyeCameraGetFrame(_cam, pCapBuffer);   
}

pCapBuffer remais NULL! So for what I see CLEyeCameraGetFrame() just updates pCapBuffer when someone “consumes” it…what I don’t get is how does CLEyeCameraGetFrame() knows that the buffer was read? I was expecting the pCapBuffer to be updated everytime I called CLEyeCameraGetFrame()....is this the regular behaviour for this function or my system has a problem? How can I make CLEyeCameraGetFrame() update the buffer without having to copy it?

Also if someone could point me out how to make a QImage out of this pCapBuffer it will be very helpful!

Profile
 
 
Posted: 31 December 2013 04:07 AM   [ Ignore ]   [ # 1 ]
New Member
Rank
Total Posts:  5
Joined  2013-12-30

I answered it in here:

http://stackoverflow.com/questions/20851840/reading-a-pseye-camera-frame

Profile
 
 
Posted: 22 January 2014 05:27 PM   [ Ignore ]   [ # 2 ]
Administrator
Avatar
RankRankRankRank
Total Posts:  585
Joined  2009-09-17

The data inside the pCapBuffer is updated every time. The difference is that in your first code snippet, you show this change by calling cvShowImage(_windowName, pCapImage), wheres in the second one, the window is not being updated and therefore no change is shown.

Profile
 
 
Posted: 22 January 2014 09:03 PM   [ Ignore ]   [ # 3 ]
New Member
Rank
Total Posts:  5
Joined  2013-12-30

Thanks AlexP, I am new to OpenCV and C++, took me a while to understand how things work “inside the hood”

Profile
 
 
 
 


RSS 2.0     Atom Feed