Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test Calibration #17

Open
teganscott opened this issue Feb 8, 2018 · 3 comments
Open

Test Calibration #17

teganscott opened this issue Feb 8, 2018 · 3 comments

Comments

@teganscott
Copy link

Is there a method I can use to test the calibration? When I put the calibration numbers into my own software (which works with opencv and calibrations from other systems) it doesn't coorrelate the camera and projector correctly.

Thank you,
Tegan

@saudet
Copy link
Member

saudet commented Feb 8, 2018 via email

@teganscott
Copy link
Author

Below is what procamlib gives me, and the formatting I have for my calibration files. These two will be slightly different because the projector and camera are in different positions. The biggest difference is in the extrinsic rotation of my old calibrations was a 3x1 matrix, and the new one is 3x3. In my code I have the following that converts the rotation matrix into Rodrigues:

cv::Vec3d axis_angle;
double data[9] = {9.9981890125721906e-01, -8.7052645857853533e-03,
1.6922856062103579e-02, 1.6082024959920501e-02,
8.6194239428941977e-01, -5.0675110004795354e-01,
-1.0175124667329560e-02, 5.0693148185441583e-01,
8.6192629588781566e-01};
cv::Mat origRot = cv::Mat(3,3, CV_64F, data);
cv::Rodrigues(origRot, axis_angle);
cv::Mat rot = cv::Mat(3, 1, CV_64F, axis_angle);

This is what procamlib gives me:

%YAML:1.0

