Go to Post Students design and build it, the engineers/mentors are there to guide us when we stray off the path. A great way to learn, a great way to mentor, a great way to grow. - chellyzee93 [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 04-03-2014, 06:02
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: MJPG lag OpenCV

The lag is caused by your camera running faster than the downstream pieces. Over time the buffers in the camera, network, and in your code store more and more images that they have arrived, but not been processed, until it either reaches a steady state, or until the buffers start to overflow.

I'd suggest measuring how long it takes to process an image. If it is 25ms, then your camera can theoretically run at 40fps to max out the system. But in practice it is wise to leave a bit of a safety margin. It is common to shoot for 80% utilization. This means that instead of 1/.025, you would set the camera to .8/.025, or 32 fps. This will hopefully allow the processing to catch up and be able to wait just a bit for new frames to come in.

Be sure to measure the time of the processing with realistic content. Some image processing algorithm steps are a constant amount of work. For 1,000,000 pixels, they will always perform N computation. Many are dependent on what they find in those pixels. So some datasets will not take 25ms, but may take 30 or 40.

Greg McKaskle
 


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 04:50.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi