So, I'm fairly novice to OpenCV, but I've done lots of searching and don't think I can find the solution anywhere online.
I have a three channel RGB image that I would like to find the ROI of. To clarify, everything but a small rectangular subset of the image (defined with a separate image) should be black.
I achieved this earlier using the following:
def roi(image, vertices):
mask = np.zeros_like(image)
cv2.fillPoly(mask, vertices, 255)
masked = cv2.bitwise_and(image, mask)
return masked
However, this, of course, only works with a greyscale image. Achieving it with a colour image has stumped me. Any advice or help as to how I could achieve this would be greatly appreciated.
Many thanks.