Motion detection with a camera

Here’s the translation:


I developed a motion sensor application that takes two photos per second with a camera and compares them. This is the core logic of the application. I used ProCamBade64 for the camera and the KIO4_CompareImages extension to compare the photos. However, when I input photos taken with two different cameras into the KIO4_CompareImages extension, it always returns 0. Please help me solve this issue.


QuickProCamToImage (1).aia (971.9 KB)

Show your relevant blocks

Please help me because this is very important to me.

Now show your relevant blocks, the ones where you compare pixels using the extension ?

Without looking to closely, you appear to be setting the output to 0 regardless...

image

"No, that code sets it to take a maximum of 2 photos from the image."

See this demo aia project, try changing the images. You get some strange results. Maybe this extension is not what is needed in your case ?

compareImages.aia (15.8 KB)

it gives error like this "Attempt to invoke virtual method 'android.graphics.Bitmap android.graphics.Bitmap.copy(android.graphics.Bitmap$Config, boolean)' on a null object reference"

I wanted to try something and noticed this: when I compare two identical images below, it tells me that both are the same. But when I compare two identical images above, it gives me an error.

Click tge red error to see the error message
Scope Asset can only be used for files in the assets

Try this

Taifun

Yes, when I tried it as you suggested, it gives a result of 0, but even when I make the 2 images different, it still gives 0