Help needed with OpenCV Face Tracking

Robot Projects

Re: Help needed with OpenCV Face Tracking

Postby plingboot » Tue Sep 14, 2010 3:07 pm

Matt,
As you know i'm no expert on programming, but i have tried to chuck myself into this one, books and all.

It appears that Processing and arduino are sister projects which use a similar (almost identical) programming environment which is open source (free to download) and available on mac, win, linux - which is great.

I've been mucking around with this on my mac which has meant a learning curve which only involves the programming and not battling with a s0dding pc. :D

I tried a couple of different installations of OpenCV, but THIS was the one which worked and is pretty well documented. The above code is based on the examples included with the download, plus a bit of code from Noodle and stuff i've picked up.

In addition and as a separate project for the pan/tilt bit, I've been able to open a serial port from Processing and talk to my Arduino - using a simple programme where dragging the mouse over a window created by processing generates a value which is sent to the arduino, the arduino then moves a servo which is connected to it.

Just wondering whether it would/should be possible to replace the arduino with the p.Brain (via bluetooth) and send PIP commands instead…
Sheriff of Nothing
plingboot
 
Posts: 275
Joined: Sun Jun 01, 2008 5:30 pm
Location: the gutter, fashionable south west london

Re: Help needed with OpenCV Face Tracking

Postby Matt Denton » Tue Sep 14, 2010 4:08 pm

Matt Denton wrote:It appears that Processing and arduino are sister projects which use a similar (almost identical) programming environment which is open source (free to download) and available on mac, win, linux - which is great.


Ok, I will take a look when I get time.... don't hold your breath ;)

Matt Denton wrote:In addition and as a separate project for the pan/tilt bit, I've been able to open a serial port from Processing and talk to my Arduino - using a simple programme where dragging the mouse over a window created by processing generates a value which is sent to the arduino, the arduino then moves a servo which is connected to it.

Just wondering whether it would/should be possible to replace the arduino with the p.Brain (via bluetooth) and send PIP commands instead…


If you can open a serial port and send stuff, then yes, send PIP packets instead! Take a look at the PIP guide, and then look at the simple BSP examples I have written, from this you should be able to see how to create the PIP packet (Stick to the simple version mode 0) and then send it to the serial port.

Sorry I can't be of much more help just now.
Matt Denton
AKA: Winchy_Matt

micromagic systems ltd
Matt Denton
Site Admin
 
Posts: 1556
Joined: Tue May 20, 2008 9:15 pm
Location: Winchester UK

Re: Help needed with OpenCV Face Tracking

Postby plingboot » Tue Sep 14, 2010 4:31 pm

thanks for the replies Matt; will let you know how i get on…
Sheriff of Nothing
plingboot
 
Posts: 275
Joined: Sun Jun 01, 2008 5:30 pm
Location: the gutter, fashionable south west london

Re: Help needed with OpenCV Face Tracking

Postby Noodle » Wed Sep 15, 2010 6:04 am

You should be able to bypass the whole arduino point as long as you can setup a serial connection with bluetooth to the hexapod. The PIP commands seem pretty simple I think, I've never tried them though! Pan/tilt and body rotation variables are there. My thought is if you want to rotate by 30 degrees, perhaps rotate pan/tilt by 15, then body by 15 to give a more lifelike approach, or something like that.
Making robots from a school students wage :(
Noodle
 
Posts: 111
Joined: Tue Dec 16, 2008 3:28 am
Location: Brisbane, Queensland Australia.

Re: Help needed with OpenCV Face Tracking

Postby plingboot » Wed Sep 15, 2010 9:29 am

umm… been staring blankly at the PIP pdf :shock: it usually takes a few reads and a look at a working example for it to sink into my head.

first step will be something very simple without involving OpenCV ie: get Processing to send a wake command to the p.Brain - just to prove serial/bluetooth comms are possible.
Sheriff of Nothing
plingboot
 
Posts: 275
Joined: Sun Jun 01, 2008 5:30 pm
Location: the gutter, fashionable south west london

Re: Help needed with OpenCV Face Tracking

Postby plingboot » Thu Sep 16, 2010 5:05 pm

Here's a bit of footage showing OpenCV in action on my mac…


Sheriff of Nothing
plingboot
 
Posts: 275
Joined: Sun Jun 01, 2008 5:30 pm
Location: the gutter, fashionable south west london

Re: Help needed with OpenCV Face Tracking

Postby plingboot » Mon Sep 20, 2010 2:11 pm

Been trying to get a simple wake command to work from my mac to the hexengine via processing.

I've set-up bluetooth; the mac will pair with the hexEngine and i can use zterm to look at the command line set-up etc.

I've been using a test sketch which i've converted to try and send the PIP command to 'wake'

It's not perfect and it's also not working (probably my programming prowess). When i run the sketch i can see the available serial ports and i know that processing is using the correct port and has paired with the hexEngine because the LED illuminates and i know that the 4 chunks are being sent - as they're written to the console as they go.

I'm all ears if anyone has any thoughts… ;)

Oh and here's the sketch i'm using…
Code: Select all
import processing.serial.*;

// The serial port:
Serial myPort;       
int[] pip = {126, 1, 43, 212} ;


// List all the available serial ports:
println(Serial.list());
println(pip[0]);
println(pip[1]);
println(pip[2]);
println(pip[3]);

myPort = new Serial(this, Serial.list()[4], 9600);
 
// Send command
for (int i=0; i< 4; i=i+1){
myPort.write(hex(pip[i]));
println(hex(pip[i]));
}
exit();
Sheriff of Nothing
plingboot
 
Posts: 275
Joined: Sun Jun 01, 2008 5:30 pm
Location: the gutter, fashionable south west london

Re: Help needed with OpenCV Face Tracking

Postby Matt Denton » Mon Sep 20, 2010 3:10 pm

Ok, so your controlling via the ESD-200 port on the p.Brain-SMB, this means you should have the jumpers so that the HexEngine is configured via the serial lead, and controlled via the TTL/ESD-200 port?

If you are able to configure via Zterm/ESD200, then I suspect you have the HexEngine in a different mode ?

Just clarify this first.
Matt Denton
AKA: Winchy_Matt

micromagic systems ltd
Matt Denton
Site Admin
 
Posts: 1556
Joined: Tue May 20, 2008 9:15 pm
Location: Winchester UK

Re: Help needed with OpenCV Face Tracking

Postby plingboot » Mon Sep 20, 2010 3:11 pm

hi matt,
edit: jumper on 2 cn18
Sheriff of Nothing
plingboot
 
Posts: 275
Joined: Sun Jun 01, 2008 5:30 pm
Location: the gutter, fashionable south west london

Re: Help needed with OpenCV Face Tracking

Postby Matt Denton » Mon Sep 20, 2010 4:16 pm

plingboot wrote:hi matt,
edit: jumper on 2 cn18


Ok, so it should boot for configuration and control over the ESD200 port, and default to PIP mode, but just to make sure, remove the jumper on CN18 and try that.
Matt Denton
AKA: Winchy_Matt

micromagic systems ltd
Matt Denton
Site Admin
 
Posts: 1556
Joined: Tue May 20, 2008 9:15 pm
Location: Winchester UK

PreviousNext

Return to Projects

Who is online

Users browsing this forum: No registered users and 1 guest