You are on page 1of 67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Navigation

HowtoinstallOpenCV3onRaspbianJessie
byAdrianRosebrockonOctober26,2015inOpenCV3,RaspberryPi,Tutorials

Like

126

13

AfewweeksagoRaspbianJessiewasreleased,bringinginatonofnew,greatfeatures.
However,theupdatetoJessiealsobrokethepreviousOpenCV+PythoninstallinstructionsforRaspbian
Wheezy:
InstallOpenCV2.4withPython2.7bindingsonRaspbianWheezy.
InstallOpenCV3.0withPython2.7/Python3+bindingsonRaspbianWheezy.
SincePyImageSearchhasbecometheonlinedestinationforlearningcomputervision+OpenCVonthe
RaspberryPi,IdecidedtowriteanewtutorialoninstallingOpenCV3withPythonbindingsonRaspbian
Jessie.
Asanadditionalbonus,IvealsoincludedavideotutorialthatyoucanusetofollowalongwithmeasIinstall
OpenCV3onmyownRaspberryPi2runningRaspbianJessie.
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

1/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Thisvideotutorialshouldhelpaddressthemostcommonquestions,doubts,andpitfallsthatarisewheninstalling
OpenCV+PythonbindingsontheRaspberryPiforthefirsttime.

Assumptions
ForthistutorialIamgoingtoassumethatyoualreadyownaRaspberryPi2withRaspbianJessieinstalled.
Otherthanthat,youshouldeitherhave(1)physicalaccesstoyourPi2andcanopenupaterminalor(2)remote
accesswhereyoucanSSHin.IllbedoingthistutorialviaSSH,butaslongasyouhaveaccesstoaterminal,it
reallydoesntmatter.

Thequickstartvideotutorial
Beforewegetthistutorialunderway,letmeaskyoutwoquickquestions:
1.IsthisyourfirsttimeinstallingOpenCV?
2.AreyoujustgettingstartedlearningLinuxandhowtousethecommandline?
Ifyouansweredyestoeitherofthesequestions,Ihighlysuggestthatyouwatchthevideobelowandfollowalong
withmeasaguideyoustepbysteponhowtoinstallOpenCV3withPythonbindingsonyourRaspberryPi2
runningRaspbianJessie:

Otherwise,ifyoufeelcomfortableusingthecommandlineorifyouhavepreviousexperienceusingthecommand
line,feelfreetofollowthetutorialbelow.

InstallingOpenCV3onRaspbianJessie
InstallingOpenCV3isamultistep(andeventimeconsuming)processrequiringyoutoinstallmany
dependenciesandprerequisites.Theremainderofthistutorialwillguideyoustepbystepthroughtheprocess.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

2/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Tomaketheinstallationprocesseasier,Iveincludedtimingsforeachstep(whenappropriate)soyouknowwhen
tostickbyyourterminal,grabacupofcoffee,orgoforanicelongwalk.
IfyoureanexperiencedLinuxuserorhavealreadyinstalledOpenCVonaRaspberryPi(oranotherother
system)before,youcanlikelyjustfollowthestepsoutlinedbelow.
However,ifthisisyourfirsttimeinstallingOpenCV(oryoudonthavemuchpriorexposuretotheLinuxoperating
systemsandthecommandline),Ihighlyrecommendthatyouwatchthevideoaboveandfollowalongwith
measIshowyouhowtoinstallOpenCV3onyourRasberryPirunningRaspbianJessie.
Thatsaid,letsgetstartedinstallingOpenCV3.

Step#1:Installdependencies
Thefirstthingweshoulddoisupdateandupgradeanyexistingpackages,followedbyupdatingtheRaspberryPi
firmware.
Installing OpenCV 3 on Raspbian Jessie
1 $ sudo apt-get update
2 $ sudo apt-get upgrade
3 $ sudo rpi-update

Shell

Timing:3m33s
YoullneedtorebootyourRaspberryPiafterthefirmwareupdate:
Installing OpenCV 3 on Raspbian Jessie
1 $ sudo reboot

Shell

Nowweneedtoinstallafewdevelopertools:
Installing OpenCV 3 on Raspbian Jessie
1 $ sudo apt-get install build-essential git cmake pkg-config

Shell

Timing:51s
NowwecanmoveontoinstallingimageI/OpackageswhichallowustoloadimagefileformatssuchasJPEG,
PNG,TIFF,etc.:
Installing OpenCV 3 on Raspbian Jessie
1 $ sudo apt-get install libjpeg-dev libtiff5-dev libjasper-dev libpng12-dev

Shell

Timing:42s

Free21daycrashcourse
JustlikeweneedimageI/Opackages,wealsoneedvideoI/Opackages.Thesepackagesallowustoload
oncomputervision&
variousvideofileformatsaswellasworkwithvideostreams:
imagesearchengines
Installing OpenCV 3 on Raspbian Jessie
Interestedincomputervisionandimagesearch
1 $ sudo apt-get install libavcodec-dev libavformat-dev
libswscale-dev libv4l-dev
2 $ sudo apt-get install libxvidcore-dev libx264-dev engines,butdon'tknowwheretostart?Letme

Timing:58s

Shell

help.I'vecreatedafree,21daycrashcoursethat
ishandtailoredtogiveyouthebestpossible
introductiontocomputervision.Soundgood?Enter

WeneedtoinstalltheGTKdevelopmentlibrarysowecancompilethe highgui submoduleofOpenCV,which


youremailbelowtostartyourjourneytobecoming

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

acomputervisionmaster.

3/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

acomputervisionmaster.
allowsustodisplayimagestoourscreenandbuildsimpleGUIinterfaces:
Installing OpenCV 3 on Raspbian Jessie

EmailAddress

Shell

1 $ sudo apt-get install libgtk2.0-dev

Timing:2m48s

LET'SDOIT!

VariousoperationsinsideofOpenCV(suchasmatrixoperations)canbeoptimizedusingaddeddependencies:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ sudo apt-get install libatlas-base-dev gfortran

Timing:50s
Lastly,wellneedtoinstallthePython2.7andPython3headerfilessowecancompileourOpenCV+Python
bindings:
Installing OpenCV 3 on Raspbian Jessie
1 $ sudo apt-get install python2.7-dev python3-dev

Shell

Step#2:GrabtheOpenCVsourcecode
Atthispointwehaveallofourprerequisitesinstalled,soletsgrabthe 3.0.0 versionofOpenCVfromthe
OpenCVrepository.(Note:AsfutureversionsofOpenCVarereleasedjustreplacethe 3.0.0 withthemost
recentversionnumber):
Installing OpenCV 3 on Raspbian Jessie
1 $ cd ~
2 $ wget -O opencv.zip https://github.com/Itseez/opencv/archive/3.0.0.zip
3 $ unzip opencv.zip

Shell

Timing:2m29s
ForthefullinstallofOpenCV3(whichincludesfeaturessuchasSIFTandSURF),besuretograbthe
opencv_contribrepoaswell.(Note:Makesureyour opencv and opencv_contrib versionsmatchup,
otherwiseyouwillrunintoerrorsduringcompilation.Forexample,ifIdownloadv3.0.0of opencv ,thenIllwantto
downloadv3.0.0of opencv_contrib aswell):
Installing OpenCV 3 on Raspbian Jessie
1 $ wget -O opencv_contrib.zip https://github.com/Itseez/opencv_contrib/archive/3.0.0.zip
2 $ unzip opencv_contrib.zip

Shell

Timing:1m54s

Free21daycrashcourse
Step#3:SetupPython
oncomputervision&
ThefirststepinsettingupPythonforourOpenCVcompileistoinstall pip ,aPythonpackagemanager:
imagesearchengines
Installing OpenCV 3 on Raspbian Jessie
1 $ wget https://bootstrap.pypa.io/get-pip.py
2 $ sudo python get-pip.py

Timing:26s

Interestedincomputervisionandimagesearch

Shell

engines,butdon'tknowwheretostart?Letme
help.I'vecreatedafree,21daycrashcoursethat
ishandtailoredtogiveyouthebestpossible
introductiontocomputervision.Soundgood?Enter

IvediscussedbothvirtualenvandvirtualenvwrappermanytimesonthePyImageSearchblogbefore,especially
youremailbelowtostartyourjourneytobecoming
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

acomputervisionmaster.

4/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

acomputervisionmaster.
withintheseinstallationtutorials.InstallingthesepackagesiscertainlynotarequirementtogetOpenCVand
PythonupandrunningonyourRaspberryPi,butIhighlyrecommendthatyouinstallthem!

EmailAddress

Using virtualenv and virtualenvwrapper allowsyoutocreateisolatedPythonenvironments,separatefrom


yoursysteminstallofPython.ThismeansthatyoucanrunmultipleversionsofPython,withdifferentversionsof
LET'SDOIT!
packagesinstalledintoeachvirtualenvironmentthissolvestheProjectAdependsonversion1.x,butProject
Bneeds4.xproblemthatoftenarisesinsoftwareengineering.
Again,itsstandardpracticeinthePythoncommunitytousevirtualenvironments,soIhighlysuggestthatyou
startusingthemifyouarenotalready:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ sudo pip install virtualenv virtualenvwrapper


2 $ sudo rm -rf ~/.cache/pip

Timing:17s
After virtualenv and virtualenvwrapper havebeeninstalled,weneedtoupdateour ~/.profile fileand
insertthefollowinglinesatthebottomofthefile:
Installing OpenCV 3 on Raspbian Jessie
1 # virtualenv and virtualenvwrapper
2 export WORKON_HOME=$HOME/.virtualenvs
3 source /usr/local/bin/virtualenvwrapper.sh

Shell

Youcanuseyourfavoriteeditortoeditthisfile,suchas vim , emacs , nano ,oranyothergraphicaleditor


includedintheRaspbianJessiedistribution.Again,allyouneedtodoisopenthefilelocatedat
/home/pi/.profile andinsertthelinesaboveatthebottomofthefile.
Nowthatyour ~/.profile hasbeenupdated,youneedtoreloaditsothechangescantakeaffect.Toforcea
reloadofthe ~/.profile fileyoucan(1)logoutandlogbackin,(2)closeyourterminalandopenupanewone,
or(3)justusethe source command:
Installing OpenCV 3 on Raspbian Jessie
1 $ source ~/.profile

Shell

Note:Youlllikelyneedtorunthe source ~/.profile commandeachtimeyouopenupanewterminaltoensure


yourenvironmenthasbeensetupcorrectly.
ThenextstepistocreateourPythonvirtualenvironmentwherewellbedoingourcomputervisionwork:
Installing OpenCV 3 on Raspbian Jessie
1 $ mkvirtualenv cv

Shell

Theabovecommandwillcreateavirtualenvironmentnamed cv usingPython2.7.
IfyouwantPython3,runthiscommandinstead:
Installing OpenCV 3 on Raspbian Jessie
1 $ mkvirtualenv cv -p python3

Shell

Again,itsimportanttonotethatthe cv Pythonenvironmentisentirelyindependentfromthedefaultversionof
PythonincludedinthedownloadofRaspbianJesse.
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

5/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Ifyoueverrebootyoursystem,logoutandlogbackin,oropenupanewterminal,youllneedtousethe workon
commandtoreaccessthe cv virtualenvironment,otherwiseyoullbeusingthesystemversionofPython
instead:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ source ~/.profile
2 $ workon cv

Youcanensureyouareinthe cv virtualenvironmentbyexaminingyourcommandline.Ifyouseethetext(cv)
precedingyourprompt,thenyouareinthe cv virtualenvironment:

Figure1:Makesureyouseethe(cv)textonyourprompting,indicatingthatyouareinthecvvirtual
environment.

Otherwise,youarenotinthe cv virtualenvironment:

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

6/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Figure2:Ifyoudonotseethe(cv)textonyourprompt,thenyouarenotinthecvvirtualenvironment.

Ifthisisthecase,youneedtorunthe source and workon commandsabove.


Assumingthatyouareinthe cv virtualenvironment,wecaninstallNumPy,animportantdependency
whencompilingthePythonbindingsforOpenCV.Youmightwanttograbacupofcoffeeorgoforawalkwhile
NumPydownloadsandinstalls:
Installing OpenCV 3 on Raspbian Jessie
1 $ pip install numpy

Shell

Timing:16m10s

Step#4:CompileandinstallOpenCV
Atthispoint,wearereadytocompileOpenCV.
First,makesureyouareinthe cv virtualenvironment:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ workon cv

Followedbysettingupthebuild:
Installing OpenCV 3 on Raspbian Jessie
1 $ cd ~/opencv-3.0.0/
2 $ mkdir build
3 $ cd build
4 $ cmake -D CMAKE_BUILD_TYPE=RELEASE \
5
-D CMAKE_INSTALL_PREFIX=/usr/local \
6
-D INSTALL_C_EXAMPLES=ON \
7
-D INSTALL_PYTHON_EXAMPLES=ON \
8
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.0.0/modules \
9
-D BUILD_EXAMPLES=ON ..
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

Shell

7/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Update(3January2016):InordertobuildOpenCV 3.1.0 ,youneedtoset -D INSTALL_C_EXAMPLES=OFF


(ratherthan ON )inthe cmake command.ThereisabugintheOpenCVv3.1.0CMakebuildscriptthatcan
causeerrorsifyouleavethisswitchon.Onceyousetthisswitchtooff,CMakeshouldrunwithoutaproblem.
Beforeyoumoveontothecompilationstep,makesureyouexaminetheoutputofCMake!
Scrolldownthesectiontitled Python 2 and Python 3 .
IfyourecompilingOpenCV3forPython2.7,thenyoullwanttomakesurethe Python 2 sectionlookslike
this(highlighted)inred:

Figure3:EnsuringthatPython2.7willbeusedforthecompile.

Noticehowboththe Interpreter and numpy variablespointtothe cv virtualenvironment.


Similarly,ifyourecompilingOpenCVforPython3,thenmakesurethe Python 3 sectionlookslikethis:

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

8/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Figure4:EnsuringthatPython3willbeusedforthecompile.

Again,boththe Interpreter and numpy variablesarepointingtoour cv virtualenvironment.


Ineithercase,ifyoudonotseethe cv virtualenvironmentforthesevariablesMAKESUREYOUAREINTHE
cv VIRTUALENVIRONMENTPRIORTORUNNINGCMAKE!
Nowthatourbuildisallsetup,wecancompileOpenCV:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ make -j4

Timing:1h35m
The -j4 switchstandsforthenumberofcorestousewhencompilingOpenCV.Sinceweareusinga
RaspberryPi2,wellleverageallfourcoresoftheprocessorforafastercompilation.
However,ifyour make commanderrorsout,Iwouldsuggeststartingthecompilationoveragainandonlyusing
onecore:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ make clean
2 $ make

