![]() |
Camera Problems
Alright, I'm about to go insane, I really need help. I'm trying to calibrate the camera, per the instructions provided, and I think I've followed them as exactly as I can, but I can't get the camera to see anything by yellow when calibrating for that color. Here's a picture of the red target:
![]() Do you see anything in that image that would make it not be able to find the obvious red target? Its lined up, and the camera 3 ft off the ground as the instructions say. I'm completely out of ideas, can anyone help? |
Re: Camera Problems
The lighting seems very poor. Have you tried it in a more well lit area?
|
Re: Camera Problems
Quote:
|
Re: Camera Problems
Yeah, the sheets in the background are a tempting white target.
|
Re: Camera Problems
Well, the sheets are out of the target mostly I think, but ya, tomorrow we'll try covering those cabinets with something else (they are orange, and show up the same color as the targer on the camera). As far as lighting, its just in like a classroom kind of thing, I don't really know what else to do for that, we're gonna try some other things too. I'll let you know if I get it, assuming my head doesn't go through a wall.... this has been 2 days straight of this.............
And just curious, when we hit a color, we get the error "Tracking packet failed" in the little statusbar window of the GUI, where you see the messages about the camera, is this normal? Or could this be a part of the problem, I kind of forgot to mention that... |
Re: Camera Problems
you might also want to use a more "rare" color. like, something bright and neon-esque. we used a very bright shade of blue (like on photoshop it would have great saturation, if that helps you imagine it better) and it found it just fine even while other team members standing around with the colors on their shirts and what not.
|
Re: Camera Problems
Quote:
The instructions in START HERE are very specific. You must be on a dark floor resembling the field that FIRST will be using. In their example, there is no bright background. Neither should you have a bright background... |
Re: Camera Problems
Quote:
We just fired up the camera tonight and basically got the same "Tracking packet failed". After reading the manual on the commands for the camera, I went into Hyperterminal and setup the camera to track all colors with no problem. I'm convinced the GUI screws up on certain PCs, probably the serial driver. I'm running a P4m @ 2.8Ghz and can't get it to run. Here's what I did to prove the camera tracked OK. 1. Setup camera playing field. Enter GUI and grab a frame. 2. Then hover the mouse over the triangle and left click on the field's triange on the screen. If the triangle looks highlighted ok, then record the RGB values that are shown. 3. Close the GUI and open Hyperterminal ( keep power on the camera). setup for COM1 @ 115200, 8, n, 1 4. Type <ret> and make sure you get an ACK 4. Type SM 15 <ret> to enable auto tracking of servos 5. Type TC Rmin Rmax Gmin Gmax Bmin Bmax.. where Rmin = Your R value -25 Rmax = Your R value +25 Gmin = Your G value -25 Gmax = Your G value +25 Bmin = Your B value -25 Bmax = Your B value +25 Your camera should now be tracking.... At least now I know the GUI is screwed up and I'm not going nuts |
Re: Camera Problems
The white sheets are reflecting a lot of light. Even if they are "out of target" they appear to be messing up the lighting balance.
|
Re: Camera Problems
Quote:
2) If you have no control over lighting, the next best thing is to skip the calibration process altogether, and manually enter numbers in the text fields beside the calibrate buttons. If you want some numbers to start with: Yellow = 36 Green = 44 Red = 90 we got these values working in a large highschool cafeteria with fluorescent lights covered with dingy yellow covers. Once you enter these values, click on the "Color" tab, then click Track [Color], and see how it looks. If you only see small patches of your triangle, increase the number for that color. If you're picking up areas of color from the surrounding area, then drop it down. Good luck! -SlimBoJones... |
Re: Camera Problems
THanks, we're gonna get more black paper (the place that had it was closed last night) and use that to cover some places, and see how that works out, otherwise, I'll try Phil's code. Thanks alot :)
|
Re: Camera Problems
Remember in this camera system, the color white is composed of mostly green (59%)some red(31%) and a little blue(11%). If you were to look at the histogram output, you would see that the sheets are producing as much or more red output than the triangle. In addition, there is so much light reflected that the camera is in overload. Try shutting off the lights over the sheets and things should improve.
|
Re: Camera Problems
Quote:
I set up a "test bed' with ideal conditions, a black sheet and mini triangles placed about 3 feet away from the camera to really get a good understanding of what's going on and how all the camera parameters work. The GUI stores "tuned" RGB values for FIRST's selected colors in config.txt in the .java folder. You might want to just highlight the triangle in the frame grab window and make sure the RGB values displayed next to the grab fall within range of the parameters for that particular color in config.txt. If not, your colors and/or lighting may be off. You might want to alter the values in config.txt to get it going. After getting a firm understanding on how this thing finally works and how to tune it, I'm really concerned about how well everything will work as a "system" on the field dealing with variations in lighting and the field. I wonder if FIRST will allow us to read the mean values off the real targets before the competitions. I can see it now.....tee shirts with 120 255 0 20 25 300.... written all over them. Good Luck. Let me know if I can help. |
Re: Camera Problems
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
|
Re: Camera Problems
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:
|
Re: Camera Problems
Quote:
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. |
Re: Camera Problems
try using a red background as well then you will know if it goes towards it...just an idea
|
Re: Camera Problems
Quote:
|
Re: Camera Problems
Quote:
-dave |
Re: Camera Problems
Quote:
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. |
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? |
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