In this post on OpenCV Python Tutorial For Beginners, I am going to show How to use matplotlib with OpenCV. matplotlib is a User friendly, but powerful, plotting library for python. I is commonly used with OpenCv images. pylab is a module in matplotlib that gets installed alongside matplotlib; and matplotlib.pyplot is a module in matplotlib. matplotlib is a python 2D plotting library which produces publication quality figures in a variety of hardcopy formats.
Gist of code I used in this video (How to Display a Matplotlib RGB Image ) –