images from opencv displayed in blue

# matplotlib interprets images in RGB format, but OpenCV uses BGR format

# so to convert the image so that it's properly loaded, convert it before loading

img = cv2.imread('filename.ext')		# this is read in BGR format
rgb_img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)		# this converts it into RGB


Here is what the above code is Doing:
1. Reads in an image using OpenCV’s imread function
2. Converts the image from BGR to RGB using OpenCV’s cvtColor function
3. Displays the image using matplotlib’s imshow function
4. Shows the image using matplotlib’s show function