Commit de9e35f1 authored by rmapaah's avatar rmapaah

Issue #13: Test case and Test data added

To test the code on real data a test case and test data is added.
parent f81f56bf

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

File added
......@@ -6,6 +6,7 @@ import numpy as np
def pivot_calibration(matrices4x4):
print(matrices4x4)
"""
Performs Pivot Calibration and returns Residual Error.
......@@ -23,7 +24,7 @@ def pivot_calibration(matrices4x4):
if not matrices4x4.shape[1] == 4: # pylint: disable=literal-comparison
raise ValueError("matrices4x4 should have 4 columns per matrix")
if not matrices4x4.shape[0] == 4: # pylint: disable=literal-comparison
if not matrices4x4.shape[2] == 4: # pylint: disable=literal-comparison
raise ValueError("matrices4x4 should have 4 rows per matrix")
number_of_matrices = len(matrices4x4)
......@@ -85,7 +86,7 @@ def pivot_calibration(matrices4x4):
# Residual Matrix
residual_matrix = (np.dot(a_values , x_values) - b_values)
residual_matrix = (np.dot(a_values, x_values) - b_values)
residual_error = 0.0
for i in range(number_of_matrices * 3):
residual_error = residual_error + np.dot(residual_matrix[i, 0], residual_matrix[i, 0])
......@@ -103,4 +104,5 @@ def pivot_calibration(matrices4x4):
output_matrix[2, 3] = x_values[2, 0]
print("pivotCalibration=(", x_values[3, 0], ",", x_values[4, 0], ",", x_values[5, 0], "),residual=", residual_error)
return residual_error
0.2324886024 -0.9449805021 0.2301324457 -425.5186462402
-0.9594704509 -0.1840910465 0.2133705467 -26.5338668823
-0.1592656821 -0.2704114914 -0.9494799376 -2017.9345703125
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2327978313 -0.9450077415 0.2297075838 -425.5144042969
-0.9593902230 -0.1844672859 0.2134059817 -26.4292411804
-0.1592967659 -0.2700596750 -0.9495747685 -2018.0262451172
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2330945134 -0.9450278878 0.2293234169 -425.5019531250
-0.9592206478 -0.1846664846 0.2139951885 -26.3663673401
-0.1598830670 -0.2698528767 -0.9495350718 -2018.1309814453
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2328812778 -0.9452112913 0.2287837565 -425.4444274902
-0.9591668844 -0.1844117045 0.2144557685 -26.2322654724
-0.1605156064 -0.2693845332 -0.9495613575 -2018.4346923828
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2326674461 -0.9453276396 0.2285202593 -425.3974304199
-0.9592376351 -0.1843032092 0.2142324150 -26.1798171997
-0.1604028046 -0.2690501213 -0.9496752024 -2018.6551513672
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2326387167 -0.9454631805 0.2279879898 -425.3385009766
-0.9591990709 -0.1843208373 0.2143896967 -26.1409435272
-0.1606746316 -0.2685612142 -0.9497675896 -2018.9136962891
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2331134677 -0.9459974170 0.2252709270 -425.1546020508
-0.9587626457 -0.1848515123 0.2158797532 -26.0687847137
-0.1625800133 -0.2663058341 -0.9500783682 -2019.6835937500
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2332523614 -0.9463402629 0.2236815244 -425.0191040039
-0.9583758116 -0.1847721636 0.2176580429 -25.9941711426
-0.1646484584 -0.2651402354 -0.9500482082 -2020.3017578125
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2328902334 -0.9472446442 0.2202037871 -424.6988525391
-0.9579698443 -0.1844524443 0.2197066396 -26.0684871674
-0.1674988121 -0.2621161342 -0.9503890276 -2021.5465087891
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2326621115 -0.9476856589 0.2185410857 -424.5401306152
-0.9577333331 -0.1841721982 0.2209693938 -26.0673255920
-0.1691603363 -0.2607152760 -0.9504800439 -2022.1881103516
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2328210622 -0.9482384920 0.2159586400 -424.3422546387
-0.9571570158 -0.1841080785 0.2235055417 -26.1260452271
-0.1721768230 -0.2587431073 -0.9504773617 -2022.9853515625
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2326726019 -0.9497447014 0.2094001770 -423.8244018555
-0.9555941820 -0.1832175702 0.2308052927 -26.1769237518
-0.1808403134 -0.2538036406 -0.9502002001 -2025.2427978516
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2322657406 -0.9503443837 0.2071188390 -423.6262207031
-0.9552552700 -0.1827850789 0.2325444072 -26.2631263733
-0.1831390262 -0.2518634796 -0.9502761960 -2026.0122070312
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2319300026 -0.9515309334 0.2019835711 -423.2285766602
-0.9545758367 -0.1827079356 0.2353781164 -26.2553825378
-0.1870655566 -0.2473998815 -0.9506838322 -2027.7713623047
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2323385328 -0.9521228671 0.1986978799 -423.0196533203
-0.9536143541 -0.1827876419 0.2391826212 -26.0536842346
-0.1914117187 -0.2450524867 -0.9504266381 -2028.8499755859
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2330232263 -0.9526116252 0.1955282837 -422.8388671875
-0.9532380700 -0.1839596778 0.2397835404 -25.8444900513
-0.1924512684 -0.2422601134 -0.9509325027 -2029.7451171875
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2335225940 -0.9543954730 0.1860014647 -422.2736511230
-0.9513300657 -0.1846939772 0.2466967702 -24.9467658997
-0.2010929137 -0.2345580459 -0.9510752559 -2032.8706054688
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2348726243 -0.9551684260 0.1802447140 -421.9718017578
-0.9498191476 -0.1861160100 0.2514048219 -24.5063419342
-0.2065875083 -0.2302479893 -0.9509508610 -2034.7055664062
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2345673740 -0.9571045041 0.1700857133 -421.3676452637
-0.9489628673 -0.1875057817 0.2535962462 -23.6070213318
-0.2108260542 -0.2208904326 -0.9522393346 -2038.3031005859
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2347284853 -0.9583149552 0.1628956646 -420.9556884766
-0.9476833344 -0.1883117110 0.2577499151 -23.1846904755
-0.2163304389 -0.2148747444 -0.9523811936 -2040.7464599609
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2342036813 -0.9597529769 0.1549932212 -420.5192565918
-0.9465846419 -0.1887722313 0.2614239156 -22.5791873932
-0.2216439545 -0.2079406530 -0.9526985884 -2043.6502685547
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2333383113 -0.9628176689 0.1361448169 -419.5701599121
-0.9436858892 -0.1904481351 0.2705299854 -21.2343158722
-0.2345425189 -0.1916029453 -0.9530362487 -2050.2836914062
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2325122058 -0.9645338655 0.1249500513 -419.0791625977
-0.9420918226 -0.1914324462 0.2753481567 -20.3339405060
-0.2416631281 -0.1817362309 -0.9531898499 -2054.0830078125
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2331520021 -0.9676557183 0.0963463262 -418.0983886719
-0.9363259673 -0.1966386139 0.2909069955 -18.4558010101
-0.2625524104 -0.1580371112 -0.9518878460 -2063.4567871094
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2315619588 -0.9694381952 0.0810471773 -417.6498413086
-0.9323585629 -0.1973820478 0.3028988540 -17.5022754669
-0.2776444554 -0.1457048804 -0.9495702386 -2068.8383789062
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2297376990 -0.9709087014 0.0675046965 -417.2518920898
-0.9299955368 -0.1985497624 0.3093318939 -16.8478107452
-0.2869299948 -0.1338442713 -0.9485551715 -2073.5583496094
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2254224569 -0.9731751084 0.0459887050 -416.6678161621
-0.9270998836 -0.1997626871 0.3171445727 -16.1149291992
-0.2994503677 -0.1141276285 -0.9472615123 -2081.6396484375
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2236240208 -0.9739305377 0.0380999036 -416.4961547852
-0.9275678396 -0.2006477118 0.3152115047 -15.8479661942
-0.2993494570 -0.1058291122 -0.9482563138 -2084.3342285156
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2210045010 -0.9749479294 0.0251710173 -416.2161865234
-0.9291412234 -0.2026367337 0.3092491329 -15.4006547928
-0.2964012325 -0.0917328745 -0.9506478906 -2089.6818847656
0.0000000000 0.0000000000 0.0000000000 1.0000000000
0.2193766236 -0.9754735231 0.0180355627 -416.0890808105
-0.9296295047 -0.2033852786 0.3072838485 -15.2655353546
-0.2960790992 -0.0841772929 -0.9514470100 -2092.6291503906
0.0000000000 0.0000000000 0.0000000000 1.0000000000