NemoSport is out

September 5th, 2009

NemoSport prototype is finally working and doing some good analysis on sport performance!

NemoSport intro!

NemoSport intro!

BrailleDuino

June 14th, 2009

A braille reader can read up to 200 words per minute (Foulke 1991).

In this tutorial I’m going to show how I implemented the electronic part for an innovative braille interface that can be connected to a computer via USB. The idea has been patented by my friend Nial Slater.

The poster describes the concept behind the innovation:

The device is composed by:

  • 6 buttons on the top side:
    • 3 buttons for the left hand and 3 buttons for the right hand
  • a rather special sheet that emboss on the fly braille characters
  • a set of 6 microactuators (and NO they are NOT simpe solenoids!) that emboss on the special sheet

Now the first prototype was built to emulate the braille encoder:
how to encode the 6 buttons combination into the corresponding micro actuators output.

Because the micro actuator has the same current draw of 40mA LEDS we decide to use 6 LEDS and dispose them to form a braille matrix.

We wired the arduino 2009 in the following way:

  • PINS 8~13 are connected to the 6 LEDS with pull down resistors
  • PINS 2~7 are connected to the 6 buttons with pull-up resistors

The reader will ask why the pull up configuration!

Because a braille typer works in a reverse way: the pins emboss the layer only when 1 or more than 1 buttons are released! This imply that:

  • in average the buttons will be pressed: therefore we do not want to drain any current!

This explanation doesn’t make sense unless you do not debug it in your head.
Assume the buttons are number from left to right as an array, when all are pressed you have:

A= 000 000 (because of the pull up)

And when they are not pressed:

Aneg=111 111

If the typer lift the index of the left hand, the status will become:

Anew=011 111

There was a transition from high to low of the MSB bit and only this pin should be activated to emboss the letter A!

The arduino code makes use of port registers and clever arithmetic operations on the PORTD and PORTB to detect the trigger of HIGH -> LOW BUT no the trigger LOW -> HIGH and then do the output of the differential status onto the LEDS matrix.

I also included a more intuitive coiding which simply copy the button configuration to the ouput LED, and also a cool features where the user input the ASCII letter on the keyboard and the arduino will output the braille encoding on the matrix. I left the reader the task to finish the braille encoding.

This video shows the initial prototype working:

And during the expo:

decode_braille

And good drink to everybody!

WiiNxtBalance

April 21st, 2009

It’s cool if you can control the NXTway-GS robot using a gamepad as this guy is doing:

But since we are Wii addicted I’m going to teach you how to use the wiimote!
Follow the tutorial and you willl be driving the balancer (and eventually crash it :-) ) like a cowboy!

What you need:

  • lego NXT with OSEK firmware and the NXTway-gs program loaded
  • a wiimote of course
  • ubuntu and python with bluetooth modules
  • rfcomm,pybluez and pyserial
  • a python script to parse the wiimote data and send it to the lego nxt

First step is to install the nxtOsek firmware: instructions here. In the directory samples/nxtway_gs there’s the code for the balancing functions. I did a patch of the program to be controlled by the wiimote via bluetooth. You can download the code from here (already compiled).

The second step is to connect your NXT to your laptop via bluetooth and rfcomm -many thanx to Linus to helped me out with this problem!-, this script will help you to do it very easily btconnect).

#!/bin/bash

# script to ease connecting to an NXT brick
# (c) 2007 Johannes Ballé

# call either with a Bluetooth address or device name

