Non Rectangular ROI - Motion Detection

I am implementing motion detection for a configurable roi. I noticed that they are of the format (x,y,w,h).

  1. Is it possible to have an roi that is not specifically rectangular? Maybe a trapezoid? A triangle? etc.

  2. I get an error when I run the snapshot_on_movement example, does the “temp” drive get created on the OpenMV on board storage or do I need an SD card or etc?

  3. With image.statistics(), is there docs on the definitions of the return of this function? The example code explains array index 5 is for lighting color channel, what are the rest?

  4. Since I am doing simple motion detection, is there any benefit to disabling any other sensor auto functions?

Thank you! :smiley: :ugeek:

  1. You can use an image mask to zero pixels. As in, create a bmp file and do b_and() of the difference frame with the mask file. This lets you pixel select the ROIs.

  2. You need an SD card.

  3. See the new API. I redid the method such that it returns an object with named parameters. I.e. you can do .mean() to get the mean. Read the documentation on the image library.

There’s an undocumented mask_ellipse() function but it’s fixed (you can’t change the size of the ellipse) and only works on grayscale. And’ing with another image is much more flexible, but it will be slower (unless loaded in memory).