Usingonlyonecorewilltakemuchlongertocompile,butcanhelpreduceanytypeofstrangeracedependency
conditionerrorswhencompiling.
AssumingOpenCVcompiledwithouterror,allweneedtodoisinstallitonoursystem:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ sudo make install


2 $ sudo ldconfig
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

9/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Step#5:Finishingtheinstall
Werealmostthere!Justafewmorethingsandwellbe100%done.

ForPython2.7:
ProvidedyoufinishedStep#4withouterror,OpenCVshouldnowbeinstalledin
/usr/local/lib/python2.7/site-packages :
Installing OpenCV 3 on Raspbian Jessie
1 $ ls -l /usr/local/lib/python2.7/site-packages/
2 total 1636
3 -rw-r--r-- 1 root staff 1675144 Oct 17 15:25 cv2.so

Shell

Note:InsomeinstancesOpenCVcanbeinstalledin /usr/local/lib/python2.7/dist-packages (notethe distpackages ratherthan site-packages ).Ifyoudonotfindthe cv2.so bindingsin site-packages ,besureto
check dist-packages aswell.
ThelaststephereistosymlinktheOpenCVbindingsintothe cv virtualenvironment:
Installing OpenCV 3 on Raspbian Jessie
1 $ cd ~/.virtualenvs/cv/lib/python2.7/site-packages/
2 $ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so

Shell

ForPython3:
OpenCVshouldnowbeinstalledin /usr/local/lib/python3.4/site-packages :
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ ls /usr/local/lib/python3.4/site-packages/
2 cv2.cpython-34m.so

Forsomereason,unbeknownsttome,whencompilingthePython3bindingstheoutput .so fileisnamed


cv2.cpython-34m.so ratherthan cv2.so .
Luckily,thisisaneasyfix.Allweneedtodoisrenamethefile:
Installing OpenCV 3 on Raspbian Jessie
1 $ cd /usr/local/lib/python3.4/site-packages/
2 $ sudo mv cv2.cpython-34m.so cv2.so

Shell

FollowedbysymlinkingOpenCVintoour cv virtualenvironment:
Installing OpenCV 3 on Raspbian Jessie
1 $ cd ~/.virtualenvs/cv/lib/python3.4/site-packages/
2 $ ln -s /usr/local/lib/python3.4/site-packages/cv2.so cv2.so

Shell

Step#6:VerifyingyourOpenCV3install
Atthispoint,OpenCV3shouldbeinstalledonyourRaspberryPirunningRaspbianJessie!
Butbeforewewrapthistutorialup,letsverifythatyourOpenCVinstallationisworkingbyaccessingthe cv
virtualenvironmentandimporting cv2 ,theOpenCV+Pythonbindings:
Installing OpenCV 3 on Raspbian Jessie

Shell

1 $ workon cv
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

10/67

6/17/2016

2
3
4
5

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

$ python
>>> import cv2
>>> cv2.__version__
'3.0.0'

Youcanseeascreenshotofmyterminalbelow,indicatingthatOpenCV3hasbeensuccessfullyinstalled:

Figure5:OpenCV3+Python3bindingshavebeensuccessfullyinstalledonmyRaspberryPi2running
RasbianJessie.

Troubleshooting
Q.WhenItrytousethe mkvirtualenv or workon commands,Igetanerrorsayingcommandnotfound.
A.GobacktoStep#3andensureyour ~/.profile filehasbeenupdatedproperly.Onceyouhaveupdatedit,
besuretorun source ~/.profile toreloadit.
Q.AfterIreboot/logout/openupanewterminal,Icannotrunthe mkvirtualenv or workon commands.
A.Anytimeyourebootyoursystem,logoutandlogbackin,oropenupanewterminal,youshouldrun source
~/.profile tomakesureyouhaveaccesstoyourPythonvirtualenvironments.
Q.WhenIopenupaPythonshellandtype import cv2 ,Igetthedreaded ImportError: No module named cv2
error.
A.Thereasonforthiserrorishardtodiagnose,mainlybecausetherearemultipleissuesthatcouldbecausing
thisproblem.Forstarters,makesureyouareinthe cv virtualenvironmentusing workon cv .Ifthe workon
commandisgivingyouproblems,thenseethepreviousquestionsinthissection.Fromthere,youllwantto
investigatethe site-packages directoryofyour cv virtualenvironmentlocatedin
~/.virtualenvs/cv/lib/python2.7/site-packages/ or ~/.virtualenvs/cv/lib/python3.4/site-packages/ ,
respectively.Makesurethatthesymlinkpathtothe cv2.so fileisvalid.Ifyoudonotknowhowtodo
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

11/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

this,pleaseconsultthevideotutorialatthetopofthispost.

So,whatsnext?
Congrats!Youhaveabrandnew,freshinstallofOpenCVonyourRaspberryPiandImsureyourejustitching
toleverageyourRaspberryPitobuildsomeawesomecomputervisionapps.
ButImalsowillingtobetthatyourejustgettingstartedlearningcomputervisionandOpenCV,andyoure
probablyfeelingabitconfusedandoverwhelmedonwhereexactlytostart.
Personally,Imabigfanoflearningbyexample,soagoodfirststepwouldbetoreadthisblogposton
accessingyourRaspberryPiCamerawiththe picamera module.Thistutorialdetailstheexactstepsyouneedto
taketo(1)capturephotosfromthecameramoduleand(2)accesstherawvideostream.
Andifyourereallyinterestedinlevelingupyourcomputervisionskills,youshoulddefinitelycheckoutmybook,
PracticalPythonandOpenCV+CaseStudies.Mybooknotonlycoversthebasicsofcomputervisionandimage
processing,butalsoteachesyouhowtosolverealworldcomputervisionproblemsincludingfacedetectionin
imagesandvideostreams,objecttrackinginvideo,andhandwritingrecognition.

AllcodeexamplescoveredinthebookareguaranteedtorunontheRaspberryPi2andPi3aswell!Most
programswillalsorunontheB+andZeromodels,butmightbeabitslowduetothelimitedcomputingpowerof
theB+andZero.
SoletsputyourfreshinstallofOpenCVonyourRaspberryPitogoodusejustclickheretolearnmore
abouttherealworldprojectsyoucansolveusingyourRaspberryPi+PracticalPythonandOpenCV.

Summary
InthislessonwelearnedhowtoinstallOpenCV3withPython2.7andPython3bindingsonyourRaspberryPi2
runningRaspbianJessie.Iprovidedtimingsforeachstepsoensureyoucanplanyourinstallaccordingly.
ItsalsoworthmentioningthatIprovideOpenCVv2.4andv3installinstructionsforRaspbianWheezyinthe
followingposts:
InstallOpenCV2.4withPython2.7bindingsonRaspbianWheezy.
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

12/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

InstallOpenCV3.0withPython2.7/Python3+bindingsonRaspbianWheezy.
Ifyourunintoanyissuesduringtheinstallationprocess,pleaseseetheTroubleshootingsection
above.Additionally,Iwouldsuggestwatchingthevideotutorialatthetopofthisposttoaidyouinthesetup
process.

Beforeyougo
ItendtocoveralotofgreatcomputervisionprojectsusingOpenCVandtheRaspberryPi,soconsiderentering
youremailaddressintheformbelowtobenotifiedwhenthesepostsgolive!

ResourceGuide(itstotallyfree).

Enteryouremailaddressbelowtogetmyfree11pageImageSearchEngine
ResourceGuidePDF.UncoverexclusivetechniquesthatIdon'tpublishonthis
blogandstartbuildingimagesearchenginesofyourown!
Youremailaddress
DOWNLOADTHEGUIDE!

install,opencv3.0,pi2,python2.7,python3.4,raspberrypi,tutorials
Analyzing91yearsofTimemagazinecoversforvisualtrends

WatershedOpenCV

274ResponsestoHowtoinstallOpenCV3onRaspbianJessie
AnastasiosSelalmazidisOctober26,2015at12:56pm#

REPLY

GreatguideAdrian.Iwaslookingforwardforthis.Workedlikeacharmforpython2.7.
Iamgoingtoinstallitnowforpython3.
Thankyou!!!

AdrianRosebrockOctober27,2015at4:52am#

REPLY

Awesome,ImgladitworkedforyouAnastasios!

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

13/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AldiDecember9,2015at11:54pm#

REPLY

HelloAdrianthanksforyourtutorialitwasgreat.IvejustfollowedtroughyourguideandIam
abletodotheexamplefromyoursitebutHowcanIruntheexamplefromtheopencv?
Thankyouforyourattention

AdrianRosebrockDecember10,2015at6:50am#

REPLY

HeyAldi,ImnotsurewhatyoumeanbyruntheexamplefromOpenCV?Mosttutorialson
thisblogpostassumeyouareexecutingaPythonscriptviacommandlineargument.Iwouldsuggest
goingthroughamorerecentpost,likethisononpedestriandetectiontoseehowPythonfilesare
createdandexecuted.Alternatively,ifyourejustgettingstartedusingPythonandOpenCV,Practical
PythonandOpenCVwouldbeagoodstart.

SupraOctober28,2015at6:30am#

REPLY

ItworkedforModelB+w/outusingvirtualenvwrapperbyusingpython3merely.

AdrianRosebrockNovember3,2015at10:40am#

REPLY

AsImentionedinthepost,usingvirtualenvironmentsisentirelyoptional.ButIdohighly
recommenditforPythondevelopment.

MichaelNovember4,2015at12:24am#

REPLY

check.ThanksMaestro!

BrianNovember4,2015at9:03pm#

REPLY

WhenItrytounzipOpenCVitgetsabouthalfwaythroughandthenIgetawriteerror,askingifmy
diskisfull.Thisisabrandnew16gigclass10microSDwithJessieinstalled.Itcantpossiblybefullalready.I
triedthewgetagainthinkingthedownloadwascorruptbutitstillgivesmeawriteerror.Anyideas?

Ahha!Iwasabletosuccessfullyunzipopencv.
Acriticalstepthatyoumightwanttomentionbeforerunningtheunzipopencv.zipcommand:
NavigatetotheRaspberryPiConfigurationToolandselectEXPANDFILESYSTEM
Hopethathelpssomeone!

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

14/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockNovember5,2015at6:38am#

REPLY

ThanksforthetipBrian!I(incorrectly)madetheassumptionthateveryonehadalready
expandedtheirfilesystemsfully.

MattNovember21,2015at12:55pm#

REPLY

Hi,
MyRaspberryPi2wontallowmetoexpandthefilesystemlikeBrianmentioned.IusedNOOBSto
installRaspbianJessieandamusingan8GBmicroSDbutonly1GBisavailableoncetheoperating
systemisinstalled.
Anyhelpwouldbemuchappreciated
Matt

AdrianRosebrockNovember22,2015at7:18am#

REPLY

Normallytoexpandthefilesystemallyouneedtodoisrunraspiconfig,selectthefirst
optiontoExpandfilesystem,andreboot.Thatshouldexpandyour8GBcard.Makesureyou
rebootafterrunningthecommand.Ifyourestillnotgettingyourfilesystemexpanded,either(1)
yourfilesystemhasalreadybeenexpandedor(2)somethingveryoddisgoingonandyou
shouldconsulttheRaspberryPidocumentation.

RogerJanuary6,2016at8:07am#

REPLY

HowdyMatt
IranintothesameissueyouexpereinednotbeingabletoexpandthememoryonSDcard
runningNOOBSversionforrsapi.
So,IdecidedtodirectlyddthersapianoswithoutalltheootherosesontoSDCard.Isuggestthis
toyou,too.
JustdownloadtheraspianosandcopyviaddcommandinLinuxCLIorwithanadditional
softwareunderwindowssorryIamnotawareofagoodonesinceIamnotworkingwithwindows.
Googlemayhelphere.
Regards,
Roger

MattJanuary20,2016at10:58am#
HiRoger,
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

15/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

YesIhavedonethesameanditworksnow.
Thanks
Matt

KevinFebruary8,2016at12:50pm#

REPLY

Areyousureyoureusingtheentire16GB?Haveyouexpandedtherootpartition,orareyou
runningJessiefromtheinstallerimage?Seehttps://coderwall.com/p/mhj8jw/raspbianhowtoresizethe
rootpartitiontofillsdcardorothersonhowtogetthefull16GB

SigiNovember15,2015at4:54pm#

REPLY

HiAdrian,
thankyouforthisgreattutorialitworkedlikeacharmrpi2jessipython3opencv3
Ihaveascriptforcircledetectionthatrunswellonrpi2wheezypython2opencv2.
butwithopencv3itcrashesattheline:
wp=
cv2.HoughCircles(blurred,cv2.cv.CV_HOUGH_GRADIENT,1,75,param1=50,param2=12,minRadius=7,maxRadius=9))

withthiserrormessage:
AttributeError:moduleobjecthasnoattributecv
WhatcanIdo?
Thanksinadvance
Sigi

AdrianRosebrockNovember16,2015at3:35pm#

REPLY

ForOpenCV3,youllneedtochangecv2.cv.CV_HOUGH_GRADIENTto:cv2.HOUGH_GRADIENT.

SigiWeichenriederNovember17,2015at4:01pm#

REPLY

HiAdrian,
thatworked:))Thankyou!!!!!!!!!!!!!!!!!!!!
Sigi

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

16/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockNovember18,2015at6:26am#

REPLY

Awesome,ImgladitworkedSigi!

kkNovember20,2015at6:21am#
Hi,Itriedhttps://www.pyimagesearch.com/2014/07/14/3wayscomparehistograms
usingopencvpython/withrpi2jessipython2.7opencv3.0installationasguidedinthis
post.
(Correlation,cv2.cv.CV_COMP_CORREL)
throwserrormessage:
AttributeError:moduleobjecthasnoattributecv
Issimilarchangerequired?But,
(Correlation,cv2.CV_COMP_CORREL),
throwserroreither:
AttributeError:moduleobjecthasnoattributeCV_COMP_CORREL

AdrianRosebrockNovember20,2015at6:36am#
Tryusingcv2.HISTCMP_CORREL.

NichtenNovember16,2015at6:49pm#

REPLY

HelloAdrian,
IhavesuccessfullyinstalledOpenCV3withPython3.4onRaspbianJessie.thank,youforyourgreatwork:).
ButIhavesomeproblemwithpackagepythonserial.Howtoinstallitinvirtualenvwithpython3?Itype
commandworkoncvandImtryingtoinstallit,buttheOSreturninformationthatitisalreadyinstalled.ButI
cantimportserialinpython3.Icandoitwithpython2.WhatImdoingwrong?
~Nichten

