Giter VIP home page Giter VIP logo

circle-fitting-hyper-fit's Introduction

This is a revised circle fitting algorithm of the original "Hyper fit" algorithm, by Nikolai Chernov
(http://people.cas.uab.edu/~mosya/cl/CPPcircle.html)

It is an algebraic fit, based on the journal article:
[1] A. Al-Sharadqah and N. Chernov, "Error analysis for circle fitting algorithms", 
Electronic Journal of Statistics, Vol. 3, pages 886-911, (2009)

THIS HYPER FIT ALGORITHM IS CONSIDERED TO BE ONE OF THE BEST (PERHAPS THE BEST) CIRCLE FITTING ALGORITHM, IN TERMS OF ACCURACY. IT IS ALSO RELATIVELY FAST.

The original algorithm fits a set of known data points (in 2D) to a circle. 
* As a contribution to the original algorithm, functions have been added to allow circle fitting on complete and incomplete circular objects, in live-stream 2D-images.

THE REVISED ALGORITHM HAS THE FOLLOWING IMPLEMENTATION BLOCKS:
(1) Image acquisition-> (2) Data points (Xi,Yi) extraction, using Canny edge detection-> (3) Gathering of data points-> (4) Fitting data points to a circle, using the circle fitting algorithm-> (5) Printing the fit circle´s arc, and radius value, onto captured frames

The algorithm is explained with comments in the "Source.cpp" file

In the repository, there is a videofile named "Circle Fitting (True radius 2 meter).webm", 
showing an example where the circle fitting algorithm has been applied on a largely incomplete circular arc.
In the video file, the short arc length (17 cm) corresponds to approximately 5 degree of a complete circle´s circumference. 
With the used camera setup, a 5 mpx camera, the algorithm fits a circle to the arc with an accuracy of approximately 99.5%, which is impressive.

* As can be noted and concluded is that the Hyper fit algorithm can be implemented to fit accurate circles to largely incomplete circular arcs.

HOW TO USE THE CODE:
VISUAL STUDIO:
  We have used visual studio 2013 and OpenCV version 2.4.13, download at (http://opencv.org/downloads.html)
  install OpenCV following steps below, it shows how to configure OpenCV 2.4.13 with visual studio 2010 (same for later versions)
  1. You need to configure OpenCV with visual studio, example: https://www.youtube.com/watch?v=KoJTIs-h-0g
  2. Create a new project in visual studio, add all the files (Cpp and Headerfiles) from our repository to the project 
  3. Link OpenCV libraries and additional dependencies (DLL:s) to the project, following the youtube-tutorial from step 1. 
  4. Compile and Run the application

Ofcourse, the project can be compiled with many other IDE´s or compilers, just make sure to link OpenCV libraries and other additional dependencies to the project files.

circle-fitting-hyper-fit's People

Contributors

sohraneliassi avatar

Stargazers

 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.