Homography having only 2 aruco markers as a reference

try

realWorldMarkerCorners.shape = (-1, 1, 2)

C++ API cv::Mat commonly has to be a column vector of multi-channel elements. this will give it a column vector shape and a 2-channel element appearance, when translated from numpy into the cv::Mat that’s expected by the OpenCV function.

-1 rows for “fill this in”, 1 for one column, 2 “channels”.

OpenCV is a bit peculiar there.