AdrianRosebrockNovember17,2015at6:21am#

REPLY

CongratsongettingOpenCV3installed,thatsgreat!Ipersonallyhavenotusedpythonserial
beforesoIamunfamiliarwithit.IbelieveinWheezythatyouhadtoinstallandrunitasroot,butwith
Jessieyoucaninstallitandrunitasasnormaluseristhatcorrect?
Itsoundslikeyoumayhaveinstalledpythonserialviaaptgetwhichiswhyitsnotworkingforyou.Ifyou
do:

1 $ workon cv
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

17/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

2 $ pip install pyserial

Itshouldworkforyou.

DeepakJanuary11,2016at11:25pm#

REPLY

HelloAdrian,
Iamalsofacingthesameissuewithserialmodule.Ihavetriedpipinstallpyserial.EventhenIamnot
abletoimporttheserialmoduletocvvirtualenv.Outsidethevirtualenv,serialmoduleisworkingfine.
Pleaseadvice.

AdrianRosebrockJanuary12,2016at6:26am#

REPLY

SinceIamnotapyserial/GPIOuser,Imhonestlynotsureabouttheproblem.Iveadded
thistomyqueueasapotentialnewblogposttohelpresolvetheissue.

YvderFebruary23,2016at5:12pm#
Please,havesomeonegottheissuefixed?Iamfacingthesameissuewithpyserial
inCVvirtualenv.
Thanks.

EddieMitchellNovember19,2015at12:42am#

REPLY

Beautifulwalkthrough.workedlikeacharmandimsuperexcitedtodiveintocomputervision.getting
yourbook[s]forchristmas!keepuptheawesomeworkAdrian!

AdrianRosebrockNovember19,2015at6:17am#
ThanksforthekindwordsEddie!

REPLY

Imgladthetutorialworkedforyou.

kkNovember20,2015at8:03am#

REPLY

HelloAdrian,
Thanksforthegreatwork.WithmyinstallationofOpenCV3.0withPython2.7onRaspbianJessie,Im
runningyourblogcodesonebyone.Imreallyenjoyingit.
ButIhaveaproblemwithinstallingscipy.pipinstallnumpyworks,butpipinstallscipyisfailed.Iwonderif
Imtheonlyonewhoissufferingfromtheproblem.
Itwouldbegreatlyappreciatedifyoucouldhelpme.Thanksinadvance.
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

18/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockNovember20,2015at8:50am#

REPLY

DidyougetanerrormessagewheninstallingScipy?AndwhichRaspberryPimodelareyou
using?

arminNovember21,2015at2:22pm#

REPLY

Hello
Thanksforyourtutorials,accordingtotheseinstructionsImtryingtobuildandcompileopencv3onRPI2
runningubuntumate15.10,butimfacingthiserrorincompilationstep:
makefile:136recipefortargetallfailed
error2

AdrianRosebrockNovember22,2015at7:17am#

REPLY

HeyArminthistutorialisdedicatedtoinstallingOpenCVonRaspbianJessie.Theoreticallythe
samestepscanbeappliedtoUbuntuMate,butIhavenotpersonallytriedthemonUbuntuMatebefore.If
youregettinganerrorwhenrunningthemakecommand,moretimesthannotitsduetoamissing
dependency.Makesureyouhaveranallofthepreviousaptgetcommandstopullintherequired
prerequisites.

MarijnDecember31,2015at6:11am#

REPLY

Iranintoasimilarerrorwhenmakingwithmakej4onanPiB+.Ithendidmakecleanfollowed
bythenormalmakecommand.Itookanother10+hours,butfinishedwithouterrorsafterthat.Andwas
abletofinishtheguide.

AdrianRosebrockDecember31,2015at6:54am#

REPLY

IfyoureusingaB+,thendefinitelyonlyusemakeinsteadofmakej4.TheB+doesnothave
fourcoreslikethePi2doessoitmakesrunningintodependencyissuesduringcompilealotmore
likely.

NicoNovember22,2015at6:28am#

REPLY

HelloAdrian
Thanksforyourgreatwalkthroughsandtutorials.IsuccessfullyinstalledOpenCV3andPython3onmyPi2
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

19/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

withcameramoduleandstep6ofthispostreturnstheexpectedresults.
WhenItriedtorunthebasicmotiondetectionscriptfromyourarticle
(http://www.pyimagesearch.com/2015/05/25/basicmotiondetectionandtrackingwithpythonandopencv/)
nothinghappend.Icreatedthescript,openedcommandline,changedtothevirtualenvcvandtriedtorunthe
scriptwiththiscommand:pythonbasic_motion.pyAfterhittingexecutenothinghappensfor2secondsand
thenanewcommandlineshowsupwaitingforinput.Nowindowsappeartoshowmethelivecameraview.
The2secondsgapisprobablythetimeittakestoimportOpenCV.Itriedtorunthecommandassudo,Ihave
giventhescriptdifferentpermissionsandIhavechangedsomecode.Sadlynothinghelpedtosolvemy
problem.Commandsasraspistillworkperfectlynicesotherecan_tbeanycameraissues.
FYIIamworkingwiththePisGUIandnotviaSSH.
Iwouldgreatlyappreciateyourhelp.Thanksinadvance.

AdrianRosebrockNovember22,2015at7:14am#

REPLY

Thebasicmotiondetectionscriptusesthecv2.VideoCapturefunctionwhichcanrequire
additionaldriversforthePi.Irecommendusingthispostformotiondetectionsinceitis100%outofthe
boxworkablewiththePiandthePicameramodule.

NicoNovember22,2015at9:47am#

REPLY

ThanksAdrianthehomesurveillancetutorialworkslikeacharm!

AdrianRosebrockNovember23,2015at6:39am#

REPLY

Awesome,ImgladtohearitNico!

GaryNovember25,2015at1:40pm#

REPLY

Help!IjustupgradedtoJessie,andsomethingbrokeonthepreviouslystablevirtualenvironmentI
setupusingyourinstructionsforPython2.7,OpenCV2.XandWheezy.
TheupgradetoJessieseemedtogowell,butIamnowseeingsomethingbrokenwiththevirtual
environment.Symptom:
1.IfItryandexecuteanypythoninthevirtualenvironmentIhadpreviously,pythonimportfails.Forinstance,
tryingtoimportdiatomiteisfailing.
2.IfIgointoPython,andmanuallyimportdatetime,itfails.
3.IfIamNOTinthevirtualenvironment,andgointoPython,Icanimportdatetimejustfine.
HowcanIrepairthevirtualenvironmenthere?DoIhavetogothroughallofthestepsabove,oraretheir
shortcutsthatarefasterandsimpler?
ThanksAdrian!!
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

20/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockNovember25,2015at1:50pm#

REPLY

HeyGaryjusttoclarify,didyouupgradefromWheezytoJessie?Ordidyoudoafreshinstall
ofJessie?Imassumingtheformer.Unfortunately,Ihavenevertriedupgradingbefore,onlyinstallingona
freshOS.HopefullyanotherPyImageSearcherreadercanhelpyououtwiththisone!

GaryNovember25,2015at2:12pm#

REPLY

Iupgraded.Ifollowedallstepsherehttps://www.raspberrypi.org/forums/viewtopic.php?
f=66&t=121880&sid=e513ef7fd4458647baf1abc6ac1ae30ewhichseemstobewhatmostfolksare
pointingtoforthebestupgradepath.Theupgradeseemedtogowell.
Oneotherclueforanyreader..ifIloadthevirtualenvironment,andthenperformstep6aboveto
verifyalliswell,IgetanerrorfromPythonontheimportcv2statement:
ImportError:numpy.core.multiarrayfailedtoimport
Odd.IfIgoto~/.virtualenvs/cv/lib/python2.7/sitepackages,numpyisstillthere.
Makesmewonderifthebindings/symlinkissomehowtrashed?
hopingtoavoidhavingtoreinstalleverythingabove.Ifanyonehasanyexperienceonupgradinga
previouslystableWheezyvirtualenvironmenttoJessie,pleaseletmeknow.
Thanks

Onemorething,ifIgotocheckthelinkssetupinStep5theyarestillvalidandshowingappropriately
inthevirtualenvsdirectoryaswellaswhenusingthereadlinkcommand.Hmmmmmmm

AdrianRosebrockNovember26,2015at6:55am#

REPLY

Asyousuggested,itsoundslikeyoursymlinkshavebeendestroyed.Icantspeakforall
theotherpackagesonyoursystem,butforOpenCVyoushouldbeabletorecreatethemusing
thelncommandlikewedidinthistutorial.AtthatpointyoushouldhaveOpenCVback.
Ihatetosayit,butyoulllikelyneedtodoareinstall.Iveranintoissueswheremysymlinks
wheredestroyed(onOSX,notRaspbian)andeverysincethenIneveranupgradetothelatest
OS.IfIwanttoupgrade,Ihavetocommitfullyandreinstallfromscratch.Ittakesawhileanditsa
lotofeffort,butitsthebestguaranteethatyouredevelopmentenvironmentwillbe100%setup
correctly.

GaryLeeNovember26,2015at12:25pm#
Ahinttoothers.Ireinstallednumpyanditseemedtogeteverythingbackinorder.
Weird.Ialso(justtobesafe)decidedtostartfreshwithanewinstallofeverything.Thanksfor
agreattutorialforgettingthisdone.Ifothersdecidetofollowtheupgradepath,reinstalling
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

21/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

numpymaybethesolution.

RobJonesNovember28,2015at5:23pm#

REPLY

AdrianThisallworked*great*andIinstalledpicamera[array]inthecvvirtualenvIamableto
readimageframesfromthecamera,processthemandoutputthem
Imusingpython2.7
NowIwanttobringRPi.GPIOintothemixthatworksfinebyitselfoutsidethecvvirtualenvasJessie
includesRPi.GPIOv0.6.0a3bydefaultthisgivesyouaccesstotheGPIOpinswithouthavingtoberoot.
ButthecvvirtualenvdoesnotseethisandthelatestversionofRPi.GPIOavailablebypipis0.5.11which
wontcutit
HowcanIgetv0.6.0a3installedinthevirtualenv?
Compilefromsourceinsidethatenv?
Imnottotallyontopofpip/virtualenvssoImreluctanttojusttryit
Imhopingthatyouhavealreadydealtwiththis
thanks!
Rob

Ifiguredouttheanswertomyownquestion:^)
YoujustmanuallycopyoverthesystemRPipackagefilesintothevirtualenvironmentlikethis:
$cpr/usr/lib/python2.7/distpackages/RPi~/.virtualenvs/cv/lib/python2.7/site
packages/

AdrianRosebrockNovember29,2015at7:10am#

REPLY

HeyRobforfuturereferenceyoucanusepipandinstallitintoyourvirtualenvironment.This
isthepreferredmethodratherthancopyingfilesdirectly:
$pipinstallrpi.gpio

PhilipNovember29,2015at10:05am#

REPLY

HiAdrian,
Thankyouforyourexcellenttutorial.Everythingworkedperfectlyexceptforafewerrorsinstallingnumpy.
Uninstallingandreinstallingfixedthat.IalsoranoutofspacebuildingOpenCVasIwasusingNoobs.
FormattingtheSDcardandjustusingtheJessieimagefilefreedupenoughspacefortheinstall.
ImjustwonderingifyouhavehadanyexperiencewithdriversforwebcamsonthePi?WhenIuseanyofmy
webcamsandtrytoget/setattributessuchasCV2.CAP_PROP_FPS,Igetthefollowingerror:
VIDEOIOERROR:V4L:Property(16)notsupportedbydevice
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

22/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Ivegotthelibv4llibraryinstalledandtheWITH_LIBV4LbooleanissettoONintheopencvbuild
configuration.
IvegoogledbutIhaventcomeupwithanythingsofar.Weird!:/

AdrianRosebrockNovember30,2015at6:35am#

REPLY

HeyPhilipImsorrytosaythatIdonthavemuchexperienceusingwebcamdriversforthe
RaspberryPi.IeitherusetheactualPicameraboardoraLogitech920Cwhichworksoutofthebox.Be
suretocheckthispageofcompatibleUSBwebcamsfortheRaspberryPitoseeifthereareanyknown
issueswithit.

SKNovember29,2015at1:46pm#

REPLY

HiAdrian,
Thereisexcellentcontentonyourwebsitethanksyousomuch!
IhavearequestwillyoubeabletoprepareatutorialtoinstallOpenCVwithQT,VTK,andtheseadditional
performancelibraries(CUDA,etc)forRaspberryPi(allthatitcansupport)andlinuxcomputers?Thankyou
forallyoudo,Iamconsideringbuyingoneofyourpackages.
SK

AdrianRosebrockNovember30,2015at6:33am#

REPLY

ItssomethingthatIcancertainlylookinto.

rapNovember30,2015at10:19am#

REPLY

Thanksfortheinstructions!However,couldyoupleasetellifthiswillworkforC++aswellasIwonder
aboutthevirtualenvironmentpart?IfIinstallforPython3accordingtotheseinstructionsistheopencvlibrary
accessibleforC++fromthedefaultenvironmenttooorwhatshouldbedoneotherwise.Thanks!

AdrianRosebrockNovember30,2015at7:07pm#

REPLY

Onceyourunmakeinstall,youhaveOpenCVfullyinstalled(asfarasC++isconsidered).The
PythonvirtualenvironmentshavenoimpactontheC++installation.

rapNovember30,2015at7:27pm#

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

23/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Thanks!

MauDecember6,2015at11:14am#

REPLY

HiAdrian,mightIbeabletocompilingwithraspberryb+512?
Thanksforyourtutorials.
Mau

AdrianRosebrockDecember6,2015at11:18am#

REPLY

ThistutorialshouldworkwiththeRaspberryPiB+however,IhighlyencourageyoutouseaPi2
forcomputervision,especiallyifyouwanttodoanytypeofvideoprocessing.

BobDecember8,2015at7:30pm#

REPLY

IsitbadifIaccidentallyranmakecleanagainafterthelongmakeprocessbutcanceleditalmost
immediately?

AdrianRosebrockDecember9,2015at6:53am#

REPLY

Technicallyno,youcanjustrunmakecleanagainandletitfinishcleaningup.However,youwill
needtorunmakeagain.Justtobesafe,Iwouldsuggestdeletingyourbuilddirectory,recreatingit,and
thenrunningcmakejusttomakesureyouarestartingfresh.

BirkanDecember10,2015at12:33pm#

REPLY

canwedeleteopencv3.0.0andopencv_contrib3.0.0foldersaftersuccesfullinstallation?

AdrianRosebrockDecember10,2015at2:22pm#

REPLY

Yes,onceyouhaveOpenCVinstalledyoucansafelydeletetheopencv3.0.0and
opencv_contrib3.0.0directories.

BirkanDecember12,2015at4:44pm#

REPLY

Thanks..

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

24/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

mohamedaboamerDecember12,2015at6:50pm#

REPLY

itsaysnoenoughspacewhendownloadingopencv
(wgetOopencv.ziphttps://github.com/Itseez/opencv/archive/3.0.0.zip)

AdrianRosebrockDecember13,2015at7:31am#

REPLY

Ifyouregettinganerrorthatthereisnotenoughspacetodownloadthe.zipfile,thenyourmicro
SDcardisfilled.EitherdeleteunneededfilestomakeroomforOpenCVormakesureyouhavealready
ranraspiconfigtoensuretheentiremicroSDcardisavailableforusage.

BrianDecember12,2015at10:09pm#

REPLY

Justtoclarify,doesthisinstallation(OpenCV3.0.0,Jessie,RPI2)runtheOpenCVscriptsinmulti
coremode?

AdrianRosebrockDecember13,2015at7:29am#

REPLY

No,itdoesnotdirectlyleveragemultiplecores.Youllneedtowriteyourownscriptstodistribute
processestomultiplecores/threadsif.

FlorianDecember21,2015at9:31am#

REPLY

HelloAdrian,
thanksforthegreattutorial,butihaveproblemsbuildingwithGTK+support.Iinstalledallthelibrarysand
dependencies,buteverytimeirunthecmakecommanditremportsbackwithGTK+No.
Doyouhaveanyidea?
ThanksFlorian

AdrianRosebrockDecember21,2015at5:35pm#

REPLY

HeyFlorianIhaveneverranintothisissue,butitlookslikethisquestionontheOpenCV
forumsmightbeabletohelp.

deepakDecember22,2015at11:52am#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

25/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

helloAdrianthanksforyourgreattutorialiamcompilingopencvonmypi2butihavegotaquestion
howtocompileopencvcontribcantotellmethestepspleaseandhowtoinstallPILonceagainthankyou

AdrianRosebrockDecember23,2015at6:43am#

REPLY

HeyDeepak,thistutorialalreadydetailshowtocompileandinstallopencvcontrib.Pleasesee
Step2wheretheOpenCVsourcecodeisdownloadedandStep4whereOpenCVisactuallycompiled.
YoucanalsoinstallOpenCVintoyourvirtualenvironmentbyusingpip:
workoncv
$pipinstallPIL

MahmoudTolbaDecember23,2015at11:11am#

REPLY

Thanksforyourgreateffort.
MayIaskyouaquestionplease?
IncaseofusingRaspberrypitypeb,ShouldIchangethiscommand(makej4)tobe(makej1)?

AdrianRosebrockDecember23,2015at1:07pm#

REPLY

IfyoureusingtheB,thenjustusemakeandleaveoffthejswitch.

DavidKadouchDecember25,2015at3:43pm#

REPLY

Imsogratefultothedeeplevelofdetailofyourtutorials.Itworkslikeacharm.
ForthesportItriedfirsttoinstallopencv3.1thatwasjustreleasedafewdaysago.Alasitfailsatthemake
stagewithanotargetserrormessage.InfactnoMakefilewascreatedaftercmake.Imustsaythatitsabit
frustratingthattheybreaktheinstallprocessforminorversions.Itmakesupgradingarealpain.Anyinsights
here?

AdrianRosebrockDecember26,2015at8:55am#

REPLY

HeyDavid,pleaseseemyreplytoNelsonChenabove.

NelsonChenDecember25,2015at7:34pm#

REPLY

Thanksforgreateffort.
Ihaveaquestionforyou.Myopencvisv3.1.0,andwhenItrytoruncmake,Igotanerror.Ihavetriedseveral
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

26/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

timesandfoundthatIhadtoremovetheINSTALL_C_EXAMPLESthingfromthecommandline,oritledtoan
error.Whatdoyouthinkofit?

AdrianRosebrockDecember26,2015at8:55am#

REPLY

IactuallyranintothiserrormyselfwhentryingtocompileOpenCV3.1.0.TryremovingD
INSTALL_C_EXAMPLES=ONDINSTALL_PYTHON_EXAMPLES=ONDBUILD_EXAMPLES=ONfromthecmake
commandanditshouldgenerateaworkingMakefile.

TomDecember26,2015at3:31pm#

REPLY

Itseemsthattheissueisinthecexamples,IhadtospecificallyaddD
INSTALL_C_EXAMPLES=OFFbeforeIgotittowork,therestofwhatyoumentionedcanstayinthe
cmakecommandwithoutissues.
Thanksforthegreattutorial

AdrianRosebrockDecember27,2015at7:54am#

REPLY

Thanksfortheclarificationregardingthecmakeoptions!

MarioJanuary1,2016at7:16am#

REPLY

Thanks,Iranintothesameproblem.

AdrianRosebrockJanuary1,2016at7:23am#

REPLY

YoucanfixtheissuebyremovingtheDINSTALL_C_EXAMPLES=ONfromtheCMake
command.

SyedTariqDecember29,2015at12:22am#

REPLY

ExcellentTutorial.Ifollowedallthestepsandtesteditbyusingasimpleprogramtodisplayvideo
fromaSonyPSEye.TheonlyissueIamfacingisthattheimportcv2isonlyrecognizedwhenmypython
programisinthesitepackagessubdirectory.IusedtheinstructionsinInstallingOpenCV3.0forbothPython
2.7andPython3+onyourRaspberryPi2butIamusingRaspbianJessieOS.Ididcompareittothe
instructionsontheHowtoinstallOpenCV3onRaspbianJessieanddidnotseeanythingthatwouldaffect
theinstallation.Anyhelpwouldbeappreciated.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

27/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockDecember29,2015at7:57am#

REPLY

AreyouusingtheworkoncvcommandtodropintothePythonvirtualenvironmentbefore
executingyourscript?

SyedTariqDecember29,2015at4:36pm#

REPLY

Iamusingworkoncv.Icansee(cv)inthecommandline.Idonttotallyunderstandvirtual
environment.Iwillreaduponitandtrydebugging.Itappearsthatthelinkcv2.soisnotglobaleven
thoughithasattributeslrwxrwxrwx.IfIcreateasymboliclinkcv2.sointhedirectoryfromwhichIrun
thepythonscriptitseemstowork.
Thankyouforyourhelp.

AdrianRosebrockDecember30,2015at7:00am#

REPLY

Ifitworkswithinyourcurrentworkingdirectory,thenthesymlinkinsidethesite
packagesofthecvvirtualenvironmentislikelynotright.Iwoulddeletethesymlinkandthenre
createit.

SyedTariqDecember31,2015at2:48pm#
AdrianThankyou.Itisallworkingrightnow.Itwasagreattutorialandithelpedme
immensely.

AdrianRosebrockJanuary1,2016at7:29am#
Awesome,Imgladyouwereabletoresolvetheissue

FraFebruary1,2016at8:52am#

REPLY

HiSyed/Adrian,Ihavethesameissuecv2.soworkswithinmycurrentworkingdirectory,
soevenformeItappearsthatthelinkcv2.soisnotglobal.
Howdidyoufixit?
Ifollowedvideoandtutorialinanydetails
WhenIrunmytest.pyin~IgetImportError:Nomodulenamedcv2otherwiseinsitepackagesit
isfine.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

28/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

BillKearsonJanuary3,2016at10:09am#

REPLY

Greatjob,
WithyourdetailedinstructionsandthecommentsIhaveOpenCV3.1andPython3working,Ihadtoremove
theCexamples,INSTALL_C_EXAMPLES=OFF,fromthecmakecommandandendeduphavingtouseone
coretoavoiderrorsduringthemake.
Intheendeverythingisworking.
Usinga8GcardIwasalmostoutofspacebutIsavedanimagebeforeandafterremovingthedownloaded
filesandfolders.Leftmewithabout%55freespace.Notbad.
Agoodtimewashadbyallovertwodays.Ididstartoverthreetimesmakingnoobmistakes:Expandthefile
systemrunningraspiconfigonfirstrun.
NowIhavemypirunningheadless,wificonnection,sshprimaryconnectionandvncavailablewithmanual
startup,ifneeded.
Thankyou

AdrianRosebrockJanuary3,2016at12:45pm#

REPLY

CongratsongettingyoursetupworkingBill!AndImintheprocessofupdatingtheOpenCV3
installtutorialstomentionremovingtheINSTALL_C_EXAMPLES=OFFflag.Itlookslikeyoubeatmetoit!

SebastianJanuary3,2016at10:38pm#

REPLY

HiAdrian
FirstIwannathankyouforthetutorials,ItriedforalongtimeinstallOpenCVinaRaspberry,butIcantdoit.I
followedyourinstructions,andIdonthaveanyerrorduringtheprocess,buttheproblemiswhenItriedto
importthelibraryinPython,Ihavethenexterror:ImportError:dynamicmoduledoesnotdefineinitfunction
(initcv2),doyouhaveanyideatosolvethat?.Thanks.

AdrianRosebrockJanuary4,2016at6:48am#

REPLY

Ithinkoneoftwothingshappened.EitheryoucompiledOpenCVwithPython2.7supportand
thentriedtoimportOpenCVwithPython3,orviceversa.Makesureyouareinthecvvirtualenvironment
priortoimportingOpenCV.Ifthatstilldoesntwork,gobacktotheCMakecommandandmakesureyou
arecompilingOpenCVforyourintendedversionofPython.

SebastianJanuary5,2016at9:32am#

REPLY

HiAdrian

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

29/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Yes,itwasmyproblem,thankyousomuch.aswesayinmycountry:youdeservetheskyand
more,thanks!!!

AdrianRosebrockJanuary5,2016at1:53pm#

REPLY

Nice,congratsonresolvingtheissue

TimFarnworthJanuary4,2016at10:50pm#

REPLY

HiAdrian,
Thankyouforthesetutorialsman.Theyaregreat!
IinstalledOpenCVlastnightandpausedtheinstallationjustafterthemakej4command.Iresumedthis
morning.OtherthenaddingDWITH_OPENMP=ONandsetDINSTALL_C_EXAMPLES=OFFtothecmakeinstall,I
havefollowedthetutorialclosely.ButforsomereasonIamhavingissues.
cv2.imshow()andcv.ShowImage()dontopenanyimagewindows.ImgettingfrustratedbecauseIcantsee
wheremycodeiswrong.
Hereisabarebonesversionofmycode:

1
2
3
4
5
6
7
8

import cv2

# Open Show Image


I = cv2.imread('MyPic.JPG')
print type(I)
A = cv2.imshow("Window",I);
print "Image shown"
cv2.waitKey(1)

Thecodeterminatesinthecv2.imshow()functionanddoesnotreachtheprintImageshownline.
Doyouhaveanyideaswhatcouldbewrong?Cheers

AdrianRosebrockJanuary5,2016at6:46am#

REPLY

ItsverystrangethattheImageshowntextisneverprintedtoyourscreen.Iwouldpointthat
unlessyouareusingavideostream,youlikelydontwanttousecv2.waitKey(1).Thiswillonlywait1ms
beforeautomaticallyclosingthewindow.Youshouldusecv2.waitKey(0)towaitindefinitelyfora
keypress.
Sinceyoudeviatedslightlyfromthetutorial,Iwouldsuggestdoingtwothingsasasanitycheck:
1.Blowawaytheinstallandstartfromscratch.Specifically,pausingduringmakej4mighthave
introducedahardtotrackdowndependencyissue.AllowOpenCVtocompilewithoutpausingthe
process.
2.Secondly,recompilewithDWITH_OPENMP=OFF.IveneverencounteredanissuewithOpenMPbefore,
butsinceitdeviatesfromthetutorial,Ithinkitsgoodtoperformasanitycheck.
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

30/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

NicolasRouxJanuary6,2016at2:28pm#

REPLY

Itsagreatguide,IthinkIalreadyusedoneofyourtutosinthepastsoathankyouwaslong
overdue.
Hereitis:
Thankyou,keepupthegoodwork.

AdrianRosebrockJanuary6,2016at2:31pm#

REPLY

ThanksforthekindwordsNicolas

MalefJanuary7,2016at10:43am#

REPLY

itrytocompileopencv3.1.0
butitstallsafter5mins[21%]onopencl/perf_arithm.cpp
6%CPUand59%MEM
UsingSwapTotal20971486800used
whatcanidowaitinglongeroristheresomethingwrong?
iscomplilingwithOpenCLmakessence?istheGPUisused?
Thanksforhelp

AdrianRosebrockJanuary7,2016at12:39pm#

REPLY

Thatsstrangethatthecompilationhasstalled.AreyoutryingtocompilewithOpenCLsupport?If
so,Iwouldsuggestdisablingandtryingagain.
Also,tryusingcompilingusingonlyasinglecorewith:make
Thiswillavoidanypotentialdependency/raceconditionswiththecompile.

MalefJanuary8,2016at5:55am#

REPLY

iswitchedoftheopenclnowthesamethingat82%buildingpythonmodulecv2
kswapdusesmosttimethecpu()andthecc1plusprocess
andthenitstalls
maybeaswappingproblemandthenacrash?

AdrianRosebrockJanuary8,2016at6:28am#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

31/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Howlongintothecompile?Also,whichPihardwareareyouusing?

MalefJanuary11,2016at5:44am#
RaspberryBfirstversion256MBRAM128MBSplit
SwaponSDwith3timesRam
Itryitnowwith16MBmemorysplitforGPU

AdrianRosebrockJanuary11,2016at6:48am#
TheRAMdefinitelysoundsliketheissue.TheseOpenCV+RaspberryPitutorialsare
intendedforeithertheB+orthePi2.IhavenevertriedwiththeB,simplybecauseithastoo
littleRAMandisntthemostsuitableforcomputervisionandimageprocessing.Ifatall
possible,youshouldtrytogetaPi2.

PaulMaherJanuary10,2016at6:11am#

REPLY

Thanksforpostingthedetailedinstructionswhichhavebeeninvaluabletome.Ihaveaquestion
thoughaboutthevirtualenvironments.IvenotusedthembeforesoImanagedtotiemyselfinaknot.
IfIswitchtotheCVvirtualenvasinyourinstructionseverythingworksfinebutifItrytoimporttheGPIO
libraryitsaysitsnotfound.IalsocantusesudotorunmyOpenCVpythonprograms(whichIwillneedtodo
asIwanttoaccessusetheGPIOportsaswellasthecamera).SoatthemomentIcan*either*usetheCV
virtualenvandgetOpenCVORnotusethevirtualenvandgetaccesstosudoandGPIO.Notsurehowtodig
myselfout!
Anyadvicegratefullyreceived!

AdrianRosebrockJanuary10,2016at7:40am#

REPLY

IveactuallyaddressedthisproblemafewtimesonthePyImageSearchblog.First,youshould
readmyreplytoRobJamesabove.Secondly,doactrl+fandsearchthispageforGPIO(especiallyinthe
commentssection).Youllnoticethatthesolutionistolauncharootshell,createavirtualenvironmentfor
therootuser,installOpenCVintoit,andexecuteyourscript.
Theimportantpointisthatyouneedtoactuallylauncharootshellratherthanjustusingsudotocallyour
script.
Finally,youcouldtryignoringthevirtualenvironmententirelyandensurebothOpenCVandNumPyare
installedintoyournormalPythonsitepackagesdirectory.Thiswillalsosolvetheproblem.

PaulMaherJanuary11,2016at3:30am#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

32/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Adrian,thanksforthepromptreply.IwilltryomittingthevirtualenvstepsandseehowIget
on.Thanksagainforthereply.

manishJanuary10,2016at7:44am#

REPLY

Sir,
howtoimportcv2onpythonshell
Ifollowedyourallstepsanditgoescorrect..
butIdidntgetonshellasitshows
nomodulenamecv2
Imusing
Raspi2,modelB
withNOOBS

AdrianRosebrockJanuary10,2016at8:18am#

REPLY

PleaseseetheTroubleshootingsectionatthebottomofthispost.Iwouldalsoencourageyou
towatchtheinstallationvideoatthetopofthispostandfollowalongwiththeexactcommandsthatI
perform.ThiswillensurethatOpenCVisproperlyconfiguredandrunningonyoursystem.

manishJanuary10,2016at8:25am#

REPLY

SirIfollowedyourvideoandattheterminalitisgoingright..
butitdidntworkonpythonshell.
ImabeginnerinRaspberrypi
Canyoutakemeoutofthis??
itwasallrightbutnotnoshell

Opencvisinstalledonmypi
Icheckeditthroughterminalasyoumentionedinlaststep..

AdrianRosebrockJanuary11,2016at6:47am#

REPLY

HeyManish,sojusttoclarifyOpenCVisindeedinstalledonyourPi?
Ifitsnot,thenIwouldsuggestgoingthroughtheTroubleshootingsectionofthispost.Imalsonotsure
whatyoumeanbyitsworkingintheterminal,butnotinthePythonshell.

CarlosAlbertoGironMay2,2016at2:15pm#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

33/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

HelloAdrianandthanksforthetutorial.
Ihavethesameproblem,ifIopentheterminalandfollowthestepssource~/.profile>
workoncv>python>importcv2,itdoesitwithoutanyproblems.Butifiopenascriptdirectlyfrom
pythonandstartwithimportcv2thenigettheerror:ImportError:Nomodulenamedcv2.
Ibelieveitmusthavesomethingtodowithmypythonscriptnotrunningontheprofileandthecv
environmentbutidontknowhowtomakeitrunfromthere.
Ifyoucanhelpmeiwouldreallyappreciateit.

AdrianRosebrockMay2,2016at7:46pm#

REPLY

HeyCarlosthisactuallyistheintendedbehaviorofusingavirtualenvironment.Your
cvenvironmentismeanttobesequesteredandindependentfromthesysteminstallofPython.I
detailhowvirtualenvironmentsworkinthefirsthalfofthisblogpost.

ArashJanuary10,2016at4:05pm#

REPLY

Thankyouforthetutorial.
AsmentionedintheupdateIgotthemakeerrorafter(C_EXAMPLES=ON)soIremovedthebuildfolderand
redidthecmakewithC_EXAMPLES=OFFhoweverIamstillgettingNotargetsspecifiedandnomakefile
found.Stop.

AdrianRosebrockJanuary11,2016at6:42am#

REPLY

Afteryouremovedthebuilddirectory,youneedtorecreateitandenteritbeforerunning
CMakeagain:

1 $ rm -rf build
2 $ mkdir build
3 $ cd build

FromthereyoushouldruntheCMakecommand.

manishJanuary12,2016at11:08am#

REPLY

sorrytohavealateresponsesir.
Igotit.andsolvedtheproblem.
thanksforyoursupportandsuggestions..
andthanksforthistutorial.itisreallyhelpful.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

34/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

urbyMarch12,2016at11:57am#

REPLY

Hellomanish.
Whatdidyoudotosolvetheproblem?BecauseIwenttroughtroubleshootingandIstillgettheerror.

KewinJanuary14,2016at11:50am#

REPLY

Ihave8gbsdcardwithraspianjessie.WhenIinstallraspianonit,thefoldermanagerofrasperrypi
showsthefreespaceabout700mb.Isthatnormal.If8gbisnotenoughIwillbuya32gbsdcard.BecauseI
wanttoinstallopencvandpythonandthediskspaceisnotenough.Pleasehelpme
thanks

AdrianRosebrockJanuary16,2016at9:40am#

REPLY

700MBisverymuchborderline.Makesureyouhaveranraspiconfigandexpandedyour
RaspberryPifilesystemtousetheentiremicroSDcard.Otherwise,ifyouhavealreadyexpandedyour
filesystem,Iwouldsuggesteither(1)deletingfilestomakeextraroomor(2)gettingalargemicroSD
card.

HilmanJanuary15,2016at6:21am#

REPLY

HeyAdrian.
Iwanttoasksomething.Isa4GBmicroSDcardbigenoughtoinstallRaspbianJessie,OpenCV3,andallthe
thingsyouvewroteabove?WhatifIwanttomakeprojectontheRaspberryPi(byusingtheRaspberryPi
cameraandyourtutorialofcourse),willitstillbebigenough?

AdrianRosebrockJanuary16,2016at9:34am#

REPLY

Realistically,a4GBcardisnotlargeenoughIwouldsuggestusingan8GBcard.

JosephJanuary16,2016at3:03pm#

REPLY

Ifollowedeverystep(doingPython3)butwhenIgottoStep#5:Finishingtheinstall,mypython3.4
directoryisempty.python2.7hasabunchoffiles,butnotcv2.so.IlookedbackatallthecommandsIentered
andeverythinglooksright.NotsurewhatwentwrongorwhereIcouldbacktrackto.

AdrianRosebrockJanuary17,2016at5:29pm#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

35/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

BesuretotakealookattheTroubleshootingsectionofthispost.Besuretotakealookatthe
build/libdirectoryaswell.

ManuMarch28,2016at12:48pm#

REPLY

HiAdrian,
ThankssomuchforyourdetailedblogonhowtoinstallOpenCV,itsverygood.
IhavehadasimilarissuetoJoseph,andIfoundthecv2.sofileunderbuild/libfolderasyouexplained.
Icopiedthefileto/usr/local/lib/python2.7/sitepackagesandproceededwithStep#5asyou
explained.
Everythingseemstoworkjustfine.AmIrighttothinkthesystemisinstalledcorrectlynow?
Thanks

AdrianRosebrockMarch28,2016at1:24pm#

REPLY

Aslongasyouranmakeinstallandthenmanuallycopiedoverthecv2.sofile,then
yes,everythingisinstalled.

maiJanuary20,2016at7:26am#

REPLY

wentthoughmakewithnoerror.
However,makeinstallgivesfollowingerrors:
HowdoIpostascreenshot?

AdrianRosebrockJanuary20,2016at1:42pm#

REPLY

Iwouldsuggestuploadinganimagetoimgurandthenpostingthelink.

VishwaJanuary24,2016at3:51am#

REPLY

Followedtheguidetilltheend,Icanimportcv2interminalbutnotinIDLE,noneofthecomments
helped.Thereisacv2.sofileinsitepackages.Idontunderstandwhatyoumeanbyrunningitinthecvvirtual
environment.Help

AdrianRosebrockJanuary25,2016at4:12pm#

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

36/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

ToaccessthePythonvirtualenvironment,youneedtouse:
$workoncv
Andthiswilldropyoudownintothecvvirtualenvironment.YoucanthenusetheterminalversionofIDLE.
TheGUIversiondoesntproperlyworkwiththePythonvirtualenvironment.

zeveroJanuary29,2016at9:57am#

REPLY

Ifyouendupnothavingenoughspacelikemeonraspian(on8GB)trytofreesomespace:
500MB:sudoaptgetremovepurgewolframengine
100MB:sudoaptgetremovepurgescratch
xxxMBsudoaptgetcleanautoclean

AdrianRosebrockJanuary29,2016at12:53pm#

REPLY

Thanksforsharingthetip!

mikelJanuary31,2016at1:39am#

REPLY

thankyousomuch!

AdrianRosebrockJanuary31,2016at8:55am#

REPLY

NoproblemMikel,Imhappythetutorialworkedforyou.

FraJanuary31,2016at5:01am#

REPLY

HiAdrian,
Ifollowedyourinstructionsuntilstep4.OnceIrunCMakeIcheckedPython2and3section.
Unfortunatelyformebothhavepackagespathsettolib/python3.4/sitepackages
Whatcanbewrong?

AdrianRosebrockJanuary31,2016at8:57am#

REPLY

Tostart,makesureyouareinthecvvirtualenvironmentpriorexecutingCMake:
$workoncv
Otherwise,assumingyouaretryingtobuildPython3bindings,itshouldstillbeokay.Youcanalways
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

37/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

copy/symlinkintothesitepackagesofthevirtualenvironmentaftercompiling.

PetriKFebruary2,2016at7:16am#

REPLY

excellentinstructions,suggestalsoadding
sudoaptgetpurgewolframengine
toreleasesomespaceonthe8Gbsdcar,withoutremovingthereisnotenoughspacetoinstallopencv.

PetriKFebruary2,2016at3:39pm#

REPLY

Anothersuggestionforinstallationjustlearnedthatwhenmountingusbdiscas/builddirectorythe
filesystemmustbeext4.IffilesystemisFATthenlibrariescannotbebuildonduetouserrightserror.Needed
tohaveanexternaldiscasrunningshortofmemoryduringmakeevenafterremovingwolframengine.
Lookslikethe/builddirectoryneedsaround1.5gigsfreespaceforthemakebeingsuccessful.Soaltogether
3gigsfreespaceonsdcardmaynotbeenoughforthefullopencvinstallation,soneededanexternalusb
drivefor/build.

HilmanFebruary3,2016at7:20am#

REPLY

HeyAdrian,Ihaveaquestion.
WhenIenteredthiscommand:
wgetOopencv.ziphttps://github.com/Itseez/opencv/archive/3.0.0.zip(Ichangedthe3.0.0to3.1.0,thatis
thelatestoneisnt?)
IgettheERROR404:NotFound.Icantevengotothelinkinthecommandmanuallyusingmylaptops
browser.HowcanIfixthis?
Thanksinadvance.