Cameras:

  • Camera 0
    Projectors:
  • Projector 0
    Camera 0:
    imageWidth: 640
    imageHeight: 480
    responseGamma: 0.
    cameraMatrix: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 7.7581750624364702e+02, 0., 3.2712277369620023e+02, 0.,
    7.7610945139991838e+02, 2.3484626839931556e+02, 0., 0., 1. ]
    distortionCoeffs: !!opencv-matrix
    rows: 1
    cols: 4
    dt: d
    data: [ -1.1150538574733834e-01, 1.7528485231520349e-01,
    1.3777229721069281e-04, 3.5512804807152055e-03 ]
    extrParams: !!opencv-matrix
    rows: 10
    cols: 6
    dt: d
    data: [ -2.4156499206165061e-01, 1.8012775548542140e-01,
    3.0971126521233794e+00, 9.7672612756320257e+02,
    8.4309337872134495e+02, 3.0579462522394706e+03,
    -7.8549242710261080e-01, -2.8501749151166361e-01,
    -2.9269460537869385e+00, 8.6784058799846707e+02,
    8.7237706917774949e+02, 2.5111457941924082e+03,
    1.7173840480802446e-01, 7.6806524901152817e-01,
    -3.0011869667530067e+00, 8.1736575306125781e+02,
    5.9774869098573743e+02, 3.1628262239991532e+03,
    -4.9985867968159597e-02, -9.3919224795251288e-01,
    -2.8871041470444330e+00, 1.1068227286276594e+03,
    1.0505865212093518e+03, 3.0583236718773715e+03,
    1.2579745239764833e-01, 9.2067055083533952e-02,
    -3.1256843279217237e+00, 9.0416180531444070e+02,
    7.0449061666552848e+02, 2.5043720925455700e+03,
    2.7428722866650290e-01, 8.7245690431954001e-02,
    3.1078726288431393e+00, 6.8503074658642504e+02,
    1.0020846281253456e+03, 4.1669747122728004e+03,
    -1.1503040335019099e+00, 1.7024453055326852e-01,
    2.8854476605390929e+00, 4.5169684320598648e+01,
    1.1418006977246384e+03, 5.0062320468696498e+03,
    -1.2036048151279497e+00, 9.0617781989513636e-04,
    -2.7793536264733043e+00, 4.9855943180165428e+02,
    9.8652834329722725e+02, 3.5770730312324645e+03,
    3.9387072333177947e-01, -1.3150287815934847e-01,
    -3.0678627249891148e+00, 3.5969986263255259e+02,
    1.1399110179951804e+03, 5.0285896568295348e+03,
    3.1649409187408778e-01, -1.4772840685344468e-01,
    -3.0460147144952132e+00, 1.3429765374386300e+03,
    1.1414031663775518e+03, 3.4867023648561662e+03 ]
    reprojErrs: !!opencv-matrix
    rows: 1
    cols: 10
    dt: d
    data: [ 1.5371241343872963e-01, 2.8960308273486646e-01,
    2.8750924207329859e-01, 2.6344386342339299e-01,
    1.9743376450287983e-01, 1.4753773852132168e-01,
    2.9277691879812734e-01, 2.3886584943637879e-01,
    1.3513256849293118e-01, 2.4715896890807423e-01 ]
    avgReprojErr: 2.2898737268678926e-01
    maxReprojErr: 5.5011680951627251e-01
    R: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1. ]
    T: !!opencv-matrix
    rows: 3
    cols: 1
    dt: d
    data: [ 0., 0., 0. ]
    E: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 0., 0., 0., 0., 0., 0., 0., 0., 0. ]
    F: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 0., 0., 0., 0., 0., 0., 0., 0., 0. ]
    avgEpipolarErr: 0.
    maxEpipolarErr: 0.
    colorOrder: BGR
    colorMixingMatrix: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 1., 0., 0., 0., 1., 0., 0., 0., 1. ]
    additiveLight: !!opencv-matrix
    rows: 3
    cols: 1
    dt: d
    data: [ 0., 0., 0. ]
    avgColorErr: 0.
    colorR2: 1.
    Projector 0:
    imageWidth: 1280
    imageHeight: 720
    responseGamma: 2.2000000000000002e+00
    cameraMatrix: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 1.7499631210240912e+03, 0., 6.1660168685378312e+02, 0.,
    1.6896417183771678e+03, 5.9724917683269268e+02, 0., 0., 1. ]
    distortionCoeffs: !!opencv-matrix
    rows: 1
    cols: 4
    dt: d
    data: [ -6.6930274333599230e-02, -6.7048107227998741e-03,
    3.5010575123940813e-03, -4.7314086914342478e-03 ]
    extrParams: !!opencv-matrix
    rows: 10
    cols: 6
    dt: d
    data: [ -1.9354736345635731e-01, -6.1930165346661692e-01,
    3.0187165004280700e+00, 8.5046734215751610e+02,
    7.4581100284211914e+01, 3.8326438369483453e+03,
    -7.0076107953804545e-01, 4.5589671940981369e-01,
    -2.7754234848766712e+00, 7.3094205313373061e+02,
    3.6713582005614649e+02, 3.3942323715873163e+03,
    1.4541709844879613e-01, 1.5413076626580589e+00,
    -2.7117090000409840e+00, 6.9619102699464202e+02,
    -1.9936683545410492e+02, 3.8187930255447154e+03,
    -3.3716930446300100e-02, -1.4679683230627441e-01,
    -3.0091628510661144e+00, 9.7759350382268417e+02,
    2.5685067132913179e+02, 3.9146135814326717e+03,
    9.0205361217915572e-02, 8.6954962865644581e-01,
    -3.0120011161430216e+00, 7.6866096349570864e+02,
    2.3546879754297171e+02, 3.3043057744979283e+03,
    -2.6449754127169411e-01, 7.7466813197389139e-01,
    -2.9912285437944126e+00, 5.8054143325837515e+02,
    -3.5399942533497466e+02, 4.8746897121799084e+03,
    -1.0018636253415676e+00, -5.4434814044426161e-01,
    2.7031010656401122e+00, -4.3939248233586440e+01,
    -6.5648750361818213e+02, 5.6725145820799644e+03,
    -1.0579535623781158e+00, 6.7401045910367141e-01,
    -2.5168695575013897e+00, 3.8391487256352377e+02,
    -7.4323400666258678e+01, 4.3831002089077683e+03,
    3.2410786388553042e-01, 7.7752121371865823e-01,
    -3.0249338868293578e+00, 2.6858102654901393e+02,
    -6.6338509230912939e+02, 5.6337688820228377e+03,
    3.2017570407206858e-01, 6.6504050110457080e-01,
    -3.0195212490458379e+00, 1.2211691022937016e+03,
    1.2375505861043740e+02, 4.3269710530395978e+03 ]
    reprojErrs: !!opencv-matrix
    rows: 1
    cols: 10
    dt: d
    data: [ 1.3164197849823371e+00, 1.3514771113547357e+00,
    6.5346257455760870e-01, 1.1105567453156828e+00,
    1.5099777827348959e+00, 9.4673348127230028e-01,
    8.6161959791194154e-01, 9.8421655271010278e-01,
    1.0521663658108733e+00, 1.0783660369344115e+00 ]
    avgReprojErr: 1.1179781153666539e+00
    maxReprojErr: 2.6356199800838387e+00
    R: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 9.9981890125721906e-01, -8.7052645857853533e-03,
    1.6922856062103579e-02, 1.6082024959920501e-02,
    8.6194239428941977e-01, -5.0675110004795354e-01,
    -1.0175124667329560e-02, 5.0693148185441583e-01,
    8.6192629588781566e-01 ]
    T: !!opencv-matrix
    rows: 3
    cols: 1
    dt: d
    data: [ -1.7107953358194348e+02, 8.7837854385005460e+02,
    7.8703985608089772e+02 ]
    E: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ -2.1594805798726945e+01, -2.3310528108853714e+02,
    1.1559308775385889e+03, 7.8515656857021804e+02,
    7.9874211286914274e+01, 1.6077691088209545e+02,
    -8.8097077592927394e+02, -1.3981418515884596e+02,
    7.1830068172726044e+01 ]
    F: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ -1.3368997344057221e-07, -1.4425744961417022e-06,
    5.9344078247353105e-03, 5.0343113925375577e-06,
    5.1194934569914426e-07, -9.6729370437643948e-04,
    -1.2468513687286359e-02, -9.3040828326544395e-04, 1. ]
    avgEpipolarErr: 2.6198481877793398e+00
    maxEpipolarErr: 7.0856579958364510e+00
    colorOrder: BGR
    colorMixingMatrix: !!opencv-matrix
    rows: 3
    cols: 3
    dt: d
    data: [ 9.6289023041437521e-02, 1.5850582325576001e-01,
    8.4659356542572395e-02, 5.1802646787281817e-03,
    2.3662243713180331e-01, 1.4141216619711117e-01,
    2.5245874910261937e-03, 4.7465533462665924e-02,
    3.3407212796649421e-01 ]
    additiveLight: !!opencv-matrix
    rows: 3
    cols: 1
    dt: d
    data: [ 4.9442887747905900e-01, 4.4000607242526013e-01,
    4.3617957606834917e-01 ]
    avgColorErr: 7.2630983371695351e-02
    colorR2: 6.7542116700531341e-01

