Go to Post I joined because I needed something to complete my nerdyness and I never regretted it. - Regine [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

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-02-2009, 20:18
shrimp shrimp is offline
Registered User
FRC #2753
 
Join Date: Feb 2009
Location: USA
Posts: 5
shrimp is an unknown quantity at this point
Optimising the camera

Apologies if this has already been asked, but any help would be greatly appreciated.

I was searching the forums but didn't see quite what I was looking for. Our team is using Windriver. We got the camera to work (using the Two color tracker).

Well, I guess there are two parts to the question. Firstly, how do I see how many fps I'm getting, the CPU usage, etc? Is it possible and how? Secondly, are there any teams that have made optimisations with the camera and are willing to share code? I just need to be able to track two colors.

Thanks very much!
  #2   Spotlight this post!  
Unread 10-02-2009, 21:25
byteit101's Avatar
byteit101 byteit101 is offline
WPILib maintainer (WPI)
AKA: Patrick Plenefisch
no team (The Cat Attack (Formerly))
Team Role: Programmer
 
Join Date: Jan 2009
Rookie Year: 2009
Location: Worcester
Posts: 699
byteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of lightbyteit101 is a glorious beacon of light
Re: Optimising the camera

Quote:
Originally Posted by shrimp View Post
Firstly, how do I see how many fps I'm getting, the CPU usage, etc? Is it possible and how?
the actual fps is in the camera init function, the first arg, but to find how fast you loop:
at the top: create a new timer
Timer tmr = new Timer();
just before the loop in auto or where ever your code is:
int timesrun=0;
tmr->Start();
in the loop:
timesrun++;
if (tmr->Get() >= 1.0)
{
tmr->Stop();
printf("This cycle was at %i Hz\n", (timesrun/tmr->Get());
tmr->Reset();
timesrun=0;
tmr->Start();
}

then open the console and every second, it should tell you the speed of the loop
__________________
Bubble Wrap: programmers rewards
Watchdog.Kill();
printf("Watchdog is Dead, Celebrate!");
How to make a self aware robot: while (∞) cout<<(sqrt(-∞)/-0);
Previously FRC 451 (The Cat Attack)
Now part of the class of 2016 at WPI & helping on WPILib
  #3   Spotlight this post!  
Unread 11-02-2009, 19:47
shrimp shrimp is offline
Registered User
FRC #2753
 
Join Date: Feb 2009
Location: USA
Posts: 5
shrimp is an unknown quantity at this point
Re: Optimising the camera

Awesome, thanks for the code.

How have most people been optimising the camera code? I haven't found any good camera documentation based on C++. Any help would be appreciated on this, I kinda just need some documentation. Thanks
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
error when build the project for the camera tracking mahmosh C/C++ 1 04-02-2009 14:47
Tell the difference: 2007 CMU Camera, 2006, 2005 camera? Chris_Elston Programming 2 07-01-2008 13:11
Where do I begin to get the robot to move using the camera? Ianuser Programming 10 16-02-2007 17:55
Where in the world is the new 2007 cmu camera docs?!?!? xrabohrok Programming 13 08-01-2007 20:28
problems mounting the camera to the 'bot with the default servo/mount set up Redneck Programming 0 16-02-2005 20:53


All times are GMT -5. The time now is 21:49.

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