Raspbian + OpenCV pre-configured and pre-installed.

Updated: September 16th, 2019

Ever since I wrote the first PyImageSearch tutorial on installing OpenCV + Python on the Raspberry Pi B+ back in February 2015 it has been my dream to offer a downloadable, pre-configured Raspbian .img file with OpenCV pre-installed.

Since November 2016 (the original publish date of this post), this dream has been a reality.

I am pleased to announce that the following products ship with my downloadable Raspbian .img files pre-configured and pre-installed:

There are two files included:

  • Raspbian3B_4B.img.gz  (compatible with RPi 3B, 3B+, 4B [1GB, 2GB, and 4GB models])
  • RaspbianZeroW.img.gz  (compatible with Pi Zero W)

All you have to do is download the .img files, flash the appropriate one to your SD card using BalenaEtcher, and boot your Pi.

From there, you’ll have a complete Python + OpenCV development environment at your fingertips, all without the hassle of configuring, compiling, and installing OpenCV.

To learn more about the Raspbian .img files, keep reading.

Raspbian Buster + OpenCV 4 out-of-the-box

I went back to my recent tutorials on installing OpenCV on the Raspberry Pi and computed the amount of time it takes to perform each step.

You know what I found?

Even if you know exactly what you are doing it can take significant time to compile and install OpenCV on your Raspberry Pi:

  • Over 55 minutes on the Raspberry Pi 4B
  • Over 2.2 hours to compile the Raspberry Pi 3B+.
  • Over 14 hours to compile on the Raspberry Pi Zero W

In the past, I’ve emailed a sample of novice readers who successfully installed OpenCV on their Pi and asked how long it took them to complete the compile and installation process.

Perhaps not surprisingly I found the amount of time for novice readers to install OpenCV on their Raspberry Pi 3B+jumped nearly 4x to over 8.7 hours (even longer for the Zero W). I haven’t conducted a similar survey for the Raspberry Pi 4, but my guess is that it would take most people about 4 hours to configure their Raspberry Pi 4.

Clearly, the barrier to entry for many PyImageSearch readers trying to learn OpenCV and computer vision is getting OpenCV itself installed on their Raspberry Pi.

In an effort to help these readers get the most out of their Raspberry Pi, I have decided to release my own personal Raspbian .img files that have OpenCV pre-configured and pre-installed.

By bundling the pre-configured Raspbian .img together with either (1) Practical Python and OpenCV, and/or (2) Raspberry Pi for Computer Vision my goal is to:

  1. Jumpstart your computer vision education by skipping the tedious process of installing OpenCV + Python on your Raspberry Pi.
  2. Provide you with a book with the best introduction to the world of computer vision and image processing that you can possibly get.

Of course, I will continue to createsupport, and provide help to any PyImageSearch reader who is using the many free tutorials I offer on installing OpenCV + Python on the Raspberry Pi.

Again, this pre-configured Raspbian .img is intended for PyImageSearch readers who want to save time and jumpstart their computer vision education.

If this doesn’t sound like you, no worries, I totally understand — I’ll be still be providing free tutorials to help you get OpenCV up and running on your Raspberry Pi. Just keep in mind that customers of mine receive priority support from me (while you’re on that page be sure to check out my other FAQs).

Raspbian Buster + OpenCV 4 pre-configured and pre-installed

The rest of this document describes how to install and use the Raspbian pre-configured .img file included in your purchase of either:

At the end of this guide, you’ll also find answers to frequently asked questions regarding the Raspbian + OpenCV .img file. If you have a question that is not covered in FAQ, please send me a message.

Download and unpack the archive

When you receive the link to your purchase, be sure to download the book, code, videos, and Raspbian. Each file is in the form of a .zip. The  Raspbian.zip  contains the preconfigured images and a README.txt  file.

Go ahead and unzip the files using your favorite unarchiving utility (7zip, Keka, etc.). There is no need to extract the included .gz files since we will flash with them directly.

After you unzip Raspbian.zip  your folder should look like this:

Figure 1: After downloading the Raspbian.zip file, unpack it to obtain the .img.gz file that you’ll flash to your SD card directly with BalenaEtcher.

