'How to plot logical matrix in python

How do I plot a logical array in python, for example, I have this code:

import numpy as np
import matplotlib.pyplot as plt

filename = r"test.jpg"
img = cv2.imread(filename)
cv2.imshow("image", img)

b, g, r = cv2.split(img)
cv2.imshow('Green', g)

g_dominant = (g > b) & (g > r)

How can I plot and see "g_dominant". Matlab treats it as a binary image but I have trouble getting it plot on cv2.imshow.

Thanks.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source