AdrianRosebrockFebruary4,2016at9:19am#

REPLY

Thatsverystrangethatthe.zipis404ing.Itsdownloadingperfectonmymachines.Trycloning
downtheentireOpenCVrepositoryandthencheckingoutthe3.0.0version:

1 $ git clone https://github.com/Itseez/opencv


2 $ cd opencv
3 $ git checkout 3.0.0

HilmanFebruary6,2016at1:41am#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

38/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Alreadyfigureditout.ItwasDNSissue

gregFebruary5,2016at2:36am#

REPLY

UhhIvebeenusinglinuxforabout15yearsandIcantgetthistocompile,IguessImretarded.
Gaveupafter34hoursofmessingaround.
http://pastebin.com/nSNjCggH

AdrianRosebrockFebruary5,2016at9:19am#

REPLY

Whichversionwereyoutryingtocompilefor?Python2.7orPython3?Also,isthatyourfull
outputfromCMake?Normallythereisalongertrace.

GINOFebruary7,2016at4:05am#

REPLY

idonthave.profileinmydirectoryhowtofixit..help

AdrianRosebrockFebruary8,2016at3:53pm#

REPLY

Ifyoudonothavea.profilefileinyourhomedirectory,createitusinganeditorsuchasnano:
$nano~/.profile

ChicagoChuckApril27,2016at2:50pm#

REPLY

YoucanalsonavigatewiththeGUIeditor(thefilecabinetatthetopofrasbarian)andgo
throughtheDirectoryTreetothehome/pifolder.Oncethere,rightclickandcheckonshowhidden
whichwillshowthefile.
So,the.profileisthere,youjustcantseeittoeditit.Ifyoucreateanotherone,youaregoingto
overwriteyouroriginalone.Onceyouuncoveritthroughthismethod,thenyoucanclickonthefile
andedit.profile

Also,thepaththatyouhaveassource~/.profilecanalsobeaccessedthrough:
source/home/pi/.profileifthesource~./profileisntworking.

AdrianRosebrockApril28,2016at3:17pm#

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

39/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

ThanksforsharingtheGUIeditortip!Asforthe~/.profile,thatissimplyashortcutforthefull
path:/home/pi/.profile.Aslongasyouareloggedinasthepiuser,thensource~/.profile
shouldwork.

GirishKumarFebruary8,2016at12:00pm#

REPLY

ThanksAdrian,OpenCV3.0.0installedlikeabreeze,greatwriteKeepupthegoodwork
Regards
Girish

AdrianRosebrockFebruary8,2016at3:44pm#

REPLY

Fantastic,ImgladthetutorialworkedforyouGirish!

liudrFebruary14,2016at1:57am#

REPLY

ThankyouAdrian!IttookmeafewtriesonRPI2BjessiebeforeIeventuallygottothefinishingline
withpython2.7
Asof2/14/16,ifoneupdatesandupgradesjessiebeforefollowingyourtutorial,heneedsa16GBcard.My
8GBcardgotonly4GBleftwiththe112515jessiedistroandthatshrankto2GBrightafterupgrade.The
opencvbuildneedsabout2.4GB.Iendedupmountingaharddriveforthebuildfolder.Mybuildtook7hours
tomake,whichiswayaboveyourmark.Willtrytoinstallopencvforpython3.5thatIcompiled.Itllbea
challenge.Iinstalleditinanoptsubfolderin/usr/local

AdrianRosebrockFebruary14,2016at9:49am#

REPLY

Thanksforsharingyourinstallexperience!

jamaludinindraFebruary14,2016at2:51am#

REPLY

thanksforyourtip
whenienteredthiscommand
pipinstallnumpy
igeterror:
ImportError:Nomodulenamedpip
howcanifixthis..?
thanks.
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

40/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockFebruary14,2016at9:48am#

REPLY

PleaseseeStep#3ofthistutorialtoinstallpip.

ThomasOverbyFebruary17,2016at10:15am#

REPLY

Thismightbeoneofthemoststructuredtutorialsihaveeverseen.Thankyoufortheeffortandthe
timeyouspenttomakethisqualityguide!Really,reallynicework.Again,thankyouforthis!

AdrianRosebrockFebruary17,2016at12:33pm#

REPLY

ThanksforthekindwordsThomas,Imhappythetutorialworkedforyou

AlexMarch2,2016at2:30pm#

REPLY

HelloAdrian,
Iamonstep4tryingtocompileOpencvbutwhenienterthecommand
cd~/opencv3.1.0/
itreturns
bash:cd:/home/pi/opencv3.1.0/:Nosuchfileordirectory.
Ireplacedthe3.0.0with3.1.0forbothopencvandopencv_contrib.
IfollowedallthestepsandIaminthe(cv)virtualenvironment.
Doyouhaveanideawhythismightbehappening?

AdrianRosebrockMarch3,2016at7:07am#

REPLY

Youllneedtodoublecheckwhereyoudownloadedtheoriginalopencv3.1.0fileto.Itseems
likeitwasnotdownloadedtoyourhomedirectory.Ifyoudiddownloadittothehomedirectory,youneed
tounzipitfirst.

CarlosMarch3,2016at9:59am#

REPLY

makej4crashesmyRaspberryPi3insteadIusedmakeonly(nootherparameters).

AdrianRosebrockMarch3,2016at11:09am#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

41/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Thanksforsharing.MyRaspberryPi3shouldbeheresoonandthenIllbetestingthistutorial
andpossiblycreatinganewone,ifneedbe.

REPLY

MarkMarch3,2016at4:39pm#

okithinktheproblemwasIusedsudopipinstallnumpywhichtoldmeitwasalreadyinstalledbutI
assumeusingsudoitwasntcheckingthecvenvironment?

AdrianRosebrockMarch6,2016at9:28am#

REPLY

ThecvvirtualenvironmentisentirelyindependentthanyoursysteminstallofPython(and
associatedpackages).Therefore,youneedtoinstallNumPyintothecvvirtualenvironmentastheblog
demonstrateshowtodo.

REPLY

VitHovorkaMarch4,2016at5:34am#

FirstlyIwouldliketoexpressmyrespecttoyouconcerningyourgreatcontributiontomachinevision
community.HopefullysomedayIllgainenoughknowledgeinmachinevisioninordertobealsousefulto
community

ButnowImonbeginningofmylearning.

AndIwouldliketothankyouspeciallyforthisdetailedtutorial.

AdrianRosebrockMarch6,2016at9:22am#

REPLY

ThankssomuchforthekindwordsVit

REPLY

MichauPeMarch6,2016at3:33pm#
HelloAdrian,helloAll.

