logo Hurry, Grab up to 30% discount on the entire course
Order Now logo

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Darryl HunterPsychology
(5/5)

747 Answers

Hire Me
expert
Irina KossovaNursing
(/5)

576 Answers

Hire Me
expert
Maurice FrancePsychology
(4/5)

649 Answers

Hire Me
expert
Ashton HamiltonEnglish
(5/5)

874 Answers

Hire Me
MATLAB
(5/5)

Write code to project these points onto an image using two methods, perspective and weak perspective projection.

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Theme: 3D to 2D projections.

Objective: The goal of this problem is to get familiar with some methods of projection. You will construct a simple object consisting of some 3D points. You will then write code to project these points onto an image using two methods, perspective and weak perspective projection. You will then judge the accuracy of the weak perspective approximation to true perspective.

Imagine that you have a perspective camera with a focal point at (0,0,0), a focal length of 1, and an image plane equal to the z=1 plane. Let us consider an object O with four 3D co-ordinates (-1, 0, 2), (1, 0, 5), (0, 1, 4), (0, -1, 3).

a. Write a function that will take as input a set of 3D points, and returns as output a set of 2D points (𝑝1 , 𝑝2 , 𝑝3 , 𝑝4 ) that are the projection of the 3D points with the perspective camera.

b. Write the second function to project the points using weak perspective projection (π‘ž1 , π‘ž2 , π‘ž3 , π‘ž4 ).

Note that the scale factor should be based on the average distance to all points.

c. Test these functions. Print out the figures showing the 2D projection of O using weak perspective and perspective projection. The functions: figure, plot, fill and text may be useful. Try, for example, plot(5,5,'o','LineWidth', 6), to get an idea of how to display a point in a figure so that it’s easily visible. The function axis may also be helpful. You should show both of the object and its 2D projection in the same 2D plot by using different shapes or colors. Label everything.

d. Write a function to compute the sum of square differences (SSD) between two sets of image points.

That is, for point sets: (𝑝1 , 𝑝2 , 𝑝3 , 𝑝4 ), (π‘ž1 , π‘ž2 , π‘ž3 , π‘ž4 ), compute: ∑ |𝑝𝑖 − π‘žπ‘– | 4 2𝑖=1 . Test it on the points generated in parts a and b.

e. Write a function to rotate the object O counter clock wise by 45 degree around the Z-axis. We call the object after rotation as R. Repeat part c and d for object R

(5/5)
Attachments:

Related Questions

. The fundamental operations of create, read, update, and delete (CRUD) in either Python or Java

CS 340 Milestone One Guidelines and Rubric  Overview: For this assignment, you will implement the fundamental operations of create, read, update,

. Develop a program to emulate a purchase transaction at a retail store. ThisΒ  program will have two classes, a LineItem class and a Transaction class

Retail Transaction Programming Project  Project Requirements:  Develop a program to emulate a purchase transaction at a retail store. This

. The following program contains five errors. Identify the errors and fix them

7COM1028   Secure Systems Programming   Referral Coursework: Secure

. Accepts the following from a user: Item Name Item Quantity Item Price Allows the user to create a file to store the sales receipt contents

Create a GUI program that:Accepts the following from a user:Item NameItem QuantityItem PriceAllows the user to create a file to store the sales receip

. The final project will encompass developing a web service using a software stack and implementing an industry-standard interface. Regardless of whether you choose to pursue application development goals as a pure developer or as a software engineer

CS 340 Final Project Guidelines and Rubric  Overview The final project will encompass developing a web service using a software stack and impleme