H7 plus Saving images to SDRAM for post processing

I’m trying to get the FPS up as much as possible on my openmv H7 plus with global shutter of small for an application where I would need to acquire a two to five seconds of small images (<3kb), 2 Rois of each snapshot, of a quickly moving scene and then right after the sequence is acquired run the images through my tf model for classification. Running classification real-time is not required and slows FPS down.
Writing to SD slows down the FPS .

  1. Is there a method to do this on the faster ram of the plus model? If so which?
  2. aside from lowering exposure time of the sensor (adding more light as well) , keeping resolution low (QQVGA greyscale saving binary midpoint filtered) and not having the Openmv connected to my computer thus executing from main, are there other ways to get higher fps?

Hi, right now the system is not setup to do this easily.

However, it’s on my todo list to enable what you need. Basically, our camera driver isn’t interrupt based. When capturing an image from the camera you are blocked while receiving the image. When you write that image to the SD card you are also blocked when writing that image. This is why the system is not getting the best performance.

I have a planned change coming soon to redo the frame capture software to run all the time in the background and store images in a triple buffer. This will decouple frame capture from whatever the main thread is doing and will double the frame rate along with allowing what you want to do.

However, as the system works right now and I have other features to implement before this I can’t say when I will get to enabling this. However, I plan to get it done by mid year.

Enabling this stuff yourself will require expert C programming skills along with a deep knowledge of the STM32H7 and the ST Hal. If you are up for this I can point out how to do this.

Alternatively, another user broke up our snapshot method to make it non-blocking. I can point you to his PR that enables this.

Thanks for your prompt reply. I actually upgraded to the H7 plus assuming it could be done but I understand.
If you could point me to the PR that could be useful.

Hi I implemented something that does exactly what you want, we didn’t have this before because memory was low. After this is merged you should be able to record frames to memory and play them back and use the frames with any image processing function:

Thanks. You guys are very helpful as always. When will the firmware containing that change be released more or less? Is it a question of weeks or months?

Can you build the firmware? This is the best way to get it. Otherwise, probably in a month.

I will try. Thanks a lot.

I’ll try to get a release out this month, but you should try to build and test this new feature so you can let us know if there’s any issues.

Hi. I flashed the new firmware 3.9.1. and I am going to start using the modified function this week with the global shutter . I’ll let you know if I find any anomalies and eventually document the performance increase I find.

I had a couple questions though. Apologies if they are stupid.

  1. What is bpp below?
  2. The seek function (seek(n)) hoes to the the nth frame and every time read() is called you get the n+1 frame out?

stream = image.ImageIO((width, height, bpp), n_frames) # Must specify the number of frames to pre-alloc.
img = stream.read()
stream.close() # does nothing for now.

Bytes Per Pixel, and read returns the current frame not n+1 if you seek(0) read() returns the first frame.

Awesome thanks. In case of binary images would I just allocate 1 bpp?

No, that’s an enum. Use sensor.BINARY.

Actually that’s right you should use the enum.