Repository: opencv
Issue: stereoRectify() get very small dst Image（the valid region is very small）
Labels: question (invalid tracker)

##### System information (version)
- OpenCV => 3.2.0
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2019

##### Detailed description
I want to use stereoRectify() to get undistorted Image，but these Images is incorrect 。
like this：
leftsrc image：
![leftsrcimage](https://github.com/Mole-09/TempImage/blob/master/0.bmp)
rightsrc image：
![rightsrcimage](https://github.com/Mole-09/TempImage/blob/master/1.bmp)

there are incorrect image：
![leftdstimage](https://github.com/Mole-09/TempImage/blob/master/EP0.bmp)
![rightdstimage](https://github.com/Mole-09/TempImage/blob/master/EP1.bmp)

I don't know why the dst Image are so small.

There are my code：
```
/*
1292.3 646.494 1292.32 538.894 //left camera intrinsic Matrix 
-2.37844 2.43079 0.000849212 -6.89203e-05 -5.32371 -2.26715 2.05333 -5.05281  //left camera distortion coeffs 
1287.19 626.962 1287.2 501.921 //right ..
104.301 -58.36 -0.00111666 -0.000194675 168.534 104.333 -47.1678 152.314  //right ...
//R Matrix
0.962588 0.00196471 0.270961 
0.00441726 0.999727 -0.0229413 
-0.270932 0.0232799 0.962317
//T Matrix 
-188.994 25.1563 18.3084
*/
int EplineUndistort(cv::Mat srcImage_L, cv::Mat srcImage_R, string pathParam, int scale, cv::Mat& dstImg_left, cv::Mat& dstImg_right, cv::Mat& Q)
{
	int rate = scale;
	int width = srcImage_L.cols;
	int height = srcImage_L.rows;
	cv::Size srcSize = cv::Size(width, height);
	cv::Size dstSize = cv::Size(width, height);
	CameraPara cp;
	ifstream inFile(pathParam);
	if (!inFile.is_open()) return 1;
	for (int i = 0; i < 4; i++)inFile >> cp.ML[i];//left camera intrinsic matrix
	for (int i = 0; i < 8; i++)inFile >> cp.DL[i];//left camera distortion coeffs
	for (int i = 0; i < 4; i++)inFile >> cp.MR[i];//right camera..
	for (int i = 0; i < 8; i++)inFile >> cp.DR[i];
	for (int i = 0; i < 9; i++)inFile >> cp.RR[i];// R matrix
	for (int i = 0; i < 3; i++)inFile >> cp.TT[i];// T matrix

	for (int i = 0; i < 4; i++) {
		cp.ML[i] /= rate;//my rate = 1
		cp.MR[i] /= rate;
	}

	double ml[3][3] = { cp.ML[0], 0,     cp.ML[1],
						0,     cp.ML[2], cp.ML[3],
						0,     0,     1 };
	double mr[3][3] = { cp.MR[0], 0,     cp.MR[1],
						0,     cp.MR[2], cp.MR[3],
						0,     0,     1 };
	cv::Mat intrinsic_matrix_L = cv::Mat(3, 3, CV_64FC1, ml);
	cv::Mat intrinsic_matrix_R = cv::Mat(3, 3, CV_64FC1, mr);
	cv::Mat distortion_coeffs_L = cv::Mat(8, 1, CV_64FC1, cp.DL);
	cv::Mat distortion_coeffs_R = cv::Mat(8, 1, CV_64FC1, cp.DR);

	cv::Mat R(3, 3, CV_64FC1, cp.RR);
	cv::Mat T(3, 1, CV_64FC1, cp.TT);

	cv::Mat R1, P1;
	cv::Mat R2, P2;

	cv::stereoRectify(intrinsic_matrix_L, distortion_coeffs_L, intrinsic_matrix_R, distortion_coeffs_R,
		srcSize, R, T, R1, R2, P1, P2, Q, 0, -1, srcSize);//cv::CALIB_ZERO_DISPARITY, -1, srcSize);

	cv::Mat mapL_X, mapL_Y;
	cv::Mat mapR_X, mapR_Y;
	cv::initUndistortRectifyMap(intrinsic_matrix_L, distortion_coeffs_L, R1, P1, srcSize, CV_32FC1, mapL_X, mapL_Y);
	cv::initUndistortRectifyMap(intrinsic_matrix_R, distortion_coeffs_R, R2, P2, srcSize, CV_32FC1, mapR_X, mapR_Y);

	cv::remap(srcImage_L, dstImg_left, mapL_X, mapL_Y, cv::INTER_LINEAR);
	cv::remap(srcImage_R, dstImg_right, mapR_X, mapR_Y, cv::INTER_LINEAR);

	ofstream outQ("Q.asc", ios::out);
	for (int i = 0; i < 4; i++) {
		outQ << Q.at<double>(i, 0) << " " << Q.at<double>(i, 1) << " " << Q.at<double>(i, 2) << " " << Q.at<double>(i, 3) << endl;
	}
	outQ.close();
	return 0;
}
```

##### Steps to reproduce

##### Issue submission checklist

 - [x] I report the issue, it's not a question
 - [x] I checked the problem with documentation, FAQ, open issues,
       answers.opencv.org, Stack Overflow, etc and have not found solution
 - [ ] I updated to latest OpenCV version and the issue is still there
 - [ ] There is reproducer code and related data files: videos, images, onnx, etc