Skip to content

xsyann/clustering

Repository files navigation

Clustering

Image clustering using Python OpenCV

alt text

Install

git clone https://github.com/xsyann/clustering.git

Usage

python clustering.py

Requirements

cv2, numpy, matplotlib, scipy, urllib2, PyQt5

Matplotlib Qt5 compatibility: matplotlib/matplotlib#3072

Features

alt text

Elbow

  • Draw the green line l passing through the first and the last point of the blue curve.
  • Select the maximum length of the red segment perpendicular to the line l and passing through the curve point.

alt text

Threshold

  • Reduce the compactness in range [0-1].
  • Select the first point below the threshold defined in the Clusterer class.

alt text

Gap statistic

  • Gap statistic by Robert Tibshirani, Guenther Walther and Trevor Hastie.
  • Stanford University, USA, November 2000.

alt text

Gap Threshold

  • Reduce the compactness in range [0-1].
  • Compute the gap between each neighbors point.
  • Select the first point where the gap is below the threshold defined in the Clusterer class.

alt text

f(k)

  • Selection of K in K-means clustering, D T Pham�, S S Dimov, and C D Nguyen.
  • Manufacturing Engineering Centre, Cardiff University, Cardiff, UK, 27 September 2004.

alt text

Slider

  • Reduce the compactness and the cluster count in range [0-1].
  • Draw a line between (0, 1) and (1, 0) and place a goal on this line depending of a percentage.
  • Select the closest point to the goal.

alt text


One clustering feature

alt text

Two clustering features

alt text

Three clustering features

alt text

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published