I have this code:
import cv2
from matplotlib import pyplot as plt
import numpy as np
img = cv2.imread('forklift2.jpg')
A = cv2.rectangle(img, (180, 90), (352, 275), (255,0,0), 2)
B = cv2.rectangle(img, (100, 220), (300, 275), (155,122,100), 2)
cv2.imshow('Object detector', img)
cv2.waitKey(0)
cv2.destroyAllWindows()
I need to detect the intersection beetween the 2 rectangle A & B like as swown in the picture:
So I need to have a boolean variable that should be true if the 2 rectangles have some common area. How can I do that?