Write OS image to a 32GB microSD card using BalenaEtcher

This Raspbian .img will work only on 32GB microSD cards. The .imgs are too large for 8GB or 16GB cards. To my knowledge, the Raspberry Pi does not support 64GB+ microSD cards.

I recommend the high quality Sandisk 32GB 98MB/s cards. They are available at Amazon and many online distributors.

To write the pre-configured Raspbian .img to your card simply follow the official Raspberry Pi documentation. The recommended tool is BalenaEtcher (compatible with Mac, Linux, and Windows).

BalenaEtcher can handle compressed files such as .gz (no need to extract the .img.gz before loading into Etcher).

Figure 2: Flashing your pre-configured Raspbian .img with BalenaEtcher for your Raspberry Pi.

Booting your Pi for the first time

After writing the the Raspbian .img to your card, insert the card into your Pi and boot it up. On the first boot, your Raspbian filesystem needs to be expanded to fit the SD card.

This means that you have to run raspi-config => Advanced => Expand Filesystem  manually.

After the expansion has completed your Pi will reboot and you will be able to use it as normal (the expansion of the filesystem is only necessary on the first boot).

Here is a screenshot of the disk utilization on my Pi after it has been auto-expanded:

Figure 3: After booting my Raspberry Pi for the first time your filesystem will be expanded to utilize the entire disk.

Notice that my entire 32GB card is available and 35% is in use.

Default WiFi

By default, your Raspberry Pi will attempt to connect to a network named pyimagesearch  with passphrase computervision .

This is useful if you are in a pickle:

  • Maybe you just flashed your microSD and you need to get connected quickly.
  • Perhaps you aren’t near your typical wireless and you want to hotspot your phone so that your Pi and laptop connect through your phone’s wireless network. Works with iPhone and Android.
  • Maybe you forgot your keyboard/mouse/HDMI screen and you need to do everything via SSH and VNC, but you can’t easily connect to your Pi at the moment.  Refer to this tutorial about remote development and connectivity with your Raspberry Pi.

We’ve used this method to get connected many times in the field. It is convenient, but it is a security risk. While we do not recommend using this wireless network long term since this password is public (in nearly all deployment applications you should delete the network + password from your Pi), it is a great way to get connected if you just flashed a microSD. We also recommend changing the default password associated with the username of your Raspberry Pi.

Using Python and OpenCV on your Raspberry Pi

In order to gain access to OpenCV 4 (and OpenCV 3) with Python 3 bindings we leverage Python virtual environments. Each Python virtual environment is totally independent from one another ensuring there are no dependency or versioning issues.

In the remainder of this section, I explain (1) what Python virtual environments are and (2) how to access the Python 3 + OpenCV 3/4 environments.

What are Python virtual environments?

At the very core, Python virtual environments allow us to create isolated, independent environments for each of our Python projects. This implies that each project can have its own set of dependenciesregardless of which dependencies another project has.

In the context of OpenCV, this allows us to have one virtual environment for OpenCV 4 and then another virtual environment for OpenCV 3. Furthermore, we can have Intel OpenVINO and Google Coral virtual environments.

For a detailed look at Python virtual environments please refer to this tutorial.

Python 2.7 support is deprecated

On January 1, 2020, Python.org will no longer be updating Python 2.7 (that goes for security updates too). Read Python 2.7’s sunset announcement here.

PyImageSearch officially no longer supports Python 2.7. All future code is Python 3-compatible only.

What virtual environments are on the .imgs?

The Raspberry Pi 3B/3B+/4B .img contains the following environments:

  • py3cv4 : Python 3.7 and OpenCV 4.1.1
  • py3cv3 : Python 3.7 and OpenCV 3.4.7
  • openvino : Python 3.7 and OpenCV 4.1.1-openvino (OpenVINO is an Intel deep learning + hardware-optimized toolkit by Intel)
  • coral : Python 3.7 and OpenCV 4.1.1
  • gopigo  : Python 3.7 and OpenCV 4.1.1

The Raspberry Pi Zero W .img contains the following environments:

  • py3cv4 : Python 3.7 and OpenCV 4.1.1
  • py3cv3 : Python 3.7 and OpenCV 3.4.7

