I am trying to detect a set of AprilTags from the 36h11 family with an Arduino Nicla Vision board. I am using the sample sketch, and I have set the resolution to HQVGA and I am using grayscale. The resolution should be fine since according to this post, it requires roughly 16x the memory of the frame buffer to process the image. The resolution is 240x160 so 16x that should be around ~0.6MB since the Nicla Vision has 1MB of RAM it should be more than enough to process the image. It is also of note that I do not get any out of memory errors but it also does not detect the tags either.
Only searching in a 100x100 ROI works most of the time but that sometimes causes memory errors “MemoryError: Out of fast Frame Buffer Stack Memory! Please reduce the resolution of the image you are running this algorithm on to bypass this issue!”.
Does anyone have any idea why this is happening? Is there a way too fix this (except for reducing the resolution of the image since memory should be more than enough).
Hi, the Nicla doesn’t have 1MB of continous RAM. ST implemented the memory in different regions and you also need to store the image too. Anyway, it comes down to like 400KB that we can store for AprilTag memory.
So, the Nicla can only do 160x120. This is the same limit as the H7 regular.
Yes, the algorithm has already been heavily optimized. We turned all the knobs years ago. The fact that it runs on an MCU is amazing in itself.