All notes
Cv2

Quick Start

Installation


# https://pypi.python.org/pypi/opencv-python
# The packages contain pre-compiled OpenCV binary with Python bindings.
# This enables super fast (usually < 10 seconds) OpenCV installation for Python.
pip install opencv-contrib-python

import numpy as np
import cv2
import os

script_dir = os.path.dirname(os.path.abspath(__file__))
imgFile = os.path.join(script_dir, "data", "example.tif")

im = cv2.imread(imgFile)
cv2.imshow("image", im)
cv2.waitKey(0) # Must set a waitKey, otherwise the displaying GUI will be only a flash.
cv2.destroyAllWindows()