I am having some issues with the OpenMV library and urgently need some help.
-
I have imported one 320x240 24-bit grayscale in bmp format picture successfully. The image size is about 225KB. (see attached jpg file. OpenMV does not support jpg file, only bmp.)
-
Some basic library function calls won’t run due to memory issues. Here is one example. We are trying to find a rectangle inside our image. I’ve tried few 320x240 bmp files and they all fail.
Here is the code:
while(True):
clock.tick()
img = image.Image("/test.bmp", copy_to_fb=True)
for r in img.find_rects(threshold = 10000):
img.draw_rectangle(r.rect(), color = (255, 0, 0))
for p in r.corners(): img.draw_circle(p[0], p[1], 5, color = (0, 255, 0))
print(r)
print("FPS %f" % clock.fps())
time.sleep(1000)
And here is the error OpenMV indicates: as seen in attached “Memory error.png”
-
Is there any ways to increase the buffer size or stack? If not, are there any other ways to get around this issue? 320x240 image is pretty small already and I can’t downsize it anymore.
-
I also tried to use framebuf module to resize/manipulate the buffer. But the import fails, as seen in attached “Import error.png”
Here is the document we’ve followed: framebuf — frame buffer manipulation — MicroPython 1.15 documentation
import framebuf
Thanks for help.