First of all I am very happy with the openmv H7. I am currently working on some background subtraction and I would like to ask for some advises:
- I want to use the camera for a continuous background correction, meaning that I want to use a frame taken in a previous time step (t0-1) as a background for a current time frame (t0):
extra_fb = sensor.alloc_extra_fb(sensor.width(), sensor.height(), sensor.GRAYSCALE) extra_fb.replace(sensor.snapshot()) triggered = False while(True): clock.tick() # Track elapsed milliseconds between snapshots(). img = sensor.snapshot() # Take a picture and return the image. img.difference(extra_fb) # Subtract background extra_fb.replace(sensor.get_fb())
However, If I do that I get only every second frame a subtracted background (the displayed image alternates between black (background subtracted) and a normal image with no subtraction). Why is that?
I would like to check how much the images were shifted and distorted between different frames at t0 ant t0-1 (in case of the moving camera). In the end I would like to get a vector for the whole image, which I could use to modify the previous image (at t0-1) and use it for a current time step (t0) as a background.
Is there I good way to track moving objects with moving camera on an openMV platform?
Any help would really helpful.
Thank you very much!