This is what the calibration software I am working with needs:
CAMERA:
%YAML:1.0
cameraMatrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [ 5.2390037217688837e+02, 0., 2.9894316833599152e+02, 0.,
5.2273440154265677e+02, 2.3062940702516227e+02, 0., 0., 1. ]
imageSize_width: 640
imageSize_height: 480
sensorSize_width: 0
sensorSize_height: 0
distCoeffs: !!opencv-matrix
rows: 5
cols: 1
dt: d
data: [ -9.4425188361295043e-02, 1.3559756613205826e-01,
2.5196205369225116e-04, -2.2982133039631367e-03,
2.9994602486057755e-02 ]
reprojectionError: 1.5748588740825653e-01

PROJECTOR:
%YAML:1.0
cameraMatrix: !!opencv-matrix
rows: 3
cols: 3
dt: d
data: [ 2.0071611042360921e+03, 0., 6.2447724667816487e+02, 0.,
2.0000916462185571e+03, 1.5582659966238060e+02, 0., 0., 1. ]
imageSize_width: 1280
imageSize_height: 720
sensorSize_width: 0
sensorSize_height: 0
distCoeffs: !!opencv-matrix
rows: 5
cols: 1
dt: d
data: [ -9.8245651394649747e-02, 5.6098143869503347e-01,
1.1589744437146346e-02, 4.8286095453437001e-03,
5.6681736350551748e-01 ]
reprojectionError: 5.2733808755874634e-01

EXTRINSICS:
%YAML:1.0
Rotation_Vector: !!opencv-matrix
rows: 3
cols: 1
dt: d
data: [ 6.8210825021344387e-02, 2.8757581667304671e-02,
-3.0531880320480636e-02 ]
Translation_Vector: !!opencv-matrix
rows: 3
cols: 1
dt: d
data: [ 2.4228539839093036e-01, 3.1220677070266731e+00,
2.1248321280799489e+00 ]

@saudet
Copy link
Member

saudet commented Feb 8, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants