diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/camera_P.m b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/camera_P.m index a29b2616..e4943cf5 100644 --- a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/camera_P.m +++ b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/camera_P.m @@ -2,7 +2,9 @@ close all clear all clc -filename = "rubiks.jpg" +filename = "rubiks2.jpg" +num_points = 24; % Set number of points + % Prompt user to load data or select points manually choice = menu('Do you want to load points from the workspace_variables.mat file?', 'Yes', 'No'); @@ -26,14 +28,13 @@ else hold on; % Keep the image displayed while adding markers % Initialize matrices to store 2D and 3D homogeneous coordinates - num_points = 36; % Set number of points image_points = zeros(num_points, 3); % For 2D image points in homogeneous coordinates world_points = zeros(num_points, 4); % For 3D world points in homogeneous coordinates disp('Click on the image to select 96 points and enter their 3D world coordinates.'); for i = 1:num_points - % Use ginput to get one image point at a time + % Use ginput to get one imJKJKJJKJKJage point at a time [x, y] = ginput(1); % Store the 2D image coordinates in homogeneous form diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.pdf b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.pdf index b90de310..16794c4f 100644 Binary files a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.pdf and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.pdf differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.tex b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.tex index 78734c63..b29ab5a3 100644 --- a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.tex +++ b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/assignment.tex @@ -76,7 +76,55 @@ \end{center} \hrule -\section{\textit{P}–Matrix Estimation Using Provided Code} +\section{\textit{P}-Matrix Estimation Using Provided Code} +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/1.1.png} + \caption{ Command window output showing he computed camera matrix $P$, the intrinsic matrix $K$, \& the rotation matrix $R$ } +\end{figure} +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/1.2.png} + \caption{ The 3D plot showing the camera center, the world points, \& the principal axis } +\end{figure} + +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/1.3.png} + \caption{ The image with projected 3D points \& vanishing lines } +\end{figure} + +\section{Using Your Own Image from Your Camera for \textit{P}-Matrix Estimation} +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/2.1.png} + \caption{ Command window output showing he computed camera matrix $P$, the intrinsic matrix $K$, \& the rotation matrix $R$ } +\end{figure} + +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/2.2.png} + \caption{ The 3D plot showing the camera center, the world points, \& the principal axis } +\end{figure} + +\begin{figure}[H] + \centering + \includegraphics[width=\textwidth]{./images/2.3.png} + \caption{ The image with projected 3D points \& vanishing lines } +\end{figure} + +\section{Experiment \& Reflect} +\subsection{How does increasing the number of points affect the accuracy \& stability of the \textit{P}-matrix estimation?} +As the number of control points increased, the accuracy and stability of the estimated P Matrix improved. With 12 points, we observed discrepancies in the back-projected 3D points, while results with 40 points were far more consistent. The intrinsic and rotation matrices derived from the P Matrix appeared less sensitive to noise with more points, enhancing the reliability of the calibration. + +\subsection{Is there a noticeable difference in the accuracy of the back-projection when using fewer points versus more points?} +Using fewer points (e.g., 12) resulted in higher deviations in back-projected points compared to their actual image locations. With 40 points, the back-projection closely matched the real-world setup, minimizing errors. + +\subsection{What challenges did you encounter when manually selecting points \& entering 3D world coordinates?} +The primary challenge that we faced when manually entering selecting the points was the precision: it was extremely difficult to precisely select the correct points due to the imprecision of the mouse as a selection device, human error, and a lack of fine-grain zoom control in the MATLAB UI. +\\\\ +We also found the process of manually entering the points very time-consuming and error-prone. +If we mis-clicked a point or accidentally entered in the wrong world coordinate, it would greatly damage the accuracy of the entire calibration and we would be forced to start over again. \end{document} diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.1.png b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.1.png new file mode 100644 index 00000000..19181186 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.1.png differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.2.png b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.2.png new file mode 100644 index 00000000..1d5cf537 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.2.png differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.3.png b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.3.png new file mode 100644 index 00000000..7297b5b3 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/1.3.png differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.1.png b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.1.png new file mode 100644 index 00000000..e361e302 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.1.png differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.2.png b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.2.png new file mode 100644 index 00000000..a66dae37 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.2.png differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.3.png b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.3.png new file mode 100644 index 00000000..230f5466 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/latex/images/2.3.png differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/output1.ofig b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/output1.ofig new file mode 100644 index 00000000..733f41b3 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/output1.ofig differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/output2.ofig b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/output2.ofig new file mode 100644 index 00000000..abb71328 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/output2.ofig differ diff --git a/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/rubiks2.jpg b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/rubiks2.jpg new file mode 100644 index 00000000..75c71f76 Binary files /dev/null and b/year4/semester1/CT404: Graphics & Image Processing/labs/1. Camera Calibration/rubiks2.jpg differ