PS MOVE Track Light Ball January 27, 2011 at 7:50 am
Anyone interested in hacking the PS MOVE in Linux can grap this file: cvtrackball.cpp
[Update] Sunshine is a killer…
If you wan’t to test the code, make sure your room is dimly lit and that you have the covers drawn.
[Update] Is Official: cvHoughCircles suck…
A detection combining shape and color would be nice.
[Update] Red, Green & Blue, we’re counting, eehh, You?
the code now works in RGB ranges, so if your ball is say cyan this line would be a good place to start:
./cvtrackball 0 0 256 200 256 200 256 1 (<- tells it to only print coordinates for 1 ball.)
to compile type:
“g++ cvtrackball.cpp -o cvtrackball -lopencv_gpu”
(you must have opencv 2.x installed)
“./cvtrackball video_device# Hue1 Hue2 Sat1 Sat2 Val1 Val2 [number_of_balls]”
The last six values are HSV values for the ball color
(a bit tricky finding the right ones, but it is possible using gimp and trial ‘n error ;-))
An example could be:
“./cvtrackball 1 10 30 0 10 250 256″
To find your video device try:
To set the color of the light ball you need the patched version of linmctool found at: http://thp.io/2010/psmove/
Best of luck!