maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   n810 camera as mouse? (https://talk.maemo.org/showthread.php?t=23832)

JeffLuszcz 2008-09-23 21:49

n810 camera as mouse?
 
I've been looking lately at attempted to use the n810 camera as a mouse.
Here's the basic idea.

The n810 camera, while low quality, should work fine to notice and track gross finger movements across the screen.

This would be handy for scrolling motions such as in the browser/microB.

Here's how I would expect it would work. A background process would watch the camera and notice wipe like motions (up / down / left /right) and translate them into events, either keyboard or touch screen equivalents.

Has anyone seen a project like this in the past or have suggestions for how to proceed?

Thanks,
Jeff

Benson 2008-09-23 21:54

Re: n810 camera as mouse?
 
There was some talk about this (ages ago) for the N800; the idea was to twist the camera to control scrolling. I don't think anyone's actually worked on it; probably very CPU intensive.

qole 2008-09-23 22:26

Re: n810 camera as mouse?
 
They got the camera working in Flash in Chinook (the hack broke in Diablo); this meant that you could play those silly flash games where you can break bubbles by waving your hands around...

But maybe that's not what you mean? ;)

Thesandlord 2008-09-23 22:44

Re: n810 camera as mouse?
 
You mean this?

http://www.infosyncworld.com/news/n/9165.html

I already asked, but no one seemed interested.

Its possible, and I think it would be cool....

Actually, I did something like this on Flash, AutoIT, and Windows. Really basic stuff, but it worked.

lardman 2008-09-23 22:48

Re: n810 camera as mouse?
 
Should be easy enough to do, record data at full rate and perform a 2D correlation on each frame to work out which way it's moved (on average).

Try using the example code for the camera, or the maemo-barcode code as a starting point. I'm happy to advise/contribute to see if it can be made to work.

Benson 2008-09-23 23:16

Re: n810 camera as mouse?
 
Yeah, but all the things you'd want to use it for are already hogging CPU.

My advice: Window a small chunk from the center of the previous frame, and do a correlation of that on the whole window, and keep resolution small, and it might work. But a basic approach is gonna be glitchy as imaginable when the CPU binds and you get no frames for a half second. Trying to accurately return results when there was no jump, and handle real jumps like that gracefully, is not gonna be easy.

If I were just looking for an arbitrary way of conveniently scrolling down webpages, I'd go with overall image brightness. Scroll up when there's lots of light, down when there's no light, and somehow (lux sensor?) detect when the user's thumb is not there and don't scroll at all. Modulate light with your thumb like one of those optical "theremins" on eBay.

qole 2008-09-23 23:50

Re: n810 camera as mouse?
 
Quote:

Originally Posted by Thesandlord (Post 226719)

What? Samsung Instinct? Don't understand. :confused: :confused:

nilchak 2008-09-24 00:48

Re: n810 camera as mouse?
 
I think cooler would be to use the front-facing (low resolution) camera as a hand gesture touchless control - like this demo
http://www.youtube.com/watch?v=7DikbVmYLR0
(check out the part at 1:16 mins where you control music playback with hand gestures)

And if this is true, then it works on a S60 platform, it should work on the more powerful Nokia IT at least.

JeffLuszcz 2008-09-24 00:59

Re: n810 camera as mouse?
 
Great replies. I can handle the image processing side pretty well, but haven't played around with Maemo/Linux event processing. Any thoughts on how to inject or emulate up or down dpad presses or emulate a upward or downward swipe on the screen?

Benson 2008-09-24 01:14

Re: n810 camera as mouse?
 
I'd just use xte, for a POC at least. D-pad is just the arrow keys, so
Code:

xte key Up
xte key Down

would be equivalent to d-pad taps. You could also implement swipes and long-presses of the keys, or page up/down...


All times are GMT. The time now is 08:19.

vBulletin® Version 3.8.8