Accessing a virtual environment

There are two ways to access our virtual environments on the Raspbian .imgs.

Option 1: Use the workon  command

If, for example, you desire to use the Python 3 + OpenCV 4.1.1  environment simply use the workon command and the environment name:

Notice that the bash prompt is then preceded with the environment name in parentheses.

Note: The OpenVINO environment requires that you use the Option 2 method below.

Option 2: Use the source  command

You can also just use the following command with the start scripts located in your home directory:

If you use OpenVINO, an additional Intel-provided script will be called automatically via the “start” script:

Your terminal will look like similar to this (I’m SSH’ed into my Raspberry Pi from macOS):

Figure 4: Starting the OpenVINO environment for the Movidius NCS on a Raspberry Pi pre-configured .img.

Executing code from my books on your Raspberry Pi

There are multiple methods to access the source code for Practical Python and OpenCV or Raspberry Pi for Computer Vision on your Pi. The first is to use Chromium, Raspbian’s built-in web browser to download the .zip archive(s):

Figure 7: Downloading the source code from Practical Python and OpenCV using the Raspberry Pi web browser.

Figure 5: Downloading the source code from Practical Python and OpenCV using the Raspberry Pi web browser.

Simply download the .zip directly to your Pi.

If the code currently resides on your laptop/desktop, you may also use your favorite SFTP/FTP client and transfer the code from your system to your Pi:

Figure 8: Utilize a SFTP/FTP client to transfer the Practical Python and OpenCV code from your system to the Raspberry Pi.

Figure 6: Utilize a SFTP/FTP client to transfer the Practical Python and OpenCV code from your system to the Raspberry Pi.

Or you may want to manually write the code on the Pi using the built-in text editor as you follow along with the book:

Figure 9: Using the built-in text editor that ships with the Raspberry Pi to write code.

Figure 7: Using the built-in text editor that ships with the Raspberry Pi to write code.

I would suggest either downloading the book’s source code via web browser or using SFTP/FTP as this also includes the datasets utilized in the book as well. However, manually coding along is a great way to learn and I highly recommend it as well!

For more tips on how to work remotely with your Raspberry Pi, be sure to read my Remote development on the Raspberry Pi blog post.

Frequently Asked Questions (FAQ)

In this section, I detail the answers to frequently asked questions regarding the Raspberry Pi .img file.

Which Raspbian images are compatible with which respective hardware?

Here is the compatibility listing:

  • Raspbian3B_4B.img.gz :
    • Raspberry Pi 4B (1GB, 2GB, and 4GB models)
    • Raspberry Pi 3B+
    • Raspberry Pi 3B
  • RaspbianZeroW.img.gz :
    • Raspberry Pi Zero W

What if I want to install OpenCV + Python on my Raspberry Pi by myself?

By all means, I encourage you to do so. It’s a great exercise and you’ll learn a lot about the Linux environment. I would suggest you follow one of my many free tutorials on installing OpenCV + Python your Raspberry Pi.

Again, this pre-configured Raspbian image is intended for readers who want to skip the install process and jumpstart their education.

How long will it take to install Python + OpenCV by hand?

I’ve ran the numbers and even if you know exactly what you are doing it will take a bare minimum of 55 minutes to compile and install OpenCV on a Raspberry Pi 4 and approximately 14 hours on the Raspberry Pi Zero W.

If you have never installed OpenCV before or you are not familiar with Linux-based environments that number can easily jump to many times those numbers based on my survey of novice readers who successfully installed OpenCV on their Raspberry Pi.

In fact, to install everything on the Raspberry Pi Zero W including 2 environments (2 compiles of OpenCV) it took approximately 6 days (including overnight compiles).

It really comes down to how much you value your time and how quickly you want to get started learning computer vision. I always encourage you to use my free tutorials on installing OpenCV on the Raspberry Pi, but if you want to save yourself time (and headaches), then definitely consider going with the pre-configured Raspbian .img.

Which Practical Python and OpenCV bundles is the Raspbian image included in?

The pre-configured Raspbian image is included in both the Quickstart Bundle and Hardcopy Bundle of Practical Python and OpenCV. The pre-configured Raspbian image is not included in the Basic Bundle.

