Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Finding color (http://www.chiefdelphi.com/forums/showthread.php?t=35026)

brownster 20-02-2005 01:35

Finding color
 
Hey, i've had no luck with the camera so far at all...all i want to do is have a code in autonomous that just finds green and returns a 1...the camera doesn't even have to move..it can just stand still..but just finding a color is posing trouble for me...if someone could give me a sample code..or what function i need to run and how that would be appreciated

russell 20-02-2005 03:23

Re: Finding color
 
Alrighty heres what I would do.
In user_routines_fast.c

at the beginning
Code:

int counter=0;
int tracking_green=0;

In the autonomous section
Code:

#if _use_CMU_Camera
if(counter=0)
  {
  camera_init(x,y,z);
  auto_servo(0);
  camera_find_color(GREEN);
  counter++
  }

if (camera_track_update()=1 && cam.size > 0)
  {
  tracking_green=1;
  }
else
  {
  tracking_green=0;
  }
#endif

then later you just have to check the value of tracking_green. Oh and remember to plug in your calibration values in that camera_init(x,y,z) function.


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi