# -*- coding: utf-8 -*-
"""
Created on Wed Dec  3 17:56:26 2014

@author: pbarnum
"""

import numpy as np

def getStereoParameters(casedPair):

    if casedPair:
        distCoeffs1 = np.array([[0.195183, -0.430572, -0.002242, -0.008574, 0.000000]])
        distCoeffs2 = np.array([[0.200389, -0.705881, 0.001868, -0.002548, 0.000000]])

        cameraMatrix1 = np.array([[731.625556, 0.000000, 319.349065],
                  [0.000000, 728.652880, 237.696598],
                  [0.000000, 0.000000, 1.000000]])

        cameraMatrix2 = np.array([[723.809091, 0.000000, 333.329786],
                  [0.000000, 722.312593, 268.228391],
                  [0.000000, 0.000000, 1.000000]])

        R = np.array([[0.999992, -0.003985, -0.000691],
                  [0.003979, 0.999950, -0.009147],
                  [0.000727, 0.009144, 0.999958]])

        T = np.array([-22.637837, 0.046683, -0.299668])

        imageSize = (640, 480)
    else:
        distCoeffs1 = np.array([[0.164272, -0.376660, 0.000841, -0.013974, 0.000000]])
        distCoeffs2 = np.array([[0.168726, -0.365303, 0.006350, -0.007782, 0.000000]])

        cameraMatrix1 = np.array([[740.272685, 0.000000, 303.320456],
                  [0.000000, 737.724452, 250.412135],
                  [0.000000, 0.000000, 1.000000]])

        cameraMatrix2 = np.array([[723.767887, 0.000000, 317.103693],
                  [0.000000, 721.290002, 295.642274],
                  [0.000000, 0.000000, 1.000000]])

        R = np.array([[0.999395, 0.030507, -0.016679],
                  [-0.030129, 0.999293, 0.022470],
                  [0.017353, -0.021954, 0.999608]])

        T = np.array([-13.399603, 0.297130, 0.749115])

        imageSize = (640, 480)

    return {'distCoeffs1':distCoeffs1, 'distCoeffs2':distCoeffs2, 'cameraMatrix1':cameraMatrix1, 'cameraMatrix2':cameraMatrix2, 'R':R, 'T':T, 'imageSize':imageSize}

