Install OpenCV on Raspberry Pi and C++ Python Sample

preview_player
Показать описание
This video will show you how to install opencv on raspberry pi and use C++ and Python to create a OpenCV sample on Raspberry Pi to capture video.
#Device: Raspberry Pi 3.
#Create OpenCV project on Raspberry C++ and Python
#OS: Linux
#Program language: #Python, #C++
#Camera: USB webcam
#C++ #OpenCV #Complie: g++ $(pkg-config --cflags --libs opencv) %e %f
Рекомендации по теме
Комментарии
Автор

Hi there,

I have tried to compile OpenCV 3.2 onto my pi Zero W Board running Stretch and i'm using a 16GB SD Card (running SSH on Mac and Python 2.7).

Running make to compile openCV takes over 9 hours to get to 83% at which point it just freezes (gets stuck) with no further progress. I am sure of this as I have left it for a good half hour and still no progress. I left it over night the first time and got the error: connection to host 192. ...: broken pipe". But that takes a good hour or so to even spit that out. It just seems to hang at 83% with no error or indication and it's happened both times I have tried all the installation processes from the beginning (By deleting the openCV folder completely in VNC) and starting again. Even when I try to continue build by changing to the build directory on the pi it continues from where it left off (i.e. 83%) but gets stuck at the same point.
Based on a lot of deep googling I have tried the following:
- Deleted wolfram and Libre Office from the pi to open up a further 1GB of space on the pi. (so its not a memory issue, currently has 6GB free). I have run the free command and get the following:

total used free shared buff/cache available
Mem: 493252 76112 183252 3748 233888 359460
Swap: 102396 476 101920

- Adjusted the GPU_mem to 16 so I could maximise ram usage. Doing this I noticed my swap memory usage went up from 0 to 476 (above) when trying to run make from 83% again..not sure if thats a good thing..is this the best setting?
- I noticed that I had the camera plugged into the pi during the whole process which seemed to be the issue for some people and tried again without the camera plugged in but no luck. I further checked config.txt to ensure x=0 not x=1 to ensure camera is definitely not enabled and GPU is set at 16.

Anyody have any ideas what could be causing this and why its not completing the build? and how I could fix this?? There's not much on the internet its just from what I've been able to gather from online forums and comments and I have been stuck on this for a few days now and I need to get it working for my uni project and its so frustrating :( I am a beginner with using the raspberry pi so any help would be greatly appreciated!

The build gets stuck at the following line:
[ 83%] Building CXX object

Thanks in advance
Amir

agh
Автор

I want to install the 3.4.4 version of OpenCV, so i just need to follow your steps but with that version?

Rafa
Автор

Does this config work if I am trying to use Aruco library? Aruco is in the contrib modules?

SuhailPrasathong
Автор

how can I mount the usbmem that command not working

mohamadalsadi
Автор

When I install the open cv, how to use the cmake -D CMAKE_BUILD_TYPE=RELEASE. i try to input and show the error:

CMake Error: The source directory does not exist.

Please help.

Thank you

tonylai
Автор

Thanks for share! I have a question. Do you have some thing to say about performance using opencv C++ or Python in Raspberry?

andersonmadureira
Автор

HI. I can't get an instruction. Can you post it again somewhere else?

taylandaribaev
Автор

sudo mount /dev/your-dev-name /home/pi/usbmem

do not work
mount: special device /dev/your-dev-name does not exist

mohamadalsadi
Автор

make -j4 command gave me error .
So tried make -j2 instead of 4 cores and it worked on my raspberry pi 2

gshan
Автор

"the link not worke"This item might not exist or is no longer available

sojoodjamal
Автор

Thank u Jacky Le . I'm successful .

tingyuyan