Motion Detection using camera...

Quickly share your Android Code Snippets here...

Motion Detection using camera...

Postby strider2023 » Tue Mar 02, 2010 6:47 am

Hello World,

Well i am trying to develop a prototype using android phone to detect small movement and its direction like a mouse...the problem is that accelerometer aint reliable in slow steady motion (conduction tests on iPhone)...so i intend to use either the inbuilt magnetic compass or camera...now i am not sure abt the magnetic compass since i haven't received my phone yet(i am waiting)...so have started looking into some movement detection code using camera.

The problem is i am new to android dev...so it will be very helpful if i get help on how to use the phone camera(phone will arrive by this weekend) and incorporate it with my motion detection algorithm!!!

Thanks in advance!!!
strider2023
Senior Developer
Senior Developer
 
Posts: 126
Joined: Tue Mar 02, 2010 6:34 am
Location: Chennai, India

Top

Postby DMacATTACK » Wed Mar 17, 2010 11:10 pm

Strider:
I have no direct answer for you, but from what I understand, what you want is quite complicated. Motion detection using a camera compares one image to the next. This requires real time image processing. I'm not sure how that would be done in java, or if at all. I do know it is possible in lower level languages such as C (Which is faster than java). If you wish to look into this I recommend looking into OpenCV.

Best of Luck
User avatar
DMacATTACK
Experienced Developer
Experienced Developer
 
Posts: 58
Joined: Thu Dec 31, 2009 6:31 pm
Location: Canada

Re: Motion Detection using camera...

Postby Trip » Sat May 22, 2010 4:09 am

there are a few c++ and vb.net functions you can dl ... i know this isnt helpful but ... i also heard a rumor u can run c++ code in droid using JNI ? ... worth checking out might make life easier

and search for dorgem (open source motion capture & streaming util) (has motion detection forum)

and the way to visualise what you need to code

2 images to compare
16/32/64 sample pixels to check colour against picture being compared
and a tolerance value
compare each rgb value
see if it is in range with tolerance
if not the image has changed
Trip
Junior Developer
Junior Developer
 
Posts: 19
Joined: Sat May 22, 2010 2:58 am

Re: Motion Detection using camera...

Postby droider » Fri Jul 23, 2010 2:56 am

Yes, you can write native C++ applications and invoke them from java.

You require NDK
http://developer.android.com/sdk/ndk/index.html
hmm...how about a Google Certified Android Developer certification?!
droider
Developer
Developer
 
Posts: 25
Joined: Sun Mar 21, 2010 6:17 am
Location: New York

Re: Motion Detection using camera...

Postby phishman3579 » Sun Aug 28, 2011 4:51 pm

You can try http://code.google.com/p/android-motion-detection/

I wrote it and It's open source.
phishman3579
Freshman
Freshman
 
Posts: 9
Joined: Sun Aug 28, 2011 4:49 pm

Top

Return to Code Snippets for Android

Who is online

Users browsing this forum: No registered users and 1 guest