opencv Build and Compile opencv 3.1.0-dev for Python2 on Windows using CMake and Visual Studio Reading Image and Converting into grayscale


Example

import cv2
import numpy as np

img = cv2.imread('<your_image>')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)

cv2.imshow('image', img)
cv2.imshow('gray', gray)

cv2.waitKey(0)
cv2.destroyAllWindows()