FreeTrack Forum

Welcome, you're not connected. ( Log in - Register )

RSS >  Suggestion: Wavelength filter?
loganfong #1 14/07/2008 - 18h17

Class : Apprenti
Posts : 3
Registered on : 10/07/2008

Off line

I am wondering if it is possible to apply a software wavelength filter in Freetrack so that only a certain range of wavelength is accepted by the program. For example I use red LEDs but am suffering from noise from the ambient light sources, if there is a wavelength filter then ambient light other than red can be filtered out, which can be really useful.

I'm not sure if this adds a huge burden to CPU usage though, just a thought to share.
Edited by loganfong on 18/07/2008 at 10h39.
danieru #2 21/07/2008 - 12h23

Class : Apprenti
Posts : 8
Registered on : 09/07/2008

Off line

I'm not a freetrack developer and I haven't really looked into the code, so I can't comment on what it's doing, but I have played around with image processing a bit in a class I took.  In the real world you're dealing with different wavelengths of light.  The webcam is converting the light to electrical signals and then we store that information in a digital format  If it's grayscale, then we could have a two dimensional array, one value for each pixel of the picture. If we want to use discrete values to represent intensity or brightness, an example would be 0 is typically black, and 255 is white. For color, a common approach is having three arrays, one for each color: Red, Green and Blue.  So if you're wanting to filter out all colors but red on the software level, a simple approach would be to simply drop the green or blue values: set them all to 0 intensity (black).  There are other approaches to representing images digitally, like YUV, but RGB is the most intuitive so it's a good starting point.

However, getting good results from this approach might be complicated by the fact that each pixel is going to have some light from all three colors, your 'red' LEDs may not be recognized as true red by the webcam, etc. Skin in particular reflects more red light.  You would probably need to use thresholding with this method to get decent results. (all pixel values below a certain intensity, set to 0, and all above, set to 1).  Also , webcams use really cheap light sensing hardware, so it doesn't create a very accurate representation of the light; muddles it up a bit.  This is probably another reason why just using intensity and thresholding is a better/simpler approach.

The above approach is very simple, and wouldn't be computationally expensive at all, but since freetrack seems to be using only an intensity thresholding approach (doesn't seem like they're messing with color), you're much better off trying their IR light approach, and then filtering visible light like they suggest.  I'm sure they're using other smart tricks to clean up the image and get better results as well.

If you think you can convince the developers to add color filters, go for it! If they think it will make freetrack more useful, who knows? You should ask them.  Otherwise I'd just try to implement the IR method freetrack is suggesting.
Deimos #3 21/07/2008 - 18h31

Class : Beta Tester
Posts : 120
Registered on : 07/11/2007

Off line

Actually, the color recognition is quite easy when the color is converted from RGB to HSL colorspace., i have an example shown here:
http://forum.free-track.net/index.php?showtopic=799&message=5977
But unless you're trying to use multiple headtracking interfaces (eg. one red and one green running simultaneously), IR approach is much better. And if you really don't want to mod your webcam, you can always add a hardware color filter, for example a piece of green plastic for green LEDs, or something red for red ones.
But i really don't see why you might want to avoid modding the camera - it's not like you can't use the camera normally (for video chat, etc) after the mod... You would just need to make the visible light filter removable.
loganfong #4 04/08/2008 - 10h24

Class : Apprenti
Posts : 3
Registered on : 10/07/2008

Off line

It seems that I can't remove the IR filter of my webcam without damaging it...so I wish they can include a colour filter  :(

By the way if my tracking system is made with  red diodes instead of IR diodes, do I still benefit with having the IR filter of the webcam removed?
tristan68 #5 04/08/2008 - 11h31

Electronicien en chef
Class : Electronicien en chef
Posts : 651
Registered on : 10/07/2007

Off line

It's all about contrasts , not IR

We usually prefer to use IR because we can acheive high contrast mode without being blinded by led beam reflection on the screen  :)

But :

Freetrack doesn't rely on colors, so as long as your markers are bright enough relative to the ambient light ( so you can work in this hi-contrast mode) you can use them.

If you can't unmout the webcam IR filter, my guesses would be :

Try with normal red leds, and see if you can find an adjustment allowing good tracking without generating reflections on your screen.
(since red leds are usually very cheap , it's worth the price to try it)

Try with SFH485P at max power (50 to 75mA).
Since they are 880nm leds,  almost every webcam can track them without IR modding it.

cya

 >  Fast reply

Message

 >  Stats

1 user(s) connected during the last 10 minutes (0 member(s) and 1 guest(s)).