You can use fillPoly()
to draw the rectangle on a mask array and you the mask array to select the pixels that you want:
import cv2
import numpy as np
rect = [[634, 547],[353, 504],[436, -41],[717, 1]]
poly = np.array([rect], dtype=np.int32)
img = np.zeros((800, 800), np.int8)
cv2.fillPoly(img, poly, 255)
imshow(img, cmap="gray")
the mask image: