Recently, I used cv::stereoRectify, cv::fisheye::stereoRectify and cv::omnidir::stereoRectify.
I found that cv::omnidir::stereoRectify returned R2 which could not get stereo images with epipolar constraint.
So I checked theirs sources.
I think that cv::omnidir::stereoRectify has a mistake.
That is omnidir.cpp, line 2225: _R2 = R21 * _R1;
Based on cv::stereoRectify and cv::fisheye::stereoRectify, this line should be: _R2 = _R1 * R21;
Besides, R2 is theoretically the rotation matrix from the coordinate system of the world to the second camera.