I have a camera pointing at a Zen Garden from above. However, the camera is fixed on the side rather than directly above the plate. As a result, the image looks like this (note the skewed shape of the rectangle):
Is there a way to process the image so that the sand area can look more or less like a perfect square?
cap = cv2.VideoCapture(0)
while True:
ret, img = cap.read()
img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
img = cv2.flip(img,0)
cv2.imshow('Cropping', img)
if cv2.waitKey(500) & 0xff == 27:
cv2.destroyAllWindows()
break
Many thanks.