Minimum RAM Capacity required for OpenCV

I am working on a project involving Raspberry Pi and OpenCV, the project is a robotic arm that sorts objects based on their color. I experimented with OpenCV on my laptop but have no experience working on Raspberry Pi.

Now I want to buy a Raspberry Pi and I am not sure what are the minimum requirements for such a project? Will a Raspberry Pi 4 model B with 2G RAM be enough? Or should I go with 4G or 8G?

I am also planning to buy Raspberry Pi camera module 2 which is an 8 Megapixel and supports 1080p30, 720p60, and 640x480p90 video.

I am on a tight budget, so I want to spend as little as possible.

I appreciate anyone with expereince to share his/her thoughts on this subject.

I use a 4GB model and haven’t run into any issues yet.

If compiling OpenCV yourself then you will run into problems on the 2GB model as it doesn’t have enough memory to compile OpenCV. To work around such problems you need to compile with a single thread, ie: make -j 1 and increase temporary the swap file.

If compiling Python bindings then the above work arounds are also required on the 4GB model.

However the price difference between 2GB and 4GB models is not much so better going for the 4GB model and save any hassle.

1 Like