Write a matlab program or python program that determines the Exterior Orientation Parameters (EOPs) of a single photo using least squares adjustment procedure. I have included a couple of links with...

Write a matlab program or python program that determines the Exterior Orientation Parameters (EOPs) of a single photo using least squares adjustment procedure. I have included a couple of links with code for a similar assignment but I need the code to be mostly original. I have attached multiple documents that outline what needs to be completed along with pseudocode (see powerpoint). I do not need you to write a report I just need the matlab or python program to be written and for the program to have notes/comments on what is done in that area of code.


Similar code: https://github.com/jeffwalton/photogrammetry-resection
Similar code: https://www.mathworks.com/matlabcentral/fileexchange/40467-space-photo-resection


Assignment 3: Single Photo Resection Objective: Determine the Exterior Orientation Parameters (EOPs) of a single photo using least squares adjustment procedure. Given: 1. The image coordinates of the calibration targets as measured/provided in Assignment 2 for images 65_09_20180803.jpg, 65_10_20180803.jpg, 65_14_20180803.jpg, and 65_18_20180803.jpg; 2. Estimated Interior Orientation Parameters from Assignment 2 (principal point coordinates, principal distance, and distortion parameters); and 3. Estimated ground coordinates of the different targets in the calibration test field. Single Photo Resection (SPR) The objective of single photo resection is to determine the position of the perspective center and the orientation of the image coordinate system (i.e., the EOP for a given image) relative to the ground coordinate system. The solution to the single photo resection problem is based on the Collinearity equations and is performed for each image/photo independently. with: r11 = cos cos r12 = -cos sin r13 = sin r21 = cos sin + sin sin cos r22 = cos cos - sin sin sin r23 = -sin cos r31 = sin sin - cos sin cos r32 = sin cos + cos sin sin r33 = cos cos Collinearity equations are nonlinear with respect to the Exterior Orientation Parameters (EOP), which are the unknown parameters of the single photo resection problem. More specifically, the EOP encompass: · The three rotation angles (, , ), which are inherent in the elements of the rotation matrix (r11, r12, … r33). These angles should be applied to the ground coordinate system until it is parallel to the image coordinate system. · The position of the perspective center (Xo, Yo, Zo) relative to ground coordinate system. Assumptions For this lab, the following quantities are considered as known quantities and treated as constants: · The Interior Orientation Parameters (IOP) – xp, yp, c, and lens distortion parameters · The ground coordinates of the calibration targets (X, Y, Z) To solve for the six unknown Exterior Orientation Parameters (EOP), a minimum of three ground control points is required (two collinearity equations per point). It is recommended to use more or all of the available control points in order to exploit the added precision provided by data redundancy. This is achieved through a Least Squares Adjustment (LSA) procedure. Preamble For the sake of implementing a Least Squares Adjustment procedure, the Collinearity equations have to be linearized with respect to the unknown parameters (Exterior Orientation Parameters – EOP) using Taylor’s theorem. The partial derivatives of the collinearity equations with respect to the EOP are provided later in this handout. Complete list of the partial derivatives relative to the IOP, EOP, and ground coordinates of object points are available through the course website. The linearized form of the Collinearity equations would take the following form: where xo and yo are the evaluated x and y image coordinates using the initial approximations of the unknown parameters; , ... etc., are the partial derivatives of the x and y equations with respect to the unknowns evaluated at the initial approximations of these parameters; and , ... etc., are the unknown corrections to be applied to the initial approximations of the unknowns. One should note that only the first order terms of the Taylor’s theorem expansion are used. The truncation of higher order terms will be compensated for through the iterative LSA procedure. In the above linearized collinearity equations, the partial derivatives can be replaced by a simpler notation for handling convenience, as follows: which yields: This final form of the linearized Collinearity equations will be used to illustrate the various steps of the solution. Least Squares Adjustment Procedure: The solution now proceeds by building the Gauss-Markov (Observation Equations) Model, which will be used to solve for the unknown EOP. The general form of the observation equations model is y = A x + ee ~ (0, o2 P-1) The terms in the above equations have different definitions based on whether the system is linear in nature or have been linearized, Linear System Non-Linear System y is the observations vector y is the vector of differences between the measured and computed image coordinates using the approximate values for the unknown parameters A is the design matrix A is the design matrix composed of the partial derivatives x is the vector of unknown parameters x is the vector of unknown corrections to the approximate values of the Exterior Orientation Parameters e is the error vector e is the error vector In our case, of course, the terms are defined as in the second column. Balance between the observations and unknown parameters Number of observations, n Number of points 2 coordinates/point Number of parameters, m = 6 dXo dYo dZo d d d Redundancy, r = n – m; The observation equations can be expressed in a matrix form as follows: Now, let’s determine the involved values in the above equations: The differences vector, y: where xcorrected and ycorrected are the image coordinate measurements from Assignment 2 after the removal of the lens distortion (use the estimated distortion parameters in Assignment 2 to derive the corrected image coordinates). To calculate the above values, a set of initial approximations for the unknown parameters should be obtained. Initial Approximations of EOP: Use the sketch in Assignment 2 (the one showing the approximate location and orientation of the different images relative to the calibration test field coordinate system) to come up with approximations for the EOP for the different images in question (i.e., 65_09_20180803.jpg, 65_10_20180803.jpg, 65_14_20180803.jpg, and 65_18_20180803.jpg). The design matrix, A: · The rows of the design matrix are calculated from the partial derivative terms of the Collinearity equations with respect to the Exterior Orientation Parameters (EOP). · The following terms a1, …, a6 and b1, …, b6 will constitute the elements of the two rows of the A matrix associated with each point. The approximate values for the rotation angles and perspective center coordinates are used for computing the A matrix. Required Task Develop a computer program using C/C++, Matlab, or Octave to solve for the exterior orientation parameters. Implement your program to estimate the EOP for images 65_09_20180803.jpg, 65_10_20180803.jpg, 65_14_20180803.jpg, and 65_18_20180803.jpg. Note: Octave is a scientific programming language whose syntax is largely compatible with Matlab. Free software can be downloaded from: https://www.gnu.org/software/octave/index. Deliverables and Report Preparation Your lab report should include the following for images 65_09_20180803.jpg, 65_10_20180803.jpg, 65_14_20180803.jpg, and 65_18_20180803.jpg: · Measured image coordinates and the approximations to the unknown EOP · The modified Exterior Orientation Parameters after each iteration · The final adjusted values of the Exterior Orientation Parameters together with their standard deviations · Comparison of the estimated EOP with the BASC-based EOPs in Assignment 2 · An estimate of the variance component · The a-posteriori variance-covariance (dispersion) matrix of the parameters · The residuals associated with the image coordinate measurements · Explanation of your results and any problems encountered · Computer code for the SPR procedure 1 ) ( ) ( ) ( 31 21 11 o o o x Z Z r Y Y r X X r N - × + - × + - × = ) ( ) ( ) ( 32 22 12 o o o y Z Z r Y Y r X X r N - × + - × + - × = ) ( ) ( ) ( 33 23 13 o o o Z Z r Y Y r X X r D - × + - × + - × = k k f f w w d x d x d x dZ Z x dY Y x dX X x x x o o o o o o o o o o o o o ÷ ø ö ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + ÷ ø ö ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + = k k f f w w d y d y d y dZ Z y dY Y y dX X y y y o o o o o o o o o o o o o ÷ ø ö ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + ÷ ø ö ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + ÷ ÷ ø ö ç ç è æ ¶ ¶ + = o o o o Y x X x ÷ ÷ ø ö ç ç è æ ¶ ¶ ÷ ÷ ø ö ç ç è æ ¶ ¶ , o o dY dX , o o o o o o o o o x a x a x a Z x a Y x a X x a ÷ ø ö ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = ÷ ø ö ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = k f w 6 5 4 3 2 1 , , , , , o o o o o o o o o y b y b y b Z y b Y y b X y b ÷ ø ö ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = ÷ ø ö ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = ÷ ÷ ø ö ç ç è æ ¶ ¶ = k f w 6 5 4 3 2 1 , , , , , k f w d a d a d a dZ a dY a dX a x x o o o o 6 5 4 3 2 1 + + + + + = - k f w d b d b d b dZ b dY b dX b y y o o o o 6 5 4 3 2 1 + + + + + = - 1 1 6 6 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 6 5 4 3 2 1 1 2 / 2 / 2 / 2 / 2 2 2 2 1 1 1 1 2 / 2 / 2 2 1 1 2 2 2 2 2 2 2 2 2 2 2 2 1 1 1 1 1 1 1 1 1 1 1 1 ´
Mar 18, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here