Code Monkey home page Code Monkey logo

librectify's Introduction

librectify

© 2020, Roman Juranek [email protected]

Minimalistic library for image perspective correction. The library prvides API for automated identification of converging line groups and image transform computation from automatic identification of two orthogonal vanishing points. The library does not warp the image, this is in the hands of the user. We provide sources for academic purposes, for commercial use, please contact the author.

Development of this software was funded by TACR project TH04010394, Progressive Image Processing Algorithms.

Dependencies

The library requires no external dependencies (apart from standard library and OpenMP runtime). Internally we use Eigen for representation of images and linear algebra. Example app uses OpenCV for image IO and warping.

Algorithms

  • Basic image processing (convolution, morphology, local maxima, flood)
  • Basic geometry processing in homogrneous coordinates
  • Eigen value solver
  • RANSAC, PROSAC, Hough Transform

Documentation

C++ API

Example

Input image Input

Automatically detected lines by find_line_segment_groups. The function accepts float image buffer, its dimmensions and stride between rows and returns allocated array of LineSegment structures which can by modified (filtering, user input, etc.).

Lines

The library provides corners for image transformation with function compute_rectification_transform. The function accept line segments and returns ImageTransform structure with new image corners.

top_left: -60.5308,-13.6642
top_right: 1041.69,-54.4891
bottom_left: 55.0519,649.464
bottom_right 969.276,621.39

There are more than one strategy how to calculate the transform - user can specify what should happen in horizontal/vertical direction. The options are - rectify, rotate (by horizontal or vertical angle) or do nothing. There are 15 meaningful combinations suitable for different use cases. The responsibilit of user is then to use the corners to calculate the final image.

Here is an example of warped image calcualted by cv::warpPerspective (see autorectify.cpp for code).

Warped

Contribute

If you have suggestions regarding the library, submit an issue. If you are brave enough, fork and improve!


Change log

librectify's People

Contributors

jmlich avatar romanjuranek avatar ytb45 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

ytb45

librectify's Issues

Deterministic output

On some images, every run results in different solution which may confuse end users.

More robust and faster model estimator

So far, RANSAC is used. It has fixed number of iterators - i.e. model evaluations on full set of lines which is slow. It can be replaced with PROSAC which is more universal and faster. And additionally, the result would be more stable (so no need of deterministic random generator)
Prosac needs:

  • A weighting mechanism for selection of single model. Most likely CHT-based.
  • PROSAC sampler

More detailed documentation

So far everything is documented in public header file. Add doc directory with documentation of API and internal stuff (how it works inside).

Get rid of get/set_num_threads

Currently user must call set_num_threads to update internal state for parallelism which is for some reason unacceptable.

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.