6d mouse with avrcam?

This forum is used for discussing hardware, software, and technical details of the AVRcam embedded system.

6d mouse with avrcam?

Postby rburns » Fri Jan 14, 2005 11:58 pm

Hello,

Im looking at getting one of your avrcams and trying to build a 6d mouse, although all I really need is 4d. I want to build something similar to whats on this site:
http://www1.bell-labs.com/user/senthil/6Dmouse.html

Looking at the link, It looks like x, z position is just taking the led positions within the image, and y is probably calculating the dist between the leds, then all I need is direction which is the 5th red led.

Id really like to have 2 of these mice at the same time, using different colors maybe, or maybe not even leds, maybe just a single drawn object or 2.

I'm wondering how hard you think this will be, or if its even possible with whats already available with the avrcam. Im pretty familiar with AVRs, I use the mega32 a lot for other projects, but I don't have much knowledge when it comes to computer vision or image processing.

Thanks,
Ryan
rburns
 
Posts: 7
Joined: Fri Jan 14, 2005 11:44 pm

AVRcam is good at locating spheres

Postby hamjudo » Sun Jan 16, 2005 3:08 pm

You could probably use LEDs, but the AVRcam is designed to work with larger colored objects. Spheres are great because they look the same from every angle. To the camera, a sphere with a matte finish is a circle. The size of the circle in pixels is inversely proportional to the distance from the camera. The native AVRcam software returns the bounding box for each blob of color. The bounding box for a circle is a square. Conviently, the center of the square is also the center of the circle.

Two spheres of different colors on a rod will give more information. Four spheres of different colors arranged in a tetrahedron will give enough information for the 6d mouse.

Colored cubes will also kind of work, but a cube at a 45 degree angle looks 1.4 times bigger than one lined up with the pixels. Something with a shiny surface will also mostly work, but under some lighting conditions, the surface will appear to be the wrong color, so the object will seem to disapear. The center of the bounding box won't always be the center of the cube.

I bring up glossy colored cubes, even though they're not optimal, just because they are very easy to make with Lego bricks. Legos come in a lot of colors, and you can easily try different sized cubes and different spacing. In the real world, you'll want more than 4 spheres for redundancy. Sometimes the operator's hand will block the view of one or more spheres.

WIll the mouse be plugged into a typical PC, or into an embedded processor? Something will have to do the trigonometry or equivalent matrix operations to transform the locations of the colored blobs into the 6 numbers that correspond to the 6 degrees of freedom.

I think there is enough program space left on the AVRcam to do the trig in the AVR. The AVR is not very fast at floating point math, so the frame rate will suffer.
hamjudo
 
Posts: 6
Joined: Mon Dec 06, 2004 11:49 am
Location: Ypsilanti MI USA

more info on my requirments

Postby rburns » Sun Jan 16, 2005 8:27 pm

hanks for the info.
The idea about using spheres sounds really good.
To be a bit more specific about my requirments:
I want to have 2 gloves, be able to track them in 3d space reliably. Some form of orientation/direction the glove is pointing, and thats it.
I will have the avrcam plugged into either a linux or OSX box which will be able to do any processing thats still needed.
I also was thinking about adding a filter to the lense to block out blue, and then use green spheres for one glove, and red for the other. This will probably be used in low light conditions so Im thinking about having the spheres glow, but not too bright. I can definity play around with whats put on the gloves.

So far from what you've told me, it seems like the AVRcam is definitly a good start for building this system. I like the fact that I get to use another AVR for a project, and that I don't have to interact with webcam drivers on different platforms.

Thanks so much for your help.
Ryan
rburns
 
Posts: 7
Joined: Fri Jan 14, 2005 11:44 pm

Postby Guest » Mon Jan 17, 2005 7:06 am

Ryan,
Sounds like a pretty cool project! I just checked out the link to the video of the folks using this device...neat stuff. I definitely think the AVRcam could be used to play around with this idea. To reiterate what hamjudo wrote, using LEDs by themselves may not be the best choice, since, as was found out with a laser pointer, the light they create may just appear as a bright spot. I'm not saying it couldn't be made to work, but there are probably other ideas that would work better (and not require any power). I typically test the system out with a few pieces of colord cardboard and some Lego bricks, just as was previously mentioned. Anything that provides high contrast with the background will work well here, especially if you can control the lighting. You may have to play around with the size of the objects required, but I'm guessing you should be able to use nickel-sized dots pretty effectively. This could be improved further if you reduce the minimum vertical/horizontal size constraints for what the AVRcam considers an actual object (as simple as changing a couple of #defines and rebuilding the source). This was added to rev 1.2 of the source for noise filtering purposes.

Keep us posted on your progress!
Guest
 

what colors can avrcam really tack?

Postby rburns » Thu Feb 03, 2005 11:43 pm

Hi,
I've been playing with my new avrcam, and I've been having a problem:

I can't seem to be able to track objects of certain colors. So far I have only successfully tracked yellow, blue, white, or red objects. But when I try to track an orange or green object I can't get the camera to "see" them. I tried placing an orange pingpong ball on my desk with the camera over it looking down. With an image capture the object shows up great(distinct bright orange), but when I click track, it won't even find it sitting there? same goes for green objects I've tried.

Any ideas as to whats going wrong? I've tried both version 1.4 and version 1.1 of the embedded software, and they have the same problem, although version 1.4 seems to be a bit smoother.


I have noticed that because of lighting conditions, the camera seems to have problems with shadows and the objects getting shaded. To solve this I noticed that giving the objects a low or "dull" illumination helps them stay a constant unshaded color. Dull glowing yellow pingpong balls work great.


Ryan
rburns
 
Posts: 7
Joined: Fri Jan 14, 2005 11:44 pm

color tracking modified

Postby rburns » Fri Feb 04, 2005 12:49 am

OK, nevermind my previous post. My problem seems to be that in colors like orange my object isn't perfectly smooth one color. Its still orange, but on a pixelish level its probably closer to checkerboard orange and red. Is there a way to adjust the color tolerance in the code? I haven't really looked at the embedded code yet. It would be nice if this run-time adjustable via the CamView software.


Thanks again,
Ryan
rburns
 
Posts: 7
Joined: Fri Jan 14, 2005 11:44 pm


Return to AVRcam Embedded System

Who is online

Users browsing this forum: No registered users and 13 guests

cron