Covert Image to matrix

Hello everyone! I want Image to dehazing processing,need covert image pixel value to matrix .But when run the script,the error information as show,had any method to finish this function.Thanks kindly support!
%(2JQYGJOFV_T~NC(YJW1X8.png
![5Q(`H8DFOX9MWWPZ_13KJ7.png|382x436

Hi, the python interface isn’t really meant for pixel level manipulation. You should write your code in C instead. There’s no way you can fit an image in the small heap space available in C. Most of the memory on the MCU is not accessible in Python world.

What algorithm are you trying to do by the way? Dehazing? Does that mean image sharpening? We have that built-in already.

Thanks K kwagyeman,I will be try.