Help installing Open CV

im at step to install opencv

cmake -D CMAKE_BUILD_TYPE=RELEASE \
                                -D CMAKE_INSTALL_PREFIX=/usr/local \
                                -D INSTALL_PYTHON_EXAMPLES=ON \
                                -D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-4.4.0/modules \
                                -D BUILD_EXAMPLES=ON ..
make -j $(nproc)

but when it installing like 20-30 min it’ll auto restart my raspberry pi and i can’t do the next step

**sudo make install && sudo ldconfig**
**sudo reboot**

in the end how to fix it
I’m using raspberry pi B model 4 8GB

Your Raspberry Pi should have adequate cooling. Use a heatsink and a fan if possible to prevent overheating.

1 Like

thanks you
now i have another problems it said make: *** [Makefile:166: all ] Error 2 what should i do to fix it

Hi Phitak,

Welcome to the forum! What Pi OS are you using? This guide of ours was made for Buster, if you are using Bookworm it may be a bit trickier.