if echo $* | grep -q ‘^..:..:..:..:..:..$’; then
MAC=$*
else
echo -n “Scanning for ‘$*’ … ” >&2
MAC=$( hcitool scan | grep ‘^    ..:..:..:..:..:..    ‘”$* *$” | cut -f 2 )
if [ -z $MAC ]; then
echo “not found.” >&2
exit 1
fi
if echo $MAC | grep -q ” “; then
echo “found multiple devices:” >&2
echo >&2
for i in $MAC; do
echo ‘    ‘$i >&2
done
echo >&2
echo “Use ${0##*/} with one of the addresses above.” >&2
exit 2
fi
echo “found $MAC.” >&2
fi

rfcomm -r connect rfcomm0 $MAC &

trap “kill $!” 1 3 9 15
wait

If the connection is going on well you should see this:

epokh@epokh-laptop:~/Documents/lego nxt$ sh btconnect.sh “NXT”
Scanning for ‘NXT’ … found 00:16:53:0A:8B:E4.
Connected /dev/rfcomm0 to 00:16:53:0A:8B:E4 on channel 1
Press CTRL-C for hangup

And the bluetooth-applet should ask for the passkey “1234″.

The last step is to run the wiimotenxt control script to interface your wiimote. Look for your wiimtoe address using:

hcitool scan

Then modifiy the script in the main function with the address you found:

w=Wiimote(”00:1E:35:DF:C5:75″,0)

Then run the script as:

epokh@epokh-laptop:~/wiimote$ python Wiimote.py
Attaching to Wiimote #1 at 00:1E:35:DF:C5:75
setled(0)
_send_command(0×52,0×11,[16])
opening serial port…
Enabling accelerometer.
_send_command(0×52,0×12,[0, 49])
_send_command(0×52,0×17,[0, 0, 0, 22, 0, 10])
Leaving _waitforpacket() after 2 packets
Got force calibration data: zero=[127, 128, 128], 1g=[152, 153, 153]
Receiving data from Wiimote #1

You can switch the control mode pressing B (’the rear button’). You can control either by the buttons either using the acceleration. The script corrects the gravity to give a better motion control.

Enjoy!

Control your spykee with fingers

April 13th, 2009

Today I want to show you how to control your Spykee using your finger movements.

What you need:

A webcam

Spykee Erector on Amazon right now is only £ 148 .

RoboRealm a software with visual and contro plugins.

A green tape to wrap around your fingers.

I wrote a simple cascade filter which:

  • filter from RGB only green channel with proper hue and saturation,
    you need to tune this according to your camera parameters
  • run a median filter
  • track the 2 biggest squared blobs on the left and right side
  • build a simple visual panel to identify your blobs
  • transform the coordinates of the blobs to motor commands
  • send the motor commands over wireless to spykee

You can download the code here:
RoboRealm module

I made some simple videos on how it works:

Because I have only 1 camera I tried to mix a video with the control tracking and the Spykee camera.
This is what I get, I’ll try to borrow another camera to make a better video soon.
Enjoy!

Cheap Head Tracking

April 4th, 2009

I did a very simple lasr cut PVC frame where you can place your infrared LEDS.

It’s a simple 3 point model cap as the lego one:

You just need:

  1. wires
  2. 1 switch
  3. 2 AA batteries
  4. 3 IrLEDS (I used 100mA ones)
  5. any support (I used mine)

If you are lazy to make one you can buy one from my website:

http://shop.robomotic.com/

To find other distributors go here:

http://www.pixelpartner.de/openKMQen.htm

Lego Head Tracking

April 2nd, 2009

Do you have a lego mindstorm NXT?
Do you want to play videogames using optical motion tracking?
This the idea I just had yesterday when playing with my robots.

What you need:

  • 3 lego nxt light sensors
  • 3 lego nxt cables
  • lego nxt core
  • a webcam which doesn’t have an IR optical filter OR a nintendo wiimote
  • a floppy disk
  • free-track software for windows

How it works:

the lego light sensors emits light in the visible and infra red spectrum
this 3 beams are captured by your camera
the coordinates of the 3 dots are used by the software free-track to estimate the player position
the head position is used in the game to look around

How to build it:

I used a 3 point cap model: build a triangle structure as in figure 1. I did it in such a way that you can attach it to a sport cap.

If your camera has ann IR filter you are in big trouble but you can still remove it as described here.
If you have a camera without an IR filter you are very lucky: open a floppy disk and remove the magnetic disk. Cut it and pose it in front of the camera lens as in figure 2.

Measure the distances as in figure 3 and insert them in the free-track configuration.

The Free-Track configuration can be downloaded from Free-Track configuration to use with Lego Head Tracker.

Write a simple program for the lego nxt that switches on and off the sensors when the user hold down the contact sensor. The simple program in NXT-G can be downloaded from Lego Nxt program

You can also use RoboRealm to track them:

The RoboRealm configuration file is Robo Realm script file.
And now enjoy your game!

If you are lazy to make one you can buy one from my website:

http://shop.robomotic.com/

To find other distributors go here:

http://www.pixelpartner.de/openKMQen.htm

PHD job available in our lab

November 12th, 2008

PHd position available in
Location: University of Glasgow, Scotland
Rankine Building, Engineering
Website application form available here

Phd is funded by GRPe which is a joint venture of industries and universities, official page is here.
Topic: computational neuroscience\biophysic
Requisites:

  • bachelor degree in one of the following: engineering, physic, math, biology
  • excellent programming skills in C\C++
  • numerical methods for equation solving
  • intermediate english knowledge
  • optional: cable and compartmental neuron models

Payment: 1078 pounds x month (tax free) funded by GRPe
Optionally: living expenses included
Nationality: EU\UK

Email me for more info
epokh [AT] elec.gla.ac.uk

Example of some previous research:

http://www.epokh.org/blog/?page_id=23

Lego NXT indoor security SMS

October 3rd, 2008

This is a first prototype of a secubot that monitor my room: it controls with its ultra sound sensor if the door has been opened and sends an sms to my mobile phone.
The first version works like that:

lego nxt turtle [sensors and filters] <—- bluetooth —–> python nxt interface —-> sms gateway

The firmware is the original lego and the connection is managed by python nxt libraries and it works perfectly on linux/ubuntu (for more details on the installation just go here).
The distance sensor output is  filtered to avoid false alarms (it’s basically a 4th order band pass FIR filter).
The second version I’m working on is made like this:
lego nxt turtle | nxc program bluetooth interface< —-> bluetooth <—> mobile phone java application

the mobile phone is inside the turtle and so you don’t need internet to send sms notifications.

The is sentinel-cvs extracted from my CVS which I will set up later on.

P.S.
I used intellisoftware sms gateway but you can use your own sms gateway, if you want an account to my quebby messanger system drop me a comment.

GRP-E Conference

September 22nd, 2008

Joint Research Institute (JRI) in Electronics, Communications and Power Systems:

Electronic and Electrical Engineering

Glasgow and Strathclyde Universities

The Glasgow Research Partnership in Engineering (GRP-E) is a major programme of investment in collaborative research involving the Scottish Funding Council and the four universities in the West of Scotland. The GRP-E in Engineering aims to build world class research capability under three Joint Research Institutes (JRI), one of which is the JRI in Electronics, Communications and Power Systems.”

Poster A0 for the GRPe conference

Poster in A1 format for GRPe conference

portrait poster for GRPe

Reversing TinEye

September 15th, 2008

TinEye is an indexing engine made for finding images.
It’s actually indexing 901 million images and the retrieval time is quite fast: for the popular Lenna image in ( 512 × 512 pixels, file size: 463 KB, MIME type: image/png)

233 results
searched over 901 million images in 1.031 seconds

What algorithm make the search so efficient? Of course doing it in real time is not possible therefore the engine compare the submitted image with the database of signatures/hashes built by the tineye robots/crawlers similar to what google does with web pages.
I’ve done some experiments with the tineye search engine to estimate what features the hash function uses to compare images.
The sample image used (JPEG image, 980×306, 221.5 KB) is from emirate arabs and it’s indexed uniquely by tineye (there are indeed 20 images but they are all equal: same website with different languages).

20 results
searched over 901 million images in 0.138 seconds

The comparison signature is investigate taking the original image, processing it and submitting for search. The first approach is in the space domain and the second one in the frequency domain.

Space domain analysis

For the space analysis on the left there’s the applied filter on the original image and on the right there’s reported the number of results reported by tineye.
Gaussian noise 10×10 pixel : 20 results
Gaussian noise 15×15 pixel : 12 results
Gaussian noise 20×20 pixel: 0 results
Gaussian noise 50×50 pixel: 0 results

Pixelize 4×4 pixel: 20 results
Pixelize 8×8 pixel: 12 results
contrast 60%: 20 results
contrast 90%: 12 results
contrast 100%: 12 results
linear color mapping: 0 results
exponential color mapping: 12 results
double exponential color mapping: 0 results

dilate 1 pass: 20 results
erode 1 pass: 12 results
erode 2 pass: 12 results
sharpen 50 pixel wide: 20 results

Flips

Flip horizzontal: 0 results

Flip vertical: 0 results

Rotation

1 degree rotation: 20 results
6 degree rotation: 20 results
90 degree rotation: 0 results

Cropping

original image size 980×306

crop1 512×304 rel=51.90% Yes 22
crop2 369×304 rel= 37.41% Yes 22
crop3 237×150 rel=11.85% No
crop4 190×222 rel=14.06 % No
crop5 225×306 rel=22.96% Yes 3
crop6 225×215 rel=16.13% No

colorize

hue 200
saturation 30
light 0
Yes 12

theta1
threshold 205 to 255
No

sobel filter: 0 results

It’s very surprising to see how the hashing function isn’t robust to rotation and mirroring.
My guess is that the comparison function is based on different measure of the image, a possible guess:

  • color statistic
  • image segmentation
  • frequency domain (maybe)

and using a bayesian classifier to guess if the image is similar or not.
Why frequency domain? Because the horizzontal flip swaps the FFT coefficients (along the vertical axis) keeping nevertheless the histogram of the image equal and it tineye is insensible to it.


Indeed using a low pass filter in the frequency domain gives still positive results even if the histogram of the image is changed. I’m investigating different filters at the moment to discover more (please be patient I don’t have so much time at the moment)

Frequency domain (high pass)

I’m using an high pass filter to check if the hash take into account higher frequencies which the human eye can’t perceive. It seems that tineye consider them because I got positive results even with different histograms.
FFThigh pass 1
down to 100 pixels
up to 0 pixels tolerance 5%
12 results
fft high pass2 down to 10 pixels up to 0
12 results
fft high pass3 down to 2 pixels up to 0
12 results

Entropy

I recently discovered that the tineye doesn’t compute the signatures if the image has a low entropy: quite interesting.
For instance an image with an entropy of :

  • 0 bit
  • 1 bit

is not accepted for the hashing