What refinement has been done to pull the execution time of the motion detection algorithm on J2ME to pull it down a period of reasonable time?

Previously posted on old Pusu blog:

28 Mar ’05 – 22:32 by Cahit Güngör

As mentioned before the motion detection algorithm runs over 18 seconds on j2me platform only to compare two images. It is not a reasonable time if an application is to be run real-time. It is urgent decision to be made to leave or to stay on development. If this time interval can not be pulled down, the project will be senseless. So the motion detection algorithm is taken under focus to refine it. At last we have done it. Now it is running under 100 ms which is a reasonable time to detect motion when compared with 18 seconds. This an obviously great achievement. 🙂

What is done?
Float class is discarded and the difference is calculated more simple way instead of square root.
int array of RGB data is used instead of byte array RGB data which saves lots of converting time.
The most considerable difference is made when only one color from RGB data is used instead of 3 colors.

The following question if the motion detection algorithm work in this trimmed form.

Advertisements

5 thoughts on “What refinement has been done to pull the execution time of the motion detection algorithm on J2ME to pull it down a period of reasonable time?

  1. hi cahit …

    using getSnapshot() method i captured the image

    byte[] byteImage;
    ” byteImage = mVideoControl.getSnapshot(null);”

    now it is in byte format, how to get the int array of RGB data from this byte array and to use anly one color from RGB data….
    please help me

  2. int[] refRGB = new int[w * h];
    refData = videoControl.getSnapshot(imgConfig);
    Image refImg = Image.createImage(refData, 0, refData.length);
    refImg.getRGB(refRGB, 0, w, 0, 0, w, h);

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s