Firstofallgreattutorial.I`veinstalledopenCVonrpi2withsuccess.NowIhaverpi3andallhavebeen
goingwellsincecmakepart.Icantfindwhyitthrowsaerror:CMakeErrorAtCMAkeLists.txt.:107=Cmake
failstodeterminethebitnessoftargetplatform.
IhavefreshinstallationofJessie,cmakeversionis3.0.2.IntxtfileisstatementthathisisapopularCMake
confmistake.Whatihavetodonow,pleasehelp

AdrianRosebrockMarch7,2016at4:12pm#

REPLY

IdontownaRaspberryPi3yetminewasplacedonbackorder,unfortunatelysoIcant
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

42/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

speakdirectlytowhattheproblemis.OnceIhaveaRaspberryPi3,Illtrythetutorialmyselfandcreate
anupdatedversionifneedbe.

MichauPeMarch8,2016at6:01pm#

REPLY

InorderofdeepinvestigationihavemanagedtoinstallopenCV3.1.0onrpi3withthiscmake
commandfirst:

1 cmake -D CMAKE_BUILD_TYPE=RELEASE \
2
-D CMAKE_INSTALL_PREFIX=/usr/local \
3
-D INSTALL_C_EXAMPLES=OFF \
4
-D INSTALL_PYTHON_EXAMPLES=OFF \
5
-D OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib-3.1.0/modules \
6
-D CMAKE_SIZEOF_VOID_P=4 \
7
-D BUILD_opencv_python3=TRUE \
8
-D PYTHON3_LIBRARY=/usr/lib/arm-linux-gnueabihf/libpython3.4m.so \
9
-D BUILD_EXAMPLES=ON ..

andmakecommandwithoutj4.
Iwishthiscansaveanighttosomebody

AdrianRosebrockMarch9,2016at4:43pm#

REPLY

ThanksforsharingMichal!ItlookslikethemainadditionisCMAKE_SIZEOF_VOID_P.I
presumethisislikelybecauseofthe64bitarchitectureofthePi3.OnceIgetmyhandsona
RaspberryPi3(Ihaveanorderplaced,itsintheprocessofshipping),Illbesuretocompile
OpenCVmyselfandlikelycreateaseparatetutorial.

YazhengMarch7,2016at10:38pm#

REPLY

HelloAdrian.Thanksforyourgreatwork!
Followedyourtutorial,IhavesuccessfullyinstalledOpenCV3withPython2.7onRaspbianJessie.ButwhenI
ranthesamplefilecalledfacedetect.py,therewasawarning:unabletoopenvideosource.Itcannotdisplay
thevideocapturedbypicameraoreventhepicameracannotcapturetheobject.Doyouhaveanyideaabout
thiscondition?Thanksagain.

AdrianRosebrockMarch8,2016at4:14pm#

REPLY

IwoulddoublecheckthatyourRaspberryPicameramoduleisconnectedproperly.Alsomake
surethatyouhaveranraspiconfig,enabledthecameramodule,andrebootedyoursystem.

JasperMarch8,2016at7:35am#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

43/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Igotsomeerrorswithcmake.Ithoughtsomedependenciesweremissing,butno:turnsoutthatI
overlookedtheOPENCV_EXTRA_MODULES_PATH=~/opencv_contrib3.0.0/modulessettingwhich
wassettothewrongversion(Iuse3.1.0).IalsochangedallsettingsforbuildingexamplestoOFF.
Nowcmakerunsfine.
Maybethiswillhelpsomeotherpoorfellowwho,likeme,knowsnothingaboutcompiling
ThanksAdrianforthegreattutorial!

AdrianRosebrockMarch8,2016at4:13pm#

REPLY

ThanksforsharingJasper!

anuMarch11,2016at5:47am#

REPLY

doweneednetconnectionformakej4commandininstallingopencvforraspberrypi

AdrianRosebrockMarch13,2016at10:26am#

REPLY

No,themakej4commanddoesnotrequireaninternetconnection.Itisonlyusedtocompile
OpenCVafteralldependencieshavebeendownloadedandinstalled.

PrateekXaxaMarch12,2016at2:17am#

REPLY

THANKYOUverymuchIcannotdescribehowmuchIneededit

AdrianRosebrockMarch13,2016at10:19am#

REPLY

Noproblem,Imhappythetutorialworkedforyou!

mikeMarch12,2016at1:49pm#

REPLY

rpiupdatekilledbySDcard.UsingabrandnewRasberryPi3.
Ihadtoerasethecardandreloadraspian.Notsurethatthisstepisrequired!

AdrianRosebrockMarch13,2016at10:19am#

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

44/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

ThanksforthetipMike.IllhavemyRaspberryPi3laterthisweekandIllbesuretotesttheinstalltutorial
(andlikelycreateanewonespecifictotheRaspberryPi).

KevinMarch14,2016at2:42pm#

REPLY

ThispastweekendIhavesuccessfullyandpainlesslyinstalledOpenCV3onmyRaspberryPi
3followingthispost.
fyiIalsopreviouslydiscoveredthatsudorpiupdatescrewedupmycardwhenItrieditonthelatest
JessieversionfromtheRPiwebsite.Youmightwanttoconsiderremovingthatlinefromyour
blogpost.
IalsosuccessfullyandpainlesslygotmyRPicameraworkingbyfollowingyourblogpostAccessing
theRaspberryPiCamerawithOpenCVandPython
IamnowworkingthroughmycopyofPracticalPythonandOpenCV+CaseStudiesonmyRPi.
SofarIvebeenfollowingitusingthecvpythonenvironmentbutIvenowcometoasmallhurdleat
Chapter7Histogramswherethereappearstobenomodulematplotlibinthecvenvironment.
Howeasyisittoinstallmatplotlibinthecvenvironmentandhowisitdone?
IsthesamesituationlikelytobethecasewhenImoveontothelaterChaptersandCaseStudies
whichusemahotas,scikitlearnandscikitimage?
AsaninterimworkaroundIhaveinstalledmatplotlibdirectlyontomyRPisoIcanrunthecodein
Chapter07butonlyoutsidethecvenvironment.Iwouldliketoknowhowtodoittherightway.
IamsogladIvefoundyourblog.Manythanks

AdrianRosebrockMarch14,2016at3:10pm#

REPLY

HeyKevin,thanksforthecomment.MyPi3willbehereinthenextfewdays,thenIcan
runthroughthetutorialmyselfandIllmakeanynecessaryupdates(suchasremovingtherpi
updatecommand).
Also,congratsongettingOpenCVinstalledonyourPialongwiththecameramodulesetup,thats
awesome!Asforinstallingmatplotlib(oranyotherpackagethatispipinstallable),youjustneed
toenterthecvvirtualenvironmentfirstandtheninstall:

1 $ workon cv
2 $ pip install matplotlib

ThiswillinstallmatplotlibintothecvPythonvirtualenvironment.
Ifyourunintoanywithmatplotlib,Iwouldsuggestconsultingthisblogpost.np

nancyMarch13,2016at1:11pm#

REPLY

thankyouforurvideo:).everythingwentwellbutwhenigaveimportcv2itshowsimporterror:no
modulenamedcv2intheterminalbutwhenichangethepathusingcdusr/bin/local/python2.7/sitepackages/
thereisnoerrorinimportcv2butwheniruninidleagainitshowserror:(whatshoukdidonow?

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

45/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockMarch14,2016at3:29pm#

REPLY

PleaseseetheTroubleshootingsectionofthisblogpost.Itsoundslikeyouarenotinthecv
virtualenvironmentpriortoimportingOpenCV:

1 $ workon cv
2 $ python
3 >>> import cv2

nancyMarch14,2016at11:58pm#

REPLY

Iusedyourcommands
$workoncv
$python
>>>importcv2
stilligeterroras
importerror:nomodulenamedcv2

AdrianRosebrockMarch15,2016at4:41pm#

REPLY

Itseemslikeyouforgottosymlinkthecv2.sofileintothesitepackagesdirectoryof
yourvirtualenvironment.GobacktoStep#5andmakesurethesymlinkisvalidandworking.

nancyMarch16,2016at4:08am#
yeahiworked.ididwhatyouhavementionedinstep5forpython2.7

StefanArnoldMarch14,2016at11:19am#

REPLY

Veryniceandsmoothinstallation!!
Thankyouverymuch!!
Minorproblemwhenyoudontsticktothetutorialliterally:
WhenyouworkonanexternalfilebaseduetospacelimitationsontheinternalSD:Becarefulwiththe
link/mounttoyourfilesystem.E.g.symlinkswillirritatethemakeprocess.

AnuMarch17,2016at2:09am#

REPLY

Smoothinstallation.Iinstalleditanditisworkingproperly.Thankyousomuchforyourtutorial

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

46/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockMarch17,2016at7:03am#

REPLY

Noproblem,Imhappythetutorialworkedforyou

vjMarch19,2016at4:48am#

REPLY

hiadrianthanksforurvideo!!!!:)mycodeshowsnomodulenameddrawmatcheswhenitryto
importsiftandsurfitshowsnomodulenamedsiftplzhelpme

AdrianRosebrockMarch19,2016at9:12am#

REPLY

YouneedtoconsultthistutorialonaccessingSIFTandSURFwithOpenCV3.Thisshouldhelp
clearupanyissues.

RedMarch19,2016at12:45pm#

REPLY

Iwouldgoforacrosscompilationhere.WhenbuildingOpenCVittendstoeatupalotofresources
CPU,RAMandstorage.Thefirsttwoonecancopewithbutthelaststoragecanactuallyleadtofailurein
finishingthebuildprocess.AndevenifabletobuildittheremightnotbeenoughspaceleftontheSDcardfor
theinstallationbecauseitcopiesthefilesfromthebuildfoldertotheirrespectiveplacesinthesystem.

oussemaMarch19,2016at2:28pm#

REPLY

raspberrypi2
raspbianjessie
AttributeError:moduleobjecthasnoattributeSURF
youcanhelpmeplease

AdrianRosebrockMarch20,2016at10:44am#

REPLY

Thisblogpostwilltakecareoftheproblem

SteveRyanMarch19,2016at6:53pm#

REPLY

AdrianAWESOMEtutorial!andthisfromsomeonewhoneverusesuppercase.Seriously,thiswas
fantasticallydetailedandspotonproceduretogetOpenCVworkingonRPiJessie.IstumbledquiteabituntilI
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

47/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

foundthispost,andtheninamere2hours(1.8ofwhichwaswaitingfortheactualbuild)Iwasdone!
Kudos,myfriendIamdeeplyinyourdebt!

AdrianRosebrockMarch20,2016at10:40am#

REPLY

ThanksSteve!Imsohappythetutorialhelpedyouout!CongratsongettingOpenCVinstalledon
yourPi,enjoy.

EvgenyMarch21,2016at10:14am#

REPLY

HiAdrian,
Justwantedtothankyouforthisamazingtutorialandyourbooks!BoughtthecourseonSat,alreadydone
withthefirstbookandnowImenjoyingCaseStudies.Thesearedefinitelyworthbuying.
Oneqcommenttherewillbesomechangesneededinthistutorialinordertomakeeverythingwork
smoothlyonRPI3.Youalreadygavesomeexplanationsinthecomments,butthisalsowouldbegreatto
havesomenotesonstep4/5/somewhereelse.
Thanks!

AdrianRosebrockMarch21,2016at6:36pm#

REPLY

ThanksforthecommentEvgenyanditsgreattohearthatyouareenjoyingPracticalPython
andOpenCV!ImactuallyjustwrappingupaninstalltutorialfortheRaspberryPi3,sobesuretokeepan
eyeonthePyImageSearchblog,itshouldbepublishedinthenext34weeks.

gaspartelekiMarch22,2016at1:45pm#

REPLY

AdrianRosebrock!
IspentdaystryinggetopencvworkingonmyraspiB+.
Noluck.
Ihaveajobandanicefamilysoimnotwillingtospendmoretimefightthecompatibilitychaoswith
raspberry.Iwanttotestmyideasonthepimachine,havefunthatsall:)
Doyouknowofanyexistingwheezy/jessieimage(withWORKINGopencv/python2.7onit)icould
download?
Bests!
Gaspar

AdrianRosebrockMarch22,2016at4:13pm#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

48/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Imsorrytohearabouttheinstallproblems,thatissuperfrustrating!Atthecurrenttime,I
donthaveadownloadableRaspbian.imgwithOpenCV+Pythonpreconfiguredand
preinstalled,butthatssomethingImcurrentlyworkingon.Expecttohavean
announcementwithinthenextcoupleofweeks

gaspartelekiMarch22,2016at7:12pm#
DearAdrian,
Thanxforyourreplyforbothofmymessages.
Happytohearthattheremightbeaprofessionalcomputervisionimageavaible.
Ithinkmanypeopleisgooglingaroundtofindone.
Accordingtofreespace:
iremovedlibreofficeby:
sudoaptgetremovepurgelibreoffice*
Deletedtheopencvfoldersandzipfles.
MentionedError:
Pipinstallscipytakesbunchofhoustowheelandfinisheswitherrorforme.Sorryicouldnot
provideerrorformattedthesdafterthat.Toarchivethesameerroriwouldneedtitryto
installagain.
Virtualenvironmentspeed:
Itseemdtomewithoutmeasuringthatexecutingapytooklongerinthevirtualenviroment.No
measurementimade!!!Soitsnotofficial.
Howcouldimeasureit?Doyouhaveanysuggestion?
Haveaniceday!

AdrianRosebrockMarch24,2016at5:22pm#
ThanksforthetiponremovingLibreOffice,Ivemadenoteofthat.Asforprofile
Pythoncode(andassociatedbinaries),IwouldconsultthePythondocumentation.

GasparTelekiMarch22,2016at3:51am#

REPLY

DearAdrian!
Youaredoingagreatworkdoingtutorials!
Iveinstalledopencv310onmypiB+withtheabovegivenmethod.
itlooksok.
BUT:
Ihavesomeissuesafterinstall:
1.Nofreespaceleftonmy8gigcard(iguessishoulddeleteopencvzipfilesandtheunzippedfolders,but
imnotsure)
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

49/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

2.Cantdo:pipinstallscipy+pipinstallmatplotlib(igettonsoferrors)=cantrunmy.pyfilesrequiring
matplotlib.
3.virtualenvseemstoslowdownthepiandmakesthingscomplicated(notfoolproof).
Isthereanyadvantagesanaverageusercangetfromvirtualenv?
Plesasereplymeifyouhavethetime.
Bests!
Gaspar

AdrianRosebrockMarch22,2016at4:22pm#

REPLY

1.AfteryouhavecompiledandinstalledOpenCV,youshouldabsolutelydeletethe.zipfilesand
theoriginalsourcecodedirectories.Thiswillfreeupabunchofspace.Youmightalsowanttoconsider
deletingtheWolframEnginetofreeupspace,aswellasOpenOfficeifitsinstalled.
2.Itshardtotellwhattheerrormessageiswithoutseeingyourerrormessage.
3.ThevirtualenvironmentwillnotslowdownthePiatall.Doyouhaveanybenchmarksthatmakeyou
thinkthat?Theprimarybenefitofusingvirtualenvironmentsisthatyoucancreateasequestered,
independentenvironmentforeachprojectyouworkon.Thisallowsyoutohavedifferentversionsof
variouslibrariesonthesamemachine,allwithoutconflictingwitheachother.

DaveMarch23,2016at5:13pm#

REPLY

Hi,Iwassuccessfulininstallingopencvandrunningit.However,onceinthevirtualenvironmentIam
unabletoimportanyadditionalmodules(ie.PIL).HowdoIimportadditionalmodulesonceinthevirtualCV
environment?
Thanksforyourhelp.

AdrianRosebrockMarch24,2016at5:14pm#

REPLY

YouneedtoinstalleachPythonmoduleintoyourvirtualenvironment.Keepinmindthatthe
virtualenvironmentisindependentfromallotherPythoninstallsinyoursystem.Forexample,toinstallPIL
(orthemorepreferredPillow):

1 $ workon cv
2 $ pip install pillow

FELIPEMARTINEZMarch24,2016at3:01pm#

REPLY

IwrotewgetOopencv.ziphttps://github.com/Itseez/opencv/archive/3.0.0.zipandthereisa
problemCannotwritetooponcv.zip(Nospaceleftondevice)Whatthapen?helpme
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

50/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockMarch24,2016at5:09pm#

REPLY

PleaseseemyreplytoMohamedandMattabove.Youeitherneedto(1)expandthe
filesystemonyourPiusingraspiconfigor(2)freeupspaceonyourPibydeletingunneededfiles.In
anextremecase,youmightneedtopurchasealargermicroSDcard.

ravishankarkmMarch28,2016at8:38am#

REPLY

Hi,Ihavefollowedyoursteps..whiledoingmakej2itsshowingNOspaceleftondevice
.complilationterminated.andiamusingraspberrypiB+board.
regards,
ravishankar

AdrianRosebrockMarch28,2016at1:30pm#

REPLY

HaveyouexpandedyourRaspberryPitousetheentirefilesystem?Makesureyouexecuted
raspiconfig,selectedthefirstoptiontoexpandthefilesystem,andthenrebootedyourPi.Ideally,you
shouldhavean8GBor16GBcardwheninstallingOpenCV.

ravishanakarkmMarch30,2016at2:09am#

REPLY

yes.Ihaveexpandedthefilesystembutnouse.Butihavenottriedon16GB.Letmetry.
thankyouforreplay.
regards,
ravishankar

AlexMarch30,2016at9:25am#

REPLY

WorkedformeonaRaspberryPi3runningRaspbianJessiewithOpenCV3.1.0
Thankyou.

AdrianRosebrockMarch30,2016at12:43pm#

REPLY

Awesome,ImhappytohearitAlex!

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

51/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

ravishankarkmMarch31,2016at11:36pm#

REPLY

Thankyou.Yesitisworkingnow.Thistimeiused16GB.
Regards,
Ravishankarkm

sathyaApril1,2016at8:41am#

REPLY

Hey,ImlookingforinstructionsthatwillhelpmeInstallcv2(OpenCV)withbindingstoPython2.7in
RASPBIANJESSIE.PLEASEHELP.DESPERATE.FORACOLLEGEPROJECT.

AdrianRosebrockApril1,2016at3:12pm#

REPLY

Pleaseseetheblogpostyouarecommentingon.ItdemonstrateshowtoinstallOpenCV(cv2
bindings)withPython2.7andRaspbianJessie.

ManasiShindeApril3,2016at8:30am#

REPLY

ihavetriedandtriedthistutorialabout7timesandfinallyopencv3wasinstalled!!ihavespentmore
than24hoursofmylife.Thistutorialsavedme.Thanksamillion.
icompletedmyinstallationcompletely,ididatestrunanditworked.butwheniopenedtheguiviavnc,the
cv2moduledidnotexist.
iguessthisis7thtimeunlucky.

AdrianRosebrockApril3,2016at10:18am#

REPLY

CongratsongettingOpenCVinstalledManasi!Also,afteropeningaGUIviaVNC,makesureyou
usetheworkoncommandtoaccessyourPythonvirtualenvironmentbeforeyoutrytoimportcv2:

1 $ workon cv
2 $ python
3 >>> import cv2

ManasiShindeApril18,2016at6:36am#

REPLY

itthrowsanerrorworkoncommanddoesntexist

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

52/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockApril18,2016at4:46pm#

REPLY

PleaseseetheanswertothefirstquestionintheTroubleshootingsectionofthisblog
postitdetailshowtoresolvethisproblem.

NoamApril4,2016at1:50am#

REPLY

ShouldIspecificallyinstalllibgtk2.0orjustthenewestversion?

AdrianRosebrockApril4,2016at9:26am#

REPLY

libgtk3.0shouldwork,butIvetendedtouselibgtk2.0.Ifyoutrylibgtk3.0anditworksforyou,
definitelyletmeknow!

AndrewRApril6,2016at4:38pm#

REPLY

HiAdrian,
Thankyouverymuchforthetutorial.
IvedonetheinstallationIcancheckitintheterminal,butPython2.7shell(IDLE)wassaying:nomodule
namecv2.
IvedoneasudoaptgetinstallpythonopencvandnowtheIDLEissayingthatIhaveOpenCV2.4.Inthe
terminalIstillhavethecorrectone3.1.0.
Couldyoupleaseexplainmehowtoremovethe2.4fromtheIDLEandthenhowtoadd3.1.0totheIDLE.
Ihopeyouwillanswermyquestion.
Regards,
AndrewR

AdrianRosebrockApril7,2016at12:42pm#

REPLY

YouwillneedtouseaptgettoremoveOpenCV2.4however,atthispointIwouldsuggest
reformattingthecardandstartingover.ThereasonIsaythisisbecausetheaptgetversionofOpenCVis
veryoldandlikelyalsoinstalledabunchofextradependenciesyoudontneed.
Secondly,makesureyouseetheTroubleshootingsectionofthispostasitdetailstheprimaryreasons
whyyouareunabletoimportthecv2bindings.

AndrewRApril7,2016at4:15pm#

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

53/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

ThankyouAdrian!Yourworkishugeandishighlyappreciated!
Regards,AndrewR.

AdrianRosebrockApril8,2016at12:54pm#

REPLY

Noproblem,happyIcouldhelp!

JimApril6,2016at7:15pm#

REPLY

Hastheissueregardingpyserial/GPIOlibraryinstalltothevirtualenvironmentbeenresolved?

AdrianRosebrockApril7,2016at12:40pm#

REPLY

Itsnotanissue,itsjustadifferenceinhowyouinstallthescript.Justaccessthevirtual
environmentandinstallGPIOintotheenvironment:

1 $ workon cv
2 $ pip install RPi.GPIO
3 $ pip install pyserial

HereisanexcellenttutorialonthebasicsofvirtualenvironmentsthatIrecommendeveryonegivearead.

JimApril6,2016at8:17pm#

REPLY

Verynicework,butitwouldveryhelpfulifyoucouldaddinstructionstotestasimplepython/opencv
scriptattheendoftheinstallationinstructionforthepurposeofverifyinginstallationandgivingthenewusera
handinlearninghowtosetupasimplescriptinthenewcvvirtualenvironment.

AdrianRosebrockApril7,2016at12:38pm#

REPLY

ThanksforthefeedbackJim.IvedonethatonpreviousOpenCVinstallposts,ImnotsurewhyI
didntforthisone.Also,ifyourelookingtoputyourOpenCV+RaspberryPiinstalltouse,besuretotake
alookatPracticalPythonandOpenCVwhichcontainsabunchoftutorialstogetyoustartedquickly.

RezaApril7,2016at12:49pm#

REPLY

Adrian,ihaveproblem,theproblemismkdirnospaceleftondevice,canyouhelpmetoresolve
this??thanks

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

54/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockApril7,2016at12:55pm#

REPLY

MakesureyouhavefullyexpandedthediskonyourRaspberryPibyusingsudoraspiconfig
andselectingthefirstoptiontoresizethedisk,thenrebooting.Ifyouhavealreadydonethisandthereis
stillnospaceleft,youlleitherneedto(1)deletefilesonthedisktomakemoreroomor(2)getalarger
microSDcard.

israelApril14,2016at2:49am#

REPLY

myraspberrypiturnedoffduringthemake.wheniusethemakeitdoesntgopast71%itlookslike
itslooping.Howdoigetpastit?Itriedmakecleanandthenmakebutthatdidntwork.Wouldihaveto
recreatethebuildfolder?

AdrianRosebrockApril14,2016at4:45pm#

REPLY

IfyourPishutoffduringthemakecommand,thenIwouldsuggestdeletingthebuilddirectory
andthenrecreatingit.Ifyoutriedcompilingusingmultiplecores,thentheshutofflikelybrokethebuild.

israelApril15,2016at6:18pm#

REPLY

Thanks,yeahduringthemultiplecorecompilationitbroke.Ijustusedtheregularsinglecore
makecommand.Nowitsallgravy:)Ireinstalledthebuilddirectoryandinstalleddependenciesand
compiledit.Thanksforthistutorial.

AdrianRosebrockApril17,2016at3:36pm#

REPLY

Nice,congratsonresolvingtheissue

AdolfoApril16,2016at12:58pm#

REPLY

Hithere!
ImfacingaproblemIamnotabletosolvebymyself(IamcompletelynewtoRPiandallthisbuildingand
compilingthings:))
WhenItrytocmakeopencv,beingoncvvirtualenv,Igetthiserrormessage:
CMakeError:Thesourcedirectory/home/pi/opencv3.0.0/build/BUILD_EXAMPLES=ONdoesnotexist.
ItriedtouseUwithalkeystoremovethemfromcache,butitkeepsthrowingthesameerror.
Anyclue?Imlost
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

55/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockApril17,2016at3:30pm#

REPLY

Itsoundslikeyourenotcopyingandpastingthecmakecommandcorrectly.Makesureyoucopy
andpastethefullcommand.

AdolfoApril19,2016at6:01am#

REPLY

Yep,Iwasmissingthetwotraillingperiods.

DumitruPopaApril17,2016at2:53am#

REPLY

Thankyou,nicework!

AdrianRosebrockApril17,2016at3:28pm#

REPLY

ThanksDumitru!

AdolfoApril17,2016at1:05pm#

REPLY

Hieverybody,
Justincasesomeisorwillgetstuckatthebeginningofstep4:thetwoperiodsattheendofthecmakeline
aremeaningful!!IwasgettinganerrormessagebecauseIthought(ignorantme)theyjustmeantyoucould
addmoreparameters.
Sillyme!

StewartBaskinApril20,2016at2:23pm#

REPLY

HiAdrian.Thanksforthegreattutorial!HaveyoumadethetutorialforthePi3?
Thanks!

AdrianRosebrockApril20,2016at5:57pm#

REPLY

Youbet.YoucanfindtheRaspberryPi3tutorialhere.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

56/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

JennyChingApril21,2016at8:17pm#

REPLY

HiAdrian,
Igottostep4(examiningtheoutputofCMake)andnoticedthatboththeInterpreterANDnumpyareboth
NOTinthevirtualenvironment(cv).WhichstepsdoIhavetogobacktotocorrectthese?Thanks!

AdrianRosebrockApril22,2016at11:46am#

REPLY

Tostart,makesureyouareinthecvvirtualenvironmentbeforeyourunCMake.Ifyouare,then
youllneedtomanuallysupplythepathstotheinterpreterandNumPydirectories.Formoreinformation
onhowtodothis,pleaseseethecommentssectionofthispost.

JennyChingApril22,2016at1:54pm#

REPLY

IdoublecheckedthatIwasinthecvenvironmentbeforeIranCMakehoweverwhenirun
CMakeIstillgetthis
Python2:
Interpreter:/usr/bin/python2.7(ver2.7.9)
Libraries:/usr/lib/armlinuxgnueabihf/libpython2.7.so(ver2.7.9)
numpy:/usr/lib/python2.7/distpackages/numpy/core/include(ver1.8.2)
packagespath:lib/python2.7/distpackages
Help!

AdrianRosebrockApril22,2016at3:51pm#

REPLY

Itactuallylooksliketheissueisrelatedtoyournumpyandpackagespathvariables.
ToresolvetheNumpyissue,haveyouinstalledNumPyintothecvvirtualenvironment?

1 $ workon cv
2 $ pip install numpy

Youcanactuallyjustleavethepackagespathvariablealoneandthenmanuallycopythecv2.so
fileintoyoursitepackagesdirectoryafterOpenCVcompilesandinstalls.

AkshayJethaniApril24,2016at3:30am#

REPLY

hii,
aftergivingthecommandofsudoaptgetupgrade,thepiistakingtolongtoupgradelike4hourssometimes,
evenafter4hoursitsstillupgradingandshowingconnectionfailedinbetween,canuplzhelpmeregarding
thisissue.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

57/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

REPLY

AdrianRosebrockApril25,2016at2:01pm#

Itsoundslikeyoumaynothaveaverystronginternetconnection.Iwouldsuggestmakingsure
youhaveagoodinternetconnectionbeforerunningtheupgradestep.

REPLY

CharlesBakerApril28,2016at11:05am#
Hello,

IhavefollowedthistutorialexactlyandhaveinstalledOpenCV3.1.0withouterrorhoweverIstillcannotseem
toaccessanyofthemodulesassociatedwithopencv_contrib(i.e.xfeatures2dtouseSIFTandSURF).Ihave
beenpullingmyhairoutoverthis,Ihavetriedreinstallingmanytimes,IincludetheD
OPENCV_EXTRA_MODULES_PATH=~/opencv_contrib3.1.0/modules\
linewhenusingcmake,therearenoerrors,thepathprovidediswheremyopencv_contribfolderisactually
locatedsoitisnotasifIampointedtothewrongdirectory,howeverIsimplygetanAttributeError:module
objecthasnoattributexfeatures2dwhenattemptingtousexfeatures2d

REPLY

AdrianRosebrockApril28,2016at2:22pm#
TakealookattheoutputofCMakespecifically,whereitoutputsthelistofmodulestobe

compiled.Doyouseeanyofthecontribmodulesinthere?Ifnot,itreallysoundslikethepathtothe
contribmodulescouldbeincorrect.

REPLY

RagunaathApril28,2016at10:37pm#
makecommandresumedafterapowerfailure.Willitpresentaproblem?

REPLY

AdrianRosebrockApril30,2016at4:03pm#

Itcould,dependingonwhereinthecompilestageyouwere.Iwouldsuggestrunningmake
cleanandthenrecompilingtogiveyourselfafreshstart.

REPLY

CollinSaleApril30,2016at3:43pm#
HiAdrian,
niceone,..worksfineandIalreadyreceivedyourhardcopy

ThanksaLot
onething:sinceIinstalledSambaShare,a5displayandsomeotherthingsbeforeIstartedopvenCV,Idid
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

58/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

actuallyrunoutofspaceonmy8GBSD,justlikeBillmentionedearlier.

BillKearsonJanuary3,2016at10:09am#
Usinga8GcardIwasalmostoutofspace

MaybeyoucouldaddaStep#7:CleanUptheSDCard

AndmentiononStep#1that8GBisjustabouttofitifyoudontinstallanythingelseearlier.
ThanksandbestRegards
Collin

AdrianRosebrockApril30,2016at3:46pm#

REPLY

ThanksforthesuggestionCollin,Illdefinitelylookintothis!

JesusDeJesusApril30,2016at8:25pm#

REPLY

HellowAdrian,Iresolvetheproblemofthecomandwget,butnowwhenIrunthecomand:
wgetOopencv.ziphttps://github.com/Itseez/opencv/archive/3.0.0.zip
thecomandlinesays:
2016020317:25:20https://github.com/Itseez/opencv/archive/3.0.0.zip
Resolvinggithub.com(github.com)192.30.252.131
Connectingtogithub.com(github.com)|192.30.252.131|:443connected.
ERROR:Thecertificateofgithub.comisnottrusted.
ERROR:Thecertificateofgithub.comisnotyetactivated.
Thecertificatehasnotyetbeenactivated
So,IfyoucanhelpmewiththatIwouldappreciateit.

AdrianRosebrockMay1,2016at3:08pm#

REPLY

HiJesustryaddingthenocheckcertificateswitchtowget,likethis:
$wgetOopencv.ziphttps://github.com/Itseez/opencv/archive/3.0.0.zipnocheck
certificate
Thisshouldtakecareoftheerror.

LukasVosykaMay3,2016at3:58pm#

REPLY

HiAdrian,
bynowyoubecamemynumber1resourceforcheckingOpenCVquestions,inspirationsandhowtos!
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

59/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Thankssomuchforyourcontributionandexcellentstepbysteptutorials.Iameventuallynewtothistopic
(comingfromWindowsand.NET^^)andyouhelpedmealot.ThisthreadwasalsoespeciallyhelpfulsinceI
gottodosomeprojectsonrapsiandOpenCV.
IlldefinitelygetyourhardcopybundleandlookingforwardimplementingsomecoolstuffwithRaspiand
OpenCV
ThanksagainforyourverydetailedandadmirablecontributiontothistopicaboutOpenCV!Guessyoullhear
fromme
Cheers,
Lukas

AdrianRosebrockMay3,2016at5:41pm#

REPLY

ThanksforthecommentLukasanditsawesometohearthatIcouldbeofhelp

ghanendraMay4,2016at12:22am#

REPLY

Helloo..!!Adrian
HowtoaddthesecommandstoautostartwhenIpoweronmyRaspberryPi?
source~/.profile
workoncv
vncviewer:1
pythonball_tracking.pypicamera1
IwanttoopenmypythonscriptusingthevirtualenvironmentworkoncveverytimewhenipowerupthePi.

AdrianRosebrockMay4,2016at12:32pm#

REPLY

Staytunedfortheblogpostin2weekswhereIdemonstratehowtoruncommands+Python
scriptsonboot

ghanendraMay4,2016at3:10pm#

REPLY

OK!!Adrian.Iamwaitingforyourfantasticposts.Moreandmoreiscomingtolearn.

MaugyMay6,2016at1:12am#

REPLY

Wow,assomeonewhoistryingtolearnLinux,thisisbyfartheclearestandbestwrittentutorialI
haveeverseen!
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

60/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Thankyou!

AdrianRosebrockMay6,2016at4:32pm#

REPLY

ThanksMaugy,Iappreciatethat

VikramBajajMay9,2016at9:41am#

REPLY

ThanksforthisawesometutorialAdrian!
Workedlikeacharm!

AdrianRosebrockMay9,2016at6:47pm#

REPLY

Fantastic,ImgladtohearitVikram!

MarcBoudreauMay12,2016at7:42pm#

REPLY

HiAdrian,
WhenyousayForsomereason,unbeknownsttome,whencompilingthePython3bindingstheoutput.so
fileisnamedcv2.cpython34m.soratherthancv2.so.,Ithinkthatsfixed.
Igotcv2.so
WhenIdothecheck,onthe(cv)raspberrypi$directory,everythingworksforthepythoncheck.
HoweverwhenIdotheversioncheckofCV2,doesntwork.
IfIchangedirectoryto(cv)raspberrypi/.virtualenvs/cv/lib/python3.4/sitepackages/
andchecktheversion,Igetsamemessageasyou.
WhenIstartaddingcomputervisionfunctionality,Imafraiditwontfindlibraries.
ImustofdoneSomethingwrong.
Isthereeasyfixoritsbesttoreformatandredoprocedure?

AdrianRosebrockMay13,2016at11:35am#

REPLY

AreyouabsolutelysurethatyoucompiledOpenCVwithPython3bindings?Doublecheckyour
outputofCMaketomakesurethisiscorrect.Youlltypicallyseethecv2.sofilewhencompilingPython
2.7bindings.

AshutoshMay16,2016at11:10am#
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

REPLY

61/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

HiAdrian,
Thanksforawesometutorial.Ihaveinstalledopencvandpythonastoldbyyou.
ButwhenIusethepicamera,Igetconsiderablelagbetweeninputandoutputshownonresult
window.Pleasesuggestsomething..

AdrianRosebrockMay17,2016at11:37am#

REPLY

HowareyouaccessingyourPicamera?NativelyviaHDMI+monitor?OroverVNC/SSH?Also,
whichmodelPiareyouusing?Allofthesecanaffectthelagyouareexperiencing.

SteveFlynnJune5,2016at9:22pm#

REPLY

Adrian,
Whenirunasavedpythonscriptasinsudopythontest_video.pyigetthecv2moduledoesnotexisterror.
Howover,wheniruntheimportdirectlyfromthecommandlineitworksperfectly.Inbothcasesiaminsidethe
virtualenvironmentandseethe(cv)ontheleft.Doesthishavesomethingtodowiththevirtualenvironment
ordidsomethingnotwork.
SteveFynn

AdrianRosebrockJune7,2016at3:28pm#

REPLY

Thisdoeshavetodowiththevirtualenvironment.Pleasereadthisblogpostformore
information,includingthesolution.

JitCraigJune7,2016at3:13am#

REPLY

awesomeguidetoinstallingopencv.everystepworkedcorrectly.nowamgettingreadytogetmy
handsdirtywithsomerealCVprojectsonmyRPi2

AdrianRosebrockJune7,2016at2:41pm#

REPLY

Fantastic,ImhappytohearthetutorialworkedforyouJit!

zoeJune11,2016at11:03pm#

REPLY

Thankyousomuch!!!Thatisreallyhelpful!!!

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

62/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

AdrianRosebrockJune12,2016at9:31am#

REPLY

Noproblem,ImgladIcouldhelpZoe!

RandyJune15,2016at10:51am#

REPLY

Followingthistutorialeverythingseemtoworkfineandcompletedwithouterrorbutattheendthe
cv2.soisnotpresentonmysystem.
Anyideas?

AdrianRosebrockJune15,2016at12:25pm#

REPLY

HeyRandyifyourenotseeingthecv2.sofile,theneithertherewasanerrorduringthe
CMake/makesteporthePythonbindingswerenotbuild.ChecktheoutputofCMaketoensurethatthe
python2/python3bindingsareinthelistofmodulestobebuild.

Trackbacks/Pingbacks
InstallingOpenCV3.0forbothPython2.7andPython3+onyourRaspberryPi2PyImageSearchOctober26,
2015
[]HowtoinstallOpenCV3.0onRaspbianJessie.[]
InstallingOpenCVonyourRaspberryPiZeroPyImageSearchDecember15,2015
[]SinceIvecoveredhowtoinstallOpenCVontheRaspberryPiinmultiple,previousblogposts,Illkeepthispost
ontheshortersideanddetailonlytherelevantcommandsnecessarytogetOpenCVupandrunning.Foramore
thoroughdiscussiononhowtoinstallOpenCV3onyourPi(alongwitha22minutevideoinstallationguide),please
refertothispost.[]
Installguide:RaspberryPi3+RaspbianJessie+OpenCV3PyImageSearchApril18,2016
[]HowtoinstallOpenCV3.0onRaspbianJessie.[]

LeaveaReply

Name(required)

Email(willnotbepublished)(required)

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

63/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch
Website

SUBMITCOMMENT

ResourceGuide(itstotallyfree).
Clickthebuttonbelowtogetmyfree11pageImageSearchEngineResourceGuidePDF.Uncover
exclusivetechniquesthatIdon'tpublishonthisblogandstartbuildingimagesearchenginesofyourown.

DownloadforFree!

Youcandetectfacesinimages&video.

Areyouinterestedindetectingfacesinimages&video?ButtiredofGooglingfortutorialsthatneverwork?Thenletme
help!Iguaranteethatmynewbookwillturnyouintoafacedetectionninjabytheendofthisweekend.Clickheretogiveita
shotyourself.
CLICKHERETOMASTERFACEDETECTION

PyImageSearchGurus:NOWENROLLING!

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

64/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

ThePyImageSearchGuruscourseisnowenrolling!Insidethecourseyou'lllearnhowtoperform:
AutomaticLicensePlateRecognition(ANPR)
DeepLearning
FaceRecognition
andmuchmore!
Clickthebuttonbelowtolearnmoreaboutthecourse,takeatour,andget10(FREE)samplelessons.
TAKEATOUR&GET10(FREE)LESSONS

Hello!ImAdrianRosebrock.
I'manentrepreneurandPh.Dwhohaslaunchedtwosuccessfulimagesearchengines,IDMyPillandChic
Engine.I'mheretosharemytips,tricks,andhacksI'velearnedalongtheway.

Learncomputervisioninasingleweekend.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

65/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Wanttolearncomputervision&OpenCV?Icanteachyouinasingleweekend.Iknow.Itsoundscrazy,butitsnojoke.My
newbookisyourguaranteed,quickstartguidetobecominganOpenCVNinja.Sowhynotgiveitatry?Clickhereto
becomeacomputervisionninja.
CLICKHERETOBECOMEANOPENCVNINJA

SubscribeviaRSS
Nevermissapost!SubscribetothePyImageSearchRSSFeedandkeepuptodatewithmyimagesearch
enginetutorials,tips,andtricks

POPULAR

InstallOpenCVandPythononyourRaspberryPi2andB+
FEBRUARY23,2015

HomesurveillanceandmotiondetectionwiththeRaspberryPi,Python,OpenCV,andDropbox
JUNE1,2015

HowtoinstallOpenCV3onRaspbianJessie
OCTOBER26,2015

InstallOpenCV3.0andPython2.7+onOSX
JUNE15,2015

InstallOpenCV3.0andPython2.7+onUbuntu
JUNE22,2015

BasicmotiondetectionandtrackingwithPythonandOpenCV
MAY25,2015

InstallingOpenCV3.0forbothPython2.7andPython3+onyourRaspberryPi2
JULY27,2015

Search
http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

66/67

6/17/2016

HowtoinstallOpenCV3onRaspbianJessiePyImageSearch

Search...

FindmeonTwitter,Facebook,Google+,andLinkedIn.
2016PyImageSearch.AllRightsReserved.

http://www.pyimagesearch.com/2015/10/26/howtoinstallopencv3onraspbianjessie/

67/67

You might also like