Ask Your Question

[Noobie] Do I need to complie OpenCV to do anything?...

asked 2018-01-07 14:03:46 -0500

Greetings, I wish to use OpenCV to do image opencv with an Raspberry Pi Zero W. I wish to create custom haar cascades for various brands or logos. I'm currently in the process of installing and configuring OpenCV on the Rpi Zero. All the tutorials say I need to compile OpenCV, which will take around 10 hours!

My question is can I compile OpenCV on my powerful desktop to create the haar cascades. Then just use like the python-opencv package or library on the Rpi? I saw one suggestion to install opencv via conda and pip. (Despite that being 64 bit.)


edit retag flag offensive close merge delete


Nope, cross compiling is a hassle and never really works. You will just have to put it on, and continue working the next day.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-01-08 03:38:40 -0500 )edit

I don't believe I'm talking about cross compiling exactly except for conda.

I got many error 2s while compiling on the rpi. I got up to 50%. But one "solution" I found for the next issue broke my make files or something so it's back to square one. fubar type of situation. I can only expect my next attempt to do the same. gravatar ( 2018-01-08 05:27:33 -0500 )edit I haven't attempted pi zero(i'm too lazy). You can install OpenCV and then download zip and run it. If you see 4 errors on prompt or debug window, just ignore it.

You can run on pc desktop. You must burn img on dvd or cd.

supra56 gravatar imagesupra56 ( 2018-01-08 10:00:55 -0500 )edit

If you want to compile. Kindly, use make J1 not j2 or j4. Using make j1 will take about 3 hrs

supra56 gravatar imagesupra56 ( 2018-01-08 10:29:40 -0500 )edit

" I wish to create custom haar cascades for various brands or logos" -- just saying, use your pi for detecting things, but train on a beefy pc, not a raspi.

berak gravatar imageberak ( 2018-01-08 11:39:30 -0500 )edit

@berak. Can do both pc and mac.

supra56 gravatar imagesupra56 ( 2018-01-08 14:02:31 -0500 )edit

@supra56 please stop. @berak yep. gravatar ( 2018-01-08 17:40:38 -0500 )edit

@supra56, can you please stop your comments, adding j1 is just plain stupid, you literally tell it to use a single core, but it does that by default. Also most of your comments make no sense at all.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-01-09 03:06:30 -0500 )edit

1 answer

Sort by ยป oldest newest most voted

answered 2018-01-09 17:40:59 -0500

updated 2018-01-09 17:42:12 -0500

For what it is worth. This tutorial worked for me: Used just make instead of any arguments. The swap is a must. OpenCV took 1 & 1/2 days to compile. OS is 10GB total in disk space with the DE. I will be cloning this OS :D

edit flag offensive delete link more


The compilation time is of course related to what you want to build in. What I mostly do is compile a lightweight OpenCV, only containing the modules I actually need. You can then prototype on desktop with full OpenCV, and make your tiny version on the pi to verify it.

StevenPuttemans gravatar imageStevenPuttemans ( 2018-01-10 02:21:21 -0500 )edit
Login/Signup to Answer

Question Tools

1 follower


Asked: 2018-01-07 14:01:16 -0500

Seen: 137 times

Last updated: Jan 07 '18