Giter VIP home page Giter VIP logo

3d-computer-vision-homework's Introduction

3D Computer Vision: Homework

Contents

  • keywords: ORB, RANSAC, normalized direct linear transformation (DLT) algorithm
  • keywords: normalized direct linear transformation (DLT) algorithm, inverse warping (bilinear interpolation), GUI mouse click
  • keywords: epipolar geometry, stereo processing
  • keywords: image stitching, image warping
  • keywords: rasterization, mesh, pygame
  • keywords: Perspective-n-Point (PnP) pose computation, DLT, EPnP, RANSAC, trajectory, augmented reality (AR)
  • keywords: chessboard, camera intrinsic matrix, distortion coefficients, RMS reprojection error
  • keywords: camera relative pose, epipolar geometry, triangulation, absolute orientation problem

Note


Project 1: Homography Estimation

Python Usage

python3 HomographyEstimation.py --img1 images/1-b0.jpg --img2 images/1-b1.jpg --n 4 --descriptor o

Original images:

Original 2 Images

Find the keypoints using ORB:

Keypoints

Brute-force Matching:

MatchORB

Find inliers using the homography matrix:

Inliers


Project 2: Document Rectification

Python Usage

python3 DocumentRectification.py --img1 images/book1.jpg 

The original book and its rectification:

rectifiedBook2


Project 3: Stereo Rectification

Python Usage

python3 StereoRectification.py --img1 images/bike1.png --img2 images/bike2.png

Original images:

StereoRectification_imgRaw

Epilines:

StereoRectification_epilines

Stereo rectification:

StereoRectification_rec


Project 4: Image Stitching

Python Usage

python3 image_stitching.py --imgDir successive_images/scottsdale --outputDir results 

StitchingPipeline

original three images

Stitching3rawImages

stitch all images

Stitching3Images

crop the image

StitchingCroppedImages


Project 5: 3D Rasterizer

  • Objective: To display the polygons
  • Language: Python
  • Library: pygame
  • Input: .obj files

Usage

The parameters can be modified in main_displayer.py. Then run

python3 main_displayer.py

Controls

  • Movement: W, A, S, D
  • Rotation: โ† (left arrow) and โ†’ (right arrow)

Displayer

cubePygame


Project 6: Camera Pose Estimation

First, merge separate data inputs.

python3 merge_data.py

After runnung merge_data.py, please make sure that 4 pkl files, namely images.pkl, point_desc.pkl, points3D.pkl, and train.pkl, are in the data directory.

Project 6-1: (camera pose) trajectory plot

python3 trajectoryPlot.py --pnp epnp_gauss
python3 trajectoryPlot.py --pnp epnp_gauss  --onlyshow 1 

Original Data (Point Clouds)

school_gate

Moving Trajectory

camera_trajectory

  • Options for the command-line argument --pnp for PnP pose computations are provided:
    • p3p_Grunert_ransac
    • normalized_DLT
    • epnp
    • epnp_gauss
    • opencv_PnPRansac

Project 6-2: (camera pose) Augmented Reality (AR)

python3 cubeDrawing.py --pnp epnp_gauss --videopath results/cubeVideo.mp4
python3 cubeDrawing.py --pnp epnp_gauss --onlyshow 1 --videopath results/cubeVideo.mp4 
python3 cubeDrawing.py --onlyshow 2 --videopath results/cubeVideo.mp4 

cubeVideo


Project 7: Camera Calibration

Python Usage

python3 camera_calibration.py

This program estimates the camera intrinsic matrix and the distortion coefficients.

Relative camera poses:

Relative camera poses


Project 8: Visual Odometry

Python Usage

python3 main_vo.py --imgDir input_vo_frames --camParams results_calibration/camera_params.npy --features 1000 --trackerConfig orb --poseMethod opencv --show True

where the --trackerConfig has the following options:

orb
brisk
sift
sift_root
akaze
LK_SHI_TOMASI
LK_FAST

Tools

Estimate the pose error (for Project 6)

python3 poseError.py

Visualize a cube by using Open3D (for Project 6-2)

python3 transform_cube.py

Note

  • All output files are saved in the results folder.
  • Some of projects are modified from the class of 3D Computer Vision with Deep Learning Applications at National Taiwan University.

Resources and References

[1] Lecture Notes from Chu-Song Chen's class of 3D Computer Vision with Deep Learning Applications (Fall 2022)
[2] Homography Estimation from hughesj919's Github
[3] Inverse Warping from makkrnic's Github
[4] (Project 3) images
[5] Stitching Pipeline from OpenCV
[6] Image Stitching from apoorva-dave's Github
[7] (Project 5) 3D Rasterizer from lcox74's github
[7] (Project 6) Dataset
[8] EPnP and Gauss-Newton Optimization from WeiyanCai's Github
[9] Direct Linear Transform (DLT) from acvictor's Github
[10] Visual Odometry from luigifreda's github
[11] Pose Recovery from laavanyebahl's github
[12] Absolute Orientation Problem in Cyrill Stachniss's lecture notes

3d-computer-vision-homework's People

Contributors

twwang97 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.