Which Raspberry Pi for Computer Vision bundles is the Raspbian image included in?

The pre-configured Raspbian image is included all bundles: Hobbyist, Hacker, and Complete Bundles.

After installing your distribution of Raspbian, how do I access Python + OpenCV?

See the “Using Python and OpenCV on your Raspberry Pi” section above.

Is Wolfram’s Mathematica included in your Raspbian distribution?

No, I am not legally allowed to distribute a modified version of Raspbian (that is part of a product) with Mathematica installed.

How did you reduce the size of the Raspbian image file?

To start, I removed unneeded software such as Wolfram’s Mathematica and LibreOffice. Removing these two pieces of software alone saved nearly 1GB of space.

From there, the size of the main partition was reduced by zeroing all bits and compressing the file to .gz format.

Which Operating System version of Raspbian is included?

The latest .imgs run Raspbian Buster.

I have your previous StretchOS image. Why won’t the workon command work?

My previous .imgs did not have the virtualenvwrapper settings in the ~/.bashrc  (they were placed in ~/.profile ).

Therefore, you need to either (1) copy the virtualenvwrapper settings from ~/.profile  to ~/.bashrc , or (2) source the profile first via source ~/.profile.

What Python packages are installed on the Raspberry Pi?

After accessing any virtual environment (see “Accessing a virtual environment”) run pip freeze  to see a full list of Python packages installed.

In short, I have included all necessary Python packages you will need to be successful executing the examples in Raspberry Pi for Computer Vision and Practical Python and OpenCV, including OpenCV, NumPy, SciPy, scikit-learn, scikit-image, mahotas, and many others. Click the following image to enlarge it so you can see all the packages:

Figure 8: A listing of the packages installed in each of the environments on the Raspberry Pi Raspbian .img.

Where can I learn more about Python virtual environments?

My favorite resource and introduction to Python virtual environments can be found here. I also discuss them in the first half of this blog post.

Where can I purchase a copy of Practical Python and OpenCV?

To purchase your copy of Practical Python and OpenCV, simply click here, select your bundle (I recommend either the Quickstart Bundle or the Hardcopy Bundle), and checkout.

Where can I purchase a copy of Raspberry Pi for Computer Vision?

To purchase your copy of Raspberry Pi for Computer Vision, simply click here, select your bundle (I recommend either the Hacker Bundle or the Complete Bundle if you really want to master the Raspberry Pi), and checkout.

Can I purchase the .img as a standalone product?

The .img files are intended to accompany my books as added benefits. I would recommend purchasing a book to gain access to the .img.

I have another question.

If you have a question not listed in this FAQ, please send me a message.

Sound good?

Figure 9: Purchase (1) Raspberry Pi for Computer Vision, or (2) Practical Python and OpenCV + Case Studies to get ahold of the pre-configured Raspbian .img files!

If you’re ready to put the .img to use on all of the Raspberry Pis you own, just purchase one of my books that come with the .img.

To purchase your copy of Raspberry Pi for Computer Vision, just click here. All bundles come with the pre-configured Raspbian .img files.

Or to purchase your copy of Practical Python and OpenCV, just use this link. You will find the pre-configured Raspbian .img files inside both the Quickstart Bundle and the Hardcopy Bundle (the Basic Bundle does not include the Raspbian .img).

To see all the products I offer, click here.

, , , , ,

