|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
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
|
|||||
|
|||||
|
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
|
|||
|
|||
|
Re: Tracking only one Light
I believe you could also change your minimum confidence value.
|
|
#4
|
||||
|
||||
|
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
}
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |