Наконец я это сделал !!!
...
ret, frame1 = cap.read()
ret, frame2 = cap.read()
print(frame1.shape)
while cap.isOpened():
diff = cv2.absdiff(frame1, frame2) # 640x480 frame
diff2 = diff[0:240, 0:320] # Top Left
diff3 = diff[0:240, 320:640] # Top Right
diff4 = diff[240:640, 0:320] # Down Left
diff5 = diff[240:480, 320:640] # Down Right
gray2 = cv2.cvtColor(diff2, cv2.COLOR_BGR2GRAY)
blur2 = cv2.GaussianBlur(gray2, (5,5), 0)
_, thresh2 = cv2.threshold(blur2, 20, 255, cv2.THRESH_BINARY)
dilated2 = cv2.dilate(thresh2, None, iterations=3)
contours2, _ = cv2.findContours(dilated2, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
gray3 = cv2.cvtColor(diff3, cv2.COLOR_BGR2GRAY)
blur3 = cv2.GaussianBlur(gray3, (5,5), 0)
_, thresh3 = cv2.threshold(blur3, 20, 255, cv2.THRESH_BINARY)
dilated3 = cv2.dilate(thresh3, None, iterations=3)
contours3, _ = cv2.findContours(dilated3, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
.
.
.
gray5 ...