News for hackers. Stuff that matters.
Re:PointerPointer: points to your cursor by paulirish on Monday June 11, 2012 @02:08PM (#4095946)
I made a quick video explaining how the webapp works: http://youtu.be/Z2ZXW2HBLPM

Essentially, using the gridPositions.json to populate a Voronoi Grid (toggle display of the <canvas> in your browser). Then your cursor position is used against the grid to find which shape encloses it which maps back to the source JPEG which is then displayed.

Re:PointerPointer: points to your cursor by snowwrestler on Monday June 11, 2012 @03:59PM (#4096594)
I watched your video. It does not seem to explain how the fingertip position in each photo was calculated, which it seems to me is really the heart of the magic.
Re:PointerPointer: points to your cursor by joejohnson on Monday June 11, 2012 @05:55PM (#4097262)
Yes, I was wondering the same thing. The difficult engineering problem here is first assigning pointing locations for every photo in the database. Because he didn't explain this step, I guess he just manually assigned each location for every photo.
Re:PointerPointer: points to your cursor by Andi on Tuesday June 12, 2012 @06:09AM (#4099688)
That's it, the developer has defined the pointing position for every photo manually.
Re:PointerPointer: points to your cursor by twymer on Tuesday June 12, 2012 @10:19AM (#4100527)
That's what I assumed until I pointed to ~20x20px from the top right corner and got a picture of a house in a flood.
Re:PointerPointer: points to your cursor by Flam on Monday June 11, 2012 @04:12PM (#4096666)
He says how it's basically a json file with every image mapped to coords of each voronoi "tile". I guess it was handmade in advance
Re:PointerPointer: points to your cursor by snowwrestler on Monday June 11, 2012 @05:48PM (#4097230)
Not a bad guess but I'd be interested to actually know the details. Making it all by hand would be problematic for reasons beyond the sheer volume. How would one find a deep, diverse set of images of people pointing? How did the creators ensure they had images to cover all possible pixel positions within a certain proximity? It seems like it would take reviewing many more than 900 images to produce a final set of 900 that includes even coverage.
Re:PointerPointer: points to your cursor by olalonde on Monday June 11, 2012 @06:03PM (#4097295)
Another guess here, but it could have been crowdsourced using Amazon Mechanical Turk. Assuming a conservative 0.05$ by picture, the total cost would be 901 * 0.05 = 45.05$.
Re:PointerPointer: points to your cursor by nmb on Tuesday June 12, 2012 @12:14AM (#4098726)
Yeah, this seems likely. Here's how I'd do it: create a webapp similar to this one to show to your Turkers. The difference would be that it would show an image at random, and the Turker would decide whether or not someone is pointing in the image, and if so they would click where the person was pointing. For each image, take the mean position of mouseclicks. This becomes a seed for the Voronoi diagram.

You can tell he/she "cheated" a bit for some the parts of the canvas that didn't get many seeds. For example, if you move your mouse within one of the large cells in the bottom left, the image just moves to keep up with the pointer. :P

Re:PointerPointer: points to your cursor by cheatercheater on Tuesday June 12, 2012 @01:24AM (#4098934)
But then everyone in the photos would be Indian.
Re:PointerPointer: points to your cursor by bnegreve on Tuesday June 12, 2012 @04:30AM (#4099444)
> How did the creators ensure they had images

You don't need a different picture for every single pixel: if the picture is large enough, you can easily crop it and use it to cover few thousands pixels.

Re:PointerPointer: points to your cursor by BHSPitMonkey on Monday June 11, 2012 @06:54PM (#4097522)
They could have had help from friends. Also, the design of the application makes it very easy to add new images to the set (just throw a new entry into the JSON file containing the x and y coordinates of the finger, and the script does the rest whenever the user loads the page).
Re:PointerPointer: points to your cursor by theon144 on Monday June 11, 2012 @04:41PM (#4096830)
But then, why do I get a picture of some garden when I move my pointer in the top right corner?
Re:PointerPointer: points to your cursor by gigawatt on Monday June 11, 2012 @05:08PM (#4097021)
You can just barely see the tip of a finger coming in from the right in that one.
Re:PointerPointer: points to your cursor by paulgb on Monday June 11, 2012 @10:56PM (#4098463)
If anyone doesn't care to explore the DOM themselves, this will show the Voronoi diagram and make the photo on top of it transparent. For Chrome, Ctrl+Shift+J and paste it into the console.

  document.getElementById('data').setAttribute('style','');  
  document.getElementById('content').setAttribute('style','opacity:0.7;left:0;top:0;margin:0');
  document.getElementById('underlay').setAttribute('style','left:0;top:0;margin:0');
Re:PointerPointer: points to your cursor by runako on Monday June 11, 2012 @01:41PM (#4095793)
Interesting example of how a hard problem (image recognition/understanding) can be faked for some cases by solving an easier problem (lookup table, a few hours of manual intervention.)
Re:PointerPointer: points to your cursor by taylorbuley on Monday June 11, 2012 @05:18PM (#4097085)
Seeing http://www.pointerpointer.com/gridPositions.json really took away some of the magic for me. Still, very clever and shows that web magic can be in the eye of the mouse-holder!
Re:PointerPointer: points to your cursor by ma2rten on Tuesday June 12, 2012 @11:30AM (#4100934)
Erm.. even there were some computer vision algorithm involved, he would probably want to run it offline.
Re:PointerPointer: points to your cursor by ajasmin on Monday June 11, 2012 @06:03PM (#4097296)
So there's no advanced computer vision algorithms involved :(
Re:PointerPointer: points to your cursor by Inufu on Monday June 11, 2012 @01:03PM (#4095604)
doesn't really work for me with Chrome on Windows 7 - an image flashes for a split-second, then it's back to "Finding pointer" (I'm not even touching my mouse)
Re:PointerPointer: points to your cursor by AsylumWarden on Monday June 11, 2012 @01:26PM (#4095723)
Same here. Just flashes the picture really fast in the latest stable release of Chrome under Windows 7. Works beautifully in the latest Firefox though. Windows IE isn't supported at all apparently (I tried IE 9).

Are the developers willing to share some insight into how this works? The picture selection is right on and there seems to be a good number of pictures at that.

Re:PointerPointer: points to your cursor by zentiggr on Monday June 11, 2012 @01:29PM (#4095734)
Agreed - never quite settles to actually show anything, just keeps asking me to hold still even though my hand's off the mouse...
Re:PointerPointer: points to your cursor by LoneWolf on Monday June 11, 2012 @04:50PM (#4096888)
Same problem windows 7 x64 Chrome 19.0.1084.52
Re:PointerPointer: points to your cursor by simonbrown on Monday June 11, 2012 @01:22PM (#4095695)
It seems to work for me when I move the cursor off the page, though that misses the point.
Re:PointerPointer: points to your cursor by tshadwell on Tuesday June 12, 2012 @03:35AM (#4099285)
Works fine in Chromium 21.0.1136.0 (136796).
Re:PointerPointer: points to your cursor by saraid216 on Monday June 11, 2012 @06:04PM (#4097300)
Snow Leopard/Chrome 19 works fine.

Seems like it's Win/Chrome.

Re:PointerPointer: points to your cursor by Inufu on Monday June 11, 2012 @03:48PM (#4096529)
intersting: on Ubuntu 12.04, still with Chrome, it works
Re:PointerPointer: points to your cursor by patrick_t on Tuesday June 12, 2012 @12:17AM (#4098742)
doesn't work on Windows 7 Chrome 20.0.1132.27
Re:PointerPointer: points to your cursor by jQueryIsAwesome on Monday June 11, 2012 @05:14PM (#4097063)
It looks like Chrome is firing the "mousemove" event when it shouldn't.

One way to make it work is to right click where you want it inside the square it and then left click anywhere outside the square.

In the Javascript looks like the error could be patched in Flasher.js line 72; save the last event.clientX and event.clientY and then check if the mouse coordinates have actually changed.

Re:PointerPointer: points to your cursor by sparknlaunch on Monday June 11, 2012 @09:42PM (#4098246)
Doesn't work in Chrome but the 'right mouse click' hack works.

There are likely some good opportunities for this code however speed of response may be a problem? Runs a little slow on my PC.

Re:PointerPointer: points to your cursor by sporksmith on Monday June 11, 2012 @08:15PM (#4097889)
Fun :). I did something similar with a bunch of photos of a stuffed monkey. I made a music video instead of an interactive web app, though the latter would probably not be too difficult since I wrote the software using Processing. http://sporksmith.wordpress.com/travels-of-code-monkey/
Re:PointerPointer: points to your cursor by shashashasha on Monday June 11, 2012 @03:50PM (#4096548)
A faster (older) version of this by the same people, with camera flashes: http://flitser.org/
Re:PointerPointer: points to your cursor by timmaxw on Monday June 11, 2012 @03:57PM (#4096583)
Warning: at least one of the images is not "family-friendly". Are the images automatically collected?
Re:PointerPointer: points to your cursor by hoprocker on Monday June 11, 2012 @05:17PM (#4097074)
It's probably easier to automate the picture harvesting here via an intensity filter. I'm still stumped about how the finger-recognition was accomplished in the OP.
Re:PointerPointer: points to your cursor by Groxx on Monday June 11, 2012 @12:54PM (#4095563)
Definitely good for a chuckle. It helps a lot that the photos are very well aimed, really makes it feel magical :)
Re:PointerPointer: points to your cursor by pyre on Monday June 11, 2012 @01:47PM (#4095820)
The images are adjusted. I was able to get the same picture 3 times in a row by moving cursor slightly, but the finger was always aligned exactly the same on the cursor, even though I had moved it.
Re:PointerPointer: points to your cursor by hackNightly on Monday June 11, 2012 @01:07PM (#4095624)
Just wasted about 20 minutes of my life playing with this. I would really like to know the technology behind. Is there some sort of ML going on, or is this human trained? Either way, very entertaining and scary accurate.
Re:PointerPointer: points to your cursor by ww520 on Monday June 11, 2012 @01:34PM (#4095756)
Something as low tech as having a predefined map of {location : picture} would do it. Break up the screen into a grid of NxN quadrants, like 20x20. Then just find 400 pictures with a finger near each quadrant. Translate cursor to a quadrant x,y; look up picture. Done.
Re:PointerPointer: points to your cursor by xd on Monday June 11, 2012 @01:24PM (#4095709)
You wasted 20 minutes ... what makes you think someone didn't waste 20 days pulling the image collection together. Occam's razor ;)
Re:PointerPointer: points to your cursor by almost on Monday June 11, 2012 @01:35PM (#4095761)
All the images are listed here:

http://www.pointerpointer.com/gridPositions.json

There are around 900 of them! I'd have used Amazon's Mechanical Turk...

Very cool effect, I also wasted way to much time playing with it :)

Re:PointerPointer: points to your cursor by hoprocker on Monday June 11, 2012 @05:19PM (#4097086)
Good "point" -- the right question posted to mturk/crowdflower/etc. could have knocked out that json file for relatively minimum time/cost. Oh, the things we humans engage in.
Re:PointerPointer: points to your cursor by B-Con on Monday June 11, 2012 @01:37PM (#4095769)
That's what I assumed. If I just moved my mouse a couple pixels I usually got the same pointing image back. I think they just divided it up into regions and then load the appropriate image for each region.

However, if that's all they're doing, it seems odd that it takes so long to load... Maybe some of that's just a built-in delay to keep from constantly cycling images from someone who's bumping the mouse.

Re:PointerPointer: points to your cursor by colanderman on Monday June 11, 2012 @01:44PM (#4095803)
The delay might be to build up suspense. The two–three seconds it spent loading I spent thinking "how could something that's essentially xeyes possibly take this long… ohhh haha very cute"
Re:PointerPointer: points to your cursor by alpb on Monday June 11, 2012 @04:18PM (#4096696)
There are serious problems around the upper right corner. I did not get any results from there. I'm wondering whether the pictures are originally pointing that coordinate or are they resized+translated to some offset?
Re:PointerPointer: points to your cursor by Geee on Monday June 11, 2012 @09:00PM (#4098082)
You'll have to move the cursor left a bit, to get the same image, but with visible finger. The images are indeed offset so that in the upper right corner the finger actually doesn't fit in the frame.
Re:PointerPointer: points to your cursor by ionforce on Monday June 11, 2012 @03:24PM (#4096368)
I don't see the point of this. The images load far too slowly.
Re:PointerPointer: points to your cursor by kephra on Monday June 11, 2012 @07:37PM (#4097733)
One suggestion is to move the jquery from jquery.com to your domain for two reasons:

1: It will be one click less, for those who use noscript. 2: It will allow your site to survive the case that jquery.com changes anything, or goes down.

Besides that its a nice toy.

Re:PointerPointer: points to your cursor by jdpage on Monday June 11, 2012 @09:29PM (#4098201)
Alternately, use the Google CDN.
Re:PointerPointer: points to your cursor by Andi on Tuesday June 12, 2012 @06:08AM (#4099685)
What is the point about this beyond showing pictures where the finger is next to my cursor? (Why is this popular?) It's not more interesting than a circumference search. You could implement that with a simple rtree.
Re:PointerPointer: points to your cursor by chousho on Monday June 11, 2012 @03:58PM (#4096588)
Haha, very clever. Although I seem to be running into problems whenever I put the mouse into one of the 4 corners of the screen. It can find anything more centrally located, though (apparently?)
Re:PointerPointer: points to your cursor by hanbam on Monday June 11, 2012 @03:44PM (#4096499)
I was actually expecting that somebody did some machine learning / matching over a large set of pictures and found all those images / coordinates.
Re:PointerPointer: points to your cursor by CountHackulus on Monday June 11, 2012 @12:01PM (#4095275)
This is pretty neat, I wonder if it has to be human trained or if there's some sort of computer vision algorithm determining pointing.
Re:PointerPointer: points to your cursor by siim on Monday June 11, 2012 @01:40PM (#4095782)
After looking into to the code I found out that this app is made by using Voronoi diagrams. [1]

The actual positions are saved in a json file. [2]

[1] http://en.wikipedia.org/wiki/Voronoi_diagram

[2]http://www.pointerpointer.com/gridPositions.json

Re:PointerPointer: points to your cursor by slig on Monday June 11, 2012 @04:04PM (#4096619)
Yes, but how did the author create that .json file? Manually or using some ML algorithm?
Re:PointerPointer: points to your cursor by saraid216 on Monday June 11, 2012 @06:08PM (#4097320)
What would be interesting is if new images were periodically added and the grid adjusted in response.
Re:PointerPointer: points to your cursor by AznHisoka on Tuesday June 12, 2012 @11:12AM (#4100823)
How can I get a pointer to my cursor in Javascript? I might find this useful in automating certain processes.
Re:PointerPointer: points to your cursor by DiabloD3 on Monday June 11, 2012 @01:12PM (#4095647)
On Firefox, never goes past "Pointer found, pointing". No image loads, works on Chrome though.
Re:PointerPointer: points to your cursor by edwinyzh on Tuesday June 12, 2012 @04:30AM (#4099445)
What's this? I saw some pictures flashed after some loading indicators are shown...
Re:PointerPointer: points to your cursor by PidGin128 on Thursday June 14, 2012 @05:51PM (#4113709)
This is technically interesting, but voyeur-istically creepy.
Re:PointerPointer: points to your cursor by gouranga on Tuesday June 12, 2012 @11:26AM (#4100908)
Doesn't work in IE9. That was the limit of my experience :(
Re:PointerPointer: points to your cursor by Inetgate on Tuesday June 12, 2012 @01:59AM (#4099017)
Is this a some kind of concentration game?
Re:PointerPointer: points to your cursor by joshu on Tuesday June 12, 2012 @12:29AM (#4098775)
Why does it take so long to load?
Re:PointerPointer: points to your cursor by apu on Tuesday June 12, 2012 @04:49PM (#4102771)
I was wondering the same thing. With a precomputed voronoi diagram and only a few hundred cells, lookups should be almost instantaneous.
Re:PointerPointer: points to your cursor by cocoflunchy on Monday June 11, 2012 @02:02PM (#4095897)
Doesn't load for me, on Chrome/FF/IE9...
Re:PointerPointer: points to your cursor by jsilence on Tuesday June 12, 2012 @03:03AM (#4099207)
awesome!