Any way to speed up python loops?


I am trying to create custom algorithm using pixel-by-pixel loop. However, 320*240 loop drops FPS from 100 to 2(!). As I understand, this is because of Python.
Is there any way to optimize per pixel loop in OpenMV?

Thanks for help

You have to write the code in C and then update the firmware. It’s not really hard to do if you setup the tooling. Please see the github.

Thanks, that is a right way to use full power of STM32.
Unfortunately, Firmware Guide is outdated. While trying to install gcc-arm-embedded it returns with “Unable to locate package gcc-arm-embedded” (Question #664111 : Questions : GNU Arm Embedded Toolchain) I have downloaded the GNU Arm Embedded Toolchain from GNU Toolchain | GNU Arm Embedded Toolchain Downloads – Arm Developer but have no idea how to install it manually. Couldn’t find solution as far as Ubuntu is new to me.
I am not sure this question is for you, but without actual Firmware Guide it is impossible to extend firmware which is, in my case, very valuable feature of OpenMV.

I’ll got run the commands again to update it.

To be clear, if you are editing the c code it is expected that you can overcome simple command line issues.

apt - How to install arm-none-eabi-gdb on Ubuntu 20.04 LTS (Focal Fossa) - Ask Ubuntu helped me.
Now I am struggling with this issue:
Latest GCC throws described errors, gcc-arm-none-eabi-7-2017-q4-major-linux.tar.bz2 throws

/usr/share/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: /openmv/src/build/bin/firmware.elf section `.text' will not fit in region `FLASH_TEXT'
/usr/share/gcc-arm-none-eabi-7-2017-q4-major/bin/../lib/gcc/arm-none-eabi/7.2.1/../../../../arm-none-eabi/bin/ld: region `FLASH_TEXT' overflowed by 11736 bytes
collect2: error: ld returned 1 exit status
make: *** [Makefile:490: firmware] Error 1

What version do you use?

See here.

Perfect, thanks