Hi @andreahmed , and welcome to opencv forum!
There is anotherquestion on OpenCV on MCU with an interesting article.
As far as I know, if you can install Linux, you can compile OpenCV. Using Embox you can avoid using the heavy Linux kernel.
While compiling OpenCV, you should pick only the libraries you need to reduce compiled binary size.