• Stars
    star
    253
  • Rank 160,776 (Top 4 %)
  • Language
    Python
  • License
    BSD 3-Clause "New...
  • Created almost 8 years ago
  • Updated almost 4 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Compute Vanishing points using RANSAC and rectify the image

Automated Rectification of Image

Implements the modified version of the following paper:

Chaudhury, Krishnendu, Stephen DiVerdi, and Sergey Ioffe. "Auto-rectification of user photos." 2014 IEEE International Conference on Image Processing (ICIP). IEEE, 2014.

Modifcation note: Instead of finding edge direction using structural tensor and its eigenvectors as in paper, I have used more reliable canny edge detection and probabalistic hough line transform.

Results

Input image:

Input Image

After rectification:

Rectified Image

How it works

First, compute list of 'edgelets'. An edgelet is a tuple of edge location, edge direction and edge strength.

edgelets1 = compute_edgelets(image)
vis_edgelets(image, edgelets1) # Visualize the edgelets

Edgelets

Next, find dominant vanishing point using ransac algorithm. In our case it turns out to be horizontal.

vp1 = ransac_vanishing_point(edgelets1, num_ransac_iter=2000, 
                             threshold_inlier=5)
vp1 = reestimate_model(vp1, edgelets1, threshold_reestimate=5)
vis_model(image, vp1) # Visualize the vanishing point model

Horizontal Vanishing Point

Remove the inliers for horizontal vanishing point. Vertical lines should now be dominant. Recompute the vanishing point using ransac should give us vertical vanishing point.

edgelets2 = remove_inliers(vp1, edgelets1, 10)
vp2 = ransac_vanishing_point(edgelets2, num_ransac_iter=2000,
                             threshold_inlier=5)
vp2 = reestimate_model(vp2, edgelets2, threshold_reestimate=5)
vis_model(image, vp2) # Visualize the vanishing point model

Vertical Vanishing Point

Finally, compute homography and warp the image so that we have a fronto parellel view with orthogonal axes:

warped_img = compute_homography_and_warp(image, vp1, vp2,
                                         clip_factor=clip_factor)

Rectified Image

More Repositories

1

outline-wiki-docker-compose

Installation and docker compose to self host outline wiki: https://www.getoutline.com/
Shell
277
star
2

ATIS.keras

Spoken Language Understanding(SLU)/Slot Filling in Keras
Python
101
star
3

image_features

Extract deep learning features from images using simple python interface
Python
89
star
4

ARM7

Implemetation of pipelined ARM7TDMI processor in Verilog
Verilog
69
star
5

Traffic-Sign-Classification.keras

Deep leaning for traffic sign classification in keras and python
Jupyter Notebook
68
star
6

telugu-nlp

NLP for Telugu language
Python
21
star
7

plantvillage-challenge

Code in Torch for PlantVillage challenge: https://www.crowdai.org/challenges/1
Lua
17
star
8

chsasank.github.io

My website
TeX
9
star
9

paul-graham-essays-ebook

E-book made from Paul Graham's essays
HTML
5
star
10

Traffic-Sign-Classification-Old

Classification of challenging German Traffic Recognition Database
C
5
star
11

pysptools-old

Python
4
star
12

django-keycloak-example

Example repo with django
Python
3
star
13

django-pyoxidizer

PyOxidizer to package a django app
Starlark
3
star
14

design-patterns

Design patterns in python
Python
3
star
15

MIP

Assignments & Projects from the course: Medical Image Processing
HTML
2
star
16

learning-rust

My notes learning rust from the rust book
Rust
2
star
17

CVX

Project from Convex Optimization course
TeX
2
star
18

CV

Assignments and Projects for Computer Vision course at IITB
MATLAB
2
star
19

newsX

Jupyter Notebook
2
star
20

pytorch-tutorials

PyTorch tutorials better rendered
Python
1
star
21

dicom-benchmarks

Python
1
star
22

compiler-tutorial

C++
1
star
23

dicom_standard

Dicom standard documentation in sphinx
Python
1
star
24

Latex-Stuff

Some of my Latex reports.
TeX
1
star
25

triton-torch

Some torch functions written in Triton
Python
1
star