You are on page 1of 33

ESSE 3650 Lab

Space Resection

Submitted to:
Prof. C. Armenakis
Ravi Persad

Name: Won Mo Jung


Email: dnjsah94@my.yorku.ca

York University

Scope:
The main purpose of this lab is to determine the exterior orientation parameters of a photograph
using the space resection method with different sets of ground control points.
Tasks:
To estimate the flying height H, the distance between two measured points are calculated using
the following equation:
()2 = ( )2 + ( )2
()2 = (620820m 620197m)2 + (4847694m 4848344m)2 = 810629m2
The mean elevation of York University from Google Earth is used.
= 197m
= 0.180mm
= 0.000mm
= 12.048mm
= 1.3972mm
= 30.8mm
= 46.362mm
= 101.400mm

= (

= (

= (
= (

Substituting equation 1.2 through 1.5 into equation 1.1 yields:


()2 = [

2
2

( ) ( )] + [ ( ) ( )]

From equation above, the only unknown value is the flying height , so when all the given
values are substituted into the equation, it should form a quadratic form of 2 + + = 0,
and using quadratic formula, the solution for can be obtained.
2
30.8
12.048
( 197)
( 197)]
810629 = [
101.4
101.4
2
46.362
1.3972
( 197)
( 197)]
+[
101.4
101.4

810629 = [(0.304 + 59.838) (0.119 23.407)]2


+ [(0.457 90.072) (0.0138 2.714)]2
810629 = [0.423 + 83.245]2 + [0.4432 87.358]2
810629 = (0.1789) 2 70.425 + 6929.73 + 0.1964 2 77.434 + 7631.42
0.3753 2 147.859 796067.85 = 0
=

2 4
2

147.859 (147.859)2 4(0.3753)(796067.85)


2(0.3753)

Finally, the flying height of the photograph above mean sea level is:
= 1666.67m
Note that from the quadratic form answer, the positive root was selected, because the negative root
for the flying height wouldnt make sense. However, this process is just to check to see if the flying
height becomes a reasonable number or not. This result will depend on the point thats been chosen.
Therefore, as the initial approximation, the flying height was given as 1670m.
Then, ground coordinates of the ground control points are calculated from the assumed vertical
photo.

= (
)


= (
)

Moreover, the parameters of 2-D conformal coordinate transformation are computed using leastsquare principle.

= +
= + +
Although this is a combined adjustment problem, for this special case, it is considered as linear
parametric adjustment by adding an error for each equation. Hence, the equations above are the
functions that are used to obtain the A matrix. From the equations above, partial derivative is taken
with respect to the unknown parameters. Here, the unknown parameters are , , , and .
Furthermore, represents a column vector that consists of the ground coordinates taken from
Google Earth. However, those coordinates are converted into local coordinates using the centroid
equation. Note that the and is also converted into local coordinates using the same centroid
equation before forming the A matrix.
= +

= +

Where X and Y minimum and maximum is chosen among the UTM ground coordinates. Then,
local coordinates are obtained using the following equation:
=
=
Thus, the local coordinates obtained will become the observable in the adjustment process.
Using the following equation, adjustment is done.
= ( )1
=

0.98798
6.0937e-05
0.044241
-0.21604

Using the computed and above, initial approximation of can be computed by the following
equation. Note that initial and is started with 0.

=0
=0
= tan1

0.98798
= tan1 (
) = 0.0035339
6.0937e5
Then, using the following equations, the rotational matrix is obtained.
11 = cos sin
12 = sin sin cos + cos sin
13 = cos sin cos + sin sin
21 = cos sin
22 = sin sin sin + cos cos
23 = cos sin sin + sin cos
31 = sin
32 = sin cos
33 = cos cos
0.9999999981
= [0.000061678599
0

0.000061678599
0.9999999981
0

0
0]
1

Hence, 11 26 , , for ground control points A through E is calculated, which forms the
matrix and misclosure vector. Note that , and is the value calculated as and in the
adjustment process. is the flying height, which was given as 1670m. , , and is the
observed ground coordinates from Google Earth that are converted into local coordinates. These
are one of the values that will be iterated later on.
= 11 ( ) + 12 ( ) + 13 ( )
= 21 ( ) + 22 ( ) + 23 ( )
= 31 ( ) + 32 ( ) + 33 ( )

11 =

[(33 + 32 ) (13 + 12 )]
2

12 =

[( + )
2
( + )]

(21 + 22 + 23 )

13 =

21 =
22 =

14 =

(31 11 )
2

15 =

(32 12 )
2

16 =

(33 13 )
2

[(33 + 32 ) (23 + 22 )]
2

[( + )
2
( )]
23 =

( + 12 + 13 )
11

24 =

(31 21 )
2

25 =

(32 22 )
2

26 =

(33 23 )
2

Then, the matrix is created accordingly. Also, the misclosure can be computed using the
following equations. These misclosures and will be rearranged into one column vector matrix
called in J K order.

= 0

= 0

Furthermore, can be obtained using the following equation:

= ( )1
This will have the components of , , , , , and .

[ ]
Consequently, the obtained will be added to the initial approximation. Thus, the following values
are updated in such order to iterate: . Iteration is done until the absolute value
of of the maximum value is smaller than 1 6 , which means itll be iterated until all the values
are small enough that adding it to the approximated value wont make any more changes. Then,
using the following equation, residuals can be obtained:
= ()
Hence, using the computed residuals, a-posteriori variance factor can be computed.
02 =


matrix row matrix column

Also, unscaled covariance matrix can be obtained by:


= ( )1
Then, the standard deviation of each parameter can be obtained by:
= 02 diagonal of
Results & Analysis:
Final Orientation Parameter =

0.06963
1.265
0.045139
166.6
-160.14
1665.3

In this lab, the exterior orientation was calculated using 3, 5, and 9 points separately. The final
orientation parameter has the same order as the delta shown above, which is in radians, local
coordinates and the last component, is the flying height which is in meters. Note that more
results are in the appendix. The result above is the final exterior orientation after the iteration using
9 points. It took 109 iterations for 3 points, 55 iterations for 5 points, and 13 iterations for 9 points.

As seen from the trend, more points result better initial approximation, therefore less iteration is
needed. Consequently, the final exterior orientation with 9 points have better results than using 3
or 5 points. However, the residuals with 3 points were the smallest, because there are less factors
to consider for errors. Thus, the residuals with 9 points were higher than the residuals with less
points.
A-posteriori for 3 points came out to be infinite, because the degree of freedom is 0 in that case.
When a number is divided by 0, it eventually becomes infinite. Since the a-posteriori factor is
multiplied to the covariance matrix to obtain the standard deviation of each element, they also
become infinite. Moreover, the a-posteriori is obtained from the residuals obtained. Therefore, the
a-posteriori with 9 points will have a higher value relative to the other a-posteriori.
From the residual plot shown in the appendix, most of the residuals were closely located when 9
points were considered, whereas the other two plots where separated apart.
Adjusted coordinates:
= 620047.132
= 484757.814
= 1665.3
Conclusion:
From this lab, the exterior orientation parameters of a photograph were determined using the space
resection method with different sets of ground control points. As seen from the results, 9 points
yielded better initial approximation. Therefore, it had less number of iterations. Also, the flying
height can be checked with the flying height obtained using the distance measurement on the image.
Since the flying height came out to be 1666.67m, using the distances and the adjustment process
resulted flying height to be 1665.3m. Therefore, its been confirmed that selecting more points for
the calculation results better results.

Appendix:

Figure 1. Points Used to determine the exterior orientation

3 Points:
Pixel Coordinates
Colum

2845.834
3867.7
1222.4

Row

GCPs (UTM)
X (m)

Y (m)

4380.083
620528
4847852
7223.3
620663
4847483
5860.5
620319
4847661
Table 1. Initial measured points

Z (m)

197
197
197

Image Coordinates
(mm)

(mm)

Ground Coordinates
X (m)

Y (m)

-7.962
12.334
-115.66
179.17
1.2348
-13.255
17.937
-192.55
-22.573
-0.99
-327.91
-14.381
Table 2. Measured Pixel coordinates Image coordinates Ground Coordinates
Image

39.324
172.92
-172.92

GCPs

185.86
37
184.5
-185.86
172
-184.5
-7.6886
-172
-6.5
Table 3. Centroid applied Local coordinates

109 Iterations
Final EO
Residuals
Adjustment
0.99314
4.1541
1.18E-25
0.0018021
-23.793
5.27E-26
-0.68946
0.41691
1.21E-25
0.35499
-443.87
3.41E-27
-89.363
7.23E-26
1549.7
4.14E-26
Table 4. Results
(Residuals are same units as final external orientation noted in the result)

39.324
185.86
172.92
-185.86
-172.92
-7.6886

A matrix
-185.86
1
39.324
0
185.86
1
172.92
0
7.6886
1
-172.92
0
Table 5. A matrix

L
0
1
0
1
0
1

Initial
0.99314
0.0018021
-0.68946
0.35499
Table 6. Initial parameters

37
184.5
172
-184.5
-172
-6.5

Initial rotational matrix


Final rotational matrix
1
0.0018146
0
0.91499
-0.021966
0.40288
-0.0018146
1
0
-0.0066579
0.99756
0.069509
0
0
1
-0.40343
-0.066283
0.91261
Table 7. Rotational matrix
Initial B matrix
-0.51122 101.47
12.672
-0.068839
-102.98 0.14023 -2.6175 0.00012491
1.305
102.79
-12.747 -0.068839
-103
-1.6784 -11.865 0.00012491
-0.23888 102.77 -0.45049 -0.068839
-101.4 -0.13161 11.794 0.00012491
Final B matrix
-4.7888
102
12.334
-0.066304
-97.286 -1.6953
7.782
0.0039062
4.8415
101.42
-13.255 -0.062444
-93.793 -0.93537 -1.4148 -0.0031641
-0.50869 106.34
-0.99
-0.075435
-101.82 -0.51927 22.393 0.00020428
Table 8. B matrix

-0.00012491 -0.001777
-0.068839 -0.0086026
-0.00012491 -0.0080548
-0.068839
0.0086536
-0.00012491 0.0080066
-0.068839 0.00030583
0.0011831
-0.069356
0.0015719
-0.069095
0.00055056
-0.074994

Initial misclosure Final misclosure


-10.4
-7.99E-15
-0.3379
1.37E-13
-10.45
1.80E-14
-0.5084
1.26E-13
-10.599
7.11E-15
-0.53951
1.45E-13
Table 9. Misclosure
Initial Delta Final Delta
-0.052054
2.87E-15
-0.038723
-2.98E-15
-0.00026029 2.63E-17
94.543
-3.81E-12
84.653
-5.65E-12
-14.148
-2.72E-12
Table 10. Delta

-0.02333
-0.012653
-0.02854
0.0034189
-0.015127
-0.0045527

Initial EO
Final EO
-2.9825
4.1541
-2.2187
-23.793
0.089055
0.41691
93.854
-443.87
85.008
-89.363
1655.9
1549.7
Table 11. Exterior Orientation
02

Covariance Matrix of External Orientation

0.043729 -0.034456 0.0075355 -45.184 -57.031 -24.881 Infinite


-0.034456
0.16189
-0.0036583
209.6
38.107
111.68 Infinite
0.0075355 -0.0036583 0.0030189 -4.8534 -9.7081 -2.7296 Infinite
Infinite
-45.184
209.6
-4.8534
2.72E+05 50172 1.44E+05 Infinite
-57.031
38.107
-9.7081
50172
74836
27584
Infinite
-24.881
111.68
-2.7296
1.44E+05 27584
80118
Infinite
Table 12. Accuracy

5 Points:
Pixel Coordinates
Colum

GCPs (UTM)

Row

2845.834
2773
3867.7
807.89
1222.4

X (m)

Y (m)

Z (m)

4380.083
620528
4847852
3210.917
620607
4847979
7223.3
620663
4847483
8480.6
620263
4847318
5860.5
620319
4847661
Table 13. Initial measured points

Image Coordinates
(mm)

(mm)

197
197
197
197
197

Ground Coordinates
X (m)

Y (m)

-7.962
12.334
-115.66
179.17
-8.6175
22.856
-125.18
332.02
1.2348
-13.255
17.937
-192.55
-26.303
-24.571
-382.1
-356.93
-22.573
-0.99
-327.91
-14.381
Table 14. Measured Pixel coordinates Image coordinates Ground Coordinates

Image

66.421
56.899
200.02
-200.02
-145.83

GCPs

191.62
65
344.48
144
-180.1
200
-344.48
-200
-1.9273
-144
Table 15. Centroid applied Local coordinates

203.5
330.5
-165.5
-330.5
12.5

Adjustment
0.9877
-0.075511
17.301
7.8646

55 Iterations
Final EO
1.2732
14.116
-4.0104
544.7
-20.12
1554.1

Residuals
2.5371
-0.61771
-2.867
0.33107
0.82644
-0.52456
-1.0775
0.39946
0.56974
0.45175

Table 16. Results

66.421
191.62
56.899
344.48
200.02
-180.1
-200.02
-344.48
-145.83
-1.9273

A matrix
-191.62
1
66.421
0
-344.48
1
56.899
0
180.1
1
200.02
0
344.48
1
-200.02
0
1.9273
1
-145.83
0
Table 17. A matrix

L
0
1
0
1
0
1
0
1
0
1

65
203.5
144
330.5
200
-165.5
-200
-330.5
-144
12.5

Initial
0.9877
-0.075511
17.301
7.8646
Table 18. Initial parameters
Initial rotational matrix
Final rotational matrix
0.99709
-0.076229
0
0.96743
-0.064514
-0.24478
0.076229
0.99709
0
0.067826
0.99768
0.0051139
0
0
1
0.24388
-0.02155
0.96957
Table 19. Rotational matrix

7.4311
-102.92
6.1956
-106.1
9.3126
-102.39
4.7113
-106.7
7.7645
-101.1

101.18
8.1725
101.71
9.6916
102.77
6.3726
103.04
11.324
102.32
7.7875

11.382
-97.271
13.589
-101.66
3.8444
-99.792
-4.7595
-97.52
6.5627
-92.495

102.11
5.8925
101.37
6.2072
101.15
7.1297
107.75
13.674
106.36
7.4188

Initial B matrix
13.678
-0.068639
-2.2474 -0.0052475
22.81
-0.068639
-7.0034 -0.0052475
-10.941
-0.068639
-13.45
-0.0052475
-24.365
-0.068639
13.14
-0.0052475
-0.52827 -0.068639
11.096
-0.0052475
Final B matrix
12.951
-0.066484
10.319
-0.0069809
22.525
-0.068072
5.5705
-0.0087051
-12.731
-0.070334
-0.58836 -0.002701
-24.97
-0.061706
25.046 -0.00052838
-1.4417
-0.062309
22.963
-0.004396
Table 20. B matrix

0.0052475
-0.068639
0.0052475
-0.068639
0.0052475
-0.068639
0.0052475
-0.068639
0.0052475
-0.068639

-0.0015257
-0.0092861
-0.0047545
-0.015486
-0.009131
0.0074276
0.0089204
0.016541
0.0075328
0.00035863

0.0043956 0.024224
-0.070174 -0.0090953
0.0045188 0.021266
-0.070845 -0.015733
0.0046925 0.017361
-0.072624 0.0084657
0.0040261 0.032939
-0.068222 0.015892
0.0040733 0.031717
-0.068168 0.00059233

Initial misclosure Final misclosure


-10.029
2.5371
-1.3447
-0.61771
-15.441
-2.867
0.046086
0.33107
-12.035
0.82644
-2.3144
-0.52456
-12.984
-1.0775
-0.20566
0.39946
-11.297
0.56974
-0.46173
0.45175
Table 21. Misclosure

Initial Delta Final Delta


0.309
5.26E-10
0.59428
5.71E-10
-7.43E-05
-1.03E-10
1061.6
7.69E-07
-461.12
-7.39E-07
0.89529
-3.41E-07
Table 22. Delta

Initial EO
Final EO
17.705
1.2732
34.05
14.116
-4.3761
-4.0104
1078.9
544.7
-453.25
-20.12
1670.9
1554.1
Table 23. Exterior Orientation

02

Covariance Matrix of External Orientation

0.022512
0.014995 -0.0049674 20.449 -31.955 -8.3403 0.6735
0.014995
0.024521 -0.0023903 32.711 -20.727 -15.47 0.70291
4.4888 -0.0049674 -0.0023903 0.0016583 -3.3048 7.1759 1.212 0.18279
20.449
32.711
-3.3048
43829 -28302 -20245 939.75
-31.955
-20.727
7.1759
-28302 45439 11433 956.86
-8.3403
-15.47
1.212
-20245 11433 10806 466.61
Table 24. Accuracy

9 Points:

Pixel Coordinates
Colum

GCPs (UTM)

Row

2845.834
2773
3447.72
5069.167
4956.583
308.25
3867.7
807.89
1222.4

X (m)

Y (m)

Z (m)

4380.083
620528
4847852
3210.917
620607
4847979
3396.35
620518
4848003
5595.25
620820
4847694
1587.021
620804
4848211
599.22
620197
4848344
7223.3
620663
4847483
8480.6
620263
4847318
5860.5
620319
4847661
Table 25. Initial measured points

Image Coordinates
(mm)

(mm)

197
197
197
197
197
197
197
197
197

Ground Coordinates
X (m)

Y (m)

-7.962
12.334
-115.66
179.17
-8.6175
22.856
-125.18
332.02
-2.545
21.187
-36.971
307.78
12.048
1.3972
175.02
20.297
11.035
37.471
160.3
544.33
-30.8
46.362
-447.42
673.48
1.2348
-13.255
17.937
-192.55
-26.303
-24.571
-382.1
-356.93
-22.573
-0.99
-327.91
-14.381
Table 26. Measured Pixel coordinates Image coordinates Ground Coordinates

Image

20.543
11.02
99.233
311.22
296.5
-311.22
154.14
-245.9
-191.7

GCPs

20.896
19.5
173.75
98.5
149.51
9.5
-137.97
311.5
386.06
295.5
515.2
-311.5
-350.83
154.5
-515.2
-245.5
-172.65
-189.5
Table 27. Centroid applied Local coordinates

21
148
172
-137
380
513
-348
-513
-170

Adjustment
0.98798
6.09E-05
0.044241
-0.21604

13 Iterations
Final EO
0.06963
1.265
0.045139
166.6
-160.14
1665.3

Table 28. Results

Residuals
0.10843
-0.031933
-5.9943
1.7202
6.2035
-1.5784
-0.045521
-0.071099
0.026884
0.23802
-0.11696
0.32046
0.021818
-0.15447
-0.038029
-0.23792
-0.15884
-0.20715

20.543
20.896
11.02
173.75
99.233
149.51
311.22
-137.97
296.5
386.06
-311.22
515.2
154.14
-350.83
-245.9
-515.2
-191.7
-172.65

A matrix
-20.896
1
20.543
0
-173.75
1
11.02
0
-149.51
1
99.233
0
137.97
1
311.22
0
-386.06
1
296.5
0
-515.2
1
-311.22
0
350.83
1
154.14
0
515.2
1
-245.9
0
172.65
1
-191.7
0
Table 29. A matrix

L
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1
0
1

19.5
21
98.5
148
9.5
172
311.5
-137
295.5
380
-311.5
513
154.5
-348
-245.5
-513
-189.5
-170

Initial
0.98798
6.09E-05
0.044241
-0.21604
Table 30. Initial parameters

Initial rotational matrix


Final rotational matrix
1
6.17E-05
0
0.99976
0.00081465
-0.022075
-6.17E-05
1
0
-0.00078763
1
0.0012327
0
0
1
0.022076
-0.001215
0.99976
Table 31. Rotational matrix

-0.025546 101.42
-101.42 0.013035
-0.68829
101.85
-102.43
0.67569
-0.082443
101.4
-102.79 0.069849
1.9847
105.93
-102.27
-1.9975
-5.2566
105.48
-108.16
5.2434
7.4653
105.94
-113.71
-7.4788
2.5038
102.51
-107.05
-2.5167
-5.8913
104.22
-113.69
5.8779
-1.5103
103.08
-102.75
1.4976
1.1546
-102.71
0.89583
-105.73
2.3454
-106.29
-0.22631
-101.67
-3.366
-115.29
14.776
-121.59
-0.18917
-103.1
-6.8805
-106.64
-0.2726
-100.89

102.01
-1.0433
101.46
-0.59262
102.13
-2.0077
102.89
0.097828
102.63
4.0174
110.59
-13.946
101.42
-0.26119
108.11
6.1752
106.28
0.091766

Initial B matrix
1.4604
-0.068839
-1.3394
4.25E-06
10.203
-0.068839
-6.7782
4.25E-06
11.855
-0.068839
-0.65166
4.25E-06
-9.4174
-0.068839
-21.44
4.25E-06
26.172
-0.068839
-20.341
4.25E-06
35.331
-0.068839
21.444
4.25E-06
-23.942
-0.068839
-10.631
4.25E-06
-35.299
-0.068839
16.905
4.25E-06
-11.687
-0.068839
13.049
4.25E-06
Final B matrix
12.366
-0.068777
7.8904 -0.00013125
21.136
-0.068933
2.4432 -0.00026311
22.766
-0.068748
8.5685
-0.0002872
1.4683
-0.069393
-12.274
3.24E-05
37.233
-0.06933
-11.188 -0.00050629
46.041
-0.068072
30.503 -0.00063308
-13.101
-0.069077
-1.393
0.00025142
-24.333
-0.068263
26.085 0.00041787
-0.78285 -0.068358
22.234
6.58E-05
Table 32. B matrix

-4.25E-06 -0.00090931
-0.068839 -0.00099145
-4.25E-06 -0.0046017
-0.068839 -0.0069264
-4.25E-06 -0.0004424
-0.068839 -0.0080483
-4.25E-06 -0.014555
-0.068839 0.0063934
-4.25E-06 -0.013809
-0.068839 -0.017768
-4.25E-06
0.014558
-0.068839 -0.023986
-4.25E-06 -0.0072173
-0.068839
0.016254
-4.25E-06
0.011477
-0.068839
0.023964
-4.25E-06 0.0088586
-0.068839 0.0079341
-6.27E-05
-0.068902
-5.82E-05
-0.068969
-6.32E-05
-0.068874
-4.62E-05
-0.069223
-4.71E-05
-0.069147
-8.09E-05
-0.068506
-5.51E-05
-0.069084
-7.74E-05
-0.068689
-7.43E-05
-0.068708

0.0068823
-0.0084867
0.0031847
-0.014461
0.0073411
-0.015549
-0.0068488
-0.0010875
-0.0061037
-0.025481
0.022128
-0.0312
0.00057615
0.0088368
0.019177
0.01639
0.016579
0.00044563

Initial misclosure Final misclosure


-10.029
2.5371
-1.3447
-0.61771
-15.441
-2.867
0.046086
0.33107
-12.035
0.82644
-2.3144
-0.52456
-12.984
-1.0775
-0.20566
0.39946
-11.297
0.56974
-0.46173
0.45175
Table 33. Misclosure

Initial Delta Final Delta


0.010909
3.45E-12
-0.011498
3.86E-10
6.31E-05
1.27E-11
116.07
5.78E-07
-175.19
2.08E-09
1.7163
-1.05E-07
Table 34. Delta
Initial EO
Final EO
0.62501
0.06963
-0.65877
1.265
0.0071498 0.045139
116.11
166.6
-175.41
-160.14
1671.7
1665.3
Table 35. Exterior Orientation

02

Covariance Matrix of External Orientation

0.0025918 -0.0008982 -0.0002202


-1.41
-3.9838 -0.50375 0.34029
-0.0008982 0.005852 0.00028197 8.7606 1.4973
-1.3445
0.51133
-0.0002202 0.00028197 0.00018872 0.45369 0.36181 -0.014334 0.091825
6.6841
-1.41
8.7606
0.45369
13148
2340.7
-1958.8
766.43
-3.9838
1.4973
0.36181
2340.7
6156
702.18
524.44
-0.50375
-1.3445
-0.014334 -1958.8 702.18
865.76
196.67
Table 36. Accuracy

UTM Coordinates
3 Points
5 Points
9 Points

X (m)
620047.1317
621007.7008
620675.0969
Table 37. UTM Coordinates

Y(m)
4847578.137
4847628.38
4847670.864

J vs. K
1.50E-13

1.40E-13
-7.99E-15, 1.37E-13

1.35E-13
1.80E-14, 1.26E-13

-1.00E-14

-5.00E-15

0.00E+00

5.00E-15

1.00E-14

K (mm)

1.45E-13

7.11E-15, 1.45E-13

1.30E-13

1.25E-13
2.00E-14

1.50E-14

J (mm)

Figure 2. Residual Plot using 3 points

J vs. K
0.6
-2.867, 0.33107

0.56974, 0.45175

-1.0775, 0.39946

0.4

0
-0.2
-0.4
0.82644, -0.52456

-0.6

2.5371, -0.61771

-0.8
-4

-3

-2

-1

J (mm)

Figure 3. Residual Plot using 5 points

K (mm)

0.2

J vs. K
2
-5.9943, 1.7202
1.5
1
-0.11696, 0.32046

0.021818, -0.15447
-0.15884, -0.20715 -0.038029, -0.23792

-0.5
-1
6.2035, -1.5784

-1.5
-2

-8

-6

-4

-2

J (mm)

Figure 4. Residual Plot using 9 points

K (mm)

0.5

0.026884, 0.23802
-0.045521, -0.071099
0.10843, -0.031933

Image measurements -> Ground coordinates -> Local coordinates

GCPs measurements -> Local coordinates

A Matrix formation

Xhat formation

Initial approximation using Xhat

Initial Rotational Matrix formation

Initial B Matrix formation

Initial Misclosure formation

Initial Delta formation

Update Initial approximation by adding the Initial Delta

Iteration Process until Small Delta Value


Rotational Matrix formation
B Matrix formation
Misclosure formation
Delta formation
Updating the approximated value by adding Delta
Output Final Adjusted Exterior Orientation approximation

Residual formulation

A-Posteriori formulation

Covariance matrix formulation

Standard of each Deviation formulation

Figure 5. Flow Chart of the Process

Matlab Code:
Main Script
clc;
clear all;
% I = imread('1038.jpg');
% imshow(I);
% pause;
% [x y] = ginput(1);
image=importdata('image.txt');
GCPs=importdata('GCPs.txt');
P_col=image(:,1);
P_row=image(:,2);
% Pixel coordiantes to Image coordiantes
pixel = 0.009;
w = 7500;
h = 11500;
xp = -0.180;
yp = 0;
for m=1:length(P_col)
x(m) = (P_col(m) - (w/2) -0.5)*pixel;
y(m)= ((h/2) - P_row(m) + 0.5)*pixel;
xa(m)=(x(m)-xp);
ya(m)=(y(m)-yp);
end
X_utm=GCPs(:,1);
Y_utm=GCPs(:,2);
% Google Earth Ground coordinates to local coordinate system
X_cen=min(X_utm)+(max(X_utm)-min(X_utm))/2;
Y_cen=min(Y_utm)+(max(Y_utm)-min(Y_utm))/2;
for l = 1:length(X_utm)
X_loc(l)=X_utm(l)-X_cen;
Y_loc(l)=Y_utm(l)-Y_cen;
end
h=GCPs(:,3);
f=101.4;
H=1670;
GCPx=X_loc;
GCPy=Y_loc;
% Image coordinates to ground coordinate system
for n = 1:length(xa)
X(n) = xa(n)*((H-h(n))/f);

Y(n) = ya(n)*((H-h(n))/f);
end
% ground coordinates system to local coordinate system
X_cen2=min(X)+(max(X)-min(X))/2;
Y_cen2=min(Y)+(max(Y)-min(Y))/2;
for m = 1:length(X)
X(m)=X(m)-X_cen2;
Y(m)=Y(m)-Y_cen2;
end
[ A,L ] = Amatrix( X,Y,GCPx,GCPy );
Xhat=inv(A'*A)*A'*L;
% Initial approximation
kappa=atan2(Xhat(2),Xhat(1));
phi=0;
omega=0;
% Rotational matrix
[ M ] = matrix( kappa,omega,phi );
% Translation
XL=Xhat(3);
YL=Xhat(4);
xo = -0.18;
yo = 0;
X=GCPx;
Y=GCPy;
% B matrix
[ b,J,K ] = B( M,X,Y,h,H,XL,YL,xo,yo,f,kappa,omega,phi,xa,ya );
% Misclosure
[ eps ] = Epsilon( X,J,K );
% Delta
delta = (inv(b'*b))*(b'*eps);
% Fixing initial approximation
omega = omega + (delta(1));
phi = phi+ (delta(2));
kappa = kappa + (delta(3));
XL= XL+delta(4);
YL = YL + delta(5);
H = H+delta(6);
% Iteration Process
e=1;
while max(abs(delta))>1e-6

[ M ] = matrix( kappa,omega,phi );
[ b,J,K ] = B( M,X,Y,h,H,XL,YL,xo,yo,f,kappa,omega,phi,xa,ya );
[ eps ] = Epsilon( X,J,K );
delta = (inv(b'*b))*(b'*eps);
omega = omega + (delta(1));
phi = phi+ (delta(2));
kappa = kappa + (delta(3));
XL= XL+delta(4);
YL = YL + delta(5);
H = H+delta(6);
e=e+1;
end
xhat = [rad2deg(omega);rad2deg(phi);rad2deg(kappa);XL;YL;H];
% Residual
V=eps-(b*delta);
% A-posteriori
apost=(V'*V)/(size(b,1)-size(b,2))
% Covariance Matrix
Cx= inv(b'*b)
% Standard deviation
std=apost*sqrt(diag(Cx))

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
function [ b,J,K ] = B( M,X,Y,h,H,XL,YL,xo,yo,f,kappa,omega,phi,xa,ya )
% B matrix
c=1;
cc=2;
for j = 1:length(X)

del_x(j) = X(j)-XL;
del_y(j) = Y(j)-YL;
del_z(j) = h(j)-H;
r(j) = (M(1,1)*del_x(j))+(M(1,2)*del_y(j))+(M(1,3)*(del_z(j)));
s(j) = (M(2,1)*del_x(j))+(M(2,2)*del_y(j))+(M(2,3)*(del_z(j)));
q(j) = (M(3,1)*del_x(j))+(M(3,2)*del_y(j))+(M(3,3)*(del_z(j)));
b(c,1) = (f/(q(j)^2))*(r(j)*((-M(3,3)*del_y(j))+(M(3,2)*del_z(j)))-q(j)*((M(1,3)*del_y(j))+(M(1,2)*del_z(j))));
b(c,2) = (f/(q(j)^2))*(r(j)*((cos(phi)*del_x(j)+ sin(omega)*sin(phi)*del_y(j)-

cos(omega)*sin(phi)*del_z(j)))...
-(q(j)*(-sin(phi)*cos(kappa)*del_x(j)+sin(omega)*cos(phi)*cos(kappa)*del_y(j) ...
-cos(omega)*cos(phi)*cos(kappa)*del_z(j))));
b(c,3) = -(f/q(j))*((M(2,1)*del_x(j))+(M(2,2)*del_y(j))+(M(2,3)*del_z(j)));
b(c,4) = -(f/(q(j)^2))*(r(j)*M(3,1)-q(j)*M(1,1));
b(c,5) = -(f/(q(j)^2))*(r(j)*M(3,2)-q(j)*M(1,2));
b(c,6) = -(f/(q(j)^2))*(r(j)*M(3,3)-q(j)*M(1,3));
b(cc,1) = (f/(q(j)^2))*(s(j)*((-M(3,3)*del_y(j))+(M(3,2)*del_z(j)))-(q(j)*((M(2,3)*del_y(j))+(M(2,2)*del_z(j)))));
b(cc,2) = (f/(q(j)^2))*(s(j)*((cos(phi)*del_x(j)+ sin(omega)*sin(phi)*del_y(j)cos(omega)*sin(phi)*del_z(j)))...
-(q(j)*(sin(phi)*sin(kappa)*del_x(j)-sin(omega)*cos(phi)*sin(kappa)*del_y(j) ...
+cos(omega)*cos(phi)*sin(kappa)*del_z(j))));
b(cc,3) = (f/q(j))*((M(1,1)*del_x(j))+(M(1,2)*del_y(j))+(M(1,3)*del_z(j)));
b(cc,4) = -(f/(q(j)^2))*(s(j)*M(3,1)-q(j)*M(2,1));
b(cc,5) = -(f/(q(j)^2))*(s(j)*M(3,2)-q(j)*M(2,2));
b(cc,6) = -(f/(q(j)^2))*(s(j)*M(3,3)-q(j)*M(2,3));
J(j) = xo-(f*r(j)/q(j))-xa(j);
K(j) = yo-(f*s(j)/q(j))-ya(j);
c=c+2;
cc=cc+2;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
function [ eps ] = Epsilon( X,J,K )
% Misclosure
k=1;
o=1;
oo=2;
for a = 1:(length(X))
eps(o,1) = -J(k);
eps(oo,1) = -K(k);
o=o+2;
oo=oo+2;

k=k+1;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
function [ A,L ] = Amatrix( X,Y,GCPx,GCPy )
%A matrix
m=1;
n=2;
for i=1:length(X)
A(m,1)=X(i);
A(m,2)=-Y(i);
A(m,3)=1;
A(m,4)=0;
A(n,1)=Y(i);
A(n,2)=X(i);
A(n,3)=0;
A(n,4)=1;
m=m+2;
n=n+2;
end
a=1;
b=2;
for j=1:length(X)
L(a,1)=GCPx(j);
L(b,1)=GCPy(j);
a=a+2;
b=b+2;
end
end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%
function [ M ] = matrix( kappa,omega,phi )
% Rotational matrix
M=zeros(3,3);
M(1,1) = cos(phi)*cos(kappa);
M(1,2) = cos(omega)*sin(kappa)+sin(omega)*sin(phi)*cos(kappa);
M(1,3) = sin(omega)*sin(kappa)-cos(omega)*sin(phi)*cos(kappa);
M(2,1) = -cos(phi)*sin(kappa);
M(2,2) = cos(omega)*cos(kappa)-sin(omega)*sin(phi)*sin(kappa);
M(2,3) = sin(omega)*cos(kappa)+cos(omega)*sin(phi)*sin(kappa);
M(3,1) = sin(phi);
M(3,2) = -sin(omega)*cos(phi);
M(3,3) = cos(omega)*cos(phi);
end

Reference:

[1] Armenakis, Costas. Photogrammetry. 22 Feb. 2016. Lecture.


[2] Wolf, Paul R., Bon A. Dewitt, and Benjamin E. Wilkinson. Elements of Photogrammetry
with Applications in GIS. 4th ed. Toronto: McGraw-Hill, 2014. Web. 22 Feb. 2016.

You might also like