Project 2
Course: Computer Vision, Spring 2020, CSE.
Coder: Hong Zhang
hmz5180@psu.edu
email:Part 1 Descripsion:
- run Colmap, get the data file and point cloud (sparse and dense).
- fit a dominant plane in the point cloud and compute the parameters of plane in the world coordinate.
- read/display 3D object .
- design a coordinate in the dominant that we 'd like to place the object
- build the object local coordinate
- place the 3D object on the designed position in the dominant plane by computing transformation matrix between object coordinate and world coordinate.
How To Run:
Run the Script (main.m) in Matlab 2019b directly.
Lower Matlab version with pcread() and pcshow() will be okay and Computer Vision Package is essential.
File:
matlab scripts :
- -- dominant_plane_finding.m (running script)
- -- RANSAC_PlaneFitting.m (function to find a dominant plane)
- -- compute_plane_parameter.m (function to compute the plane parameters after RANSAC)
- -- build_object_coordinate.m (function to build a object local object and origin in the dominant plane)
- -- transform_3Dobject.m (function to compute the transformation matrix between object local coordinate and the designed coordinate in the dominant plane)
Data (get from COLMAP):
- --- Data/fused.ply (Dense Point Cloud)
- --- Data/camera.txt
- --- Data/images.txt
- --- Data/points3D.txt (Sparse Point Cloud)
Supplemantal Functions and Files:
https://www.turbosquid.com/Search/3D-Models/free?page_num=7)
Directory: './3Dmodel' (download from- --- chicken_01.obj : 3d model
- --- chicken_01.jpg: texturemap
Directory './OBJRead/'
https://www.mathworks.com/matlabcentral/fileexchange/18957-readobj
cite fromhttps://www.mathworks.com/matlabcentral/fileexchange/20307-display_obj
- --- readObj.m : Read 3D model .obj file
- --- display_obj.m : to display the object
Co-worker: Shimian Zhang
Part 2 Descripsion:
- read camera internal and external parameters from Colmap running result.
- compute camera pose (orientation + location) from the external parameter.
- display poses of each camera on a 3D figure.
- project the 3D object vertices from world coordinate to camera coordinate.
- use Z-buffer concept to fill each face of the 3D object, together with the corresponding image taken by each camera.
File:
matlab scripts :
- -- camera_projecting.m (running script)
- -- loadCameraParas.m (function to read camera internal and external parameters)
- -- Projection.m (function to do projection of a 3D object by a specific camera parameter)
- -- WorldToImage.m (function to do projection of a single point from world coordinate to a 2D camera coordinate)
Data (get from COLMAP):
- --- Data/camera.txt
- --- Data/images.txt
- --- Data/dataset/xxx.jpeg (Original images taken by the same camera in different poses)