The images used for the extrinsic calibration of the cameras are images of an ArUco marker on a cardboard, as shown below,
aruco.DetectMarkers(): Function from the aruco library of OpenCV, detects the corners of the aruco marker and returns the id of the aruco marker along with image coordinates of the corners of the marker.
cv2.stereoCalibrate(): Given the camera matrices, object points and the corresponding image points in images from both of the stereo cameras, it calculates the R, T, E, F i.e. Rotation Vector, Translation Vector, Essential Matrix and the Fundamental Matrix respectively. R and T define the extrinsic calibration parameters between the two cameras.
The above results can be verified by calculating the value of-
which is supposed to be equal to zero according to the standard fundamental matrix equation. Closer the value to 0, accurate are the results. x' and x in the above formula are the corresponding image coordinates in second and first image respectively.