Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Camera Is Spazzing Out! (http://www.chiefdelphi.com/forums/showthread.php?t=42426)

BrittanyV 22-01-2006 13:29

Camera Is Spazzing Out!
 
I've posted a few questions in various places and I've decided to bring it all together in one thread. We're having major issues with our camera and we can't figure out what's wrong.

At first, we couldn't get the camera to scan, but now we can. Also, we can't figure out what we changed in order to allow the camera to scan. Now, when we turn our robot on, "scanning..." appears for a little bit. After that, the camera will start saying that it sees the target, as if everything is green. The red light on the camera, which we noticed is on when the camera tracks, will blink randomly as the camera says it can see the target. If you put the lens cap on, the camera scans perfectly, so we know there's something wrong with what the camera is seeing. The camera is perfectly calibrated in LabVIEW, and we've done exactly what the manual says. We just don't understand what is making the camera do this.

We're all novice programmers, so we just don't know what to do. Any help at all would be absolutely amazing. Please help!

Kevin Watson 22-01-2006 13:40

Re: Camera Is Spazzing Out!
 
Quote:

Originally Posted by BrittanyV
I've posted a few questions in various places and I've decided to bring it all together in one thread. We're having major issues with our camera and we can't figure out what's wrong.

At first, we couldn't get the camera to scan, but now we can. Also, we can't figure out what we changed in order to allow the camera to scan. Now, when we turn our robot on, "scanning..." appears for a little bit. After that, the camera will start saying that it sees the target, as if everything is green. The red light on the camera, which we noticed is on when the camera tracks, will blink randomly as the camera says it can see the target. If you put the lens cap on, the camera scans perfectly, so we know there's something wrong with what the camera is seeing. The camera is perfectly calibrated in LabVIEW, and we've done exactly what the manual says. We just don't understand what is making the camera do this.

We're all novice programmers, so we just don't know what to do. Any help at all would be absolutely amazing. Please help!

As was pointed out elsewhere, if you're using the FIRST green light, you don't need to calibrate anything. Just load the camera.hex file and it should just work.

-Kevin

maniac_2040 22-01-2006 13:59

Re: Camera Is Spazzing Out!
 
Our team is having the same problem. I think it has something to do with very bright lights. Sometimes the camera will sort of lock onto a ceiling light or something and not continue the search algorithm. It'll just sort of jerk/vibrate around in one area. It tracks the vision target fine if it sees it first, but sometimes it'll catch something else....i dunno how to counter/fix this... The camera even locked onto a window when there was a reflection of a bright light! (This is using the default camera driver, no changes)

ctshirk7 22-01-2006 14:09

Re: Camera Is Spazzing Out!
 
the first time we got ours to work properly we had to show it the green light several times and it took a while before it "saw the light" i think maybe it was because the room we are in was pretty bright try it in a darker room see if that helps any.

Kevin Watson 22-01-2006 14:55

Re: Camera Is Spazzing Out!
 
Quote:

Originally Posted by maniac_2040
Our team is having the same problem. I think it has something to do with very bright lights. Sometimes the camera will sort of lock onto a ceiling light or something and not continue the search algorithm. It'll just sort of jerk/vibrate around in one area. It tracks the vision target fine if it sees it first, but sometimes it'll catch something else....i dunno how to counter/fix this... The camera even locked onto a window when there was a reflection of a bright light! (This is using the default camera driver, no changes)

Quote:

Originally Posted by ctshirk7
the first time we got ours to work properly we had to show it the green light several times and it took a while before it "saw the light" i think maybe it was because the room we are in was pretty bright try it in a darker room see if that helps any.

Sometimes the camera doesn't have enough time to let the tracking software know that it has found the green light. Try increasing the value of SEARCH_DELAY_DEFAULT by one or two. This can be found in tracking.h.

-Kevin

BrittanyV 23-01-2006 10:43

Re: Camera Is Spazzing Out!
 
Quote:

Originally Posted by Kevin Watson
Sometimes the camera doesn't have enough time to let the tracking software know that it has found the green light. Try increasing the value of SEARCH_DELAY_DEFAULT by one or two. This can be found in tracking.h.

-Kevin


We actually decreased the value of SEARCH_DELAY_DEFAULT to 3, and it seems to work better, but only when there isn't any fluorescent lighting around. Unfortunately, all competitions will have fluorescent lighting. If you don't have to calibrate the camera for camera_s, how can you make the camera so it doesn't see the white lights?

BrittanyV 23-01-2006 10:50

Re: Camera Is Spazzing Out!
 
Oh, I forgot something. Also, once you show it the green light, the camera will stay locked on it, until something comes between the camera and the light. The camera kind of reminds me of my grandma's dog. He can't find his ball by himself, but once you point it out to him, he goes running for it. (I hate yappy little dogs) Does anyone else have this problem and what have you done about it?

steveg 23-01-2006 10:54

Re: Camera Is Spazzing Out!
 
Another couple of things to check is to be sure that your camera is in focus and that the backup battery is fully charged. A lot of times when the backup battery is low, you can get some pretty strange behavior from the camera. Also, we're using a custom scanning algorithm, and received sort of a weird jerky motion when the max angle that the camera was allowed to tilt to was less than the angle it needed to be at to track.

The scanning algorithm wasn't paying attention to the maxes set by Kevin's code, so it would find the target, then When tracking, it would say "Hey, I'm too far up, let me tilt down" and lose the target, then it would go back to the scanning code... ad infinitum.

steveg 23-01-2006 10:56

Re: Camera Is Spazzing Out!
 
Quote:

Originally Posted by BrittanyV
Oh, I forgot something. Also, once you show it the green light, the camera will stay locked on it, until something comes between the camera and the light. The camera kind of reminds me of my grandma's dog. He can't find his ball by himself, but once you point it out to him, he goes running for it. (I hate yappy little dogs) Does anyone else have this problem and what have you done about it?

What you can do there is incorporate a delay before the camera starts looking for the target again. So, after it's held a track for a while, if it looses the track, don't start scanning for x number of loops.

maniac_2040 01-02-2006 19:16

Re: Camera Is Spazzing Out!
 
One way to combat the camera locking onto fluorescent lighting or really bright lights is to make the camera code check the confidence level of the tracked blob. For us, when the camera "locked" onto any light other than the actual vision target it would have a very low confidence level and sort of "spaz out" (i.e. jerky). I made the code check the confidence level for a higher value and it seemed to fix the problem.

The code you need to change is in tracking.c, in the function Servo_Track() near the beginning. There's a line that looks like this:

if(T_Packet_Data.my != 0)

Which checks if the camera found a target, you simply change it to make sure the camera found a 'good' target like so:

if(T_Packet_Data.my != 0 && T_Packet_Data.confidence > some_value)

I just sort of tweaked around 'some_value' till I got good results. A confidence of 80-90 seems pretty good.

Anime-niac_2.9 01-02-2006 19:28

Re: Camera Is Spazzing Out!
 
when we tested it it started tracking something else, not a light. a little more specifically, lol, one of our programmers, and he wasn't wearing any green let alone a green light.

bush 01-02-2006 21:34

Re: Camera Is Spazzing Out!
 
Quote:

Originally Posted by maniac_2040
One way to combat the camera locking onto fluorescent lighting or really bright lights is to make the camera code check the confidence level of the tracked blob. For us, when the camera "locked" onto any light other than the actual vision target it would have a very low confidence level and sort of "spaz out" (i.e. jerky). I made the code check the confidence level for a higher value and it seemed to fix the problem.

The code you need to change is in tracking.c, in the function Servo_Track() near the beginning. There's a line that looks like this:

if(T_Packet_Data.my != 0)

Which checks if the camera found a target, you simply change it to make sure the camera found a 'good' target like so:

if(T_Packet_Data.my != 0 && T_Packet_Data.confidence > some_value)

I just sort of tweaked around 'some_value' till I got good results. A confidence of 80-90 seems pretty good.


That's an excellent idea. Why didn't I think of this???

X-Istence 01-02-2006 21:39

Re: Camera Is Spazzing Out!
 
Quote:

Originally Posted by Anime-niac_2.9
when we tested it it started tracking something else, not a light. a little more specifically, lol, one of our programmers, and he wasn't wearing any green let alone a green light.


It was tracking my team's mentor/teacher, rather than the green light, fixed it with some nudging of some values.

Anime-niac_2.9 01-02-2006 22:29

Re: Camera Is Spazzing Out!
 
Quote:

Originally Posted by X-Istence
It was tracking my team's mentor/teacher, rather than the green light, fixed it with some nudging of some values.

plz, tell me exactly what values you changed. oh, and just so you know, first time we tested the camera the guy was facing the little thing and when it first tracked him it was in the crotch.

mallot1243 03-02-2006 07:34

Re: Camera Is Spazzing Out!
 
OK, I finally got the camera to work, all it took was a new adapter (3.5 weeks to find that out...) So now we found the light and I think the camera gets so excited and freaks out. Any help for our epileptic light?


All times are GMT -5. The time now is 17:52.

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