Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Implement a function in Matlab that computes the three coordinates of a point in

ID: 3684165 • Letter: I

Question

Implement a function in Matlab that computes the three coordinates of a point in space given the coordinates of its images for two cameras. The two cameras have parallel optical axes, equal focal lengths, coplanar image planes and parallel pixel rows and columns, in other words there is “ideal” geometry. The arguments of the function should include the coordinates of the two image points with respect to the top left corners of the images, the positions of the image centers in pixels for each camera, the focal length of the cameras and the baseline distance. The outputs should be the 3D coordinates of the point in the “cyclopean” Euclidean coordinate system of the camera system (i.e. the origin is at the middle of the baseline and its axes parallel to the camera axes).

Explanation / Answer

The ability to automatically calculate the shortest distance from a point to a line is not available in MATLAB. To work around this, see the following function:

In this function, pt, v1, and v2 are the three-dimensional coordinates of the point, one vertex on the line, and a second vertex on the line, respectively. The following example illustrates how this function would be called:

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote