Detect camera movement

Hi everyone,

I’m trying to create a mini app that detects movement and then plays a m4a sound. I already have the sound part figured out (I admit, that’s the easy thing :)).

Now I’m stuck on the Camera part. I’m able to launch it and takes photos on request. However I would like to receive a callback whenever the camera detects movement. Probably this is not available out of the box but can you guys think of an existing tool that could help with this?

E.g. use something like face detection, listen to some events when it’s trying to assess what passes by the camera? Or taking very low resolution pictures and comparing them, or …

Please help me in the easiest possible direction :)!

Hey @pjmuller,

I think taking a look at our camerja project will help you out!

Project: Expo

Source Code: GitHub - expo/camerja

Cheers,

Adam

Hi @adamjnav ,
I already took a look at it but only see

  • settings that influence camera zoom / filters / …
  • triggers (for faces)

but this does not give me a clue how to detect random (not face) changes that happen in front of the camera.

So please some extra help along the way :slight_smile: ?

there’s no movement api on the camera right now. also we don’t have a canvas api so you can’t just do something like this: Motion Detection with JavaScript / Coder's Block (neat stuff). you might need to get creative to work within the constraints of the current expo api set :wink:

1 Like

Hi @notbrent , this motion detection by lonekorean seems indeed what I need.

I’ll then go ahead and build a regular html/javascript webpage I’ll load on the smartphone.

Thanks for pointing me in this direction!

1 Like

This topic was automatically closed 20 days after the last reply. New replies are no longer allowed.