Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Camera Problems (http://www.chiefdelphi.com/forums/showthread.php?t=32727)

Phil Roth 15-01-2005 08:16

Re: Camera Problems
 
Quote:

Originally Posted by pickle
Well, we covered the white with some black sheets, and then we did some other stuff to add more dark, and we got 3 values, but it seems that that made things worse, it couldn't track any colors with them.... Before calibration, we used hyper terminal to get the servo to follow green, and after, it wouldn't follow anything. I'm really not liking this camera. I'm just going to assume that treacking green will be the most useful thing, since the vision tetras are green. Otherwise, I'll set up something to get it all working using the manual method suggested earlier. Consider that image obsolete, there is no more glare, and no more black in the image. When we select the red triangle, its the only thing within the threshhold of 25 that gets selected in the image. *shrugs* Same story with green and yellow, however, I know green works, because I got it to track it. So ya


I think FIRST chose a special green so make sure you are using it if you are trying to calibrate with the GUI and default RGB values in config.txt. The .txt file also specifies the size of the targets and the green is smaller so you may have better luck if you duplicate the exact size of the smaller green target. I found that you can send commands down "manually" with the GUI and can prove things out by doing the following:

1. Launch GUI. Enter Config menu. Set White balance ON, Auto gain ON, and then hit Update All down on the bottom. Then run the Calibration to make sure you get good numbers. Either adjust lighting and/or alter config.txt to match your colors. You can use white balance on Auto Gain ON for testing but not in competition because they are too slow. These settings let the camera automatically adjust exposure settings for light.

2. Go to the Color menu and hit Track Yellow with the yellow target which is the easiest. You should see it highlighted with a red pixel in the centroid. If so, then try this because it's a good demo:

A. Press STOP and then wait 10 seconds because the GUI hangs. I think there is trouble with the GUIs serial driver if you send commands while the camera is still streaming data. Then go to the Console entry box of the GUI on the top of the screen and type SM 15 to set the servos to autotrack the target. Press SEND to send the command to the camera. My GUI's AutoTrack ain't working and only sends SM 1.

B. Then type TC 100 255 75 255 0 20 <ret> in the console . The Camera should find the Yellow target and servos should track it as you move the target around.

That's how I got it to work in my basement last night with a 3" Yellow triangle on a black sheet mounted about 6 feet away. Now it's off to the school to try things out for real. Keep plugging away at it, you'll get it. There is nothing else to do in autonomous mode.

781Co-Cap 15-01-2005 14:16

Re: Camera Problems
 
try using a red background as well then you will know if it goes towards it...just an idea

JMac 15-01-2005 18:08

Re: Camera Problems
 
Quote:

Originally Posted by russell
I am thinking that at the competition couldnt they just post the numbers for all the teams? Or does the effect of the numbers vary between cameras? :confused:

I'm hoping they send out the numbers, because otherwise, calibrating at each competition will be a nightmare! I mean, numbers would have to be unique for each competition, but still, there should be a way to do it... I can't imagine all teams will choose to use a vision system, but I feel that even if a majority of teams do, there will need to be either a whole "calibration field" with the same lighting as the real one, or a huge chunk of time for calibrating cameras. I think that would be insane... Has anyone come across any info on this?

dlavery 15-01-2005 18:44

Re: Camera Problems
 
Quote:

Originally Posted by JMac
I'm hoping they send out the numbers, because otherwise, calibrating at each competition will be a nightmare! I mean, numbers would have to be unique for each competition, but still, there should be a way to do it... I can't imagine all teams will choose to use a vision system, but I feel that even if a majority of teams do, there will need to be either a whole "calibration field" with the same lighting as the real one, or a huge chunk of time for calibrating cameras. I think that would be insane... Has anyone come across any info on this?

Due to variences in the lighting environments and ambient light levels at each venue, the calibration values will be unique to each site. FIRST field staff will be providing calibration numbers at each event. This is documented in one of the manuals. I forget which one right now, but will look it up and give you the reference when I find it.

-dave

Phil Roth 15-01-2005 18:55

Re: Camera Problems
 
Quote:

Originally Posted by 781Co-Cap
try using a red background as well then you will know if it goes towards it...just an idea

Has anyone noticed strange things in the default code that runs the camera??

In camera.c the function:
int camera_const_cmd(rom const char *cmd_str)

terminates on \r or NULL and will send the \r or NULL out the serial port. I guess the camera won't choke on the NULL but the camera has to see the \r to process the command and sometimes this function is called using a constant that has the \r terminator like:
rom const char *Str_cr = "CR 19 32\r"; // terminate string with \r

and other times it calls it with:
rom const char *raw_mode = "rm 1"; // no \r here

I know the code works because we are running it fine. ??????


Another weird thing in camera.c is the call
camera_const_cmd(manual_agc);
which sets BIT 5 of the Common control B reg in the camera.
This bit sets 8 bit format for the UV bus rather than 16 bit and has nothing to do with AGC.

ALSO.... camera_auto_servo( ) sets the SP parameters but rom const SP parameters also exist in user_routines_DDT.c.

probizzle 20-01-2005 20:06

Re: Camera Problems
 
This camera is making me pull my hair out. We still haven't been able to get it to calibrate to anything but red.

But my concern is that it gave me 29 as the value for red, and I'm a bit worried seeing your 90. Should I be worried?

JMac 20-01-2005 20:43

Re: Camera Problems
 
I believe color numbers should be lighting dependent, which is different for everyone. I was working in a classroom for awhile that had white walls and bright, glossy floors lit by natural light mixed with fluorescent lighting, and successfully calibrated. We had trouble tracking color, however. I moved to a hall with less fluorescent light, added halogen lighting, and used a darker grey color for my backgrounds. Again, I successfully calibrated, and this time I could track all the colors. However, the numbers were all significantly different than before. Maybe this was just my setup being quirky, but as I understand it, lighting determines both the ability to calibrate, and the numbers that calibration gives you.


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

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