Giter VIP home page Giter VIP logo

shape-finder's Introduction

Shape-Finder

A Shape Finder using Corner-Harris and Heirarchical Clustering.

Prerequisite:

How is this method different from other shape finders:
Generally, all shape finders will use number of arcs to determine the shape of an object. But this method uses Corners of an object to determine it's shape. Using this method we can find the length of the arcs, angles and more.

Okay, how it is done ? Glad you asked, We can easily find corners using Corner-Harris method!
The issue is Corner-Harris is not very accurate in real time. If we give it a triangle, it should give only 3 corners. Instead, it gives us 30-40 nearby points for each corner.

Now our task is convert this 120 points into 3 corners.
After some search and learnings from AI techniques, it's found that Heirarchical Clustering is the way to do it.

Heirarchical Clustering:

Two liner: It's a Machine Learning technique used to group bunch of points without giving any idea or mentioning number of groups required. Unlike traditional Clustering, we don't have to give to how many groups it should be seperated.
It is simply demonstrated here.

Those stars represent an individual group for each cluster.

hr

Groupify the seperate clusters:

Run this.
Supply Image:
For simplicity, we give it a image containg triangles.
We did some contour detection for selecting the triangle for a particular color.
In this case, we select Red one as our target triangle.

tri

Find Corners:
Now apply Corner-Harris to find the corners in the contour.
We found some bunch of points in each corner, we will have find the actual corners from this by applying Heirarchical Clustering.
Once we apply HC, it is gonna look like this in graph:
That Star represents the center that it found for each cluster.

matplot

Visualization:

opencv

Output:

We got 3 corners, it is easy to determine it's shape and we can do more operations from other informations like below:

op

shape-finder's People

Contributors

perseus784 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  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.