Monday, February 25, 2008

"Interactive Projector Screen" videos on Blogger.com...

Someone complained about not being able to access YouTube. : )

But also, YouTube seems to be messing up with the video quality (which were already poor in the first place, so now it's worse.)

So, I decided to repost the videos here.

Here's the demos video on the Interactive Projector Screen :

video


Here's the video of Sufi playing House of the Dead 3 using a laser toy gun on the interactive projector screen:


video

Wednesday, February 20, 2008

Project Videos On YouTube - Interactive Computer Interface using Webcam

I have decided to upload some videos on YouTube about our project.

Here's the demos for the Interactive Projector Screen prototype we created:




Here's how we played The House of the Death 3 using a M16 Replica Laser Toy Gun:



There is supposed to be a story to tell attached to each video, but due to time constraint I was not able to complete my stories as planned. On the other hand there are some urgency on this side to release the videos and not hold it back for too long (many reasons, don't ask me why ... )

If you happened to reach this page due to my videos, please bear with me as I struggle to complete this "project", which would include the final release of the codes (I hope...) to everyone ....

... oh, my, look at the time ....

Tuesday, February 19, 2008

How to Make A Pocket Penlight-based Mouse Controller for Your Notebook or PC

Interactive Computer Interface Using Webcam project demo #2

How to Make A Pocket Penlight-based Mouse Controller for Your Notebook or PC
by lohchinfei, 19Feb2007




In this project we will show you how to use the webcam and an infrared light spot – either from a pocket touchlight or “penlight” or from a infrared (IR) LED – to control the mouse cursor control on your PC or notebook computer.

Combined with a external wired or wireless mouse, you can then move the mouse around on the screen and use it to control other applications, play games, etc, simply by waving the penlight around like a wand.


Background

The basic idea is really simple: a program running on the PC will process the images viewed from the webcam, find the position of the penlight/light spot, and use this position to deternine where to place the mouse cursor on the screen.


Now, if we can assume that the light spot/point is always the brightest object in the area, than the detection algorithm will be very simple: find the location of the pixel with the highest intensity level.

We make use of two additional useful facts:
  1. a normal pocket touchlights (or any incandescent lamp for that matter) actually emits several times more infrared light than visible light, and so works better as IR point source than a visible light source.
  2. most webcam are able not only to detect visible lights (red, green and blue, etc) but they can also detect infrared (IR) lights – for example as emitted by the IR LEDs commonly found on TV/Hifi remote controls – which are invisible to the human eyes.
So if we can somehow use the webcam to capture only the infrared lights from our light source and reject the surrounding visible lights, we will be ensured of a very reliable system. An additional feature of this system will be it will work if we replace the torchlight with any IR LEDs.

One way to do so is by converting the webcam into an infrared webcam – you can do a Google search on the internet for websites on how to convert normal webcams into IR webcams. The methods normally involved taking apart the camera, removing a small piece of filter in the lens assembly and replacing it with a piece of photography film negative. The film negative is actually an excellent infrared filter which blocks out all visible light while allowing only infrared light to pass through.

However, it may not be possible to dismantle and modify your webcam (in the case of built-in webcams for some notebook computer), and fortunately, it is also unnecessary to do so as we have discovered. By simply placing the piece of film negative in front of the webcam, we found that in most cases it is sufficient to do the trick for our purpose.


Instruction:

To keep the long story short, here’s a simple video to show how to make your own Wii-like controller.

What we used in our demo :
  • Light source – a mini touchlight Eveready Energizer Pocket Penlight, S$4/US$2.50.
  • A piece of film negative – to act as an infrared filter. Free.
  • Notebook: Apple Macbook Pro running WinXP+Bootcamp
  • Webcam - the iSight built-in webcam on my Macbook Pro.



What’s not shown in the video: clicking of the mouse buttons is done using external mouse devices: in the demo we used a wireless presenter device most of the time.

The control code is available for download at my MeL website, see detail below.



Converting the system into a Light Gun Controller

We tried converting the system into a light gun for playing shooting games like Virtual Cops 2 and House of the Dead 3.

The simple solution we used is to modding existing toy guns with IR LEDs. We have two variations:

1. a simple S$2.60 candy toy gun with Red LED lights and sound. We simply replace the LED with an IR LED and disabled the irritating sound. 
2. a more complex S$6.00 toy gun with multiple trigger and switches. We were able to insert the circuits from a small wired mouse into the gun, and wired the mouse buttons to the trigger and reload lever on the gun to control the firing and reload actions of these games. See picture below.



The guns modification was done by our design project student Mohd Sufi.

The result were surprisingly good, initially anyway.

Note that the system at its present form is not really a precision pointing device, i.e. you can move the penlight to move the mouse around the screen, but you can’t actually point the penlight towards any part of the screen.

Therefore, to use the device as a precision pointing device we are required to perform a calibration process before running the control program.

The precision achieved is surprisingly good. The calibration process takes into account all characteristic of the user holding the gun: his height, his arm length, where he stands, how he hold and aim the gun, etc.

However the accuracy will drift the moment the person moves away from where he is standing during the calibration process. In other word, the accuracy is only as good as long as the person holding the gun remains in his "calibration position". So for all practical purpose, the calibration works but is effective only “temporarily”.

So the system works, it’s fun even if the fun is only temporary, but is really not a very good solution.


Coming Up Next ...

I will elaborate about the calibration process in my next bog. In the meantime, the softwares (both the calibration and the control program) are now available on my MeL website at:

https://mel.np.edu.sg/webapps/cmsmain/webui/_xy-629307_1

for downloading.

More next time ...

Wednesday, February 13, 2008

Interactive Computer Interfacing using Webcam and Image Processing Techniques

For the past several months, we have been working on techniques and application for interacting with a computer using a webcam.

Applications? Think playing computer games by swinging a stick, or para-para solo dance game like in the video arcade ... okay, try thinking interactive giant posters and displays that interacts with the viewers/pedestrians, that allows users to enter inputs by touching the display or by gestures. Okay, how about the computer automatic enabling/disabling your screen saver when you are away or sitting in front of the screen?

Why/why not? Webcams are now becoming a standard feature for all personal computer system. Notebooks especially are now available with built-in webcams at the top of their LCD display:


The tiny iSight built-in webcam on my Apple Macbook Pro.

The idea is simple enough: The webcam would pick up the image of a person and send it to the computer. A program running on the computer would would analyze the image and look for certain feature of the person, his/her movement or gesture, etc. This information would then be used to make the computer do something - what this is is up to the programmer.





For example, here's a simple video of my daughter playing hide-and-seek with a computer generated spider - the spider would chase after my daughter when she moves:


The spider animation in the video is a modified version of a Flash program from http://www.uncontrol.com. We wrote a short program to capture images from the iSight webcam, and used these to detect the position of my daughter using a simple motion detection algorithm. The program then calculates and tells the spider program where to position the spider.

Simple.

Our program is written in C/C++. We also used the open source library OpenCV for all our image processing needs.

The OpenCV library even came with a face-detection demo program, and we had great fun playing and modifying the program. First, we wrote a simple smiley "avatar" program :



After the initial fun is over, we wrote a program to control the mouse cursor by moving our head. Our program worked, and we played several rounds of solitaire using our heads(!).

But after a while we started developing stiff necks which was not so fun. And so that's the end of our investigation on head-motion based mouse control. If you are interested, you can find one very good program based on this idea at http://robotica.udl.cat/headmouse/headmouse2/headmouse2e.html.

Next we will talk about our light-spot based computer interface interface.


============================================================
.


sigh, the first post ...

This blog is for us to share with everyone information about some of our projects done in our lab - the Audio-Visual Project Lab, Electrical Engineering division, School of Engineering, Ngee Ann Polytechnic, Singapore.

In particularly, we want to use this blog to highlight some of the projects that we feel will be fun and interesting to everyone, in particularly students and aspiring engineers.

What do we do in our lab? Well, our lab focuses on technologies & applications related to the MICE Industry"... (MICE = Meetings, Incentive Travel, Conventions and Exhibitions").

Depending on how you look at it, the above can literally mean "anything-under-the-sun". We solder, we program, we make things work. Right. What we don't do: we don't dissect frogs or rats or rabbits, we don't play with (real) "things-that-explodes", we don't host wares/any-morally wrong websites, ...

We think all projects should be fun. We believe engineering can be fun.

PS: and we are not so bothered about our spellings and grammars, nor how we dress and how we look ...