Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   C/C++ (http://www.chiefdelphi.com/forums/forumdisplay.php?f=183)
-   -   Camera Colors (http://www.chiefdelphi.com/forums/showthread.php?t=75737)

ExarKun666 11-03-2009 23:08

Camera Colors
 
I have not been very successful with color tracking, I am trying to get the TwoColorDemo code to work and I am pretty sure it's the values for pink and green, but I have kept most of the default code their. So here are some questions:

1) What values for the min, and max for luma, saturation, and hue have teams used that have been successful? [For pink and green, plz specify which color it is for]

2) Is there any of the default code that would cause the robot not to see the target?

3) I put in my own for loops to move the two servos instead of using their default ones, since whenever I turned the robot on the camera would vertically turn up or down all the way, and then turn left or right all the way right when autonomous started., is this smart to do?

4) Are there any suggestions on how to get the camera working? [I have tried NI Vision Assistant, but was unsuccessful with either getting an image from the camera, or taking a screen pic of the florescent green with the camera, and attempting to get values from the pic]

TYVM to any who respond, and help! :D

rogerlsmith 11-03-2009 23:14

Re: Camera Colors
 
We were able to use the TwoColorTrackDemo right out of the box. We changed very little to the code and it has worked well for us. We scored autonomously twice in week 1 (on moving trailers) with that code.

I'd suggest reverting back to as few changes as possible.

You can see a video of our autonomous scoring on my blog - posted yesterday:
http://rogeronfirst.blogspot.com/200...-no-hands.html.

ExarKun666 12-03-2009 00:17

Re: Camera Colors
 
how about on your camera settings did you change anything?
because the thing is I put the target (green being on top) at a distance where the camera was looking at it, and when it started the servos just spazzed and went all up/down & all the way left or right, and it was with the default, out of the box code, what up?? what needs to be tried?? Is there something that might interfere, like if our robot uses servos elsewhere would that effect it??

rogerlsmith 12-03-2009 16:38

Re: Camera Colors
 
There are certain motors that will interfere with the signal to the servos. However, if all other motors are off, you shouldn't experience any interference.

The TwoColorTrackDemo code pans left and right; I don't think it tilts up and down by default. Double check and make sure you've plugged the servos in the right port and they have the servo jumper attached on the side car.

Alan Anderson 12-03-2009 23:12

Re: Camera Colors
 
Quote:

Originally Posted by ExarKun666 (Post 834970)
...the servos just spazzed and went all up/down & all the way left or right, and it was with the default, out of the box code, what up??

If your camera is mounted upside down from the way the software expects, the servos will end up moving the camera away from the target instead of toward it.

If you have the tilt servo and pan servo connections swapped, the software will be trying to move the camera horizontally but it will actually move vertically, and vice versa.

If you built the pan/tilt assembly mirror-imaged from the drawings, the tilt servo will be reversed from how the software wants to control it.

All these can be corrected easily, if you know to check for them.

Sentient 21-03-2009 10:33

Re: Camera Colors
 
The detection color values from the demo may or may not work depending on your lighting. The code worked for us right out of the box, but when we got to regionals, the lighting was so different that the code we had used during the build season was useless. You will have to experiment with different values.

Check this out: http://joule.ni.com/nidu/cds/view/p/id/1270/lang/en

I haven't taken a close look at it yet, but it looks like a tool that will make color calibration easier.

You may be having problems because of hardware, as others have said, but if you are still having problems after you're sure everything is connected properly, you should just play around with color values. It really does make an incredible difference.

Greg McKaskle 21-03-2009 13:16

Re: Camera Colors
 
Just to clarify,
Quote:

the lighting was so different that the code we had used during the build season was useless.
The code is the same. In fact the tool you reference is also built from the same example code. The code does refer to constants that were determined based on lighting in shops, classrooms, etc. They were determined before anyone had access to a field. In most cases there are three numbers that need to change for pretty good response. Brightness, and the three lower saturation values.

As you point out, the tool at that URL will hopefully make it quick and painless to learn about the event lighting and adjust the constants for almost any lighting.

Greg McKaskle

Sentient 21-03-2009 16:24

Re: Camera Colors
 
Quote:

Originally Posted by Greg McKaskle (Post 838759)
Just to clarify,

The code is the same.

Greg McKaskle

Yes, you're right. The code was the same. What I meant was, the HSL ranges that we had working perfectly back at school became completely moot when we arrived at competition.


All times are GMT -5. The time now is 13:05.

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