0

I followed https://medium.com/@patrick_ryan/building-opencv-4-10-on-raspian-buster-and-raspberry-pi4-64669bd2eb74 to install open-cv on my raspberry pi.

On using the make -j4 command it took approx 2 hours to reach till 100% but after that the process never completed. I restarted the pie again and ran the same command but still, it gets stuck at 100%. What should I do?Sreenshot of my terminal

  • 2
    Please don't post pictures of text. Instead paste the text output direct into the question. – Ingo Sep 8 '19 at 10:49
  • The link you have given is wrong. – Ingo Sep 8 '19 at 10:57
  • This is the link. medium.com/@patrick_ryan/… – Nitesh Singh Sep 8 '19 at 19:15
  • Please edit your question and correct the link there. And please take the short Tour and visit the Help Center to get an idea how things work here. – Ingo Sep 8 '19 at 22:50
  • I have down voted the question because the important link is still wrong. – Ingo Sep 27 '19 at 17:36
3

You don't tell us why do you want to compile OpenCV from source so I assume it is not necessary. We have seen many problems on this site doing it. You also try to compile for python version 2. This is nowadays only used for backward compatibility. It is strongly recommended to use up to date python3.

OpenCV is part of the default raspbian repository. Just installing it with apt works out of the box. How to do it you can look at Pre-Built openCV on raspbian Buster.

| improve this answer | |
  • I have to use open cv in my Geany Editor using C++. Am able to import cv2 in python and no error is shown. But how do I set the OpenCv path for my Geany. Because the tutorial which am following is showing multiple include files which are not present in my open cv folder. – Nitesh Singh Sep 8 '19 at 19:06
  • @NiteshSingh Please edit your question and add the additional information from the comment to it. – Ingo Sep 8 '19 at 22:52
1

If the build process doesn't throw an error and keeps the CPU busy, I'd assume it's still working. I never tried to build OpenCV, but 2 hours doesn't seem like an extraordinary time. Building Firefox on an RPi 4 takes more than that.

If you didn't install any cooling, a thermally throttled CPU can take days to build something substantial. Running at extreme temperatures will also damage the board sooner or later.

Since you have restarted the system while a build was in progress, I'd recommend cleaning it up (make clean, or just scrap the whole folder and start from scratch) before you re-attempt a build.

| improve this answer | |
0

Sorry, I couldn't follow the link. Compiling OpenCV from source may run into swap file limits. Check the value of the CONF_SWAPFILE in the file /etc/dphys-swapfile. You may want to increase it because the default Raspbian Buster setting (as before) is 100.

| improve this answer | |
0

It can be difficult installing opencv on raspberry pi. A couple suggestions:

1) Use make instead of make -j4.

2) If suggestion 1 doesn't get you passes the ram stall; Try building with different opecv version. I generally get better results on the RPI when building with versions 3.4.

3) Make sure swap ram is configured properly. Adjusting the Swappiness could also help.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.