Shape Detector

Vefak Murat Akman


It takes the image from local path and go through shape detection phase:

  1. Do image preprocessing
  2. Find Contours
  3. Use Ramer–Douglas–Peucker to reduce number of points.
  4. Generate lines from points.
  5. Find angles between them.
  6. Coloring contours by angle value.

Important Note OpenCV Library Version must be 3.4.3

Original Image

alt text

Resulting Image

alt text

Additional Notes

Distance Formula
alt text

Angle Between Two Lines
alt text

References