comparing small (10-20kb) jpgs in upython #13028
Replies: 3 comments 1 reply
-
I'm not sure what type of "human body model" (I didn't delve into it) it use, but if You have false detection from small animals and "ghosts" (i.e no movements/ sun shade changes and etc.) that means preprocessing fails (motion detection and object extraction) , infrared sensor works here as motion detector ( i assume it is sensor - not a ccd infrared camera). the simplest way ( based on your infra red sensor as motion detector working as "trigger"):
second step: if resolution of image is big, then resizing can significantly speed-up process. For fast development I I recommend use first python (even with open-cv) to just build your prototype and perform testing and chose parametrs , and when all will be as you planned -> migrate to upython. |
Beta Was this translation helpful? Give feedback.
-
Tensorflow lite is available for micropython: This site has firmware for the ESP32 both for with or without SPIRAM.
There is an example for image classification (after reducing to grayscale 96x96 pixels). |
Beta Was this translation helpful? Give feedback.
-
I think what I need is just some simple motion detection code that identifies movement by comparing each new photo to the previous one. The C programmers seem to have an EloquentSurveillance.h lib for this, although I've yet to see how it works. All the online references to it (eg https://github.com/eloquentarduino/EloquentSurveillance) show how to access it but I can never find the actual C++ jpg comparison code. I briefly thought https://github.com/remibert/pycameresp/blob/main/modules/lib/motion/motioncore.py might have a upython jpg comparer in it but after half an hour of raking through the the .py files I can't seem to find it. I guess it must be in the 'specially modified ESP32CAM firmware'? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I've got an outdoor esp32cam woken from deepsleep to take a photo by a passive infra red sensor. The sensor claims to have some fancy human body model but gives ~10 to 20 false wakeups/day. By false wakeup I mean not a warm blooded creature or any sign of movement anywhere in the frame.
I've tried comparing photo file sizes between current & previous photos to reduce the image count but it's a blunt tool for a problem that needs more finesse. Limiting wakeup rate has also helped (the false wake ups are sometimes bursty) but I'm still left with ~5 to 10 false wakeups/day.
All the photo comparison hits online post 2018 involve openCV, pillow or other libs not available for upython. Posts from before then tend to have a lot of math but not much in the way of python code I could use as a starting point. Tiny ML doesn't seem to fit the bill either & looks to have a really steep learning curve
I need a better way to find differences between 2 jpgs than simply comparing files size. Anyone else come up against this type of problem & found a upython solution?
Beta Was this translation helpful? Give feedback.
All reactions