Motion Detection using camera?

by Rijad Sacirovic » Mon, 07 Jun 2010 07:45:43 GMT

Sponsored Links
 Is this possible?
How do i do it?
I want to learn but dont know where to begin even :/


Motion Detection using camera?

by TreKing » Tue, 08 Jun 2010 01:18:35 GMT


Is what possible? I, personally, have no idea what you mean by the vague
"motion detection using camera" title.

Use the camera to detect motion maybe? Without more information on what
you're actually trying to do, that's the best answer you're likely to get.

Try the documentation on the camera?

TreKing - Chicago transit tracking app for Android-powered devices 


Sponsored Links

Motion Detection using camera?

by BobG » Tue, 08 Jun 2010 03:14:58 GMT

 This is the realm of 'image processing'. One algorithm might be: run a
couple of nested for loops and find the x,y loc of the brightest pixel
or the center of some bright feature, and do this in two frames. If
the feature moves 3 pixels, you have solved the problem.
Sounds easy when explained by a master huh?


Other Threads

1. Resuming Previous Activity Properly

I have two Activities which both share a toolbar component that
extends a linear layout, the toolbar looks like this:

public class Toolbar extends LinearLayout {


public Toolbar(final Context con, AttributeSet attrs) {
                super(con, attrs);

TextView tab1 = (TextView) findViewById(;
                tab1.setOnClickListener(new OnClickListener() {
                        public void onClick(View v) {
                                Intent intent = new Intent(con, 


                TextView tab2 = (TextView) findViewById(;
                tab2.setOnClickListener(new OnClickListener() {
                        public void onClick(View v) {
                                Intent intent = new Intent(con, ShowLog.class);


When I click on tab 1 it works fine, it launches an acitvity
containing a webview. Likewise, tab 2 launches another tab with a
webview. The issue comes when I click tab 1 again, it restarts the
activity from scratch. I would like it to restore the state of the
webview to where it was. I believe I need to store the webview state
somehow and then on startup detect a restart and restore the webview
through the savedInstanceState Bundle. The issue I have is that the
bundle is always null even if I save it in the onSaveInstanceState
method of tab 1.

Tab 1's code looks like this:

        protected void onCreate(Bundle savedInstanceState) {

if (savedInstanceState != null) {
                        final File f = new File(lCurrentPicture);
                        webview.restorePicture(savedInstanceState, f);
                        SharedPreferences.Editor editor = settings.edit();

                } else {

        protected void onSaveInstanceState(Bundle outState) {
                isSavedInstanceState = true;
                Log.i("ShowDashboard", "onSaveInstanceState");
                File mThumbnailDir = getDir("thumbnails", 0);

                final File f = new File(mThumbnailDir, webview.hashCode() +
                boolean savedPic  = webview.savePicture(outState, f);
                Log.d("ShowDashboard", "savedPic:" + savedPic);
                outState.putString("currentPicture", f.getPath());


Tab 2 looks similar, any help is appreciated. Thanks!


2. modifying build.prop on emulator

I want to change build.prop file on my emulator.
Here are the speps I have done:
  emulator vd <device> artition-size 128
  adb pull /system/build.prop
edit build.prop
  adb mount
  adb push build.prop /system/build.prop
  adb shell rm /system/app/SdkSetup.apk
Close emulator, delete the files: userdata-qemu.img, userdata.img, cache.img 
from avd\<device> directory
start emulator:  
  emulator vd <device>
  adb pull /system/build.prop
I see the original build.prop file, not modified one, I can also see 
SdkSetup.apk in system/app, 
so the the emulator is reverted back to its original stage.
Am I missing something?


3. Sharing gps stuff between several activity

4. Record the Output audio from device

5. EditText View control distorted in a qvga android phone as well as the emulator

6. receive GPS enable/disable settings event

7. Are the gyroscope features broken in Android 2.3 or Nexus S?