Go to Post Using a mouse is so 20th century! - Tom Bottiglieri [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
  #1   Spotlight this post!  
Unread 12-02-2009, 20:01
ellisk ellisk is offline
Registered User
FRC #1540
 
Join Date: Dec 2008
Location: Vancouver, WA
Posts: 41
ellisk is on a distinguished road
Image tracking code: colors off? (Lighting)

Hi all,
I'm writing code to lock onto targets, based off of the example two-color tracking code which used servos (but our robot uses a turret instead). It is very intermittent in finding the two colors, except when someone shines a bright light on it. Has anyone had any similar troubles/have any proposed solutions? Here's a bit of our code which I think is relevant:
Code:
	// Initialize particle analysis report
	memset(&par, 0, sizeof(par));
	
	// Image data for tracking - override default parameters if needed:
	// Make PINK the first color because GREEN is more susceptible to
	// hue variations due to lighting so may result in false positives
	
	// PINK
	sprintf(td1.name, "PINK");
	td1.hue.minValue = 220;
	td1.hue.maxValue = 255;
	td1.saturation.minValue = 75;
	td1.saturation.maxValue = 255;
	td1.luminance.minValue = 85;
	td1.luminance.maxValue = 255;
	
	// GREEN
	sprintf(td2.name, "GREEN");
	td2.hue.minValue = 55;
	td2.hue.maxValue = 125;
	td2.saturation.minValue = 58;
	td2.saturation.maxValue = 255;
	td2.luminance.minValue = 92;
	td2.luminance.maxValue = 255;
	
	// Set up debug output: 
	// DEBUG_OFF, DEBUG_MOSTLY_OFF, DEBUG_SCREEN_ONLY, DEBUG_FILE_ONLY, DEBUG_SCREEN_AND_FILE
	SetDebugFlag(DEBUG_SCREEN_ONLY);
	
	// Start the CameraTask
	// Possible values for resolution: k640x480, k320x240, k160x120
	if(StartCameraTask(framesPerSecond, 0, k160x120, ROT_0) == -1)
	{
		printf("Failed to spawn camera task; exiting. Error code %s", 
				GetVisionErrorText(GetLastVisionError()));
	}
 


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
Image Tracking with a Template Delian NI LabVIEW 1 02-02-2009 22:25
449's code for tracking two colors jacobhurwitz NI LabVIEW 4 15-01-2009 21:19
CMU CAM2 image colors looks weird!! urgent help needed bballbeng Programming 2 08-01-2007 09:44
Tracking Different Colors russell Programming 2 06-02-2005 22:40
Tracking and Beacon off of one Edu DanL Programming 7 23-01-2004 15:04


All times are GMT -5. The time now is 02:22.

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