Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   What information can we access from the camera? (http://www.chiefdelphi.com/forums/showthread.php?t=41240)

seanwitte 18-01-2006 09:26

Re: What information can we access from the camera?
 
Quote:

Originally Posted by seanwitte
Attached is a Windows app for version 2.0 of the .NET framework that I used when I reviewed the camera code last month. The app will display what the robot thinks its seeing and the values for the pan and tilt servos. Directions for sending the data are included in the zip file. Extract the exe and the dll to the same folder and run it.

It looks like the x and y bounds in the application are wrong and should be reversed. It will still track and display fine, but the x axis is too long and the y axis is too short. I will make the correction and re-post if anyone is actually using it.

Kevin Watson 18-01-2006 11:51

Re: What information can we access from the camera?
 
Quote:

Originally Posted by seanwitte
It looks like the x and y bounds in the application are wrong and should be reversed. It will still track and display fine, but the x axis is too long and the y axis is too short. I will make the correction and re-post if anyone is actually using it.

You might consider adding a colored rectangle around the center pixel that represents the maximum allowable error as defined in tracking.h. The tracking software won't move the servos if the centroid pixel is within this rectangle.

During development of the camera software I used one of these standalone LCD graphics displays to display in real-time what the software is doing. It's very similar to your software and kinda fun to watch.

If there is demand for it, I'll release a revised version of terminal.c that will send output to: 1) IFI terminal, 2) your software, or 3) to the LCD that I mentioned above.

-Kevin

Mike AA 18-01-2006 22:18

Re: What information can we access from the camera?
 
Quote:

Originally Posted by Kevin Watson
You might consider adding a colored rectangle around the center pixel that represents the maximum allowable error as defined in tracking.h. The tracking software won't move the servos if the centroid pixel is within this rectangle.

During development of the camera software I used one of these standalone LCD graphics displays to display in real-time what the software is doing. It's very similar to your software and kinda fun to watch.

If there is demand for it, I'll release a revised version of terminal.c that will send output to: 1) IFI terminal, 2) your software, or 3) to the LCD that I mentioned above.

-Kevin

Kevin, I got our camera working about an hour ago and I would be interested in this code. Also, I looked at the different displays on the linke dpage, but which one have you used to display? When I was watching the code on the terminal it seems to go by quickly, does your LCD display also do that?

-Mike
Team 1654

Uberbots 18-01-2006 23:27

Re: What information can we access from the camera?
 
on IFI's documentation of the camera, there is a section where it describes the possible input and output values for the camera.

what to look for? there is a page or two full of tables with the specific fcodes needed for the CMUcam to recognize and access its values. these values go anywhere from inputtint eh color values, to (i dont really know where it ends, to tell you the truth im still reqading it myself :D )

--ss32

Kevin Watson 19-01-2006 00:13

Re: What information can we access from the camera?
 
Quote:

Originally Posted by Mike AA
Kevin, I got our camera working about an hour ago and I would be interested in this code. Also, I looked at the different displays on the linke dpage, but which one have you used to display? When I was watching the code on the terminal it seems to go by quickly, does your LCD display also do that?

-Mike
Team 1654

Here's an image of the display, and a .avi movie, which shows the display in action. The movie is around 22MB.

Edit: The red box in the middle represents the target area defined by the two ALLOWABLE_ERROR #defines in tracking.h. The green box that's moving around is the green target and the single green pixel in the middle of the green blob is the centroid of the blob. The tracking software is designed to keep the centroid pixel within the red box. If the centroid pixel moves outside of the box, the software will move the servos in an attempt to get the centroid pixel back into the box. It's kind of fun to watch.

-Kevin

Mike AA 19-01-2006 01:23

Re: What information can we access from the camera?
 
Quote:

Originally Posted by Kevin Watson
Here's an image of the display, and a .avi movie, which shows the display in action. The movie is around 22MB.

Edit: The red box in the middle represents the target area defined by the two ALLOWABLE_ERROR #defines in tracking.h. The green box that's moving around is the green target and the single green pixel in the middle of the green blob is the centroid of the blob. The tracking software is designed to keep the centroid pixel within the red box. If the centroid pixel moves outside of the box, the software will move the servos in an attempt to get the centroid pixel back into the box. It's kind of fun to watch.

-Kevin

Cool, this is quite neat. Did you hook up on the RC or OI somehow? Which model # was that LCD screen?

-Mike

Kevin Watson 19-01-2006 01:28

Re: What information can we access from the camera?
 
Quote:

Originally Posted by Mike AA
Cool, this is quite neat. Did you hook up on the RC or OI somehow? Which model # was that LCD screen?

-Mike

It's the ezlcd-001 and it's wired to serial port one/programming port.

-Kevin

Joe Hershberger 20-01-2006 03:22

Re: What information can we access from the camera?
 
Quote:

Originally Posted by Kevin Watson
It's the ezlcd-001 and it's wired to serial port one/programming port.

-Kevin

Kevin,

That display looks very nice. A bit expensive for just playing around, but very cool. Is the interface to it pretty straightforward? Does it have primitive graphics function included such as draw circle, draw rect, draw text? What kind of update rate can you get on it over the serial port?

Very impressive.

-Joe

varcsscotty 20-01-2006 03:29

Re: What information can we access from the camera?
 
is there a way to use this in the dashboard? is it allowed?

Kevin Watson 20-01-2006 11:46

Re: What information can we access from the camera?
 
Quote:

Originally Posted by Joe Hershberger
Does it have primitive graphics function included such as draw circle, draw rect, draw text?

Yes it does. You can download the documentation from the website.

Quote:

Originally Posted by Joe Hershberger
What kind of update rate can you get on it over the serial port?

I don't know what the upper bound is. I have the display update with each new t-packet, which come in at around twelve Hertz.

-Kevin

viewtyjoe 21-01-2006 10:35

Re: What information can we access from the camera?
 
When using the code provided by Kevin Watson, I've gotten some weird calculations for the distance to the target (we're talking 300 inches in error). I believe this is because the camera is calculating the wrong tilt angle, and hopefully, I'll have the values calculated before today's over. If anyone has a tilt angle calculation that works, post a link or post it here, please.

