From c951b5b6dff97bae49404125e92387c54166b75c Mon Sep 17 00:00:00 2001 From: PGgit08 Date: Wed, 25 Dec 2024 22:07:24 -0500 Subject: [PATCH] arducam calibration works --- .../arducam-2/arducam-2 (1280x720).json | 324 ------------------ .../arducam-2/arducam-2 (640x480).json | 44 +++ calibration/calibrator.zsh | 13 +- 3 files changed, 45 insertions(+), 336 deletions(-) delete mode 100644 calibration/arducam-2/arducam-2 (1280x720).json create mode 100644 calibration/arducam-2/arducam-2 (640x480).json diff --git a/calibration/arducam-2/arducam-2 (1280x720).json b/calibration/arducam-2/arducam-2 (1280x720).json deleted file mode 100644 index 31df315..0000000 --- a/calibration/arducam-2/arducam-2 (1280x720).json +++ /dev/null @@ -1,324 +0,0 @@ -{ - "resolution": { - "width": 1280, - "height": 720 - }, - "cameraIntrinsics": { - "rows": 3, - "cols": 3, - "type": 6, - "data": [ - 800.6365457, - 0, - 791.9161849, - 0, - 768.3667098, - 367.7534259, - 0, - 0, - 1 - ] - }, - "distCoeffs": { - "rows": 1, - "cols": 288, - "type": 6, - "data": [ - -0.0420521062, - -0.03452606236, - -0.02543768124, - -0.02774321421, - -0.01386361539, - -0.02171027022, - -0.00751879645, - -0.01796442497, - -0.00422848891, - -0.01523147929, - -0.00364732367, - -0.01628132283, - -0.002939614991, - -0.01788310504, - -0.002585392601, - -0.02264587361, - 0.001307292809, - -0.02895713359, - 0.0092860112, - -0.03833967023, - 0.02268060445, - -0.04965110183, - 0.04407622776, - -0.06436944692, - 0.0780067498, - -0.07734868125, - 0.03789794855, - -0.02780859663, - 3.858776105e-109, - -2.262041165e-109, - 0.0, - 0.0, - -0.02963282401, - -0.02115725412, - -0.01422574401, - -0.01554670051, - -0.004581225622, - -0.01117057185, - 0.0002452863659, - -0.007977313367, - 0.001438698203, - -0.006470493239, - 0.0005296925949, - -0.006203625463, - -0.001240658866, - -0.007809614197, - -0.001708556538, - -0.01085862296, - -0.0003150185059, - -0.01592154896, - 0.00571095126, - -0.0225340145, - 0.0174831086, - -0.03131779262, - 0.03717523878, - -0.04144885742, - 0.06600703182, - -0.05474809866, - 0.1086938129, - -0.06398981047, - 3.406367872e-106, - -1.635056579e-106, - -5e-324, - 0.0, - -0.02085441633, - -0.01173244511, - -0.006448155447, - -0.007963247234, - 0.002171324963, - -0.004856156038, - 0.005583402745, - -0.002756243934, - 0.005732099915, - -0.001557785196, - 0.003353645244, - -0.001614206757, - 0.0005769674046, - -0.002447472468, - -0.001487538192, - -0.004470520754, - -0.001195070473, - -0.007609774944, - 0.003268248884, - -0.01204920965, - 0.01372177898, - -0.01767593283, - 0.03208403838, - -0.02463335524, - 0.05997565399, - -0.03239597056, - 0.09673160894, - -0.04156559206, - -6.65306225e-111, - 2.079081953e-111, - 0.0, - 0.0, - -0.01550749836, - -0.005222279152, - -0.001685123994, - -0.003245774578, - 0.006162090744, - -0.001725716951, - 0.008858151593, - -0.0006367114099, - 0.008152106293, - -3.072674972e-05, - 0.005086470663, - 6.716103986e-05, - 0.001468576721, - -0.0003048948871, - -0.001265156551, - -0.001242092838, - -0.001951093715, - -0.002798262129, - 0.001673026305, - -0.004943894714, - 0.01144749611, - -0.007727458591, - 0.02896174124, - -0.01096104422, - 0.05606696224, - -0.0152284519, - 0.09223172228, - -0.01937883213, - 0.0, - 0.0, - 0.0, - 0.0, - -0.01354189567, - -0.0002021758915, - -5.881360871e-05, - -0.0002388580184, - 0.007552814218, - -0.0002003630938, - 0.01003971809, - -0.0001239133753, - 0.008995019244, - -5.582250151e-05, - 0.005713299582, - 1.319998067e-05, - 0.001841544277, - 8.689282207e-05, - -0.00132273131, - 0.0001645335052, - -0.002113367803, - 0.000211208579, - 0.001220857426, - 0.0003913457035, - 0.01070404822, - 0.0005725630744, - 0.02789919413, - 0.0007219640739, - 0.05474172933, - 0.001219855489, - 0.09148021993, - -0.000215113045, - 0.0, - 0.0, - 0.0, - 0.0, - -0.01515574445, - 0.004713562883, - -0.001462642533, - 0.002866605518, - 0.006278348115, - 0.001411722743, - 0.008982591821, - 0.0004131263676, - 0.008239822016, - -6.015556884e-05, - 0.005147420574, - -2.569261666e-05, - 0.001493895372, - 0.0005415884176, - -0.001474789484, - 0.001594980133, - -0.001897076468, - 0.003385772504, - 0.001717216185, - 0.005725381055, - 0.01141104437, - 0.008823756431, - 0.02887844879, - 0.01247245966, - 0.05641917392, - 0.01722843542, - 0.07460277472, - 0.01406025734, - -9.913835302e-119, - -1.239229413e-119, - 0.0, - 0.0, - -0.02018361679, - 0.01130964763, - -0.00592758392, - 0.007406679488, - 0.002458462205, - 0.004437276408, - 0.005935316786, - 0.00245936403, - 0.005774036332, - 0.001475209299, - 0.003571640315, - 0.001538391522, - 0.0004602273593, - 0.00262905044, - -0.001617189584, - 0.004848512473, - -0.001296110448, - 0.008206708553, - 0.003193908851, - 0.01287947293, - 0.01353671399, - 0.01878860073, - 0.03217807886, - 0.02617774815, - 0.05866080756, - 0.03410219434, - 0.08015989995, - 0.03069125195, - 5e-324, - 0.0, - 5e-324, - 0.0, - -0.02895971867, - 0.02042327858, - -0.01374956958, - 0.01499749238, - -0.004013220377, - 0.01062587154, - 0.0005530326284, - 0.007641057552, - 0.001833613178, - 0.006160808175, - 0.0005226472261, - 0.006243333645, - -0.0009812117039, - 0.007865655937, - -0.00207493351, - 0.01124239415, - -0.0002073684634, - 0.01643878408, - 0.005376655936, - 0.02337559007, - 0.01759764588, - 0.03238917499, - 0.03599225913, - 0.0425647851, - 0.06949767289, - 0.05888882184, - 0.06201056639, - 0.03466841105, - 5e-324, - 0.0, - -5e-324, - 0.0, - -0.04036729337, - 0.03407444002, - -0.02421789425, - 0.02708813451, - -0.01351797666, - 0.02161100059, - -0.006743838188, - 0.01774480138, - -0.004305346813, - 0.01574743135, - -0.003441945507, - 0.01585825604, - -0.003526780018, - 0.01828139798, - -0.002276982438, - 0.02301869665, - 0.0008304687753, - 0.02953967858, - 0.009380704253, - 0.03972678143, - 0.02106917669, - 0.05088181914, - 0.04998424233, - 0.0700111255, - 0.04364365186, - 0.04130988491, - 0.002541361965, - 0.001877462756, - -5e-324, - 0.0, - -5e-324, - 0.0 - ] - }, - "observations": [], - "calobjectWarp": [], - "calobjectSize": { - "width": 0, - "height": 0 - }, - "calobjectSpacing": 0 -} \ No newline at end of file diff --git a/calibration/arducam-2/arducam-2 (640x480).json b/calibration/arducam-2/arducam-2 (640x480).json new file mode 100644 index 0000000..e61faf8 --- /dev/null +++ b/calibration/arducam-2/arducam-2 (640x480).json @@ -0,0 +1,44 @@ +{ + "resolution": { + "width": 640, + "height": 480 + }, + "cameraIntrinsics": { + "rows": 3, + "cols": 3, + "type": 6, + "data": [ + 741.3237774, + 0, + 643.9216594, + 0, + 741.6691762, + 346.4754739, + 0, + 0, + 1 + ] + }, + "distCoeffs": { + "rows": 1, + "cols": 8, + "type": 6, + "data": [ + 0.05007112537, + -0.08635102934, + 0.0002018647954, + 0.0009635985618, + 0.03145788721, + -0.001694410973, + 0.003333728397, + -0.001227151637 + ] + }, + "observations": [], + "calobjectWarp": [], + "calobjectSize": { + "width": 0, + "height": 0 + }, + "calobjectSpacing": 0 +} \ No newline at end of file diff --git a/calibration/calibrator.zsh b/calibration/calibrator.zsh index d4cc93e..36dadad 100644 --- a/calibration/calibrator.zsh +++ b/calibration/calibrator.zsh @@ -20,15 +20,6 @@ read -r spacing echo -n "Enter focal length in pixels (ex: 1015): " read -r focal -echo -n "Enter horizontal fov in degrees (ex: 70): " -read -r fov - -echo -n "Enter Nx (ex: 16): " -read -r nx - -echo -n "Enter Ny (ex: 9): " -read -r ny - mrcal_to_photon="$PWD/mrcal_to_photon.py" # cd to where the input file is @@ -60,12 +51,10 @@ evens='frames/*[02468].png' odds='frames/*[13579].png' all='frames/*.png' -lensmodel="LENSMODEL_SPLINED_STEREOGRAPHIC_order=3_Nx=${nx}_Ny=${ny}_fov_x_deg=${fov}" - mrcal_calibrate=( mrcal-calibrate-cameras \ --corners-cache corners.vnl \ - --lensmodel $lensmodel \ + --lensmodel LENSMODEL_OPENCV8 \ --focal $focal \ --object-spacing $spacing \ --object-width-n $n \