I am trying to translate an image (from a video capture) 100px left by cutting off the 100px on the left and adding 100px of black pixels on the right so that the image stays the same size. I know this can be done with cv2.warpAffine() and a translation matrix, but doing this to each frame is adding high amounts of latency. I have read that there may be a way to do this using cv2.copyTo(), but I am still not sure how exactly this can be done, whether it is using copyTo or another method. Thanks!
This is done in Python 3 with OpenCV 4.1
Current (slow) method:
translation_matrix = np.float32([[1, 0, x_shift], [0, 1, y_shift]])
img = cv2.warpAffine(img, translation_matrix, (w, h))