Out of Memory Error

Discussion related to "under the hood" OpenMV topics.
calvinmryan
Posts: 5
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Out of Memory Error

Postby calvinmryan » Fri Feb 09, 2018 6:49 pm

I occasionally get an out of memory error when trying to print(img.compressed_for_ide(quality = 30)). I understand that jpegs are large even when compressed, but I'm confused as to why sometimes I can show the image in the serial terminal IDE and other times not. Is there an explicit way to clear the onboard memory of the M7 at the end of the script? Would that prevent me from running into this issue?
User avatar
kwagyeman
Posts: 1401
Joined: Sun May 24, 2015 2:10 pm

Re: Out of Memory Error

Postby kwagyeman » Sat Feb 10, 2018 2:31 am

Yes, use the compress() method versus compressed (). Compress() compressed in place. The ed() method creates a copy in the heap which is tiny.
Nyamekye,
calvinmryan
Posts: 5
Joined: Tue Jan 30, 2018 11:05 am
Location: Boston, MA

Re: Out of Memory Error

Postby calvinmryan » Sun Feb 11, 2018 9:47 pm

This fixed my problem - thanks!

Return to “Technical Discussion”

Who is online

Users browsing this forum: No registered users and 5 guests