Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   How far have you gotten on coding the camera tracking? (http://www.chiefdelphi.com/forums/showthread.php?t=72611)

s0crates 12-02-2009 18:53

Re: How far have you gotten on coding the camera tracking?
 
Quote:

Originally Posted by Dr. Manhattan (Post 819466)
We tried testing it with the full range of color available, yet for some reason the green doesn't show up at all. So far I have no clue why. And for some reason the servo's aren't moving while on gimble tracking mode, I assume they're supposed to and have no clue why.

And yes, see you there. :D

The way I did it when it absolutely failed to pick anything up was to start with the range 0-255 for all 3 (hue, saturation, and luminance) and narrow it down from there. Slow, but it works.

Did you put the jumpers next to the servo pwms? Are the pwms in the program the correct ones/where the servos are plugged in?

-jonathan

Greg McKaskle 12-02-2009 19:00

Re: How far have you gotten on coding the camera tracking?
 
If you aren't having any luck with the colors, you might try the NI Vision assistant. It is an easy way to bring in an image and check out the pixels in HSL. Ideally, you get in the habit of grabbing a couple photos in different orientations, different amounts of light, etc. Then you get a better feel for the range of HSL values needed to cover the different lighting.

Greg McKaskle

Dr. Manhattan 12-02-2009 20:19

Re: How far have you gotten on coding the camera tracking?
 
Quote:

Originally Posted by s0crates (Post 819497)

Did you put the jumpers next to the servo pwms? Are the pwms in the program the correct ones/where the servos are plugged in?

-jonathan

Yes, I know that the pwm's are correct because we have code to be able to control them with a joystick on the same pwm channels. I'm checking it out now and seeing if we can get it to work, but a lot of our focus is on the encoders at this point in time.

mikeqfl 15-02-2009 21:01

Re: How far have you gotten on coding the camera tracking?
 
We have our camera tracking ok. It commands a motor to turn a turret to keep the image in the center of its field of view. The problem we are having is the camera/turret is constantly oscillating back and forth trying to find the center. Any ideas of how to put in a PID loop into Labveiw? I am not up on the programming, just trying to help our programmer out.

s0crates 16-02-2009 01:44

Re: How far have you gotten on coding the camera tracking?
 
Quote:

Originally Posted by mikeqfl (Post 821587)
We have our camera tracking ok. It commands a motor to turn a turret to keep the image in the center of its field of view. The problem we are having is the camera/turret is constantly oscillating back and forth trying to find the center. Any ideas of how to put in a PID loop into Labveiw? I am not up on the programming, just trying to help our programmer out.

It sounds like it would be easiest for you to just have a dead zone in the center of the image - if the target is within a certain bounding box in the center of the image don't try to adjust it any further. Rather than try to center it at the center pixel, aim for a box around the center. It oscillates because the image changes slightly frame-to-frame.

cooldude8181 17-03-2009 23:18

Re: How far have you gotten on coding the camera tracking?
 
It took us a very long time to finally get it to the point that it worked, but we do have it working...

Lord_Jeremy 18-03-2009 17:17

Re: How far have you gotten on coding the camera tracking?
 
We ran into some pretty massive problems. No matter what we seemed to do, the camera would intermittently find a color (or two) for a few seconds, then x and y would immediately go to maximum. We assumed it was centering on the fluorescent lights in the room, but we're not entirely sure. And it was doing this both with our code and the TwoColorTrackingDemo code. I don't think the camera was at fault, as images grabbed from it looked just fine. We tried manually defining the color fields a couple times but that didn't help. Mind you we're using C/Windriver.

jacobhurwitz 18-03-2009 22:56

Re: How far have you gotten on coding the camera tracking?
 
We've spent a long time on our camera tracking code, and it finally works very well! (The night before our regional, too. Phew!) Our robot has a shooter, and we're using the camera to aim it at targets and then calculate how far it should fire. I'm pretty sure we'll post all our code on CD at the end of competition season, in case anybody's interested. We also have a pretty cool dashboard :)


All times are GMT -5. The time now is 16:35.

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