66 Responses to Raspbian + OpenCV pre-configured and pre-installed.

  1. Hugh November 21, 2016 at 12:29 pm #

    Excellent work Adrian, many thanks! I am working with a group of students who are using a USB monochrome camera on a Pi-3; the camera supports 1394 protocol over USB-2 (it’s a Point Grey Chameleon 2), have you any examples using that interface with Python?

    • Adrian Rosebrock November 21, 2016 at 12:43 pm #

      Thanks Hugh. I don’t have any examples that directly cover the firewire protocol, but I would instead look to see if the camera is compatible with the cv2.VideoCapture function. If it is, this is by far the easiest way to access frames from a video stream for peripheral cameras.

      • sachin October 6, 2017 at 4:08 am #

        where can i get the image file?

        • Adrian Rosebrock October 6, 2017 at 4:53 pm #

          Hi Sachin — the pre-configured Raspbian .img file is part of the Quickstart Bundle and Hardcopy Bundle of my book, Practical Python and OpenCV.

          • Jamboree February 1, 2018 at 3:53 am #

            You should make it freely available. Why make is something that user pays for?

          • Jamboree February 1, 2018 at 3:54 am #

            The costing is huge for over Half the world population

  2. Atas Feti November 21, 2016 at 1:30 pm #

    Dear Adrian thank you for your great explanation. I am about to start rasppery pi and İ find your module very useful. So that raspian.zip file should we buy some kind of course to be able download it cause ı couldnt see a link to do so

    • Adrian Rosebrock November 21, 2016 at 2:11 pm #

      Hey Atas — the Raspbian .img file is included in both the Quickstart Bundle and Hardcopy Bundle of Practical Python and OpenCV.

      Once you purchase your copy you will be able to download a file named “Raspbian.zip”. Inside this .zip file is your Raspbian .img file.

  3. Bogdan November 22, 2016 at 3:01 am #

    I was waiting for this for some time. This is really helpful Adrian! I have just finished installing OpenCV on a CHIP computer (9 bucks). Compiling takes even longer (~9 h), so I preferred using apt-get, but I get only Opencv 2.x, which is fine (at least for now).
    I wish Chip would have a way to backup and restore, so that I can just flash an *.img file like I can on RPi.
    Btw, do you think this img would run on RPi zero also?

    • Adrian Rosebrock November 22, 2016 at 12:33 pm #

      Let me boot up my Raspberry Pi Zero and test it out. I will edit this comment as soon as I get the result.

      EDIT: Confirmed. I just booted up my Raspberry Pi Zero and confirmed that my Raspbian .img file will work with the Pi Zero as well. I have included a photo as proof here (the terminal is simply demonstrating that Python can import the OpenCV bindings).

  4. Melrick Nicolas November 22, 2016 at 4:33 am #

    where is the download link?

    • Adrian Rosebrock November 22, 2016 at 12:31 pm #

      The Raspbian .img file is part of the of the Quickstart Bundle and Hardcopy Bundle of Practical Python and OpenCV. You would need to purchase one of these bundles to download the pre-configured Raspbian + OpenCV .img file.

  5. Rick November 23, 2016 at 7:42 pm #

    Have a wonderful time with all your friends and family. You’re an very class act and I look forward to another year!

    • Adrian Rosebrock November 24, 2016 at 9:36 am #

      Thank you Rick, I appreciate that 🙂

  6. Aly November 28, 2016 at 2:55 am #


    How do I rebuild opencv in your new img. I want to rebuild it because of a opencv bug in face.hpp I commented something out, and now I want to rebuild opencv how would I do that?


    • Adrian Rosebrock November 28, 2016 at 10:18 am #

      If you would like to install compile + install OpenCV again you would need to download the source, make your modifications, and then re-run CMake and make. I would refer to my previous tutorial on installing OpenCV on the Pi for more information.

  7. Tony Eckel November 29, 2016 at 4:08 pm #

    Note for Windows Users: To use remote desktop, at SSH prompt do:

    sudo apt-get install xrdp vnc4server

    That will allow Remote Desktop access to the Raspberry Pi desktop

    Notice that Mathimatica and Wolfram icons are dead in the menu bar. Were these removed from the build?

    • Adrian Rosebrock December 1, 2016 at 7:43 am #

      Yes, they were removed from the build. Please see the “Is Wolfram’s Mathematica included in your Raspbian distribution?” section of this post for more details.

  8. Sam December 11, 2016 at 12:14 pm #

    What default password have you set for the user ‘pi’ in this pre-configured image?

    • Adrian Rosebrock December 12, 2016 at 10:37 am #

      The password is the same default password for all Raspberry Pi machines: raspberry

  9. steve gale January 3, 2017 at 3:39 pm #

    Hi Adrian,

    I have been following your blog for quite a while and have created an application which I want to run automatically when my raspberry PI boots.

    Do you know if it is possible to get a virtual environment to run on power up?
    I have created a script similar to your start_py2cv3.sh ,
    source ~/.profile
    workon cv
    python /home/pi/homesurv.py –conf conf.json

    when the python script runs I get an error message along the lines of can’t find cv2 implying that the virtual environment is not running.

    If not, I will start with a clean image and install opencv manually, following one of your blogs of course!


  10. Roberto January 9, 2017 at 2:05 pm #

    Hi and thanks for the valuable posts you do.
    I’d like to know (probably I just missed it) the raspian version you’ve installed opencv on, is it pixel?

    • Adrian Rosebrock January 10, 2017 at 1:08 pm #

      Hey Roberto — you are correct, the Raspbian version that comes with OpenCV pre-installed has PIXEL.

  11. Daniella Solomon January 14, 2017 at 12:53 pm #

    What application do you use in mac for SFTP/FTP client?

    • Adrian Rosebrock January 15, 2017 at 12:04 pm #

      I normally use Transmit or CyberDuck, but you could just as easily use the command line as well.

  12. ALOK MISHRA January 20, 2017 at 2:16 am #

    sir,i want to ask u
    i just copy my sd card which have already rasbian and open cv and paste it into another new memory card and then i want to use that new memory card
    is it possible

    • Adrian Rosebrock January 20, 2017 at 10:55 am #

      Hey Alok — I’m not sure I understand what you mean. You have a new memory card and you want to install my pre-configured Raspbian .img file on it?

  13. Ian May 15, 2017 at 10:13 am #

    great job in providing this package.

    My question: Is this opencv build also good for c and c++ programming? Thanks.

    • Adrian Rosebrock May 17, 2017 at 10:09 am #

      Yes, you can use this same install for C/C++ programming with OpenCV as well.

  14. andri July 28, 2017 at 11:35 pm #

    What is this package from os jessie, python2.7 + opencv3.? For raspberry pi 3? Problem i lost backup? sorry i speak from google translite thank you before

    • Adrian Rosebrock August 1, 2017 at 9:51 am #

      The pre-configured Raspbian .img file runs Raspbian Jessie. It supports Python 2.7 + OpenCV 3 and Python 3 + OpenCV 3.

  15. Shirish (Sam) Ranade September 1, 2017 at 4:06 pm #


    Does one have to format an SD card that came with the RPi-3 Kit?

    The SD card already has NOOBS on it.

    Can I just use WIN32DISKIMAGER and write Raspbian.img onto it?

    Awaiting your reply before I start on this project

    • Adrian Rosebrock September 5, 2017 at 9:41 am #

      Hi Shirish — yes, you can use Win32DiskImager to flash your Raspbian .img file onto the SD card, exactly like the Raspbian tutorials on the official Raspberry Pi site.

  16. Daniel September 29, 2017 at 2:31 pm #

    Hello Adrian,

    Once I get the Pi running with the Raspbian .img file is it recommended to do a “sudo apt-get update & “sudo apt-get upgrade” ?

    • Adrian Rosebrock October 2, 2017 at 10:08 am #

      Yes, it’s best to ensure that your packages are updated.

  17. Bashir Hassan December 20, 2017 at 12:49 pm #

    Hello Adrian ! great content and tutorials thank you for your efforts in making things easier 🙂

    I have purchased the Quickstart Bundle and it has awesome content, but just when I’m trying to run the module for any of the codes I receive

    File “/home/pi/Desktop/code/color_tracking/track.py”, line 8, in
    import cv2
    ImportError: No module named cv2

    how can i fix it ?
    thank you in advance ! ::)

    • Adrian Rosebrock December 22, 2017 at 7:05 am #

      Hey Bashir — thank you for picking up a copy of Practical Python and OpenCV! I assume you using my pre-configured Raspbian .img file? If so, pelase see the “Accessing the Python 2.7 + OpenCV 3 environment” or “Accessing the Python 3 + OpenCV 3 environment” section of this post. I think you are likely forgetting the “workon” and/our “source” commands. I hope that helps!

  18. Mark Z January 1, 2018 at 10:16 pm #

    Does the preconfigured image that you are currently distributing included the optimization’s from your “Optimizing OpenCV on the Raspberry Pi” post?

    • Adrian Rosebrock January 3, 2018 at 1:06 pm #

      Yes, along with a few additional libraries such as dlib as well.

  19. Bruce Cano January 5, 2018 at 4:19 pm #

    I downloaded the pre-installed ISO with opencv and python, I have raspberry zero, but it just looked like a screen with colors, it does not boot.

    • Adrian Rosebrock January 8, 2018 at 2:57 pm #

      Hey Bruce — was this for the Raspberry Pi Zero or the Pi Zero W?

  20. amar February 16, 2018 at 4:33 am #

    when am update firmware raspberry stopped booting ,its shows red light only

    • Adrian Rosebrock February 18, 2018 at 9:52 am #

      Hey Amar — it sounds like for whatever reason the firmware update hurt your install. I would suggest re-flashing your Raspbian .img file to your SD card and booting.

  21. Ahmad February 26, 2018 at 3:25 pm #

    How can I get your pre-configured Raspbian .img file
    Thank you alot

    • Adrian Rosebrock February 27, 2018 at 11:37 am #

      Hey Ahmad — the Raspbian .img file is included in the Quickstart Bundle and Hardcopy Bundle of my book, Practical Python and OpenCV.

  22. Craig April 15, 2018 at 6:02 am #

    I purchased the Quickstart Bundle with the Raspbian .img file. I’d like to add files to the py3cv3 virtual environment within the included Raspbian image. Could you specify its location from the root directory?

    • Adrian Rosebrock April 16, 2018 at 2:27 pm #

      Hey Craig — can you clarify what you mean by “add files”? Are you talking about pip-installable packages? Or special Python packages you are coding on your own machine?

  23. Houman August 19, 2018 at 3:32 pm #

    I’m having issues loggign in. When I type in pi for the suername and raspberry for the password it says my login is incorrect.

    • Adrian Rosebrock August 22, 2018 at 10:05 am #

      Hey Houman — are you using a US/English keyboard layout? If not, make sure you update your keyboard mapping. The password is indeed raspberry

  24. hemanthnr1 November 5, 2018 at 6:50 pm #

    i can’t login to the pi. Username pi and password raspberry not working. using english us format

    • Adrian Rosebrock November 6, 2018 at 1:10 pm #

      The Raspbian OS assumes you are using an English keyboard layout (I also had to use the English keyboard layout to setup the Pi). You can change the keyboard layout using these instructions. Could you switch your keyboard to an English layout just to login and then switch it to whatever layout you need?

    • pazli March 15, 2019 at 3:56 am #

      at first i failed to login to pi user.
      to go to root, only need to sudo

      to hv new passwd:

      -open Terminal (with your mouse)
      -type: sudo su – (you are root now)
      -type: passwd pi (to change to a new passwd )
      * now if you want, u can set to login without X-windows.

  25. Tom July 22, 2019 at 7:04 am #

    Hi Adrian,
    I see the post is from 2016 and the link that brought me here is from your product update email for the upcoming “RPi for CV” book (2019). With this time diff in mind I’ve got a couple of quick questions:
    1. Are versions of cv2 and tf included in the .img file (linked in the email under “View Purchase Online” link) up-to-date (i.e. OpenCV v4 and tf 1.12+) ?
    2. Has the .img been tested on the new RPi4?
    3. Are packages for Coral included too?

    • Adrian Rosebrock July 25, 2019 at 9:33 am #

      Hey Tom — while this post was originally published in 2016 I keep it updated with the latest guides and instructions. The .img file here includes both OpenCV 3 and OpenCV 4. A new .img file will be released later this year with Coral support as well!

  26. Bill Strum July 23, 2019 at 8:19 pm #

    I’m assuming the 3B code will run on the Pi 4. Is this correct?

    • Adrian Rosebrock July 25, 2019 at 9:28 am #

      Yes, you are 100% correct. The code works on a RPi 4.

  27. john potpolak August 15, 2019 at 4:48 pm #

    Does this image have the facetracking and servo control on it ?

    • Adrian Rosebrock August 16, 2019 at 5:24 am #

      No, because we don’t want to make the assumption/force you to use specific hardware. We do provide our recommended hardware and instructions on how to install the supporting libraries inside Raspberry Pi for Computer Vision.

  28. Daniel Krotov September 12, 2019 at 4:22 pm #

    Hey Adrian

    This is more of an FYI I believe unless you are already aware. So mind you, I have never messed with the Raspberry PI so please take this with a grain of salt. I have recently been asked to look into doing some computer vision on the Raspberry Pi and thought this was an awesome time to try out the image you provided. I put in an order for a Raspberry Pi 4B and received it recently and today I thought I would try to perform the load. I went through the process of flashing it, only to have it not boot. I reformatted and tried again and again got a flicker of the green light and the red light stayed on permanently.

    So I took to Google and found the following “sticky” in their forum that seems to be what’s happening here. Mind you, I did try to boot with nothing connected and no sdcard and I get the flashing 4 green lights which suggests the bootloader is fine. So it seems that the new Raspberry Pi 4B cards will not work with older versions.

    Thought you might find it of interest, or perhaps you already were aware and I just missed it. Going to go about just performing the install the standard way. It seems the default NOOBS approach is already atleast booting.

  29. Phil September 19, 2019 at 7:06 pm #


    Please note – in order to install the latest image, I had to use a 64Gb uSD – and not the zip package (which Etcher lets you do) – but the actual *.img file.

    Just thought you should know – to avoid the frustrations I had earlier today


    • Adrian Rosebrock September 25, 2019 at 10:50 am #

      Thanks for sharing, Phil.

      What model micro-SD card are you using? Are you using a cheaper Kingston card? I’ve seen a few readers run into flashing issues if they are using a cheaper card. Try using the SanDisk cards recommended in this guide.

  30. Bob O December 17, 2019 at 2:27 pm #


    Loving the new bundle! I saw above that you update the image, but is there a version control or something similar to tell what version I have installed if I use it? I have some cards with earlier images, and some with later, and want to be able to know which version I have for the forum.

    I do keep everything apt update, so that may impact it.

    I would also love to be able to tell when you have updated the image.

    2 lazy-newb requests. It would be awesome if you preinstalled the actual example software, and pre-customized the hostname that shows up i.e RPiForCVvX.

    Keep up the great work, and I think I have to buy the third bundle when I finish working through Hacker!

    • Adrian Rosebrock December 18, 2019 at 9:45 am #

      Thanks Bob, I’m glad you’re enjoying them! There isn’t a version control yet, but in the next release we’ll include a “version.txt” file which indicates the version.

      As for the actual example software, I’ve considered doing that, but ultimately decided against it, the main reason being it would dramatically inflate the .img file. It’s already large enough as is and I don’t want the download to break for readers with slower/loss reliable internet connections.

