Thumb a9b1ccfc d50b 4439 8ce8 d4b8d892f6f9

From Zero to Python OpenCV 3 on Windows x64

This guide will get you all set up for Python-based image processing on any x64 mashine!

Project State

Public Project

Licences

Software Licence: Project has no software
Hardware Licence: Project has no hardware

Project Tags

Admins

StudentCV

Members

svholdt
Imaginghub
robbie7869

Does this project pique your interest?

Login or register to join or follow this project.

From Zero to Python OpenCV 3 on Windows x64

This guide will get you all set up for Python-based image processing on any x64 mashine! You should also be familiar with basic usage of your system's terminal. Let's get started!

Prerequisites

  1. This guide assumes that you're running Windows x64 on your machine. I've created the guide on a Advantech AIIS-1200P, which is a typical mashine for a vision application.
  2. Ensure your system's software is up-to-date.

pylon

Pylon contains all the software we need for interacting with Basler cameras. Builds are provided for multiple platforms.

  1. Download the latest pylon version from here, pick the hardfloat ARM version for Linux
  2. Unpack the file to a directory of your choice
  3. Follow the instructions in the INSTALL file. Do not attempt to run the pylon viewer as it is not bundled with ARM releases
  4. After successful installation plug in e.g. your Basler USB camera
  5. Now we will check if everything works. In your terminal move to pylon's Samples/Grab directory and execute make, then run ./Grab, you should see some text scrolling with information about pictures being grabbed

OpenCV and Python 3

On a x64 Windows mashine it's quite easy to get OpenCV up and running. The easiest way is using Miniconda for the installation.

  1. Download and install Miniconda. Miniconda also allows you to manage several Python installations easily.
  2. I recomment creating a new enviroment for this setup, but this is not mandatory. Therefore use these commands:
    conda create --anyName
    activate anyName
  3. Now its very easy to install OpenCV by the following commands. Numpy is not necessary, but strongly reccomendet.
    conda install -c menpo numpy
    conda install -c menpo opencv3
  4. Check your fresh installation of OpenCV by typing:
    python
    import cv2

PyPylon

The only missing part is connecting Python to your camera now. PyPylon takes care of this task. This step is compatible with any Basler camera. If you are using other cameras check if it offers a Python interface.

  1. First, ensure you're using the cv virtualenv you created while installing OpenCV
  2. Get your exact python version by running python --version from within your virtualenv
  3. Using this information, pick the corresponding PyPylon version from here
    (e.g. Python 3.5 → ..pypylon-1.0.7+pylon5.0.5.8999-cp35-none-win_amd64.whl)
  4. Install the whl file with pip via pip install *path-to-whl*
  5. Check the installation by typing:
    python
    import pypylon.pylon

Done! You can either try out our example projects now or create some cool stuff of your own. Have fun!

Comments