Joe Hershberger 21-01-2006 12:03

Re: What information can we access from the camera?
 
Quote:

Originally Posted by viewtyjoe
When using the code provided by Kevin Watson, I've gotten some weird calculations for the distance to the target (we're talking 300 inches in error). I believe this is because the camera is calculating the wrong tilt angle, and hopefully, I'll have the values calculated before today's over. If anyone has a tilt angle calculation that works, post a link or post it here, please.

What code of Kevin's is supposed to give you the distance? I didn't even realize that it computed the angle at this point.

-Joe

Kevin Watson 21-01-2006 13:53

Re: What information can we access from the camera?
 
Quote:

Originally Posted by Joe Hershberger
What code of Kevin's is supposed to give you the distance? I didn't even realize that it computed the angle at this point.

-Joe

range = (green light height - camera height)/tan(tilt angle)

-Kevin

maniac_2040 22-01-2006 01:02

Re: What information can we access from the camera?
 
Quote:

Originally Posted by viewtyjoe
When using the code provided by Kevin Watson, I've gotten some weird calculations for the distance to the target (we're talking 300 inches in error). I believe this is because the camera is calculating the wrong tilt angle, and hopefully, I'll have the values calculated before today's over. If anyone has a tilt angle calculation that works, post a link or post it here, please.
Our team got the distance calculation to come within 50 millimeters (~2 inches). This was around an angle of 30 degrees and using a height much lower than the actual height of the vision target. Using the actual height of the target, and at higher distances, our calculations came within 500 millimeters(~20 inches). To calculate tilt angle, our team placed the vision target at a known height, then using special right triangles, placed our camera at a distance that should give us a known angle. Doing this, and recording the servo position at the time, we discovered that an angle of 30 degrees(above the horizontal) is a servo position of approximately 186 and an angle of 45 degrees is a servo position around 214. You can use these values to convert between servo position and angle..

One reason there is error in the angle/distance calculation is that there's no telling which part of the vision target the camera will start tracking. It depends on how the search algorithm catches it. It could start tracking the bottom, top, side..anywhere. It won't automatically aim for the center. Since the target is 200 mm tall this can result in significant error. For us, with the camera at the same position sometimes the angle varied by a degree or two, which believe me, can equal a significant amount in distance..there are many ways to approximate and get more accurate results, but it'll never be dead on...anyways, has anyone else gotten better results?

Joe Hershberger 23-01-2006 02:47

Re: What information can we access from the camera?
 
Quote:

Originally Posted by maniac_2040
Our team got the distance calculation to come within 50 millimeters (~2 inches). This was around an angle of 30 degrees and using a height much lower than the actual height of the vision target. Using the actual height of the target, and at higher distances, our calculations came within 500 millimeters(~20 inches). To calculate tilt angle, our team placed the vision target at a known height, then using special right triangles, placed our camera at a distance that should give us a known angle. Doing this, and recording the servo position at the time, we discovered that an angle of 30 degrees(above the horizontal) is a servo position of approximately 186 and an angle of 45 degrees is a servo position around 214. You can use these values to convert between servo position and angle..

One reason there is error in the angle/distance calculation is that there's no telling which part of the vision target the camera will start tracking. It depends on how the search algorithm catches it. It could start tracking the bottom, top, side..anywhere. It won't automatically aim for the center. Since the target is 200 mm tall this can result in significant error. For us, with the camera at the same position sometimes the angle varied by a degree or two, which believe me, can equal a significant amount in distance..there are many ways to approximate and get more accurate results, but it'll never be dead on...anyways, has anyone else gotten better results?

Have you tried using the other tracking data that you get to refine your angles? Just look at the tracking centroid that's returned to adjust.. it will tell you where in the image the center of the target is.

Cheers!
-Joe


All times are GMT -5. The time now is 00:11.

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