'**SUMMARY**
Computes rectification transforms for each head of a calibrated stereo camera.
**PARAMETERS**
calibration - is a tuple os the form (CM1, CM2, D1, D2, R, T, E, F)
CM1 - Camera Matrix for left camera,
CM2 - Camera Matrix for right camera,
D1 - Vector of distortion coefficients for left camera,
D2 - Vector of distortion coefficients for right camera,
R - Rotation matrix between the left and the right camera coordinate systems,
T - Translation vector between the left and the right coordinate systems of the cameras,
E - Essential matrix,
F - Fundamental matrix
**RETURNS**
On success returns a a tuple of the format -> (R1, R2, P1, P2, Q, roi)
R1 - Rectification transform (rotation matrix) for the left camera.
R2 - Rectification transform (rotation matrix) for the right camera.
P1 - Projection matrix in the new (rectified) coordinate systems for the left camera.
P2 - Projection matrix in the new (rectified) coordinate systems for the right camera.
Q - disparity-to-depth mapping matrix.
**EXAMPLE**
>>> StereoCam = StereoCamera()
>>> calibration = StereoCam.loadCalibration(fname="Stereo1")
>>> rectification = StereoCam.stereoRectify(calibration)'

def stereoRectify(self, calib=None, WinSize=(352, 288)):

    (CM1, CM2, D1, D2, R, T, E, F) = calib
    R1 = cv.CreateMat(3, 3, cv.CV_64F)
    R2 = cv.CreateMat(3, 3, cv.CV_64F)
    P1 = cv.CreateMat(3, 4, cv.CV_64F)
    P2 = cv.CreateMat(3, 4, cv.CV_64F)
    Q = cv.CreateMat(4, 4, cv.CV_64F)
    print 'Running    stereo    rectification...'
    (leftroi, rightroi) = cv.StereoRectify(CM1, CM2, D1, D2, WinSize, R, T, R1, R2, P1, P2, Q)
    roi = []
    roi.append(max(leftroi[0], rightroi[0]))
    roi.append(max(leftroi[1], rightroi[1]))
    roi.append(min(leftroi[2], rightroi[2]))
    roi.append(min(leftroi[3], rightroi[3]))
    print 'Done.'
    return (R1, R2, P1, P2, Q, roi)
