Go to Post What else could you do with a t-shirt? Wait... never mind... I retract my previous statement and realized this is FIRST and we can do anything with anything. ;) - Jeremiah Johnson [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 18-02-2007, 17:33
wingnut1705's Avatar
wingnut1705 wingnut1705 is offline
Registered User
AKA: Kevin
FRC #0453 (Gears)
Team Role: Programmer
 
Join Date: Jan 2007
Rookie Year: 2006
Location: Michigan
Posts: 53
wingnut1705 is an unknown quantity at this point
Send a message via AIM to wingnut1705
Tracking only one Light

Our team wants us to only track one light instead of two. Does anyone know how to alter Kevin Watson's code so that the camera only tracks one light?
  #2   Spotlight this post!  
Unread 18-02-2007, 23:05
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Tracking only one Light

Someone else on the forum recently suggested having it use one of the bounding box corner values instead of the centroid values. You can pick a left or right corner and end up consistently tracking a single light.
  #3   Spotlight this post!  
Unread 18-02-2007, 23:18
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,420
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: Tracking only one Light

I believe you could also change your minimum confidence value.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #4   Spotlight this post!  
Unread 18-02-2007, 23:35
ace123's Avatar
ace123 ace123 is offline
Registered User
AKA: Patrick Horn
FRC #0008 (Paly Robotics - http://robotics.paly.net/)
Team Role: Programmer
 
Join Date: Feb 2005
Rookie Year: 2004
Location: Palo Alto, CA
Posts: 50
ace123 has a spectacular aura aboutace123 has a spectacular aura about
Send a message via AIM to ace123
Re: Tracking only one Light

The way the example code does it is by taking the leftmost coordinate (x0) and adding a constant to it. This way it ignores the median value of the box.

Code:
int lowright_x = packet.x1, centroid_x = packet.mx, upleft_x = packet.x0, target_width=packet.x1-packet.x0;

if ( target_width > WIDEST_ONE_LIGHT  ) { // looking at two lights?
    targets = 2;
    
    if ( ( lowright_x - centroid_x) < (centroid_x - upleft_x) ) {
        // the centroid is nearer the right 
        target_x = lowright_x- HALF_LIGHT_WIDTH  ;
    } else {
        // the centroid is nearer the left
        target_x = upleft_x + HALF_LIGHT_WIDTH  ;
    }
} else { // the target is NOT wide, it's one light
    targets = 1;
    target_x = centroid_x; // target that light
}
__________________
-Patrick Horn, Paly Robotics

Check out the space simulator called Vega Strike, modelled after the space simulator games Elite and Wing Commander. It's Open Source too!
If you have ever played Wing Commander, or especially Privateer, and had a feeling of nostalga derived from the you will enjoy these two Vega Strike mods: Privateer Gemini Gold and Privateer Remake!
I'm working on adding multiplayer support this year...
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
Multiple Light Tracking with Distinct Light Boxes in EasyC hal Programming 1 19-02-2007 11:56
Multiple Light Tracking with Distinct Light Boxes MaHaGoN Programming 30 19-02-2007 10:46
Enabling Multiple Light Tracking Using Kevin's Code Mitch Programming 7 05-02-2007 06:17
Light Tracking theycallhimtom Programming 1 19-01-2007 15:11
Camera Only Tracking Green sybert1ger Programming 2 08-02-2005 20:21


All times are GMT -5. The time now is 00:30.

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