Before you leave a comment...

Hey, Adrian here, author of the PyImageSearch blog. I'd love to hear from you, but before you submit a comment, please follow these guidelines:

  1. If you have a question, read the comments first. You should also search this page (i.e., ctrl + f) for keywords related to your question. It's likely that I have already addressed your question in the comments.
  2. If you are copying and pasting code/terminal output, please don't. Reviewing another programmers’ code is a very time consuming and tedious task, and due to the volume of emails and contact requests I receive, I simply cannot do it.
  3. Be respectful of the space. I put a lot of my own personal time into creating these free weekly tutorials. On average, each tutorial takes me 15-20 hours to put together. I love offering these guides to you and I take pride in the content I create. Therefore, I will not approve comments that include large code blocks/terminal output as it destroys the formatting of the page. Kindly be respectful of this space.
  4. Be patient. I receive 200+ comments and emails per day. Due to spam, and my desire to personally answer as many questions as I can, I hand moderate all new comments (typically once per week). I try to answer as many questions as I can, but I'm only one person. Please don't be offended if I cannot get to your question
  5. Do you need priority support? Consider purchasing one of my books and courses. I place customer questions and emails in a separate, special priority queue and answer them first. If you are a customer of mine you will receive a guaranteed response from me. If there's any time left over, I focus on the community at large and attempt to answer as many of those questions as I possibly can.

Thank you for keeping these guidelines in mind before submitting your comment.

Leave a Reply