Go to Post Once we know how magic works it's no longer magic; it becomes science. - Karthik [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-01-2009, 21:22
nickmagus's Avatar
nickmagus nickmagus is offline
Registered User
AKA: Nick Clayton
FRC #0008 (Paly Robotics)
Team Role: Programmer
 
Join Date: Dec 2007
Rookie Year: 2007
Location: Palo Alto, Califorinia
Posts: 56
nickmagus is an unknown quantity at this point
Send a message via AIM to nickmagus
Re: Finding green/pink flags

I have had the same problem. I also tried.
Code:
if (StartCameraTask(10, 0, k160x120, ROT_0) == -1){
	printf("Failed to spawn camera task: %s\n",GetVisionErrorText(GetLastVisionError()));
}

// Set up camera tracking parameters.
tdata = GetTrackingData(GREEN, PASSIVE_LIGHT);
tdata.hue.minValue = 67;
tdata.hue.maxValue = 114;
tdata.saturation.minValue = 161;
tdata.saturation.maxValue = 255;
tdata.luminance.minValue = 24;
tdata.luminance.maxValue = 101;
in the init with
Code:
ParticleAnalysisReport par;
if (FindColor(IMAQ_HSL, &tdata.hue, &tdata.saturation, &tdata.luminance, &par)
		&& par.particleToImagePercent < MAX_PARTICLE_TO_IMAGE_PERCENT
		&& par.particleToImagePercent > MIN_PARTICLE_TO_IMAGE_PERCENT) {
	int lightX = (int)(par.center_mass_x_normalized * 1000.0);
	int lightY = (int)(par.center_mass_y_normalized * 1000.0);
	printf("Light found: x: %i y: %i\n", lightX, lightY);
} else {
	if (err)
		printf("Failed to spawn camera task: %s\n", GetVisionErrorText(GetLastVisionError()));
	else
		printf("light not found\n");
}
in the main loop but that didn't work either

Last edited by nickmagus : 04-01-2009 at 21:26.
Reply With Quote
Reply


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
Flags???? cprogrammer Programming 4 25-07-2005 20:21
Flags trdragons204 General Forum 2 23-03-2005 10:29
Concerns regarding the green paneling/green shirts Petey General Forum 127 15-01-2005 10:35
6 Flags Raven_Writer Chit-Chat 12 30-07-2004 23:01
Six Flags? Hermione692 Championship Event 29 29-04-2003 21:12


All times are GMT -5. The time now is 03:17.

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